kawa-commonlisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Kawa-commonlisp-dev] [PATCH] Type refactoring.


From: Charles Turner
Subject: Re: [Kawa-commonlisp-dev] [PATCH] Type refactoring.
Date: Fri, 19 Oct 2012 22:43:45 +0100

On 28 September 2012 07:18, Per Bothner <address@hidden> wrote:
> On 09/22/2012 06:15 AM, Charles Turner wrote:
>>
>> On 22 September 2012 01:24, Per Bothner <address@hidden> wrote:
>> gnu/xquery/lang/XQResolveNames.java:350:  type =
>> Scheme.getInstance().string2Type(sym.getName());
>>
>> I'd like for this not to be the case, but I get testsuite failures if
>> I instead call the method from Language.getCurrent() (or
>> XQuery.getInstance(), which should be equivalent in this case).
>
> One reason I think it would be better to avoid static methods is
> that there may multiple instances of a given language, corresponding
> to different variants/dialects.  Thu it is better to get the specific
> current language.  Mostly Language.getCurrent() should work, but for
> example in XQResolveNames we could use parser.interpreter.  Not only
> is this faster, but it also is guaranteed to the get the same Language
> instance as currently being used.

I'll get testsuite failures about the boolean stuff with
parser.interpreter as well. I can't see why at the moment. Like I say,
I'm really unfamiliar with XQuery, so I'm treading carefully in these
files...

>>> It might also be help to add some comments - for example what is
>>> the difference between getNamedType and string2Type.
> Certainly we don't need to merge string2Type and getNamedType
> at this time - though I would like to document better the difference.

Turns out getNamedType isn't nice. What I (I think!) did ages ago was
provide a hook in string2Type so that we do a bit of extra processing
in the lisp languages. In particular, LispLanguage, in addition to the
processing of string2Type, checks for package style types, and
CommonLisp special cases "boolean" type. These are the only uses of
getNamedType (I removed one from XQuery because it should have been
calling string2Type). Basically getNamedType should probably never be
called, should call string2Type instead now.

There's no need for getNamedType to be abstract. It's on death row as
far as I'm concerned!

I generalised LispLanguage's string2Type into Language. There are now
no overrides of this method, it's only fiddled with using the
getNamedType hook as explained above.

There's probably a much cleaner way of achieving these special cases.
I need to think it about it more. Still not very happy with the type
handling.

> Anyway, when you have an updated patch I'll check it out.

I've attached it. It causes a a problem with RunTestScript on my
computer, seems like the process.waitFor() in RunTestScript never
returns.  I've no idea why, can someone check if this is a problem on
their computer? I'm not sure what changes I've made that could be
causing this.

Thanks for your time,
Charles.

Attachment: types.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]