{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Lec3 - CMPSC461:ProgrammingLanguage Concepts Lecture3...

This preview shows pages 1–6. Sign up to view the full content.

CMPSC 461: Programming Language Concepts Lecture 3 Instructor: Prof. Swarat Chaudhuri

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Recursion, [email protected] n by n checkerboard Fibonacci: Fib(0) = 0 Fib(1) = 1 Fib(n) = Fib(n – 1) + Fib(n – 2) Sum of the first n natural numbers Sum of the all even numbers up to n The sum (1 + c + 2*c + 3*c + … + c*n) The sum (1 + c+ c 2 + c 3 + … + c n )
Anonymous [email protected] How annoying would be to give a name to every constant value? (define x 2) rather than just 2 So why are you expected to assign a name to every [email protected] you use??? In Scheme, anonymous [email protected] (lambda (x) exp) e.g., (lambda (x y) (* x y y)) a procedure that takes x, y and computes xy 2 .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Procedures are just data No basic difference between “foo” and 2 Well, ok, one thing is that “foo” doesn’t print

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.
• Fall '08
• CHAUDHURI
• Sumofthefirstnnaturalnumbers Sumoftheallevennumbersupton Thesum, Sumoftheallevennumbersupton Thesum, ProgrammingLanguage Concepts

{[ snackBarMessage ]}