Open axch opened 8 years ago
The Scheme community has put some (not very broadly adopted) thought into surface syntaxes that would be both "more traditional" yet still homoiconic. See
for examples in Scheme proper. I also wouldn't be surprised if the Racketeers have something in this space.
Clojure suggests another option, which is that vectors with square brackets [a b c] evaluate as literal vectors, and many special forms use vectors instead of lists for internal grouping syntax (e.g. (let [var exp] body), (fn [arg] body)). Clojure's list/vector distinction is a little weird in that it conflates different data representations with different interpretations, and it would be a departure from Scheme style (as Venture is implemented so far), although a self-evaluating vector literal would be useful in its own right. (Maybe that should be a separate issue.)
Workaround: One can always write
list(list("y_out", "y", "UArray(Number)", "N"))
That way there's extra verbiage, but at least the parens are all in reasonable places.
We recently added syntactic sugar for array literals (with square brackets) (#511). That might be considered enough for this use case. The other reasonable thing to do would be to suppress leading subform motion under quote or quasiquote.
From a venstan example:
is how one spells what in the abstract syntax looks like
This is because the VentureScript syntax for lists of all kinds is
<first_elt>(<second-elt>, <third-elt>, ...)
regardless of whether they are meant as function application syntax or as list literals.The same problem screws attempts to use the
cond
andletrec
macros.