RU beehive logo ITEC dept promo banner
ITEC 380
2008fall
ibarland

homeinfolecturesexamsarchive

lect02c
unions

After reviewing the previous lecture (define-struct), create a structure for armadillos, which aggregate three pieces of info: the name, the length (in m), and whether or not they're alive.

; Data definition:
; A dillo is:
;   (make-dillo string number boolean)

(define-struct dillo (name length alive?))



; hit-with-truck:  (-> dillo dillo)
;
(define (hit-with-truck a-dillo)
  ...)







Union data

; Data definition: ; An Animal is ; - a boa, or ; - a dillo.

homeinfolecturesexamsarchive


©2008, Ian Barland, Radford University
Last modified 2008.Sep.13 (Sat)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme