[Grace-core] Some comments from Tijs on parsing Grace

Tijs van der Storm storm at cwi.nl
Wed Jul 27 03:14:00 PDT 2016


>
>
> so my answer here is that the "longest match of identifiers" rule is
> extended to operators and brackets. Just as "aa" is space sensitive vs "a
> a" so "++" is space sensitive vs "+ +" and "[[" is space sensitive vs "[
> [".     The current exceptions to this rule - there is always - are only
> for () and {} brackets, but they're pretty special.
>

Hmm. Personally, I think longest match on parentheses is bad, since it does
not match how we normally write parentheses/bracketing constructs.
Moreover, I can't define my own brackety things, so the analogy with
operators is only partial.

Btw, reminds me, I once had a language design where , (comma) was just an
infix binary operator, and bracketing using [] was unary around-fix
operator. The comma then would create a shallow line-up like object, the
bracket converted it to a list/array; same with {} for sets. (You weren't
allowed to use comma expressions in param lists directly, but with
parentheses you'd just get the shallow line-up). The only problem is that
you couldn't write empty lists or set using the bracket notation.

T


>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20160727/5df81604/attachment-0001.html>


More information about the Grace-core mailing list