Lecture overview -- Keyboard shortcut: 'u'  Previous page: Definitions [Section] -- Keyboard shortcut: 'p'  Next page: Functions [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 1 - Page 24 : 49
Programming Paradigms
Introduction to Functional Programming in Scheme
Definitions

A definition binds a name to a value


(define name expression)

A name is first introduced and the name is bound to the value of the expression

  • About Scheme define forms

    • Appears normally at top level in a program

    • Creates a new location named name and binds the value of expression to that location

    • In case the location already exists we have a redefinition, and the define form is equivalent to an assignment

    • Does not allow for imperative programming, because define cannot appear in selections, iterations, etc.

    • Can also appear at certain positions in bodies, but only as syntactic sugar for local binding forms (letrec)