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

RETURN-FROM inside a FINALLY



This is a CommonLisp question not necessarily a
Symbolics question.

I have code which looks something like:

(loop named outer
      collect (foo) into x
      finally (loop for y in x
                    when (bar y)
                      do (return-from outer x))
              (return nil))

The idea is that the outer loop does some work and builds a
list. When it is finished, the second loop in the finally
clause munges over that result. If a certain criteria is met
for any of the elements of the list, then the whole list is
returned by the return-from. Otherwise the, outer loop returns
nil. This works fine on both the L/G-machine and Ivory. When
I compile this in Lucid I get an error telling me that
there is no block named NIL when compiling (return-from outer x).
I can get arround this by doing:

(block outer
 (loop collect (foo) into x
       finally (loop for y in x
                     when (bar y)
                       do (return-from outer x))
               (return nil)))

which works fine but I don't know whether the first example is
incorrect CommonLisp code or whether it is a problem with Lucid.
        Jeff
-------