[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] CHICKEN 4.9.0rc1 is available
From: |
John Cowan |
Subject: |
Re: [Chicken-users] CHICKEN 4.9.0rc1 is available |
Date: |
Sun, 4 May 2014 14:57:37 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Andy Bennett scripsit:
> We also had to fix the dropbox egg where it calls alist-ref. Some time
> after CHICKEN 4.7.0 it became mandatory to pass a well formed alist to
> alist-ref but we were relying on it returning the default value.
For the record, it is an error in all versions of Scheme to pass
anything other than a (proper) list of pairs to the alist procedures,
so the effect of doing so is entirely implementation-defined. Here is
a suitable predicate:
(define (alist? obj)
(cond
((null? obj) #t)
((not (pair? obj)) #f)
((not (pair? (car obj))) #f)
(else (alist? (cdr obj)))))
It is O(n), which is the best you can do.
--
John Cowan http://www.ccil.org/~cowan address@hidden
Rather than making ill-conceived suggestions for improvement based on
uninformed guesses about established conventions in a field of study with
which familiarity is limited, it is sometimes better to stick to merely
observing the usage and listening to the explanations offered, inserting
only questions as needed to fill in gaps in understanding. --Peter Constable
- Re: [Chicken-users] CHICKEN 4.9.0rc1 is available, (continued)
- Re: [Chicken-users] CHICKEN 4.9.0rc1 is available, Peter Bex, 2014/05/05
- Re: [Chicken-users] CHICKEN 4.9.0rc1 is available, Michele La Monaca, 2014/05/06
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Mario Domenech Goulart, 2014/05/06
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, John Cowan, 2014/05/06
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Michele La Monaca, 2014/05/06
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Mario Domenech Goulart, 2014/05/06
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Peter Bex, 2014/05/07
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Michele La Monaca, 2014/05/07
- Re: [Chicken-users] [Chicken-hackers] CHICKEN 4.9.0rc1 is available, Peter Bex, 2014/05/08
Re: [Chicken-users] CHICKEN 4.9.0rc1 is available, Andy Bennett, 2014/05/04
- Re: [Chicken-users] CHICKEN 4.9.0rc1 is available,
John Cowan <=