Arc Forumnew | comments | leaders | submitlogin
3 points by ambition 5990 days ago | link | parent

I looked into this some more, and it looks like this is a difference between arc and scheme. I just wanted to put this out there for anyone else looking at Scheme materials through an Arc lens.

Arc:

    arc> (def fn2() (def i() (prn "fn2-i")) (i))
    #<procedure: fn2>
    arc> (fn2)
    fn2-i
    "fn2-i"
    arc> (def fn1() (def i() (prn-"fn1-i")) (fn2) (i))
    #<procedure: fn1>
    arc> (fn1)
    *** redefining i
    *** redefining i
    fn2-i
    fn2-i
    "fn2-i"
    
Scheme:

    > (define (fn2) (define (i) (print "fn2-i")) (i))
    > (fn2)
       "fn2-i"> (define (fn1) (define (i) (print "fn1-i")) (fn2) (i)) 
    > (fn1)
       "fn2-i""fn1-i">