allow-redefinitionGBBopen Toolsbounded-valueassqGoTo Top

assq   item alist => entry[Function]

Purpose
Search for entry in alist using eq as the comparison function.

Package   :gbbopen-tools

Module   :gbbopen-tools

Arguments and values

item     An object
alist     An association list
entry     A cons that is an element of alist or nil

Returns
The first cons in alist whose car is eq to item, or nil if no such cons is found.

Description
Assq is a convenient shorthand for:

  (assoc item (the list alist) :test #'eq)

See also
    memq

Examples

  > (assq 'b '((a . 1) (b . 2) (c . 3) (b . 4)))
  (b . 2)
  > (assq 'x '((a . 1) (b . 2) (c . 3) (b . 4)))
  nil
  >


The GBBopen Project


allow-redefinitionGBBopen Toolsbounded-valueassqGoTo Top