hello,
can anyone of the lisp gurus please answer the following question ?
the function foo-bar
(defun foo-bar (x)
(labels ((foo (x) (return-from 'foo-bar "exit")))
(foo x)))
when called (e.g. (foo-bar 'test) ) from allegro common lisp or harlequin
common lisp raises an "unseen block name 'foo-bar" error.
if my understanding of block-name scoping and the labels special form as
described in steele, 2nd edition is not completely wrong, foo-bar is
expected to yield "exit".
am i wrong ? why ? is the implementation incorrect ? why ?
thanks... bernd
--
Bernd Meyer, LG Praktische Informatik IV, FernUniversitaet Hagen, D-5800 Hagen
Bahnhofstrasse 46/48, FRG, Phone: +49 2331 181677, ** ·····@db0hag **
·····@fernuni-hagen.de or ·····@dhafeu61.bitnet
s=meyer; ou=vax1; ou=informatik; p=fernuni-hagen; a=dbp; c=de
On 20 Sep 91 Bernd Meyer <·····@fuhainf2.fernuni-hagen.de> wrote:
>(defun foo-bar (x)
> (labels ((foo (x) (return-from 'foo-bar "exit")))
> (foo x)))
>
>when called (e.g. (foo-bar 'test) ) from allegro common lisp or harlequin
>common lisp raises an "unseen block name 'foo-bar" error.
The block name argument to return-from should not be quoted.
Try
(labels ((foo (x) (return-from foo-bar "exit")))
and see if that works.
- SEB
In article <····@fuhainf.fernuni-hagen.de> ·····@fuhainf2.fernuni-hagen.de (Bernd Meyer) writes:
Hello.
>>
>>(defun foo-bar (x)
>> (labels ((foo (x) (return-from 'foo-bar "exit")))
>> (foo x)))
>>
RETURN-FROM is a special form.
I think it is ok , if you write (return-from foo-bar "exit") .
^^^^^^^
;; Noritoshi Rokujo ,Fujitsu LTD.