Hi,

Brian Jaress <[EMAIL PROTECTED]> writes:

> Without record types, you'd probably have a definition somewhere like:
>
> (define (add value weight)
>   ;something)
>
> With 5.97 record types, it would be:
>
> (define (add value weight-accessor)
>   ;something)

This is similar to SRFI-9 records and to built-in types: you usually
don't pass accessors around to procedures; instead, procedures that need
it are expected to import the modules that define `container-weight',
`vector-ref', `car', etc.  This seems consistent to me.

> I'd like to see records handled like vectors, but with symbols instead
> of numbers:
>
> (record-ref record 'field)
> (record-set! record 'field value)

Interestingly, this was the approach taken by SRFI-35, although one of
its authors is also the author of SRFI-9.  I didn't find any clue in the
list archive as to why named fields were preferred over accessors.
Maybe because it allows for very loose connections between the module
that instantiates a condition and the one that handles it?

Thanks,
Ludovic.


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to