unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* make-vtable
@ 2007-02-12 21:13 Kevin Ryde
  2007-02-13  8:13 ` make-vtable Ludovic Courtès
  0 siblings, 1 reply; 16+ messages in thread
From: Kevin Ryde @ 2007-02-12 21:13 UTC (permalink / raw)
  To: guile-devel

I made a bit of a start trying to improve the structures section of
the manual, I always found it pretty hard to follow.  One big
stumbling block for me was vtables, but I now see if you want to make
a struct you have to make a vtable vtable, and from that a vtable, and
only then your struct.  Seems hard work for casual users, if you're
not (at first) interested in that second level of "type of type".

How about something like this to just make a vtable from fields and
optional printer func,

    (define (make-vtable fields . print)
      (apply make-struct (make-vtable-vtable "" 0) 0
             (make-struct-layout fields)
             print))

I suppose a func should be judged on whether it'd be used, but a
make-vtable like this would certainly make the manual easier reading,
since you can get started making structs just from the fields layout,
and only later that learn details of sets of related types, extra
slots in the vtable(s) for class data, etc.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-03-06  8:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-12 21:13 make-vtable Kevin Ryde
2007-02-13  8:13 ` make-vtable Ludovic Courtès
2007-02-13 21:26   ` make-vtable Kevin Ryde
2007-02-14  8:01     ` make-vtable Ludovic Courtès
2007-02-14 20:51       ` make-vtable Kevin Ryde
2007-02-15  8:45         ` make-vtable Ludovic Courtès
2007-02-16  0:07           ` make-vtable Kevin Ryde
2007-02-16  8:12             ` make-vtable Ludovic Courtès
2007-02-18 18:10       ` make-vtable Neil Jerram
2007-02-18 20:05         ` make-vtable Ludovic Courtès
2007-02-18 23:56           ` make-vtable Neil Jerram
2007-02-19  0:14             ` make-vtable Kevin Ryde
2007-02-19  0:39               ` make-vtable Neil Jerram
2007-02-19  8:39               ` make-vtable Ludovic Courtès
2007-03-06  0:27                 ` make-vtable Kevin Ryde
2007-03-06  8:32                   ` make-vtable Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).