Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Custom Whitespace in Clojure

Tags:

clojure

In Clojure, commas are treated as whitespace. This serves a simple purpose: it helps the human read the code.

I'd like to specify that another character should be treated as whitespace. Is this possible?

If you're curious, it's ∈/∊. If I could type (for [i ∊ set1, j ∊ set2] (* i j)), I think that'd be pretty sweet.

Thanks in advance.

like image 459
galdre Avatar asked Mar 23 '14 18:03

galdre


1 Answers

No, this is not easily possible. See http://clojure.org/reader , in particular:

The read table is currently not accessible to user programs.

like image 85
georgek Avatar answered Nov 15 '22 07:11

georgek