Details

Description

In general Clojure's number types can be read prefixed with either a +
or - and this seems to work correctly for reading integers and floats.
In the case of ratios however things break down when ratios are
prefixed with a +.

The ratio pattern in LispReader.java does match on ratios starting
with both + and - but matchNumber fails on ratios prefixed with +
because it ends up calling "new BigInteger(m.group(1))" and it turns
out the constructor for BigInteger has no problems with negative
numbers but it doesn't like numbers prefixed by a +.

clj-923-reading-ratios-prefixed-by-plus-patch2.txt still semantically same as Cosmin's original patch, except it applies, builds, and tests cleanly on latest master as of Mar 23, 2012. Context lines around patch must have changed recently.

Andy Fingerhut
added a comment - 23/Mar/12 7:55 PM clj-923-reading-ratios-prefixed-by-plus-patch2.txt still semantically same as Cosmin's original patch, except it applies, builds, and tests cleanly on latest master as of Mar 23, 2012. Context lines around patch must have changed recently.