Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does anyone actually use flet?

actually flet
0
Posted

Does anyone actually use flet?

0

This question is usually motivated by the existence of labels, which is a similar form for binding functions, but also allows mutual recursion between the functions being bound. Given this, it is perhaps natural to question the utility of flet. However, there are two reasons for using flet: one idiomatic and one programmatic. The idiomatic reason is that flet can be useful to signal to the reader of the code that it is not expected that the functions will be mutually recursive; in other words, it is part of the documentation of the system, so that a subsequent programmer can see by inspection the purpose of binding the functions. More usefully, though, flet can be useful to locally modify the behaviour of functions, for instance (a contrived example due to Kent Pitman): (defun square (x) (* x x)) (flet ((square (x) (make-instance ‘square :area (square x)))) …

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123