[armedbear-devel] ABCL-0.25.0
Erik Huelsmann
ehuels at gmail.com
Mon May 16 22:06:50 UTC 2011
Hi Paul,
On Mon, May 16, 2011 at 6:49 PM, Paul Bowyer <pbowyer at olynet.com> wrote:
> Hello:
>
> I'm very new to lisp and decided to try ABCL to see how it works. I have
> some experience (not much though) with SBCL and CMUCL using Slime. I've also
> tried ClozureCL, but it is a little more problematic.
>
> I built ABCL with:
> Netbeans-6.9 (ant-1.8.2)
> and with:
> Netbeans-7.0 (ant-1.11.1)
> as Java Free-Form Projects
>
> In both cases, ABCL built without noticeable problems.
So far so good. It's expected, but good to hear people experience it that way.
> I'm running PCLinuxOS, so I used the install instructions for Linux from:
> "http://common-lisp.net/project/armedbear/doc/abcl-install-with-java.html"
> by copy/paste of "test.lisp" and running :
> "java -jar <mypath>/abcl.jar --load test.lisp" which also went without
> problems.
That's very nice. I'm impressed, actually, since it has been a while
since that documentation has been reviewed. Thanks for confirming!
> I then created a shell script (named "abcl") in my home directory by
> copy/paste of your "/usr/bin/lisp" with the corrected "ABCL_JAR=" set for
> the location of my newly built "abcl.jar" but when I run that script from a
> Konsole shell, the "CL-USER(1):" prompt copies itself plus the character I
> typed for each character I type at the prompt. As I type, the screen fills
> with "CL-USER(1):" until I press the enter key and then the lisp form is
> evaluated and the CL-USER(2): is now at the normal expected location at the
> lower- left corner of the shell.
>
> I have "rlwrap 0.30" installed for use with ABCL.
That's weird. However, I'm personally not using ABCL on Linux, most of
the time; hopefully one of the other developers can chime in here. The
Windows version of ABCL behaves as if it's wrapped by rlwrap (ie you
can scroll through history at the REPL prompt).
> Startup of ABCL:
> ----------------------------------------------------------------------
> Armed Bear Common Lisp 0.25.0
> Java 1.6.0_24 Sun Microsystems Inc.
> Java HotSpot(TM) Client VM
> Low-level initialization completed in 0.746 seconds.
> Startup completed in 2.318 seconds.
> Type ":help" for a list of available commands.
> ----------------------------------------------------------------------
This looks good.
> I tried using ABCL with Slime and it starts up OK, but it would not compile
> and load some lisp files that work properly with SBCL and CMUCL.
Files from Slime itself? Or files of yours, like the util.lisp
attached? (or both?)
> From a Konsole shell using: 'java -jar "<mypath>/abcl.jar"' to run ABCL so
> as to avoid the prompt problem, I tried:
> :cload <mypath-to-files>/util.lisp and it went through the compile, but
> choked at loading with the following:
> ----------------------------------------------------------------------------------------------------------------------------------------
> ; Compiling <mypath-to-files>/util.lisp ...
> ; (IF (NOT #) ...)
> ; (IN-PACKAGE "UTIL")
> ; (DEFUN ELEMENTP ...)
> ; (DEFTYPE ELEMENT ...)
> ; (DEFUN LIST-DUP-EL-SRCH ...)
> ; (DEFUN BAGP ...)
> ; (DEFTYPE BAG ...)
> ; Wrote <mypath-to-files>/util.abcl (0.644 seconds)
> Error loading <mypath-to-files>/util.abcl at line 6 (offset 274)
> #<THREAD "interpreter" {993730}>: Debugger invoked on condition of type
> PACKAGE-ERROR
> The symbol COMMON-LISP-USER::ELEMENTP is not accessible in package UTIL.
> Restarts:
> 0: TOP-LEVEL Return to top level.
> ----------------------------------------------------------------------------------------------------------------------------------------
> This was one of the files that compiles and loads without problems with SBCL
> or CMUCL. ClozureCL will compile and load this file from Slime if I coax it
> through the process, but it takes more effort than SBCL or CMUCL.
>
> I have attached the source for this file if it is needed. It is just some
> code built by following (kind of) some common lisp tutorial instructions.
Well, I do understand why the error is being generated. The problem is
that the symbol "ELEMENTP" which you're exporting in the EVAL-WHEN if
the package already exists (which it does, because it was created in
the compile phase, so LOAD running the EXPORT form) is a symbol in the
package which was the current package when you called COMPILE-FILE.
(common-lisp-user, which is the startup default).
Since the COMMON-LISP-USER package isn't used by the UTIL package
[there's no (:use :common-lisp-user) or (use-package
:common-lisp-user)] and the symbols ELEMENTP, etc are also not
explicitly imported, the symbols you're passing to EXPORT are not
accessible within the context of the UTIL package.
ABCL is generating this error, because you cannot EXPORT what's not there.
See http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_export.html
for more info on EXPORT.
How to solve this issue then? You could put the EXPORT form after the
IN-PACKAGE form.
HTH,
Erik.
More information about the armedbear-devel
mailing list