From: Vassil Nikolov
Subject: returning from a function (Ex: Re: some small proposed changes to standard)
Date: 
Message-ID: <l03130304b3bd02b9ecba@195.138.129.78>
Mark Stickel wrote:                [1999-07-20 21:20 -0700]
(to the ·····@ai.sri.com list)

Among other items:

  > 8. Add implicit (BLOCK DEFUN ...) around body of defuns
  > 
  > (BLOCK function-name ...) is automatically added around the body of
  > defuns now; this enables (RETURN-FROM function-name ...) to be used.
  > It would be convenient for (BLOCK DEFUN ...) to be added as well, so
  > that (RETURN-FROM DEFUN ...) can be used.  This obviates the task of
  > editing RETURN-FROM forms when the name of the function is changed
  > and facilitates writing macros that produce defuns with RETURN-FROM
  > forms.

Making any symbol (apart from NIL) a special case for RETURN-FROM
seems inelegant.  Wouldn't it be better to have a macro called (say)
FRETURN which can be used only lexically within a function definition
(a DEFUN form, maybe a LAMBDA form as well) as if

  (defun foo (...)
    ...)

is implicitly

  (defun foo (...)
    (block #1=#:function
      (macrolet ((freturn (&optional value) `(return-from #1# ,value)))
        ...)))


Vassil Nikolov
Permanent forwarding e-mail: ········@poboxes.com
For more: http://www.poboxes.com/vnikolov
  Abaci lignei --- programmatici ferrei.