From: Bernd Meyer
Subject: Scoping of Blocknames and Labels
Date: 
Message-ID: <7190@fuhainf.fernuni-hagen.de>
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 

From: Doug Cutting
Subject: Re: Scoping of Blocknames and Labels
Date: 
Message-ID: <CUTTING.91Sep20093614@skye.parc.xerox.com>
In article <····@fuhainf.fernuni-hagen.de> ·····@fuhainf2.fernuni-hagen.de (Bernd Meyer) writes:

> (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.

You shouldn't quote block names.  Thus your example should read:

(defun foo-bar (x)
  (labels ((foo (x) (return-from foo-bar "exit")))
    (foo x)))

	Doug
From: Stephen E. Bacher
Subject: Re: Scoping of Blocknames and Labels
Date: 
Message-ID: <RNETMAIL9109201327460SEB1525@MVS.DRAPER.COM>
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
From: Noritoshi Rokujo
Subject: Re: Scoping of Blocknames and Labels
Date: 
Message-ID: <NORI.91Sep25152703@nsx.kagaku.se.fujitsu.co.jp>
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.