Re: newbie question about load, eval-when and packages (sbcl)



In article
<b96d579c-2baf-4ba5-b28d-fe24f8a9324d@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ram Bhamidipaty <rambham@xxxxxxxxx> wrote:

I have a small package:

lib1.lisp:
------------------
(defpackage #:lib1
(:use #:common-lisp)
(:export #:hello))

(in-package #:lib1)

(defun hello ()
"hello")
------------------

I am trying to use that package in another
lisp program - and I want to dump an executable.

user1.lisp:
------------------
(eval-when (:compile-toplevel :load-toplevel)
(load "lib1" :verbose t :print t))

(use-package "LIB1")

(defun doit ()
(hello))

(sb-ext:save-lisp-and-die "user1" :toplevel 'doit :executable t)
------------------

I am using sbcl. When do "sbcl --load user1.lisp" I get
this error:

sbcl --load user1.lisp
This is SBCL 1.0.16, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.

debugger invoked on a SIMPLE-ERROR:
Error during processing of --eval option (LOAD #P"user1.lisp"):

Just a guess: it did not load lib1.lisp . Check your EVAL-WHEN statement.
Add :execute for example.

The name "LIB1" does not designate any package.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE] Ignore and continue with next --eval option.
1: [ABORT ] Skip rest of --eval options.
2: Skip to toplevel READ/EVAL/PRINT loop.
3: [QUIT ] Quit SBCL (calling #'QUIT, killing the process).

((LAMBDA (SB-IMPL::E)) #<SB-KERNEL:SIMPLE-PACKAGE-ERROR {A674A81}>)
0] 3


I don't understand this message.


To further confuse me - in slime I can do this:

(load "lib1" :verbose t :print t)
(use-package "LIB1")

and that works great.

Please help!
-Ram

--
http://lispm.dyndns.org/
.



Relevant Pages

  • newbie question about load, eval-when and packages (sbcl)
    ... (defun hello () ... I am trying to use that package in another ... lisp program - and I want to dump an executable. ... This is SBCL 1.0.16, an implementation of ANSI Common Lisp. ...
    (comp.lang.lisp)
  • Re: the best Linux for me
    ... I've ben using debian on my desktop for about 8 years, ... What's Debian's package / distro system called? ... cl-clx-sbcl - An X11 Common Lisp client library for SBCL ... You can also see how out of date my unstable install ...
    (comp.lang.lisp)
  • compiler verbosity
    ... As a test i typed "defun' in 4 different lisp compilers (clisp, cmucl, ... sbcl, gcl) to see the error messages, sbcl gave an extremely verbose ... :FUNS NIL ...
    (comp.lang.lisp)
  • Re: compiler verbosity
    ... sbcl, gcl) to see the error messages, sbcl gave an extremely verbose ... (EVAL DEFUN) ... :FUNS NIL ...
    (comp.lang.lisp)
  • Debian: SBCL: fails to install
    ... SBCL fails to install on current release of etch (i'm doing it on vmware, ... Reading package lists... ... (Dialog frontend will not work on a dumb terminal, ...
    (comp.lang.lisp)