CSC104H1 Lecture Notes - Lecture 10: Substring, Grace Hopper, Ada Lovelace

38 views8 pages

Document Summary

;let us put lists into lists (define l (list ant (list bee cat dog) (list eel) > ;collapsing the expressions that produce the leements emphasizes that it does not matter hoe the elements are produced, or what datatype they are; each expression produces one value, and counts as one element of the list l. ;there are dome functions to extract the first, second, third, or fourth element of a list. ;fourth: list -- any (fisrt l) fisrt: this function is not defined. > ;the first element of l is a string: (string? (first l)) > ;the second element is a list: (list? (second l)) > ;can we get bee from l? can we get dog? or eel? (first (second l)) > ;what erroes fo these produce (first (first l)) first: expects a non-empty list, but received ant > (fourth (second l)) fourth: expects a list with four or more items, but received (list bee cat

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents