Functional Programming

Elements of Programming

The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this: Primitive Expressions, Means of Combination, Means of Abstraction.

Primitive Expressions

  1. Numbers: 3 21412 1.3e-10
  2. Strings: “hello, world”
  3. Boolean (true or false): #t #f #nil
  4. Primitive Procedures (Built-in to the Interpreter)

Some Primitive Procedures

How to use primitive procedures?

Expressions representing numbers may be combined with an expression representing a primitive procedure (such as addition or multiplication) to form a compound expression that represents the application of the procedure to those numbers.

General form: (op arg1 arg2)

(+ 13 14)
(* 5 99)
(+ 2.7 100.001)