Arc Forumnew | comments | leaders | submitlogin
5 points by CatDancer 5754 days ago | link | parent

Arc allows you to use pattern matching with let and function definitions (and very convenient it is too!):

  (let (a b) '(1 2)
    (prn a)
    (prn b))
  1
  2


2 points by CatDancer 5751 days ago | link

Oops, I think I misspoke when I described this Arc feature as "pattern matching"; iirc what "pattern matching" means is something that lets you compare a value against a list of patterns and select the first that matched. (Perhaps including setting pattern variables to the corresponding parts of the value, which would be like what this Arc feature does).

Hmm, "auto-destructuring" or even "destructuring" as what to call it, even if is standard usage, is quite the mouthful though...

-----