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

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

Re: [Kawa-commonlisp-dev] [GSoC] Status


From: Charles Turner
Subject: Re: [Kawa-commonlisp-dev] [GSoC] Status
Date: Mon, 6 Aug 2012 22:33:50 +0100

Hey Jamison,

On 6 August 2012 21:53, Jamison Hope <address@hidden> wrote:
> On Aug 6, 2012, at 1:37 PM, Charles Turner wrote:
> Scala, right? Or are you just eating lots of pasta as you work on the
> tests? ;-)

:-) -- Helmut pointed me in the direction of this project:

http://homepage1.nifty.com/bmonkey/lisp/sacla/index-en.html

This person has made some really comprehensive tests, so I'm pulling
them into Kawa. There's a *lot*, so I'm not going for a full port now
(haven't implemented enough anyway), just for ideas really.

>> * Freakin' out over the bootstrapping problems.
>
> This is about your commenting/uncommenting loadClass("defmacro") bit, right?
>
> Does that loadClass line need to be there at all, or could we just have
> some lines like defSntxStFld("destructuring-bind",
> "gnu.commonlisp.lisp.defmacro");
> instead?

This is actually what I'd like to do, mimic the Scheme file. Per has
mentioned in the past that the loadClass route should only be
considered temporary, but I have problems with this approach. Take
LENGTH:

CommonLisp:
defProcStFld("length", "gnu.commonlisp.lisp.primitives");

LENGTH is defined toward the bottom of that file, when the make suite
compiles primitives.lisp, there's a reference to LENGTH from a macro
in the same file before LENGTH's definition, and I get the following
error:
primitives.lisp:231:22: exception loading 'COMMON-LISP:LENGTH' - no
such class: gnu.commonlisp.lisp.primitives

if and only if the following is in CommonLisp:
defSntxStFld("once-only", "gnu.commonlisp.lisp.primitives"); // the
macro that references LENGTH.

So I guess because of the compile-time nature of macros, I can't do
this? Or I have to define once-only in another file (or at the bottom
of the current file).

I've uploaded my latest changes to my repository, in case you want to
have a look. I take no responsibility for accelerated aging whilst
trying to build it, though. :-)

> My understanding of how those things work is this:
> - loadClass() immediately loads everything in the file
> - def*Fld() doesn't load anything yet, it just lazily says where to find the
> function/macro later; it gets loaded as if by
> (import (only (class name) function-name))
> the first time the function is referenced.

Ah, thanks Jamison. That makes more sense to me now.

>> * Considering how best to approach CL sequences with the existing Kawa
>> infrastructure.
>
> Can you elaborate, please? We briefly discussed this a long time ago
> (pretty sure it was before GSOC 2012 started) but I don't remember what
> the issues were.

I need to review those discussions. Whilst I've been tidying up a few
rough edges, I was considering how you'd go about implementing a
generic reverse function, one that worked on all applicable data
types. My approach would be modify the Sequence interface to provide a
reverse method, and so on for all the other generic functions, but
I've no idea if that's how you guys would attempt it. Perhaps another
option would be to implement CLOS first (!) and then use its method
overloading on the set of standard common lisp types. The latter is
probably more elegant for CL, while the former might be more amenable
for immediate use from other languages.

Charles.



reply via email to

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