guile-devel
[Top][All Lists]
Advanced

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

Re: GOOPS todo


From: Ludovic Courtès
Subject: Re: GOOPS todo
Date: Thu, 24 Apr 2008 00:03:26 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi Andy!

Andy Wingo <address@hidden> writes:

> * Generic application only works for instances of <generic>, or for
>   instances of a couple of other specially blessed classes. This is
>   because for these classes, the C code knows how the objects will be
>   laid out in memory, and can access memory directly instead of using
>   slot-ref. In general in GOOPS (and in MOPs in general) there is a
>   tension between extensibility and efficiency; the former is expressed
>   in protocols of generic functions, and the latter in invariants and
>   possibilities for direct memory access.
>
>   The evaluator really needs to be able to do direct memory access, if
>   possible. So for that reason the existing bits of generic function
>   dispatch that are wired into eval.c check instances of those blessed
>   clases, via checks like (SCM_OBJ_CLASS_FLAGS (proc) &
>   SCM_CLASSF_PURE_GENERIC).
>
>   This "direct memory access" also has repercussions in tail recursion;
>   that if the code to dispatch a method can't bottom out in eval.c, we
>   lose tail recursion.
>
>   So, we need to add support for instances of subclasses of <generic>,
>   without losing efficiency. Apparently there is some code for this, see
>   goops.scm:apply-generic.

(I realize this answers my previous message on `guile-user'...)

Good to see you have idea on this!  :-)

> * We have no :before or :after methods. I don't know if STKlos had these
>   either.

Not sure, but a nice thing to have.

> * GOOPS should define a with-accessors macro.

Actually, I don't like it a lot (probably because I wouldn't mind adding
accessors to the global namespace).  Do other CLOS-like systems have
something similar?

> * GOOPS reference should be folded into Guile's reference, as it is now
>   part of Guile.

Not sure about it since it's quite a large document and it's easier to
search it when it's separate.

> * Possibly the worst section of Guile's manual:

I like this one.  :-)

> * method cache code could be rewritten in C (dispatch.scm), although I
>   have never had a problem with it -- it doesn't show up on my profiles.

I'd be reluctant to this, as it's already complex enough.

Thanks for this instructing (and entertaining) review!

Ludo'.





reply via email to

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