2015-02-18 17:52 GMT+01:00 James Reeves <ja...@booleanknot.com>:

> It occurs to me that you could use a macro to fake this:
>
>     (N 1,000,000,000)
>
>     (defmacro N [& parts]
>       (apply + (map * (reverse parts) (iterate (partial * 1000) 1))))
>
> But I wouldn't recommend it :)
>

​I will not do that then. ;-)​




> You could also just use exponents: 1e9 means the same thing as 1000000000.
>

​I already did that. But I like the solution of Gary even better (* 1000
1000 1000). But that is not a solution for a number like 2.911.054, there I
should use 2.911054E6.



> On 18 February 2015 at 15:33, Akos Gyimesi <a...@gyim.hu> wrote:
>
>> It is not possible in Clojure. This is the full regexp pattern for
>> integers:
>>
>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L67
>> On 18 Feb 2015, at 08:07, Cecil Westerhof <cldwester...@gmail.com> wrote:
>>
>>
>> In Java I can use:
>>     1_000_000_000
>>
>> This makes code a lot more readable. But it seems this is not possible in
>> Clojure. Am I overlooking something?
>>
>>
-- 
Cecil Westerhof

-- 
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/d/optout.

Reply via email to