t3x.org / sketchy / library / memq.html
SketchyLISP
Reference
  Copyright (C) 2007
Nils M Holm

memq

Conformance: R5RS Scheme

Purpose: Return the sublist starting at the first member of a list that is identical to a given symbol. If no such member exists, return #f.

Arguments:
X - symbol to find
A - list

Implementation:

(define (memq x a)
  (cond ((null? a) #f)
    ((eq? (car a) x) a)
    (else (memq x (cdr a)))))

Example:

(memq 'c '(a b c d e f)) 
=> (c d e f)

See also:
memv, member, assq.