[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extent of function definition created by FLET/LABELS



   Date: 8 Apr 1986 18:06-EST
   From: NGALL@arpa.bbng
   
   Is the following legal CL:
   
   (funcall (labels ((foo () (print "hello"))
                     (bar () (foo)))
              #'bar))
   
   If not, where is it forbidden?

I'm somewhat puzzled by this question.  I sounds as if you think there's a
pretty good chance that it isn't legal but a pretty poor chance that the Book
says so.  I would say that it's almost certainly legal, although the book's
clarity on this point may still be in doubt.

I can't find anything in CLtL that explicitly says the functions created by
LABELS have indefinite extent, although it is reasonably clear that functions
made from lambda-expressions do (see, e.g., the COMPOSE example on page 37).
And named functions are explicitly connected to lambda-expressions in section
5.2.1 on page 59.  That the FOO in the definition of BAR refers to the right
local function should also be clear from the definition of LABELS in page 113
and 5.2.1 again.

-- Jeff