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/11/2012 01:57 PM, Charles Turner wrote:
It can't account for the arbitrary ClassType's. I've sunk a lot of
time into trying to get case folding to work in a sane way, but I just
can't see the light. For instance, how would this even work?

(invoke-static some.java.ClassName 'whatEver)

It doesn't have to. I think it's ok to require the programmer to write: (invoke-static |some.java.ClassName| '|whatEver|)

Note that case-folding must be disabled inside vertical bars.

The reader, if using case folding, presents the system with a fold
like SOME.JAVA.CLASSNAME and a method WHATEVER. How will it know what
the correct case is when it comes time to lookup the Java code? I'll
have to look into how ABCL gets around this. I did investigate the
possibility of postponing folding until later in the compiler, so I
could check things like type names. This worked, sorta, but I
abanonded it because I'd convinced myself after a day or two that it
can't be the right method.

It would be possible to have a way to extra the "original token" from an Expression. For example a ReferenceExp has a line and column, which could be used to get raw token from the source file, though some API enhancements would make sense. Doing the same for a quoted symbol (i.e. a QuoteExp) is a little harder in the general case.

However, looking at the "original token" like this adds complexity and
is not in the "spirit" of Common Lisp, so let's not, at least for now.

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