This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: GSOC | Extending Common Lisp support
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).
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)
Export successfully finds "A" in TEST's internal table (by trimming of
the package prefix). 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. However, the
exists a symbol in this export table with name "{TEST}:A", exactly the
same as the name I constructed. Furthermore, Symbols hashCode()
returns this name, so the lookup should succeed. It can't be object
identity problems, since the hash codes of strings are computed using
the following formula:
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
Any ideas?
Charlie.