



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Some concept of Building Programming Experience are Trees, Square Limit Language, Special Forms, Quizanssheet, Professor Abstraction, Compound Procedure, Procedures And Recursion. Main points of this lecture are: Glossary, Collection, Program, Procedures, Static Data, Accomplishes, Arguments Computes, Normal Values, Procedures, Equivalent
Typology: Slides
1 / 6
This page cannot be seen from the preview
Don't miss anything!
program collection of procedures and static data that accomplishes a specific task.
procedure a piece of code that when called with arguments computes and returns a result; possibly with some sideeffects. In scheme, procedures are normal values like numbers.
function see procedure; they’re equivalent in scheme. Some other languages make a distinction.
argument An input variable to a procedure. A new version of the variable is created every time the procedure is called.
parameter see argument.
expression A single valid scheme statement. 5 , (+ 3 4), and (if (lambda (x) x) 5 (+ 3 4)) are expressions.
value The result of a evaluating an expression. 5, 7, and 5 respectively.
type Values are classified into types. Some types: numbers, booleans, strings, lists, and procedures. Generally, types are disjoint (any value falls into exactly one type class).
call Verb, the action of invoking, jumping to, or using a procedure.
apply Calling a procedure. Often used as “apply procedure p to arguments a1 and a2.”
pass Usage “pass X to Y.” When calling procedure Y, supply X as one of the arguments.
sideeffect In relation to an expression or procedure, some change to the system that does not involve the expression’s value.
iterate To loop, or “do” the same code multiple times.
variable A name that refers to a exactly one value.
binding Also verb “to bind”. The pairing of a name with a value to make a variable.
recurse In a procedure, to call that same procedure again.
(a) selfevaluating expressions whose value is the same as the expression.
(b) names Name is looked up in the symbol table to find the value associated with it. Names may be made of any collection of characters that doesn’t start with a number.
(define one 1)
(define two (+ 1 one))
(define five 3)
(+ five two)
(define biggiesize *)
(define hamburger 1)
(biggiesize hamburger five)
(= 7 (+ 3 4))
(= #t #f)
((+ 5 6))
biggiesize
(if #t 1 (+ 3 0))
(if (if #f #t #f) #f #t)
(if (if (= hamburger five) 3 7) (+ (if (= (+ 1 one) two) 3
"yay")
(/ 256 (if (> five (+ two 1)) (/ 7 (hamburger 1)) 2))
(a) Identify the variables are are unbound. (b) Supply definitions (ie (define x ...)) for each of the variables that make the expres sion evaluate to the target value. (c) Type in the expressions and verify that your solution gives the correct result.
(+ x (* y 3)) ;Value: 13
(if q (if r 3 4) 7) ;Value: 4
(+ 7 (if z (+ a z) 3)) ;Value: 11
(= yum (* 1 (+ yum 2))) ;Value: #t
(< (if (not thirtyfour) 34 thirtyfour) (+ thirtyfour (* seventyseven (if seventyseven 1 1)))) ;Value: #f