[Top][All Lists]

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

Re: overriding car/cdr

From: Dirk Herrmann
Subject: Re: overriding car/cdr
Date: Sun, 08 Feb 2004 17:21:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821

Paul Jarc wrote:

Marius Vollmer <address@hidden> wrote:
Hmm, my immediate reaction is that car/cdr are too low-level for
making them overrideable, but map and for-each and other operations
that work on whole sequences look like good targets...

Going that route, there will always be one more function that someone
wants to be converted.  Third-party libraries also often won't be able
to handle generated lists without modification.  OTOH, by modifying
SCM_CAR/SCM_CDR, everything that handles lists automatically becomes
able to handle generated lists, and the cost for normal lists is only
the same cost as when compiling with -DSCM_DEBUG_PAIR_ACCESSES=1.

The macros SCM_CAR and SCM_CDR should IMO not changed to handle generic pairs. In the guile kernel we need a layer to deal with the built-in low level data types.

Best regards

reply via email to

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