Thanks a lot, Armando. Looks like I should switch to Clojure 1.3 asap.

Cheers,

Dominikus

2011/5/5 Armando Blancas <armando_blan...@yahoo.com>:
> In 1.3 the function will (eval) to itself:
>
> Clojure 1.3.0-alpha6
> user=> (defn id [x] (list id x))
> #'user/id
> user=> (id 7)
> (#<user$id user$id@3411a> 7)
> user=> (eval (id 7))
> (#<user$id user$id@3411a> 7)
> user=> (= (id 7) (eval (id 7)))
> true
>
> On May 5, 6:04 am, Dominikus <dominikus.herzb...@gmail.com> wrote:
>> My observation is best distilled with the following definition of a
>> function in Clojure 1.2:
>>
>> user=> (defn id [x] (list id x))
>> #'user/id
>>
>> Interstingly, (id 7) and (eval (id 7)) result in different instances
>> of function id as the number after the '@' char unveils:
>>
>> user=> (id 7)
>> (#<user$id user$id@53797795> 7)
>> user=> (eval (id 7))
>> (#<user$id user$id@2de12f6d> 7)
>>
>> Consequently, the following comparison leads to false:
>>
>> user=> (= (id 7) (eval (id 7)))
>> false
>>
>> Why is the instance relevant to '='? What is the precise semantics of
>> two values being equal in Clojure?
>>
>> Dominikus
>>
>> (Remark: In Scheme, the use of 'eqv?' returns also #f, but the less
>> restrictive 'equal?' does not and returns #t.)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to