This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-05
Channels
- # announcements (2)
- # babashka (23)
- # beginners (67)
- # biff (4)
- # calva (19)
- # cider (6)
- # clj-kondo (40)
- # clj-yaml (14)
- # clojure (3)
- # clojure-austin (13)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-uk (5)
- # clojurescript (42)
- # datascript (2)
- # datomic (6)
- # emacs (32)
- # graalvm (8)
- # humbleui (12)
- # hyperfiddle (13)
- # jobs (5)
- # lambdaisland (1)
- # lsp (18)
- # malli (15)
- # off-topic (20)
- # overtone (1)
- # pathom (5)
- # pedestal (15)
- # portal (3)
- # reitit (13)
- # releases (1)
- # remote-jobs (1)
- # yamlscript (4)
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?
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.
I need to learn more about defrecord.
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=
...