On Mon, Jan 25, 2010 at 10:52 PM, Zach Tellman <ztell...@gmail.com> wrote:
> At the REPL, in 1.2.0-master
>
>> (meta (second '(a #^b c)))
> nil
>
> In 1.1.0-new (and I believe all previous versions)
>
>> (meta (second '(a #^b c)))
> {:tag b}
>
> Is this intentional, or a bug?  Is the new type hint syntax being
> introduced in 1.2?

I think it's a bug, perhaps related to quoting behavior.
Everything seems to work okay before this commit:

    commit 430dd4fa711d0008137d7a82d4b4cd27b6e2d6d1
    Author: Rich Hickey <richhic...@gmail.com>
    Date:   Tue Jan 19 14:25:26 2010 -0500

        metadata for fns

Afterward:

    (meta '#^a b)
    ;=> nil

    (meta '#^{:foo :bar} [5 10])
    ;=> nil

    (meta (first '[#^{:foo :bar} {}]))
    ;=> nil

This, however, works both before and after:

    (meta #^{:foo :bar} [5 10])
    ;=> {:foo :bar}

Also, the problem appears to be related to 'eval' not 'read':

    (second (read-string "(quote #^a b))"))
    ;=> b

    (meta (second (read-string "(quote #^a b))")))
    ;=> {:tag a}

    (eval (read-string "(quote #^a b))"))
    ;=> b

    (meta (eval (read-string "(quote #^a b))")))
    ;=> nil

--Chouser

-- 
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