;Language extension file for compatibility with Elk commands ;it redefines some PLT commands to fit the ELK syntax ;not all of the ELK commands are implemented ;of mytest in PLT Elk Mix Mode ;Author: Robert Matovinovic, 31.03.2008 #lang mzscheme (provide (all-from-except mzscheme format read-string print random load)) ; following require usually loads all the language commands ; (require "mytest-commands-plt.ss") ; (provide (all-from "mytest-commands-plt.ss")) ;sample command from one of the files above changed that it does not require DDE (provide mytest-command) (define-syntax mytest-command (syntax-rules () [(cmd a ...) (printf "This is the mytest-command. Argument/s is/are ~a~n" (list a ...))])) ;------------------------------------------------------------------------------- ; redefining section ;------------------------------------------------------------------------------- (provide (rename format~ format)) (define-syntax format~ (syntax-rules () ((format a1 a2 ...) (if (eqv? a1 #t) (printf a2 ...) (fprintf a1 a2 ...) ) ) ) ) ;(provide -1) ;(define (-1 z) (- 1 z)) (provide 1-) (define (1- z) (- 1 z)) (provide 1+) (define (1+ z) (+ 1 z)) (provide (rename read-string~ read-string)) (define read-string~ read-line) (provide (rename print~ print)) (define-syntax print~ (syntax-rules () ((print~ a1 a2 ...) (begin (print a1 a2 ...) (newline)) ) ) ) (provide srandom) (define srandom random-seed) (provide (rename random~ random)) (define (random~) (random 32768)) (provide (rename load~ load)) (define-syntax load~ (syntax-rules () ((load~ a1 a2 ...) (if (symbol? a1) (load (symbol->string a1) a2 ...) (load a1 a2 ...) ) ) ) )