evanrmurphy / SweetScript

A lispy language that compiles into JavaScript, strongly influenced by Arc.
https://github.com/evanrmurphy/SweetScript
14 stars 4 forks source link

Infix dot #3

Open evanrmurphy opened 13 years ago

evanrmurphy commented 13 years ago

Working on an infix implementation for the JavaScript dot-operator in a separate branch.

Now being implemented as a sort of ssyntax. This may work, but has issues when the dot appears in a top-level form (i.e. not inside a list). May need to wrap all expressions passed to js in a do to resolve this.

The right way to do this is as an extension to the reader. This is also the only way to get . to be our symbol (right now using ..), because Racket's dotted lists will have to be modified. Perhaps dotted lists could just be given a different symbol, such as ... or &.

evanrmurphy commented 13 years ago

Allowing infix dots even between non-symbol expressions would break a precedent for Arc, which so far has only allowed intra-symbol ssyntax. But I believe it will only be problematic for:

  1. dotted lists
  2. unquote-splicing when used outside of the rest parameter context

and these are rarely needed in real code.