Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.5+ - certain strings throwing NumberFormatException in REPL #105

Open
omriAckley opened this issue Aug 21, 2012 · 0 comments
Open

Comments

@omriAckley
Copy link

In the REPL, if you evaluate a string starting with a digit, that is followed at some point by a non-digit non-bracket, which is followed at some point by a forward slash, a NumberFormatException is thrown. However, this exception does not seem to halt anything, because it ultimately returns the correct result.

If it helps to conceptualize, I think the following regex would match any strings for the bug occurs: #"[0-9]+[^{}]+/.*"

This bug does not occur if the string is produce through an expression, rather than writing it by hand.

For example:

user> "5a/"
NumberFormatException Invalid number: 5a  clojure.lang.LispReader.readNumber (LispReader.java:253)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:156)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:156)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:156)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:156)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:156)
=> "5a/"

user> (str 5 'a '/)
=> "5a/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant