Here's an example from my game, PushOver, using recursion. I don't know if
it's "tail" recursion, but it works and is "cool"..
comment { The following function creates a new row/col pattern of 5 cells as
a
result of the piece, movpc, moving onto the head of the existing
pattern.
Note recursion applied, in which 'newp is used in definition of
'newp.
}
newp: func[oldptn movpc /local svdpc
][
either (movpc <> 0)and(not tail? oldptn)
[ svdpc: first oldptn
oldptn: change oldptn movpc
movpc: svdpc
newp oldptn movpc
]
[ return head oldptn]
]
Russell, [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 08, 1999 2:54 PM
Subject: [REBOL] Recursion Re:
> Hi Ingo,
>
> which Scheme book are you reading - the one by Dybvig?
> I recall that some time ago (nine, ten months?) someone on this list did
> confirm that REBOL is tail recursive. I don't recall who said that or how
> knowledgeable that person was ...
>
> Elan
>
> At 10:40 PM 10/8/99 +0200, you wrote:
> >Hi Rebols,
> >
> >while reading a book about scheme, I thought about if Rebol
> >is tail recursive, too. Or why not. Seems to me, that this
> >could solve some of the problems, e.g. with recursive parse
> >rules.
> >
> >
> >What du YOU think?
> >
> >Ingo
> >
> >-- _ . _
> >ingo@)|_ /| _| _ <We ARE all ONE www._|_o _ _ ._ _
> >www./_|_) |o(_|(/_ We ARE all FREE> ingo@| |(_|o(_)| (_|
> >http://www.2b1.de/Rebol/ ._| ._|
> >
> >
> >
>