Presentation is loading. Please wait.

Presentation is loading. Please wait.

Organization of Programming Languages

Similar presentations


Presentation on theme: "Organization of Programming Languages"— Presentation transcript:

1 Organization of Programming Languages
Meeting 24 March 14, 2016

2 Functional Programming Language
Four components Objects Primitive functions Functional forms Function definition mechanism

3 Objects Things called atoms Objects, the formal definition Numbers
Strings Objects, the formal definition Atoms Lists of objects Written surrounded by ( ) with spaces separating entries, so (A B C), ((1 2) (3) ((4) 5))) Or surrounded by [ ] with commas as separators

4 Objects (2) Fundamental principles of functional programming
Everything is an object This means everything: data, programs, subprograms, etc.

5 Functions Functions Map objects to objects
Entire, defined for all possible objects Partial, defined on a subset of objects Lists of numbers Atoms etc

6 Fundamental Principles
Fundamental principles of functional programming Everything is an object This means everything: data, programs, subprograms, etc. Programs are functions This means that every program is a single function that takes some input values (objects) and returns single value (an object)

7 Specifying Semantics Use Backus’ FP notation Written on a single line
Yes, the same guy, but a different notation. Written on a single line Interpreted as a case statement

8 Notation Symbols : apply the function to the argument is defined as
−> if – then ; else

9 Primitives first last head tail atom? nil? list?

10 Lisp Download LispWorks Personal Edition version 6.1.1
Start the system Prompt should be CL-USER 1 > Try some commands, like (car ‘(1 2 3)) (cdr ‘(1 2 3)) (car ‘((A (B)))) Try to explain any errors that you get


Download ppt "Organization of Programming Languages"

Similar presentations


Ads by Google