Example: Textual View


(glispobjects

 (pizza (list (topping string) (size symbol))
   views ((circle pizza-as-circle)) )

 (pizza-as-circle (z753 pizza)
   prop  ((radius
            ((if ((size z753) == 'large)
                 9
                 6)) ) )
  supers (circle) )
 )

(gldefun t12 ((p pizza)) (area (circle p)))

> (glcp 't12)
result type: REAL
(LAMBDA (P)
  (IF (EQ (CADR P) 'LARGE)
      254.46900494077323
      113.09733552923255))

Note that the view name, circle, is used as a type-change operator to change to the view type.

Contents    Page-10    Prev    Next    Page+10    Index