This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


On 06/16/2012 12:11 PM, Charles Turner wrote:
I'm getting tangled up in what format strings should be stored in the
namespace tables. My current strategy that internal names do not have
a package prefix, whereas external names do (even if the package
prefix if the package exporting the symbol).

Perhaps I misunderstand you, but that sounds very wrong. A Namespace is a mapping from names to symbols, and a LispPackage is a slightly more complex mapping (because of the uses list etc. This names should be the same name as symbol-name returns, i.e. without a prefix.

However, I'm having trouble looking names up. For instance:

(make-package 'test)

(use-package 'test)

(intern "A" 'test)

So at this point (find-symbol "A") will return nil nil, because "A" is
internal to TEST, not CL-USER. Intern is creating the new symbol using
Symbol s = Symbol.make(pkg, name); which then gets added to TEST's
internal symbol table.

Let's export "A" in TEST then:

(export '{TEST}:A 'test)

I think I've missed some of the previous discussion, but this is not Common Lisp syntax. It should be:

(export 'test::A 'test)

Better:

(setq testA (intern "A" 'test))
(export testA "test")

Export successfully finds "A" in TEST's internal table (by trimming of
the package prefix).

The package prefix is only used by the Lisp reader (and printer). It does not appear in any internal data structures, except as the name of a package (and then with no colons).

Then test.remove(s); test.exported.add(s); is performed.

My FIND-SYMBOL at this point should return the inherited "A", but it
doesn't. Ultimately it attempts to look the the constructed string "{"
+ test.getName() + "}:" + "A" in TEST's export table.

find-symbol (after searching if its 'present' in CL-USER) should search for plain "A" in the test.exported. No constructed string.

However, the
exists a symbol in this export table with name "{TEST}:A", exactly the
same as the name I constructed.

There shouldn't be. Don't use or construct any such string. -- --Per Bothner per@bothner.com http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]