Fork me on GitHub
#yamlscript
<
2024-01-05
>
Ingy döt Net16:01:08

Clojure allows symbols to be any combination of a certain set of characters. > Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, ', ?, <, > and = YS is much stricter. Basically it supports the style of symbols that are actually used in clojure.core. This leaves room for other syntax down the road. Currently I'm making it so that the compiler will look/lex for a valid clojure symbol, but then error if it is not a valid YS symbol or construct. The only outlier I've actually seen is stuff like foo->bar which could easily be expressed as foo-to-bar. Are there others I should be aware of?

phill17:01:45

We could consider the -> gimmick to be "used in clojure.core" inasmuch as defrecord Foo creates constructor functions named ->Foo and map->Foo for you.

Ingy döt Net17:01:44

I need to learn more about defrecord.

Ingy döt Net20:01:14

I should have said the clojure.core subset available in SCI. The map->Foo defrecord thing does work in SCI (checked with bb) I'll add that to the YS symbol rules. Is the char after map-> always uppercase? I prefer to be as strict as possible, since you can always be more lenient as needed. Here's the "weirdos" I get from bb's ns-refers:

+'
->Eduction
StackTraceElement->vec
Throwable->map
as->
bound-fn*
cond->
cond->>
inc'
list*
multi-fn?-impl
not=
read+string
tap>
I will likely elide the ones ending in ' or *. Forgot about not=...