Hi, in common lisp, the names labels and flet are somewhat peculiar to me.
flet could be described as a sort of let for functions. So it named as such. What about labels?
And where does the "f" of getf, setf, remf come from?
Thanks.
Hi, in common lisp, the names labels and flet are somewhat peculiar to me.
flet could be described as a sort of let for functions. So it named as such. What about labels?
And where does the "f" of getf, setf, remf come from?
Thanks.
LABEL (without the s) is a very old (from the early Lisp dialect) construct that allows to give a name to a function so that it can call itself using that name:
Something like (this is not valid Common Lisp):
(label 'ff (lambda (x) (if (foo) (bar) (ff (baz)))))
It labels a function with a name.
For Common Lisp this name has been recycled. LABELS now allows to define local functions that can call themselves by name.