[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] [PATCH] Re: 4.9.0rc1: Error: (assv) bad argument typ
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] [PATCH] Re: 4.9.0rc1: Error: (assv) bad argument type: null |
Date: |
Sun, 4 May 2014 20:53:06 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, May 04, 2014 at 01:52:06PM +0100, Andy Bennett wrote:
> Hi,
>
> > + (assert-error (alist-ref 'foo 'bar cmp))
> > + (assert-error (alist-ref 'foo '(bar) cmp)))
>
> What's a good predicate to use to check whether what will be passed to
> alist-ref will not throw an exception?
I don't understand the question.
> The 2nd assert-error rules out a simple list? or an O(1) algorithm.
> (Tho' list? is already O(n)).
No, the check only checks while it's cdring down the list, so it will
only error when it encounters an improper list tail. so it's still O(n)
instead of O(2n), which it would've been if it first checked the entire
list.
Cheers,
Peter
--
http://www.more-magic.net
Re: [Chicken-users] [Chicken-hackers] 4.9.0rc1: Error: (assv) bad argument type: null, Andy Bennett, 2014/05/04