Best method.

From: Clifford Beshers <beshers_at_cs.columbia.edu>
Date: Fri, 5 Jan 1996 20:35:36 -0500

What do people use for type verification in the instance hierarchy?

That is, given:

(define-class <a> ()
  (...))

(define-class <b> ()
  (...))

(define-class <x> (<a> <b>)
  (...))

I want a function isa? which has the following behavior:

(isa? <x> (make <x>) -> #t
(isa? <a> (make <x>) -> #t
(isa? <b> (make <x>) -> #t

(isa? <x> (make <a>) -> #f
(isa? <a> (make <a>) -> #t
(isa? <b> (make <a>) -> #f

(isa? <x> (make <b>) -> #f
(isa? <a> (make <b>) -> #f
(isa? <b> (make <b>) -> #t

anything else is #f

I'm writing one using instance?, class-of, class-name and
class-direct-supers. This seems the most straightforward way, but I
wondered if I was missing something.
Received on Sat Jan 06 1996 - 02:37:32 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST