guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: infixorder


From: Jon Wilson
Subject: Re: infixorder
Date: Tue, 30 Jan 2007 09:46:41 -0600
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

Hi Oriana,
Well, since you're learning scheme, here is a tip: Use the conventional indentation and such. It will seem weird and you will find yourself counting parens at first, but quickly you will get used to it, and begin to not even see the parens. Your code snippet should be written:

(equal?
 (infixwalk
   '((a) b ((c) d (e))))
 '(b a d c e))
=> #t

That little => at the end means "the above (or left) expression evaluates to the expression on the right."

The indentation rules for Common Lisp at
"http://dept-info.labri.fr/~strandh/Teaching/MTP/Common/Strandh-Tutorial/indentation.html";
apply more or less to scheme as well. As that page says, indentation rules are /not/ a matter of personal taste, but a matter of /shared culture/.
Best of luck with your homework,
Jon Wilson

oriana paro wrote:
Hi. I'm learning scheme (Guile) and I have some problem with the infix order 
walk in a tree...
I want to write a function infixwalk that walks though a tree in infix order (left tree - node - righ tree) so that the call (equal?
   (infixwalk
       '( (a) b ( (c) d (e) ) )
    )
    '(b a d c e)
)
returns #t. Anyone can help me?? Thanks in advance.




------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada30gen07




_______________________________________________
Guile-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/guile-user





reply via email to

[Prev in Thread] Current Thread [Next in Thread]