<div>Thanks for the explanation; it makes sense now. Part of my confusion stemmed from not recognizing that the calls were stacking up until the eof condition was met.</div>
<div>Jan Erik</div>
<div><br> </div>
<div class="gmail_quote">On Wed, Dec 12, 2012 at 11:49 AM, Stephen Bloch <span dir="ltr"><<a href="mailto:sbloch@adelphi.edu" target="_blank">sbloch@adelphi.edu</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div class="im"><br>On Dec 12, 2012, at 10:29 AM, Matthias Felleisen wrote:<br><br>> In Racket, Scheme, and Lisp, parentheses are NOT optional, they are meaningful. Everyone counts.<br><br></div>In specific, one of the things parentheses often mean is that the first thing inside the parentheses is a function to be applied to the remaining things.<br>
<br>In your example,<br>... (begin ((print a) (loop (+ 1 a))))<br>you're basically asking Scheme to use the result of (print a) as a function which it can then apply to the result of (loop (+ 1 a)). Since (print a) doesn't return any result at all, it certainly doesn't return a function that can be called on something else.<br>
<br>What you're running into is a common problem for students moving from high school algebra to Lisp/Scheme/Racket: in high school algebra, MISSING parentheses can sometimes give you wrong answers due to order-of-operations errors, but EXTRA parentheses can never hurt. In Lisp/Scheme/Racket, either one can hurt.<br>
<span class="HOEnZb"><font color="#888888"><br>Stephen Bloch<br><a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a><br><br></font></span></blockquote></div><br>