Hey Peter,
Thanks for your suggestion. I don't think it's a question of
my omitting a parentheses. I've tried typing it directly into the
REPL, I've pasted it in from my PDF version of the book. I've studied
in in emacs to make sure I have balanced parentheses. I've pasted it
into an email message so I could use the "Paste Without Formatting"
option in case there were some non printing characters sneaking in and
running amok.
Here is a copy of a CLISP session in progress. I've again
copied the code from the Land Of Lisp pdf file, then pasted that into
the REPL. The first three calls to the ingredients function work just
great. The fourth call seems to hang the REPL. At this point I left
my computer unattended for a bit. When I returned there was a pop from
my Norton Anti-Virus software "High CPU Usage: Lisp.exe" I've seen
this before but I don't see it every time.
Here is my session:
[7]> (defun ingredients (order)
(mapcan (lambda (burger)
(case burger
(single '(patty))
(double '(patty patty))
(double-cheese '(patty patty cheese))))
order))
INGREDIENTS
[8]> (ingredients '(single))
(PATTY)
[9]> (ingredients '(double))
(PATTY PATTY)
[10]> (ingredients '(double-cheese))
(PATTY PATTY CHEESE)
[11]> (ingredients '(single single))
*** - Ctrl-C: User break
The following restarts are available:
ABORT :R1 ABORT
Break 1 [12]>
In this session I managed to exercise every branch in the "case
" call before the function stopped responding. That doesn't PROVE it's
not a syntax problem, but I'm beginning to think it isn't.
Never the less, Peter, thank you for taking a moment to help me
think about my problem.
On 12/11/2012 10:24 AM, Peter Frings wrote:
> Hi Brian,
>
> maybe it's a stupid suggestion, but I've had a similar problem, so maybe it can help...
>
> Did you enter that function directly in the repl? If the expression is not properly closed (e.g., missing last paren), the repl will wait for you to finish the sexp, and that looks like it's hanging...
>
> Just trying...
> Peter.
>
>