[plt-scheme] Confused by local
--- Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> Try
>
> (local ([define x 3]) x)
>
> (local ([define (f y) (+ y 1)]) (f 10))
>
> Shriram
>
Got it. SICP talks about internal definitions, as in
> (define (f x)
(define y 2)
(+ x y))
> (f 3)
5
How does that differ from
> (define (f x)
(local
((define y 2))
(+ x y)))
> (f 3)
5
?
(Where do you put the question mark in a case like that? Time to
consult "Eats, Shoots and Leaves", I suppose.)
===
Gregory Woodhouse <gregory.woodhouse at sbcglobal.net>
"All truth passes through three stages: First, it is ridiculed.
Second, it is violently opposed. Third, it is accepted as
being self-evident."
--Arthur Schopenhauer