COMP 3007 Lecture Notes - Lecture 2: Polish Notation, Operand, Evaluation Strategy

28 views4 pages

Document Summary

Lisp = list + processing: formalism for reasoning about the use of recursive equations as a model of computation, fully functional language, scheme, dialect of lisp. Important feature: processes, called procedures, can be manipulated as data. Expressions: scheme has a read-evaluate-print-loop (repl) displays the result of evaluating an expression, numbers, ex. 3: ex. (define size^2 4, variables are not case sensitive, hello is the same as hello. Interpreter must maintain name-object pairs: this memory is called the environment (global environment) Compound procedures: elements of scheme that must appear in any powerful programming language, 1. Numbers and arithmetic operations are primitive data and procedures: 2. Nesting of combinations provides a means of combining operations: 3. Suppose we want x squared plus y squared: (define (sum-of-squares x y) (+ (square x) (square y)): can redefine procedures, ex. (define + -, parameter can have same name as procedure, ex. (define (square square) (* square square))

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