lec4 Scope functions and data

7 4 attrib d 5 i type attrib name of string

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: njit";; val x : attrib = Name "Ranjit" # let a2 = Height 5.83;; val a2 : attrib = Height 5.83 # let year = 1977 ;; val year : int = 1977 # let a3 = DOB (9,8,year) ;; val a3 : attrib = DOB (9,8,1977) # let a_l = [a1;a2;a3];; val a3 : attrib list = ... 8 6 , 1! + # , 6 ,& 1! + attrib datatype attrib = Name of string | Age of int | DOB of int*int*int | Address of string | Height of real | Alive of bool | Phone of int*int | Email of string; ' ? A" + , ' 0 4 0 4 0 J J 0 , 4 0 $ D ' ' !! 7/ 4 , , attrib ! $ D 5 I / type attrib = Name of string | Age of int | DOB of int*int*int | Address of string | Height of float | Alive of bool | Phone of int*int | Email of string;; / $ -C match e with Name s -> e1 | Age i -> e2 | DOB (m,d,y) -> e3 | Address addr -> e4 | Height h -> e5 | Alive b -> e6 | Phone (a,n) -> e7 | Email e -> e8 6 , -! match e with Name s -> e1 | Age i -> e2 | DOB (m,d,y) -> e3 | Address addr -> e4 | Height h -> e5 | Alive b -> e6 | Phone (a,n) -> e7 | Email e -> e8 6 ' 8 0 " 0 -! $ -...
View Full Document

This note was uploaded on 02/14/2008 for the course CSE 130 taught by Professor Jhala during the Fall '06 term at UCSD.

Ask a homework question - tutors are online