This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

assq-ref vs assq


mlivshin@bigfoot.com writes:
> > > why do assq-ref and friends return #f when the key is not found, in
> > > stead of #<unspecified>? This makes it kind of hard to distinguish
> > > between an alist not containing KEY and  (KEY . #f)
> > 
> > Actually, it would be best to throw an error if the key is not
> > found.

> `assq' and friends, or maybe use some syntactic sugar like the
> following:

It's what I did, and was surprised it returned #f iso. #<unspecified>.

In any case, could something be done about the order of arguments to
assq-ref ? It is reversed from that of assq, which is confusing. I
realize this breaks compatibility, but maybe it could be done when
there is going to be a big non-compatible upgrade.

-- 

Han-Wen Nienhuys   |   hanwen@cs.uu.nl    | http://www.cs.uu/~hanwen/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]