munge should not convert $ (since it isJavaIdentifierPart)

13 views
Skip to first unread message

Michał Marczyk

unread,
Aug 25, 2010, 8:51:07 AM8/25/10
to cloju...@googlegroups.com
munge is overeager in converting $ to _DOLLARSIGN_, since $ is a valid
character in Java identifiers:

user> (filter #(Character/isJavaIdentifierPart %) (keys
clojure.lang.Compiler/CHAR_MAP))
(\$)

Patch attached.

Sincerely,
Michał

0001-munge-no-longer-changes-to-_DOLLARSIGN_.patch

Michał Marczyk

unread,
Aug 25, 2010, 9:48:05 AM8/25/10
to cloju...@googlegroups.com
On a related point, ' (single quote) is not admissible in Java
identifiers, but it is not munged on master:

user=> (Character/isJavaIdentifierPart \')
false
user=> (munge "'")
"'"

This leads to e.g.

user=> *'
#<core$_STAR_' clojure.core$_STAR_'@5adf48c4>

(note the ' after _STAR_).

Sincerely,
Michał

Michał Marczyk

unread,
Sep 9, 2010, 7:03:51 AM9/9/10
to cloju...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages