This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: struct bug


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> That part of the struct code is a mess:  The documentation and
> implementation both hold inconsistencies.

[...]

It's actually only the documentation which is wrong.  Remember that
this documentation was written fairly recently, so I think it is
forgivable that it contains inconsistencies.

> ** There is now a fourth (optional) argument to make-vtable-vtable and
>    make-struct when constructing new types (vtables).  This argument
>    initializes field vtable-index-printer of the vtable.
> 
> However, this is IMO complete rubbish:  How do you distinguish an optional
> fourth argument from the other rest arguments ?  And, the way the code
> works, there is no distinction made.  Thus, any first initializer is used
> to initialize the printing function slot.

In the normal case (I've never seen another case than the normal case
so far), a vtable-vtable doesn't contain any further fields, so the
printer init arg is last, and may be omitted, like all other init
args.  Therefore it can be considered optional, even though this
should be clarified.

If anyone would like to have a new kind of vtable-vtable and therefore
adds further fields, they are considered optional as well.  It's not
uncommon to have several optional fields.

I'll try to get time later today to update the documentation.  I'll
then mail Clark, you, and the list.


And, I think there's a risk that Guile gets unnecessary bad PR if we
developers go out self-bashing like this.  The current struct system
is not something we would like to keep, but it is not at all as bad as
you try to paint it in your letter.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]