Re: upvalues actually are values?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: upvalues actually are values?
- From: spir <denis.spir@...>
- Date: 2012年10月23日 20:31:56 +0200
On 23/10/2012 20:19, Johann Hibschman wrote:
I'm curious: what languages would print 1 and 2 below? I can't think of one.
The equivalent Scheme,
(define (inc i) (lambda (n) (+ n i))
(define i 1)
(define inc1 (inc i))
(inc1 0)
(set! i 2)
(inc1 0)
should never ever print anything other than 1 and 1.
You are right, my example is wrong!
Denis