Well, it seems like it should be possible. At the end of the defn macro,
metadata is attached to a function, so you can see the name with:
```
(meta #'my.ns/add)
```
And you could do this inside the function:
```
(defn add [a b]
(let [name (:name (meta #'add))]
(str a b name)))
```
But that can't be what you want. The thing is, the actual function body
doesn't know that it's being bound to the symbol "add" and making it aware
would seem to contravene a number of league bylaws.
That is to say, the macro "defn" attaches the meta-information to the
symbol #add, not to the code that follows.
You could certainly make your own macro to make the bound variable name
visible to the body of the code, but I'm not sure you can do that with the
built-in defn.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/clojure/CAJAnwPmWK82nS1udL7MvVeDpa1rQHQ3c34G37WWasm%3D7DieroA%40mail.gmail.com.