[Ecls-list] Package locks and symbol-package
Matthew Mondor
mm_lists at pulsar-zone.net
Wed Oct 10 01:12:58 UTC 2012
On Tue, 9 Oct 2012 19:55:52 -0400
Matthew Mondor <mm_lists at pulsar-zone.net> wrote:
> ECL:
>
> (make-package :foo) -> #<"FOO" package>
> (defparameter foo::gentemp 10) -> GENTEMP
> (symbol-package 'foo::gentemp) -> #<"COMMON-LISP" package>
Also:
SBCL:
* (make-package :foo)
#<PACKAGE "FOO">
* (in-package :foo)
#<COMMON-LISP:PACKAGE "FOO">
* (cl:import (cl:make-symbol "GENTEMP"))
COMMON-LISP:T
* (cl:describe 'gentemp)
FOO::GENTEMP
[symbol]
* (cl:symbol-package 'gentemp)
#<COMMON-LISP:PACKAGE "FOO">
ECL:
> (make-package :foo)
#<"FOO" package>
> (in-package :foo)
#<"FOO" package>
FOO> (cl:import (cl:make-symbol "GENTEMP"))
Condition of type: SIMPLE-PACKAGE-ERROR
Cannot import the symbol #:GENTEMP from package #<FOO package>,
because there is already a symbol with the same name
in the package.
Available restarts:
1. (CONTINUE) Ignore conflict and proceed
2. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
Broken at SI:BYTECODES. [Evaluation of: (IMPORT (MAKE-SYMBOL "GENTEMP"))] In: #<process TOP-LEVEL>.
New ECL session:
> (make-package :foo)
#<"FOO" package>
> (symbol-package 'foo::gentemp)
#<"COMMON-LISP" package>
> (foo::gentemp)
T0
So if I understand, a virgin package automatically uses CL?
Thanks,
--
Matt
More information about the ecl-devel
mailing list