This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-06
Channels
- # announcements (3)
- # architecture (16)
- # beginners (5)
- # cherry (1)
- # cider (3)
- # cljsrn (2)
- # clojure (54)
- # clojure-dev (11)
- # clojure-europe (14)
- # datalevin (26)
- # emacs (8)
- # helix (5)
- # honeysql (5)
- # hyperfiddle (40)
- # lsp (12)
- # malli (23)
- # missionary (7)
- # nrepl (2)
- # off-topic (18)
- # releases (2)
- # yamlscript (1)
Today I had a major YAMLScript design breakthrough. I realized that YS has a need for its own "macro" definitions and "special forms".
For example the preferred YS if
syntax is:
if (a == b):
- foo
- bar
# or (simpler in this case):
if (a == b): foo bar
rather than the more general function call style:
if:
- (= a b)
- foo
- bar
Right now I special case if
in the YS reader library (along with several other common things),
but today I realized these special cases are going to be super common so I need a way to define these as "YS macros".
The YS way to do a def
is:
foo =: 123 # (def foo 123)
This is more of a YS "special form", because I can't namespace it under foo
like I can for the previous if
.
I think that a well thought-out YS macro system should greatly simplify a YS implementation, as there will be way less special cases.
Reminder: all these YS things simply get translated to Clojure forms by the YS reader library.
Also when I say ys-macro or ys-special-form what it translates to in Clojure is not related.