jank-lang / jank

A Clojure dialect hosted on LLVM with native C++ interop
https://jank-lang.org
Mozilla Public License 2.0
1.6k stars 43 forks source link

reader conditional? #8

Closed The-Alchemist closed 2 years ago

The-Alchemist commented 2 years ago

Wondering if it's time to request an "official" reader conditional key and file extension.

https://clojure.org/guides/reader_conditionals

#?(:clj  (Clojure expression)
   :cljs (ClojureScript expression)
   :cljr (Clojure CLR expression)
   :default (fallthrough expression))

Maybe :jank sounds too project specific, maybe :cljl? Kinda hard to read.

jeaye commented 2 years ago

jank will definitely support reader macros for wrapping interop. I imagine it will be :jank, rather than :cljl or something more generic, since jank's interop is going to be entirely its own thing.

I don't believe there's a need to perform any official request for this, though, since Clojure doesn't use a fixed set of known keywords there. It just only looks for the one it supports.

❯ clj
Clojure 1.11.1
user=> #?(:jank 1 :default 0)
0