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: John Cowan
Subject: Re: [Chicken-hackers] [PATCH] Return the result of EXP from (assert EXP)
Date: Fri, 15 Nov 2013 16:24:08 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

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.

-- 
Unless it was by accident that I had            John Cowan
offended someone, I never apologized.           address@hidden
        --Quentin Crisp                         http://www.ccil.org/~cowan



reply via email to

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