Lecture-08-inclass - The first three lines of this file were inserted by DrScheme They record metadata about the language level of this file in a

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

View Full Document Right Arrow Icon
metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "reader.ss" "plai" "lang") ; ; Lecture 8: First class functions ; ; - - - Announcements - - - - - - - - - - - - ; ; - Assignment 2: due wednesday at midnight. ; Actually, only part 1 is due wednesday ; part 2 (lazy interpreter) is due on friday next week. ; - Assignment 3: will be a "group" project ; - groups of size 2 (and one group of 3 for "the odd one out") ; - try to find a partner. Next week in tutorial there will be ; a sign-up sheet. ; => if you are not signed up we will pair you with a random ; person. ; - - - - - - - - - - - - - - - - - - - - - - #| Last time I showed you some examples of programs in our next language, FWAE. The concept we are interested in this time is first class anonymous functions (like Scheme's lambda functions) Today: implement FWAE Some simple example programs: {{fun {x} {+ x 1}} 3} {with {double {fun {x} {+ x x}}} {+ {double 10} {double 5}}} What's the BNF? <FWAE> ::= <number> | {+ <FWAE> <FWAE>} | {with {<symbol> <FWAE>} <FWAE>} | {fun {<symbol>} <FWAE>} | {<FWAE> <FWAE>} |# (define-type FAE (num (n number?)) (id (name symbol?)) (add (lt FAE?) (rt FAE?)) (fun (arg-name symbol?) (body FAE?)) (app (fun-exp FAE?) (arg-exp FAE?))) ; I've already done parse to save some time. (define (parse sexp)
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 09/21/2009 for the course CS cs taught by Professor Cs during the Spring '09 term at University of the Bío-Bío.

Page1 / 4

Lecture-08-inclass - The first three lines of this file were inserted by DrScheme They record metadata about the language level of this file in a

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