proj4 - Project 4 Overview CMSC 330: Organization of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Languages 2 Project 4 Overview • Scheme programming – Write some functions in Scheme • Scheme interpreter – Given Scheme AST – Evaluate AST • Scheme parser – Write recursive descent parser – Build Scheme AST 3 Scheme • Functional programming language – Based on LISP • L ots of I diotic S tupid P arentheses • But uses lexical scoping – Resembles lambda calculus • Features – Higher order functions – lambda (x) (…) – Builds lists using cons cells - cons, car, cdr 4 Scheme Examples • Function evaluation – (+ 1 2) evaluates to 3 – (+ 1 2 3 4 5) evaluates to 15 – (- 3 4) evaluates to -1 – (- 3 4 5) evaluates to -6 5 Scheme Examples • Booleans – (= 1 2) evaluates to #f – (= 1 1) evaluates to #t – (bool? #t) evaluates to #t – (bool? 6) evaluates to #f 6 Scheme Examples • Global bindings – (define three 3) – (+ three 4) evaluates to 7
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2012 for the course CMSC 330 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 3

proj4 - Project 4 Overview CMSC 330: Organization of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online