The reader always returns objects, it's the compiler that sometimes
decides to unbox literal numbers.

As for type, it's just a regular Clojure function which takes a single
object argument (so the 23 will be passed to it in a Long box). Here
it happens to delegate to class and ultimately (.getClass (Long. 23)).

Cheers,
M.


On 22 February 2013 14:19, John Lawrence Aspden <aspd...@googlemail.com> wrote:
> So, something like: (type 23) the reader makes a list of a symbol and a
> primitive, the evaluator evals to get a generic function and a primitive,
> then tries to apply the generic function to the primitive, can't find a
> primitive version, so boxes the primitive to an object and tries again, and
> then finds that there is a specific type function that takes long objects
> and applies that? (i.e. type isn't lying, but the evaluator is deceiving it)
>
> Are there any docs for this or any way to trace the process? How would I
> work out what's going on in a given case?
>
> On Thursday, February 21, 2013 6:59:33 PM UTC, Herwig Hochleitner wrote:
>>
>> Both are true.
>>
>> The type function doesn't have a primitive version, so its argument gets
>> auto-boxed.
>>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to