Email or username:

Password:

Forgot your password?
Niki Tonsky

Blows my mind that both

36r123XYZ

and

22/7

are in Clojure but

100_000_000

isn’t

14 comments
Kirill Chernyshov

@nikitonsky omg, why anyone might ever need this? also in any case you could write (* 100 1000 1000).

Niki Tonsky

@dotfox I was _just_ reading Steve Yegge rant about Clojure from 2011 about how hostile the community is for new features and guess what? groups.google.com/g/seajure/c/

Kirill Chernyshov

@nikitonsky sure, I'm no saint. thanks for pointing this out. let me rephrase - why do you need this way to write a number?

Kirill Chernyshov

@nikitonsky ok. I can't say it reads better for me, but I understand your point. However, I think it's ok to say that making changes for third-party readers can hardly be justified on the grounds that “it reads better for some developers”. Saying only that Go and Java have already adopted such syntax, so Clojure should do so as well, is not the best way to reason about such additions, don't you think?

Niki Tonsky

@dotfox man, sorry, but you really sound like a typical example person from that thread

Niki Tonsky

@dotfox it’s the perfect example. The feature is widely adopted among other PLs. It’s obviously good and desirable. It will harm no one. Implementation is probably 30 minutes. Yet “Clojure has its ways”

Kirill Chernyshov

@nikitonsky your not yet released edn reader will likely break after adding such separators. Why are you saying "harm no one"?

Niki Tonsky replied to Kirill

@dotfox what do you mean? Multiple languages with 15+ year history make the change and it’s been fine so far? EDN is also not set in stone: they’ve added tagged literals, namespaced maps, duplicate key check, ##Inf recently. So there’re multiple precedents. It's been fine so far?

Niki Tonsky replied to Niki

@dotfox this change doesn’t even have to go into EDN, it could just be an addition to LispReader. And, as I said, implementation-wise it’s a trivial change

Kirill Chernyshov replied to Niki

@nikitonsky I was about to reply that none of those changes break the reader in unusual way when older version of clojure is used. like reader of any version of clojure prior to 1.10 will not read ##Inf as something valid, exception will be thrown. Unlike 42_000 that can be read as 42 followed by a symbol _000.

But I forgot that underscore does not stop number reading in any version of clojure. So I don't know any technical difficulties in adding separators for number literals.

Kirill Chernyshov

@nikitonsky I have my opinion, you have yours. That's no reason to go back into toxic conversation and call someone "typical example".

Go Up