axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] ANSI Lisp and Axiom (Boot)


From: Kai Kaminski
Subject: Re: [Axiom-developer] ANSI Lisp and Axiom (Boot)
Date: Mon, 05 Mar 2007 12:53:03 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (darwin)

Gabriel Dos Reis <address@hidden> writes:

> Kai Kaminski <address@hidden> writes:
>
> | Gabriel Dos Reis <address@hidden> writes:
> | 
> | > Kai Kaminski <address@hidden> writes:
> | >
> | > | Gaby wrote:
> | > | >   The ANSI specification for the IN-PACKAGE syntax dictates that
> | > | > the argument must be a string, not a symbol.  SBCL gives a fatal
> | > | The hyperspec [1] says that the argument of IN-PACKAGE has to be a
> | > | string *designator*, that is either a string or a character or a
> | > | symbol. I've tested this with SBCL 1.0.2, CMUCL 19d and Allegro CL
> | > | 8.0. They all accept any of #:foo, :foo, 'foo or "FOO" as argument to
> | > | IN-PACKAGE.
> | >
> | > I'm using SBCL 1.0.2.  Here is what I got when I sent the message:
> | >
> | > sbcl --noinform --noprint --eval '(compile-file "exports.lisp" 
> :output-file "exports.o")'
> | > ; compiling file "/home/gdr/build/axiom/src/boot/exports.lisp" (written 
> 04 MAR 2007 08:41:33 PM):
> | > ; compiling (IN-PACKAGE (QUOTE BOOTTRAN))
> | > ; file: /home/gdr/build/axiom/src/boot/exports.lisp
> | > ; in: IN-PACKAGE 'BOOTTRAN
> | > ;     (IN-PACKAGE 'BOOTTRAN)
> | > ; 
> | > ; caught ERROR:
> | > ;   (during macroexpansion of (IN-PACKAGE 'BOOTTRAN))
> | > ;   'BOOTTRAN cannot be coerced to a string.
> | >
> | >
> | > Which I interpret as an error on using a symbol in place of a string.
> | > How should it be read?
> | Good one. I'll look into this, but I can't find EXPORTS.LISP in my
> | Axiom tree. I'll download your branch and look for it there.
>
> It is extracted from src/boot/exports.lisp.pamphlet, with Tim listed
> as \author.  I don't think it is particular to my branch.
So I stuffed up twice. The file is indeed not particular to your
branch. I simply forgot the .PAMPHLET suffix when running FIND.

The IN-PACKAGE form doesn't work, since it doesn't evaluate its
argument[1]. Hence you must not quote the symbol. The following work
like a charm (in my case it chokes because there is no such package):

(in-package boottran)

I'm sorry for spreading confusion when claiming that 'foo should
work. It does work in Allegro CL and CMUCL, and apparently I've
overlooked the warnings they issue.

Of course, as I said before, it is usually recommended to use
uninterned or keyword symbols, hence

(in-package #:boottran)

The EXPORT statement in that file should probably just be appended to
the DEFPACKAGE statement like so:

(defpackage #:boot-translator
  (:nicknames #:boottran)
  (:use #:cl)
  (:export #:boottocl
           #:boottocllines
           #:boottoclc
           #:boottoclclines
           #:boottomc
           #:compile-boot-file
           #:boot
           #:eval-boot-file
           #:bo
           #:fbo
           #:fev
           #:stout
           #:steval
           #:sttomc
           #:fc
           #:boot-compile-definition-from-file
           #:boot-eval-definition-from-file
           #:boot-print-definition-from-file
           #:boclam
           #:bootclam
           #:bootloop
           #:defuse
           #:xref))

> | > [...]
> | >
> | > | > error on that.  Furthermore, the specification also says that the
> | > | > packages LISP, USER and SYSTEM are no longer required for a
> | > | > conforming implementation.  Consequently, it is non-portable (and a
> | > | > potential source of errors) to say something like
> | > | > 
> | > | >         (in-package 'BOOTTRAN :USE '(LISP USER SYSTEM)) 
> | > | > 
> | > | > SBCL gives a fatal error.
> | > | That should probably be 
> | > | 
> | > | (defpackage #:boottran
> | > |   (:use #:cl))
> | > | 
> | > | in a file packages.lisp, and then
> | >
> | > Does the file *name* matter?
> | No, not at all. But it is customary to put your package definition,
> | i.e. the DEFPACKAGE forms, in a single file called either
> | PACKAGES.LISP, PACKAGE.LISP or DEFPACKAGE.LISP.
>
> src/boot/boothdr.lisp.pamphlet serves similar purpose.
It should probably be renamed, but that's none of my business.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]