We're updating the issue view to help you get more done. 

GC Issue 13: validate in (keyword s) and (symbol s)

Description

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Reported by richhickey, Dec 17, 2008 Make sure they create readable keywords/symbols Comment 1 by p...@hagelb.org, Apr 27, 2009 Could this be done with a regex, or should it try to confirm the name using the reader? Comment 2 by p...@hagelb.org, Apr 27, 2009 I've implemented this in the attached patch. One thing that could be improved is that invalid names simply raise an Exception, though it seems LispReader's ReaderException would be more appropriate. I wasn't sure how to raise that though since it needs a line number; it's not clear how to get the current line number. The patch is still an improvement on the current state of things, though I'd appreciate a tip as to how to raise the right exception. I've also attached a patch to the test suite that ensures (symbol s) and (keyword s) work properly in the context of invalid names. I can re-submit this to the contrib project if that's desired if the core patch is accepted. 0001-Test-invalid-symbol-keyword-names-raise-exceptions.patch 1.6 KB Download Comment 3 by p...@hagelb.org, Apr 27, 2009 Last patch had a problem; used things like defn- etc. before they were defined in core.clj. This attachment fixes that. validate-symbol-keyword-names.patch 2.1 KB Download Comment 4 by p...@hagelb.org, Jun 13 (3 days ago) This exists as a git branch too now: http://github.com/technomancy/clojure/tree/validate-symbols-issue-13

Environment

None

Status

Assignee

Unassigned

Reporter

Rich Hickey

Labels

Approval

None

Patch

None

Fix versions

Priority

Blocker