I was trying to write a loop procedure in Guile. I came up with the following:
(define loop
(lambda (predicate callback)
(when predicate)
callback
(loop predicate callback)))
But that of course didn't work. The compiler doesn't even start as it seems to not be a valid syntax.
I am not sure what the procedure is designed to do, but it does seem like there is an error in the placement of parentheses.
whenevaluates the condition and executes the following statements if it's true. In the above codewhendoesn't see the statements at all.Maybe you meant to write this: