COMP 3007 Lecture Notes - Lecture 7: Nth Metal, General Idea

20 views3 pages

Document Summary

Abstraction barriers: abstraction barriers isolate different levels of the system. -- (programs that use rational numbers) --- rational numbers in problem domain. --- (add-rational , subtract-rational , ) --- rational numbers as numerators and denominators. -- (make-rational, numerator, ) --- rational numbers as pairs. -- (cons, car, cdr) --- however pairs are implemented: barrier separates the program above that uses the data abstraction from the program below that implements the data abstraction, each level is the interface, for data abstraction: Identify basic set of operations: use only those operations, makes programs easier to maintain and modify later. For example: (define (numerator rational) (let ((g (gcd (car rational) (cdr rational)))) (/ (car rational) g))) What is meant by data: more than just selectors and constructors; more than just arbitrary set of procedures, must also specify conditions that these procedures must fulfill in order to be a valid representation, for example:

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