Technically, this is a user error, since . (dot) is not a valid character
inside user-defined symbols. Clojure does mostly take the stance that it is
a sharp tool and you are allowed to cut yourself, should you really want to.

See http://clojure.org/reader for reference, especially these two sentences
:

"Symbols begin with a non-numeric character and can contain alphanumeric
characters and *, +, !, -, _, and ?"
"Symbols beginning or ending with '.' are reserved by Clojure."


On 9 April 2013 11:51, Niels van Klaveren <niels.vanklave...@gmail.com>wrote:

> In Clojure 1.5.1:
>
> => (+ .3 1.7)
> CompilerException java.lang.RuntimeException: Unable to resolve symbol: .3
> in this context, compiling:(NO_SOURCE_PATH:1:1)
>
> So the only way you can do this is if you def'd .3 before
>
> => (def .3 0.4)
> => (+ .3 1.7)
> 2.1
>
>
> On Tuesday, April 9, 2013 10:53:06 AM UTC+2, Cedric Greevey wrote:
>>
>> This may look mildly surprising, and suggests one more thing *not* to
>> ever do in production code:
>>
>> user=> (+ .3 1.7)
>> 2.1
>> user=>
>>
>> :)
>>
>> Shouldn't be hard to figure out how to put a repl in a state where that
>> expression will evaluate to that result. I'm sure mathematicians everywhere
>> are deeply offended by the clojure reader now. :)
>>
>>  --
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to