1 Beginning Student
2 Beginning Student with List Abbreviations
3 Intermediate Student
4 Intermediate Student with Lambda
5 Advanced Student
Index
On this page:
recur
Version: 4.0.2

 

5.10 recur

(recur id ([id expr] ...) expr)

A short-hand recursion construct. The first id corresponds to the name of the recursive function. The parenthesized ids are the function’s arguments, and each corresponding expr is a value supplied for that argument in an initial starting call of the function. The last expr is the body of the function.

More precisely, a recur form

  (recur func-id ([arg-id arg-expr] ...)

    body-expr)

is equivalent to

  ((local [(define (func-id arg-id ...)

             body-expr)]

     func-id)

    arg-expr ...)