Arc Forumnew | comments | leaders | submitlogin
1 point by kennytilton 6135 days ago | link | parent

[WARNING: Common Lisp follows, but I do not think the Arc/CL differences change anything]

No coffee yet, but why is the first one problematic?

  (destructuring-bind (&optional (m 100)(p m)) nil
    (list m p))
  -> (100 100)
In this case, the second optional parameter VAR simply shadows the VAR introduced by LET, so it is not a hard case:

  (let ((var 42))
    (destructuring-bind (&optional (m var) var) nil 
       (list m var)))
-> (42 nil)

Where VAR is used as the default for M, hey, there better be one out there outside the DSB to eat.



1 point by almkglor 6135 days ago | link

It's problematic for a recursive solution. ^^ So is the second. ^^ In the end I decided that the sketch up of your solution is better, since 'withs is, after all, recursive ^^

-----