[Top][All Lists]

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

Re: segfault in SRFI-1 partition on non-list input

From: Ludovic Courtès
Subject: Re: segfault in SRFI-1 partition on non-list input
Date: Wed, 30 Apr 2008 09:28:11 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi Julian,

"Julian Graham" <address@hidden> writes:

> Great links -- I had no idea this was such a contentious topic!

Actually, R5RS `list?' itself must be used with care since it's O(N).

> Actually, though, what Olin Shivers says in the introduction to SRFI-1
> is that specific parts of SRFI-1 should work (and are documented to
> work) on dotted and / or circular lists in addition to proper lists.

Well, SRFI-1, under "Improper Lists", reads this:

  Most procedures are defined only on proper lists -- that is, finite,
  nil-terminated lists.  The procedures that will also handle circular
  or dotted lists are specifically marked.

> Coincidentally, I noticed last night that Guile's implementation of
> some of these parts is a bit buggy in this regard -- `take',
> `take-right', `drop', and `drop-right' don't work on dotted lists.

Indeed, the examples of SRFI-1 for `take' and `drop' with dotted lists
work fine, but those of `take-right' and `drop-right' don't.  Something
we should fix.

The reason is that these two procedures use `scm_list_tail ()', which is
apparently not supposed to work with dotted list.

I've just opened a bug: .
Anyone is welcome to fix it!  ;-)


reply via email to

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