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

Re: [spr7837] Compiling code containing return-from



Your problem report has been assigned a tracking id of spr7837.
Please use this id in the subject line of any mail related to
it so that we may better track communication on your inquiry.
Also, please address mail to bugs@franz.com as well as me,
so your questions can be answered if I am unavailable.

  When I try to compile codes containing return-from, I get compilation
  error stating 
  return-from label NIL isn't visible.

  Can you tell me what I am doing wrong?
  -MK

Well, not with just this amount of information 8-).  I tried the
example in the CLMAN page on RETURN-FROM, and it worked interpreted,
compiled without error, and worked compiled.  This was on Allegro CL
4.1 on a Sparcstation.  It is possible that the behavior in the
version you are running is different, which is why it is useful to us
if you include the Allegro CL version number (its in the banner
printed when Lisp comes up) and the type of machine in every message
and problem report.

Do you have a sample of code which fails?  Note that RETURN-FROM
requires a name argument that names the block being returned from.  Is
it possible you left that out (and the result form was NIL instead)?

Anyway, here is the example from CLMAN:

Allegro CL 4.1 [SPARC; R1] (5/29/92 15:51)
Copyright (C) 1985-1992, Franz Inc., Berkeley, CA, USA.  All Rights Reserved.
;; Optimization settings: safety 1, space 1, speed 1, debug 2
;; For a complete description of all compiler switches given the current
;; optimization settings evaluate (EXPLAIN-COMPILER-SETTINGS).

;; Starting socket daemon and emacs-lisp interface...
USER(1): (defun block-test (arg)
      (block outer
        (format nil "arg is a list of length ~d"
                (block inner
                  (if (atom arg)
                      (return-from outer "arg is an atom")
                      (return-from inner (length arg)))))))
BLOCK-TEST
USER(2): (block-test 1.0)
"arg is an atom"
USER(3): (block-test '(1 2 3))
"arg is a list of length 3"
USER(4): (compile 'block-test)
BLOCK-TEST
NIL
NIL
USER(5): (block-test 1.0)
"arg is an atom"
USER(6): (block-test '(1 2 3))
"arg is a list of length 3"
USER(7): 

I look forward to getting more information on the problem you are
having. 

David Margolies
Franz Inc.