[ prog / sol / mona ]

prog


cddr

23 2024-08-20 13:59 *

>>22

(let ((a 1) (b 2) (c 3) (d 4))
  (list a c))

(destructuring-bind (a b c d) '(1 2 3 4)
  (list a c))

(match '(1 2 3 4)
  [(a b c d) (list a c)])

while the above destructuring-bind and match could be rewritten to the equivalent let, i'm not sure the same is true for the cases below

(destructuring-bind (a (b c) &rest d) '(1 (2 3) 4)
  (list a c))

(match '(1 2 3 4)
  [(a (b c) d ...) (list a c)])
29


VIP:

do not edit these