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]

Re: another nit.




Craig Brozefsky <craig@red-bean.com> writes:

> [[library procedure]] (assq obj alist)
[...]

>>> why do assq-ref and friends return #f when the key is not found
               ^^^^

From Guile's geiler dokumentation:

 - primitive: assq-ref ALIST KEY
 - primitive: assv-ref ALIST KEY
 - primitive: assoc-ref ALIST KEY
     Like `assq', `assv' and `assoc', except that only the value
     associated with KEY in ALIST is returned.  These functions are
     equivalent to

          (let ((ent (ASSOCIATOR KEY ALIST)))
            (and ent (cdr ent)))

     where ASSOCIATOR is one of `assq', `assv' or `assoc'.



Not too logical, but at least it's documented. :)



Jost 








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