<< Back to previous view

[CLJ-433] munge should not munge $ (which isJavaIdentifierPart), should munge ' (which is not) Created: 09/Sep/10  Updated: 01/Mar/13  Resolved: 05/Jan/11

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.3

Type: Defect Priority: Major
Reporter: Assembla Importer Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File 0001-fix-munge-handling-of.patch    
Approval: Ok

 Description   

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))
(\$)

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).

Originally reported on the Dev list.

See also this thread on the (regular) Clojure ggroup.

The attached patch applies cleanly against current master.



 Comments   
Comment by Assembla Importer [ 28/Sep/10 4:32 PM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/433
Attachments:
0001-munge-no-longer-changes-to-DOLLARSIGN.patch - https://www.assembla.com/spaces/clojure/documents/dp5tziVaer34yIeJe5cbLr/download/dp5tziVaer34yIeJe5cbLr

Comment by Stuart Halloway [ 30/Oct/10 12:12 PM ]

Patch is clean, the real issue here is doing the right thing. Two concerns:

  • was the original choice to munge $ motivated, and if so do we need a more subtle patch that preserves that original intent?
  • presumably this is (yet another) binary-compatibility-breaking change. 1.3 already has major change, so now is a good a time as any...
Comment by Rich Hickey [ 05/Nov/10 8:00 AM ]

This issue mentions two problems but patch fixes only one. Should add the single-quote handling

Comment by MichaƂ Marczyk [ 08/Dec/10 12:12 AM ]

Right, I forgot about that in the patch somehow. Also, I just noticed that " is also not JavaIdentifierPart and yet is not currently munged. The newly attached patch fixes all three issues.

Generated at Fri Oct 31 15:52:56 CDT 2014 using JIRA 4.4#649-r158309.