chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Return the result of EXP from (assert EXP)


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Return the result of EXP from (assert EXP)
Date: Fri, 15 Nov 2013 22:29:56 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Nov 15, 2013 at 04:24:08PM -0500, John Cowan wrote:
> Peter Bex scripsit:
> 
> > Sorry, this should read "list?", not "pair?".  It gets asserted to be
> > a list, which may be either a pair or null, so the null? check won't
> > know anymore that it should give a warning.
> 
> This is pretty misleading.  A predicate that returns #t if its argument
> is a pair or null is O(1), and should be called `pair-or-null?`.  `List?`
> returns #t if its argument is a proper list, and is O(n) in the length of
> the list.  It's a little irritating that Scheme doesn't have a standard
> equivalent of CL's LISTP.

I fucked up a second time in my explanation.  list? does what you expect
it to, it does not check for pair or null.  Or at least, it's not
supposed to, but perhaps the scrutinizer makes this over-simplified check.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

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