[Top][All Lists]

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

Re: [Chicken-users] [ANN] SRFI-99 record types for CHICKEN

From: John Cowan
Subject: Re: [Chicken-users] [ANN] SRFI-99 record types for CHICKEN
Date: Wed, 7 Sep 2011 21:47:07 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Thomas Chust scripsit:

> The SRFI's syntax for record definitions is compatible with SRFI-9,
> but several extensions including convenient default names of
> procedures, single inheritance of record types and introspection
> capabilities are available, too.

Very cool!  I started to write this a long time ago, but never got
around to writing the syntactic module.

Bug report:  A constructor defined to take explicit arguments does
not work: instead of returning the instance, it returns a procedure
that takes N arguments and ignores them, where N is the number of slots
specified for the constructor; this procedure must then be invoked with
M arguments, where M is the number of slots in the record.

API suggestion: add redefine-record-type, which is the same as
define-record-type except that instead of a gensym'd uid it uses the
record name as the uid.  That allows you to easily redefine a record
defined by Chicken's native SRFI-9 implementation so that you can define
child record types of it, while still allowing existing instances to work.

Implementation suggestion: rather than storing the uid-to-rtd mapping in
a global hash table, store it on the property list of the uid under the
the key 'srfi-99.  That allows you to reload the implementation without
trashing existing mappings.

My corporate data's a mess!                     John Cowan
It's all semi-structured, no less.    
    But I'll be carefree                        address@hidden
    Using XSLT

reply via email to

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