bug-guile
[Top][All Lists]
Advanced

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

Re: sloppy_memq docstring.


From: Dirk Herrmann
Subject: Re: sloppy_memq docstring.
Date: Thu, 12 Oct 2000 10:14:57 +0200 (MEST)

On Wed, 11 Oct 2000, Han-Wen Nienhuys wrote:

> in guile 1.4 it says.
> 
>       "This procedure behaves like @code{memq}, but does no type or error
> 
> this is not true: memq returns '() if nothing is found, not #f.

Hmmm.  memq returns #f, but sloppy-memq returns '() or any non-pair that
terminates the list.  Thus, if you use sloppy-memq, you can be fooled by
the following situation:
  (sloppy-memq 'a '(a))
  --> (a)
  (sloppy-memq 'a '(b c . (a))
  --> (a)
Thus, you can't tell whether a ceratin result means success or failure :-(

I figured out that sloppy-mem(q|v|ber) as well as the C counterparts are
not used throughout guile (except for within list.c itself).  Thus I
recommend to deprecate these functions.

Best regards
Dirk




reply via email to

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