This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: why undefined return values?
>>>>> "ka" == Ken Anderson <kanderso@bbn.com> writes:
ka> (let ((eof (eof)))
ka> (and (not eof)
ka> (let ((match (find-match regexp)))
ka> (and match
ka> (let ((str (car match)))
ka> ...)))))
(cond ((eof) #f)
((find-match regexp) => car)
(else #f))
In general, a test based on an expensive or side-effecting
computation, which might be written in CL as
(when (setq val (expensive-computation))
...)
can be written in R5RS Scheme as
(cond ((expensive-computation) =>
(lambda (val) ...)))
--
Eric Marsden