Arc Forumnew | comments | leaders | submitlogin
1 point by zck 4518 days ago | link | parent

To discuss your specific issues, I prefer '+ to 'join for lists. I don't particularly have an opinion on how it looks in infix, because I don't like infix. Certainly

  ('(1 2 3) + '(4 5))
does look pretty ugly, but I like infix for basically everything. Your heuristic seems quite reasonable, though. What do you do about math? Do you still hold to it? For example, how would you write y(x) = mx+b:

  (def y (x)
       (+ (* m x)
          b))

  (def y (x)
       (+ (m * x)
          b)

  (def y (x)
       (m * x
        + b))
Or something else? I prefer the first one, but I know not everyone does.


1 point by akkartik 4518 days ago | link

I don't know if you saw the thread about infix in wart[1], but I can say:

  def (y x)
    (m*x + b)
All operators have the same precedence, but operators without whitespace have precedence over operators with whitespace:

  (n * n-1)
The major drawback is, of course, that you can no longer use '* or '- in symbols. I use capitalization for globals and underscores in long names, and have been mulling camelCase.

(Wait, didn't someone check the pitchforks at the door?)

[1] http://arclanguage.org/item?id=16775

-----