In Java, numbers prefixed with a "0" are treated as octal.  It should not
surprise us, then, that 08 and 09 blow up.

On Thu, Mar 12, 2009 at 4:08 PM, levand <luke.vanderh...@gmail.com> wrote:

>
> Seems like there's a bug here. All the digits less than 8 work. If
> leading zeros aren't allowed, at least the behavior ought to be
> consistent.
>
> (def n 01)
> #'user/n
>
> ...
>
> (def n 07)
> #'user/n
>
> BUT
>
> (def n 08)
> clojure.lang.LispReader$ReaderException:
> java.lang.NumberFormatException: Invalid number: 08
>
> (def n 09)
> clojure.lang.LispReader$ReaderException:
> java.lang.NumberFormatException: Invalid number: 09
>
> Same thing with additional leading zeros...
>
> (def n 007)
> #'user/n
>
> (def n 008)
> clojure.lang.LispReader$ReaderException:
> java.lang.NumberFormatException: Invalid number: 008
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to