variable name duplicate

42 views
Skip to first unread message

vinurs

unread,
Jul 30, 2022, 5:23:39 AMJul 30
to Clojure
hello,
i have the following code:
```
(let [x- 1 x_ 2] (fn [] [x- x_])) ; => Throws: Duplicate field name "x_" with signature "J" in class file [...]
```
i tested from clojure 1.0.0 to the latest, all throw the exception

Paul Stadig

unread,
Jul 30, 2022, 9:06:48 AMJul 30
to clo...@googlegroups.com
I'm pretty sure what is happening is the Clojure compiler is munging "x-" into "x_" but since you already have an "x_" you get an exception.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/72a4df10-b0a7-4886-b1aa-79e15f1f9c79n%40googlegroups.com.

vinurs

unread,
Jul 30, 2022, 9:45:49 AMJul 30
to Clojure
but, in this situation i cant write code like this?
(let [user-id 1 user_id 2] (log/info user-id user_id))
Reply all
Reply to author
Forward
0 new messages