languages/lambda-calculus.ss
;; Lambda Calculus language module
;; From PLT MzScheme: Language Manual by Matthew Flatt

(module lambda-calculus mzscheme 
  
  ; Restrict lambda to one argument:
  (define-syntax lc-lambda 
    (syntax-rules () 
      [(_ (x) E) (lambda (x) E)])) 
  
  ; Restrict application to two expressions:
  (define-syntax lc-app 
    (syntax-rules () 
      [(_ E1 E2) (E1 E2)])) 
  
  ; Restrict a lambda calculus module to one body expression:
  (define-syntax lc-module-begin  
    (syntax-rules () 
      [(_ E) (#%module-begin E)])) 
  
  ; Disallow numbers, vectors, etc.
  (define-syntax lc-datum 
    (syntax-rules ())) 
  
  ; Provide (with renaming):
  (provide #%top ; keep mzscheme's free-variable error
           (rename lc-lambda lambda) 
           (rename lc-app #%app) 
           (rename lc-module-begin #%module-begin) 
           (rename lc-datum #%datum)))