There's something quite basic about how scheme works that eludes me.
 Please let me know if it would be more appropriate to post this somewhere
eles.

This program works as I expect:

(let loop ((a  0))
  (if (> a 3)
      (print "it's over")
      (begin (print a)
             (loop (+ 1 a)))))

If add an extra set of parentheses around the begin clause:

(let loop ((a  0))
  (if (> a 3)
      (print "it's over")
      (begin ((print a)
             (loop (+ 1 a))))))

I get the following (from DrRacket 5.3.1) :
0123"it's over". . application: not a procedure;
 expected a procedure that can be applied to arguments
  given: #<void>
  arguments...:
   #<void>

I don't understand how adding the extra parentheses caused the change in
behavior.

Thanks,
Jan Erik
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to