*** post for FREE via your newsreader at post.newsfeed.com ***
Hi
I want to implement a easy fun . But I don't know how to do it.
The question is instead () with different separator . Such as :
( )---> |
( )---> !
( )---> ~
( )---> `
Then ( a ( b c) (d ( e (f ( g))))) will translate to a | b ! c | d
! e ~ f ` g .
Thanks a lot
Lquan
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 90,000 Groups! - 17 Servers! - Unlimited Download! =-----
In article <········@post.newsfeed.com>,
post.newsfeeds.com <·····@jfsys.com> wrote:
> I want to implement a easy fun . But I don't know how to do it.
This sounds like a homework problem, so I'll just give some ideas rather
than the solution.
> The question is instead () with different separator . Such as :
>
> ( )---> |
> ( )---> !
> ( )---> ~
> ( )---> `
>
> Then ( a ( b c) (d ( e (f ( g))))) will translate to a | b ! c | d
>! e ~ f ` g .
You should write it as a recursive function. It should recurse over two
arguments: the nested list of lists, and a list of all the delimiter
characters. When it's processing a list, it should print all the elements
separated by the first element of the delimiter list.
--
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.