Schools of fish or students!
(define whats-in-school?
(lambda (a n)
(when (eq? a ‘fish)
(for ((i (in-range n)))
(printf ” <o))))))<“)))
(when (eq? a ‘students)
(for ((i (in-range n)))
(printf ” O_o”)))
))
(whats-in-school? ‘fish 35)
Arielle
This entry was posted on
September 22, 2009 at 6:34 pm and is filed under Uncategorized.
Tags: define, for-loop, when
September 22nd, 2009 at 7:09 pm
A ‘?’ is missing in the concluding function call.
(whats-in-school ‘fish 35)
should be
(whats-in-school? ‘fish 35)
Also, the quotation marks (” ”) and apostrophes (’ ’) have to be retyped into the Scheme editor (as ” ” and ‘ ‘) because Scheme refuses to read this character set’s inverted commas.
September 22nd, 2009 at 8:39 pm
oh that’s a shame about having to retype all of the apostrophes and question marks!
Will fix that call though…
thanks for pointing it out!