unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: segfault in SRFI-1 partition on non-list input
Date: Mon, 28 Apr 2008 17:28:46 +0200	[thread overview]
Message-ID: <87od7u0zip.fsf@gnu.org> (raw)
In-Reply-To: 2bc5f8210804280641r1c51a266x52883da55d882a3b@mail.gmail.com

Hi,

"Julian Graham" <joolean@gmail.com> writes:

> Oh, yeah, that's fine -- sorry, didn't realize that was the behavior
> of SCM_VALIDATE_LIST.  Just as long as it doesn't segfault any more,
> I'm happy.

Actually, there are many places where `SCM_VALIDATE_LIST' is used where
it should be avoided.  An example is SRFI-1's `member'.  Try the
following:

  (use-modules (srfi srfi-1)
               (ice-9 time))

  (define l (make-list 1000000 0))
  (time (not (not (member (car l) l))))

  ;; ... versus...

  (time (not (not (member 0 '(0)))))

Looking at SRFI-1 specifically, the spirit is apparently to phrase
things in a way that allows implementations to not actually check
whether arguments are proper lists when proper lists are expected (see,
e.g., [0, 1]).

Thanks,
Ludovic.

[0] http://srfi.schemers.org/srfi-1/mail-archive/msg00061.html

    "[I]t's unlikely that any implementation would ever enforce the
     proper-list typing of its list parameter."

[1] http://srfi.schemers.org/srfi-1/mail-archive/msg00054.html





  reply	other threads:[~2008-04-28 15:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28  4:37 segfault in SRFI-1 partition on non-list input Julian Graham
2008-04-28  8:27 ` Ludovic Courtès
2008-04-28  8:31   ` Ludovic Courtès
2008-04-28 13:41   ` Julian Graham
2008-04-28 15:28     ` Ludovic Courtès [this message]
2008-04-30  3:40       ` Julian Graham
2008-04-30  7:28         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87od7u0zip.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).