Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

This should complain about using a fully-qualified name as a parameter:

(defmacro lookup (link: )
`(reify clojure.lang.ILookup

      (valAt (link: _ key))))

Instead it simply ignores that parameter in the method body in favour of clojure.core/key.

5 Answers

0 votes
by

Comment made by: importer

richhickey said: I'm not sure the bug is what you say it is, or the resolution should be what you suggest. The true problem is the resolution of key when qualified. Another possibility is to ignore the qualifier there.

0 votes
by

Comment made by: importer

Converted from http://www.assembla.com/spaces/clojure/tickets/348
Attachments:
0001-Add-a-test-for-348-reify-shouldn-t-accept-qualified-.patch - https://www.assembla.com/spaces/clojure/documents/d2xUJIxTyr36fseJe5cbLA/download/d2xUJIxTyr36fseJe5cbLA

0 votes
by

Comment made by: importer

technomancy said: (link: [file:d2xUJIxTyr36fseJe5cbLA)]: A test to expose the unwanted behaviour

0 votes
by

Comment made by: importer

technomancy said: Interesting. So it's not appropriate to require auto-gensym here? Why are the rules different for reify methods vs proxy methods?

(defmacro lookup (link: )
`(proxy (link: clojure.lang.ILookup) (link: )

      (valAt (link: key) key)))

(lookup)

Can't use qualified name as parameter: clojure.core/key
(link: Thrown class java.lang.Exception)

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-348 (reported by alex+import)
...