Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 6045 days ago | link | parent

Actually the prefix $ will have to be higher precedence than . if we want to support $.sin syntax.

Basically what is done is, it scans linearly through the ssyntaxes* list, and performs the splitting at the time. So if the list is:

  $ prefix
  $ standalone
  :  infix
  ~prefix
  ~ standalone
  . infix
  ! infix
Then when processing $.sin, it will see the prefix $ first, so it will split it into {$, .sin} and attempt to return a curried 'map with '.sin


1 point by absz 6045 days ago | link

Actually, that's precisely why it has to be lower precedence: we want $.sin to turn into ($ sin), so as to get at trig from mzscheme; if it were to become (map .sin ...), things would die because of the malformed ssyntax in .sin. (I tried it both ways, which is how I figured this out.)

-----

1 point by almkglor 6045 days ago | link

Ah, I think we have a misunderstanding here: from my point of view, objects earlier in the list have lower precedence to objects later in the list. ^^ So your "lower precedence" is my "higher precedence". Basically, it has to do with stuff like:

  foo!bar:qux!quux
which is compiled as:

  {{foo ! bar} : {qux ! quux}}
So !, which is listed later, has higher precedence (it gets grouped more tightly)

-----