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: Package initialisation in CL boot


On 07/12/2012 11:06 AM, Charles Turner wrote:
The problem for now is, how to handle something like
COMMON-LISP-USER::java.lang.String as a type name. Translator#exp2Type
returns an error saying unknown type name because this symbol gets
turned into a ReferenceExp by rewrite_car in exp2Type. One way around
this would be to unpack the ReferenceExp in exp2Type (in Translator
where is checks texp instanceof ReferenceExp) and perform a
rewrite(((ReferenceExp) texp).getName()) to get the ClassType when
it's appropriate, then wrap that up in a QuoteExp and return it.
Doesn't seem "right" though, any ideas on a better approach?

The may work better if you just concentrate on getting COMMON-LISP-USER::|java.lang.String| to work.

What do you mean by this? 'CL-USER::|java.lang.String| does what it's supposed to according to the spec now, but are you saying that the unpacking of a ReferenceExp in Translator is an acceptable approach?

It's what we do for Scheme, and it seems plausible to do the same or something similar for Common Lisp.

Scheme uses SchemeCompilation#checkDefaultBinding to resolve the class.

For Common Lisp it might be reasonable to use a separate package,
for example:
  class:|java.lang.String|
It's a tradeoff: Convenience of using COMMON-LISP-USER vs better
of the package system for namespace separation.  Helmut, what do you
think?

--
	--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]