Re: Crazy macro





Drew McDermott wrote:
As an example, we can use 'control-nest' to provide the functionality
of 'let*' for 'multiple-value-let':

(control-nest
(multiple-value-let (x y z)
(foo ...)
:bind-p-q)
:bind-p-q
(multiple-value-let (p q)
(baz x y)
:bind-r-s)
:bind-r-s
(multiple-value-let (r s)
(zap x p)
...)))

expands to

(multiple-value-let (x y z)
(foo ...)
(multiple-value-let (p q)
(baz x y)
(multiple-value-let (r s)
(zap x p)
...)))

(Notice that we didn't provide 'tag1' here; it's optional because it
plays no actual role in expanding the macro.)

Any comments?

(a) I have the rope, where is the crib?
(b) 17" flat panel monitors, bigger if you like
(c) FLET, LABELS
(d) You call that readable?!
(e) finally...

For another, if the program's current
state is stored in several local variables

This may be The Real Problem. A more functional attitude would clean up your code nicely, making all this unnecessary.

hth, kenny
.



Relevant Pages

  • Re: Crazy macro
    ... the macro is a little weird. ... (multiple-value-let (x y z) ... (baz x y) ... (zap x p) ...
    (comp.lang.lisp)
  • Re: Crazy macro
    ... (multiple-value-let (x y z) ... similar to the reason why lexical binding is generally preferred over ...
    (comp.lang.lisp)