Arc Forumnew | comments | leaders | submitlogin
1 point by evanrmurphy 2531 days ago | link | parent

The reason I care about this is I think I've devised a way to allow javascript-style infix dotting in my lisp->js project [1], even between non-symbol expressions such as

  ($ "#foo").(addClass "bar").(show "slow")
that arc's ssyntax system doesn't usually touch. The problem is my solution would break:

1) unquote-splicing if you're not just using it to splice rest parameters

2) dotted lists (and, in turn, rest parameters), unless I pick another symbol for denoting them, e.g. `dot` or `..`

---

[1] https://github.com/evanrmurphy/SweetScript



2 points by shader 2530 days ago | link

What we really need is our own reader for arc, so that ssyntax isn't limited to intra-symbol, but can be used between other tokens as well, such as lists and strings.

-----

1 point by evanrmurphy 2530 days ago | link

Can you help me understand why Racket's reader couldn't be extended to do this? It seems very extensible [1]. I've already gotten good mileage out of hacking it with aw's extend-readtable [2]. (Come to think of it, I should continue playing around with this to try and implement the JavaScript-style dot operator.)

I also wonder if rntz's arcc might be useful here [3]. (I haven't tried it yet.)

---

[1] http://docs.racket-lang.org/guide/hash-reader.html

[2] http://awwx.ws/extend-readtable0

[3] http://arclanguage.org/item?id=11128

-----

2 points by aw 2529 days ago | link

The reader is implemented in Arc in the runtime project I'm working on (https://github.com/awwx/ar).

-----