variable name duplicate

已查看 46 次
跳至第一个未读帖子

vinurs

未读,
2022年7月30日 05:23:392022/7/30
收件人 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

未读,
2022年7月30日 09:06:482022/7/30
收件人 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

未读,
2022年7月30日 09:45:492022/7/30
收件人 Clojure
but, in this situation i cant write code like this?
(let [user-id 1 user_id 2] (log/info user-id user_id))
回复全部
回复作者
转发
0 个新帖子