class


; Determine the class of an object
; A list with a known class name
; (one listed in the *methods* table)
; as the first element is treated as an object.
(define (class x)
  (if (pair? x)
    (if (assoc (car x) *methods*)
        (car x)
        'pair)
    (if (symbol? x)
        'symbol
        (if (integer? x)
            'integer
            (if (null? x)
                'null
                (if (string? x)
                    'string
                    #f))))))

Contents    Page-10    Prev    Next    Page+10    Index