guile-devel
[Top][All Lists]
Advanced

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

srfi-1 take and drop


From: Kevin Ryde
Subject: srfi-1 take and drop
Date: Tue, 06 May 2003 09:14:05 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

Am I right that srfi-1 take and drop are the same as the core
list-head and list-tail?  In which case perhaps,

        * srfi-1.scm (take): Make this an alias for list-head.
        (drop): Make this an alias for list-tail.

        * tests/srfi-1.test: New file, exercising take and drop.
        * Makefile.am (SCM_TESTS): Add it.

The only difference I could spot in the current implementations was
list-head and list-tail throw an exception for negative n, where take
and drop code quietly treat that as 0.  srfi-1 doesn't say anything
about negatives as far as I can tell, so presumably there's a free
choice.

Attachment: srfi-1.test
Description: Text document

Attachment: srfi-1.scm.take-drop.diff
Description: Text document


reply via email to

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