Arc Forumnew | comments | leaders | submitlogin
5 points by absz 5656 days ago | link | parent

This has come up before; see particularly http://arclanguage.org/item?id=6759 . The reason you can't just do this is that Arc supports list destructuring on variable binding; to wit,

  (def stats (data)
    (list (reduce + data) (avg data)))
  
  (let (sum avg) (stats '(1 2 3 4 5))
    (prn (string "sum = " sum ", avg = " avg)))
  
  ; Output: sum = 15, avg = 3
Thus, even if the first argument is a list, let has well-defined semantics. An alternative in the thread I linked to is to remove the implicit do (either modifying let or creating a new macro given), which never requires parenthesizing the arguments but requires an explicit do if its body contains more than one statement; I still think is is a good idea.


1 point by tc-rucho 5656 days ago | link

Ouch, didn't know abut this. Thanks a ton.

-----