Course:CPSC311/2010WT1/Lecture Notes/2010-09-13/NNek
< Course:CPSC311/2010WT1 | Lecture Notes(Redirected from Course:CPSC311/2010WT1/Lecture Notes/2010-09-13/Steve)
CPSC 311 September 13 2010
(define-type OpMapping [opMapping (op symbol?) (impl procedure?)]) (opMapping '+ +) Racket is cool. Why? Functions can be passed as values, second thing is that Racket Data looks like Racket programs, or vice versa Concrete Syntax: (+ 5 7) == 5 + 7 == (5 7 +) Abstract Syntax, a single way to represent the different forms of concrete syntax, generally forms trees Statement, executes next statement after executing itself Expression, returns a value (in Racket, expressions are functions) Normally: Lexer (text) -> (tokens) Parser (abstract syntax tree) -> Interpreter (value) Useful for checking for errors on tests: (define (failed-tests) (reverse (filter (lambda (x) (not (symbol=? (first x) 'good))) plai-all-test-results))) Alt-p previous, alt-n next Case, checks a symbol, cond checks a condition