Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Glossary - Building Programming Experience - Lecture Slides, Slides of Computer Programming

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

2012/2013

Uploaded on 04/25/2013

lathika
lathika 🇮🇳

4

(12)

178 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Glossary
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 side-effects. 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.
side-effect 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.
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Glossary - Building Programming Experience - Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

Glossary

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.

Values

  1. Numbers
  2. Booleans
  3. Strings
  4. Procedures
  5. Lists

Scheme

  1. Basic Elements

(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.

  1. Combination ( procedure argumentsseparatedbyspaces ) Value is determined by evaluating the expression for the procedure and applying the resulting value to the value of the arguments.

(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))

2. Five write an expression that evaluates to 3.

3. Five write a more interesting expression that evaluates to 3.

4. Define X for each of the following expressions:

(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