[ prog / sol / mona ]

prog


cddr

24 2024-08-20 16:17

> 23

yeah modern LET is insufficient, i was just pointing out that "using functions" is the og way of binding variables. it's the lambda calculus way and the little schemer kind of books like to introduce lambda-binding, but i personally didn't realize that it wasn't just some theoretical curiosity. it was used as the only method until someone invented LET macro.

there's actually a part in the second sept 17th quote that i skipped, because i didn't want to complicate the discussion,

    An extension to the binding of one variable, is a "pattern" of
    variables, which are bound to the corresponding subparts of the 
    "val";  e.g., (LET ( ((A . B) '(CONS 1 2)) ((C () D) (LIST 1 2 3)))
                       <forms>)
    would bind A to "CONS", B to "(1 2)", C to "1", and D to "3".

so you could write your last destructuring-bind as

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

at some point there must've been a conscious decision made to make LET less powerful. maclisp also had destructuring in DEFUN arguments, so you could have monstrocities like (defun f ((w x) &optional ((y . z))). but both LET and DEFUN destructuring are already missing in zeta lisp

29


VIP:

do not edit these