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

head?

Conformance: SketchyLISP Extension

Purpose: Check whether an expression is the head of another.

Arguments:
X - potential head
Y - expression

Implementation:

(define (head? x y)
  (cond ((null? y) (null? x))
    ((null? x) #t)
    ((equal? (car x) (car y))
      (head? (cdr x) (cdr y)))
    (else #f)))

Example:

(head? '(a b c) '(a b c d e f)) 
=> #t

See also:
tail?, last.