s c h e m e w i k i . o r g

/ Scm.MatchByName

This Web


WebHome 
WebChanges 
WebTopicList 
WebStatistics 

All Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
TWiki Shorthand

Offsite Links


Schemers.org
Lambda the Ultimate
twiki.org
;; tested in PLT Scheme 300.3 (require (lib "plt-match.ss"))

(define-struct expr (srcloc)) (define-struct (id expr) (name)) (define-struct (lam expr) (arg body)) (define-struct (app expr) (rator rand))

;; incomplete evaluator (define (eval e r) ;; expr, environment (as alist) (match e [(? id? (app id-name name)) (cdr (assq name r))] [(? app? (app app-rand rand) (app app-rator (? lam? (app lam-arg arg) (app lam-body body)))) (eval body (cons (cons arg rand) r))]))

 
 
© 2004 by the contributing authors. / You are Main.guest