Reference to Substructures

A substructure or property is referenced by its name, in a form similar to that of a Lisp function call.


(glispobjects
  (circle (list (center vector)
                (radius real))
    prop  ((diameter (radius * 2))
           (area     (pi * radius ^ 2)) ) )
 )

(gldefun t1 ((c circle)) (radius c))

(glcp 't1)
  result type: REAL
  (LAMBDA (C) (CADR C))

(gldefun t2 ((c circle)) (area c))

(glcp 't2)
  result type: REAL
  (LAMBDA (C) (* 3.14159265 (EXPT (CADR C) 2)))

Contents    Page-10    Prev    Next    Page+10    Index