This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

define vs define-syntax



>i want to do a loop, i want to have interesting things happen in the loop,
>but i don't want to save state information each time i recurse.  i believe
>if i do a case statement, inside the loop, and i recurse at the end of
>each case, that this should be so, but has guile been optimized for this?

I think you're asking if the recursive calls will be tail calls,
right?  You're concerned about accumulating stack frames?

If a case statement is in tail position, then its clauses are in tail
position.  So, yes, it is possible to write loops which recurse from
within case statements that execute in constant space.

The case statement isn't the only thing you have to worry about, of
course...