GNU bug report logs - #17296
[PATCH] SRFI-1 'length+' raises an error unless passed a proper or circular list

Previous Next

Package: guile;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Fri, 18 Apr 2014 19:29:02 UTC

Severity: normal

Tags: patch

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 17296 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: David Kastrup <dak <at> gnu.org>
Cc: 17296 <at> debbugs.gnu.org
Subject: Re: bug#17296: Uh, wrong?
Date: Tue, 03 Jun 2014 22:55:42 -0400
David Kastrup <dak <at> gnu.org> writes:
> So the behavior for length+ on a dotted list is strictly unspecified.
> It is not even stated "it is an error".

Actually, it is.  At the end of the section that defines the "types"
such a "clist" and "flist", it states:

  It is an error to pass a circular or dotted list to a procedure not
  defined to accept such an argument.

While it is true that we are not required to signal an error, I'm wary
extending 'length+' in this way.  It also effectively extends 'map' and
'for-each' to support things like (map + '() 'foo), and thus potentially
affects many other procedures both inside and outside of Guile that use
'map' and 'for-each'.  Once we've done this, users are likely to grow
dependent on it and we can never go back.

> At any rate, what I am getting at is that I was going to submit the
> following patch as a part of a series fixing other bugs, bugs that I
> need a working "get the length of a dotted list" operator for.  We don't
> have any such operator in GUILE, and that's awkward.

It might be helpful to add such a procedure, but I don't think 'length+'
should be it.

   Regards,
     Mark




This bug report was last modified 10 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.