This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; This library is described at https://www.cs.indiana.edu/chezscheme/match/ | |
(load "match.ss") | |
(define (id x) x) | |
(define (cps exp) | |
(letrec ([cps | |
(lambda (exp k) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;e;; A simple macro expander implementation based on Macros That Work. | |
;;; | |
;;; Usage: | |
;;; (macroexpand s-exp) yields a fully expanded form | |
;;; | |
;;; Primitive special forms: | |
;;; if | |
;;; set! | |
;;; begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax quasiquote | |
(syntax-rules () | |
[(_ e) (qq-expand e)])) | |
(define-syntax qq-expand | |
(syntax-rules (quasiquote unquote unquote-splicing) | |
[(_ `x . lv) | |
(list 'quasiquote | |
(qq-expand x #f . lv))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Usage: | |
;;; (mbe pattern template sexp) | |
;;; Expand a single-rule macro (represented by pattern & template) | |
(define (wrong msg . args) | |
(apply error 'error msg args)) | |
(define (match sexp pattern) | |
(let ([env (match-help (cdr sexp) (cdr pattern))]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
showUsage() { | |
echo "Usage: $0 version jar-file" | |
echo 'Supported versions:' | |
for ver in ${!mcp[*]}; do | |
echo " $ver" | |
done | |
exit 1 | |
} |