




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























CIS
CIS let atts : int = (attendees 500) let atts2 : int = atts + atts let atts2 : int = (attendees 500)
CIS total_snds 5 30 22
Suppose we are asked by Penn to design a new email system for noFfying instructors and students of emergencies or unusual events. What should we be able to do with this system? Subscribe students to the list, query the size of the list, check if a parFcular email is enrolled, compose messages for all the list, filter the list to just students, etc.
What are the relevant concepts and how do they relate?
How should the program interact with its environment?
How does the program behave on typical inputs? On unusual ones? On erroneous ones?
Oien by decomposing the problem into simpler ones and applying the same recipe to each
let l1 : string list = [ "[email protected]"; "[email protected]"; "[email protected]" ] let l2 : string list = [ "[email protected]" ] let l3 : string list = [] let test () : bool = (length l1) = 3 ;; run_test “length l1” test let test () : bool = (length l2) = 1 ;; run_test “length l2” test let test () : bool = (length l3) = 0 ;; run_test “length l3” test Define email lists for tesFng. Include a variety of lists of different sizes and incl. some instructor and non-instructor emails as well.
1::2::3::4::[] “abc”::”xyz”::[] a list of (four) ints a list of (two) strings (false::[])::(true::[])::[] a list of lists that each contain booleans [] the empty list
[1;2;3;4] [“abc”;”xyz”] a list of (four) ints a list of (two) strings [[false];[true]] a list of lists that each contain booleans [] the empty list
[1;true;3;4] 1:: different element types 2 is not a list 3::[]::[] different element types