zybino/old-code/expander.rkt
2020-06-09 14:50:42 +12:00

24 lines
564 B
Racket

#lang br/quicklang
(provide (rename-out [z-module-begin #%module-begin])
val
z-ld)
(define-macro (z-module-begin (z-program LINE ...))
#'(#%module-begin
(define-values (A B C D E F H L)
(values 0 0 0 0 0 0 0 0))
(set! A 8)
LINE ...
(displayln
(format "A: ~a ; F: ~a\nB: ~a ; C: ~a\nD: ~a ; E: ~a\nH: ~a ; L: ~a"
A F B C D E H L))))
(define (val h x)
(if (symbol? x)
(hash-ref h x)
x))
(define-macro-cases z-ld
[(_ (z-r8 S) (_ D)) #'(set! S (val D))])