Closed Ismael-VC closed 6 years ago
Or do you think a literal tuple syntax would be more useful instead?
What about #(1 2 3)
?
Currently '[1 2 3]
and '(1 2 3)
are interchangeable, should a possible #(1 2 3)
be the same as
#[1 2 3]
?
This is interesting. Many lisps use #
as a reader-macro dispatch character. I think clojure uses this character for reader dispatch and I believe they use #()
as an anonymous function dispatch as in #(+ %1 %2)
which translates into (fn [a b] (+ a b))
Perhaps we use either the (, _ _)
or use tuple dispatch #tuple{}
or #tuple()
and just properly implement constructor dispatch. The word tuple
can be any constructor in that case.
What do you think?
just pushed a version that includes an experimental version of reader dispatch. two further steps would be necessary to support tuples:
Hy lang uses this:
currently we do this:
I'm not sure if this conflicts with the backquote syntax:
I think clojure uses ~ am I right?