![]() |
![]() |
|
home—info—lectures—exams—archive
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.
home—info—lectures—exams—archive
©2008, Ian Barland, Radford University Last modified 2008.Sep.13 (Sat) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |