Arc Forumnew | comments | leaders | submitlogin
2 points by fallintothis 3075 days ago | link | parent

In ssyntax, everything is evaluated from left to right regardless of the operator.

Actually, no. . and ! are evaluated left-to-right in relation to each other, but there are currently three priority levels; from highest to lowest they are: (1) : and ~, (2) . and !, (3) &. Characters within the same level needn't be evaluated left-to-right, though . and ! are. For example,

  arc> (ssexpand 'a.b:c.d) ; : takes precedence over .
  (compose a.b c.d)
  arc> (ssexpand 'a.b&c.d) ; . takes precedence over &
  ((a b&c) d)
  arc> (ssexpand 'a:b&c:d) ; : takes precedence over &
  (compose a b&c d)
Then, since & has lower precedence than ~, you can't do

  arc> even&~odd
which causes Arc to hang (which is actually a bug).

Further, though ~ and : are in the same level, : takes priority over ~ regardless of order.

  arc> (ssexpand '~a:~b)
  (compose (complement a) (complement b))
If you're interested in rewriting code to use ssyntax, you can check out my sscontract library (and let me know if it's broken!):

1 point by evanrmurphy 3074 days ago | link

Very clarifying, thanks. I stand corrected. :)