resume in bf functions

pull/2/head
Matthew Butterick 8 years ago
parent b4a47b754f
commit 5ba6234a08

@ -9,6 +9,11 @@
#'(void OP-OR-LOOP-ARG ...)) #'(void OP-OR-LOOP-ARG ...))
(provide bf-program) (provide bf-program)
(define-macro (loop "[" OP-OR-LOOP-ARG ... "]")
#'(until (zero? (current-byte))
OP-OR-LOOP-ARG ...))
(provide loop)
(define-macro-cases op (define-macro-cases op
[(op ">") #'(gt)] [(op ">") #'(gt)]
[(op "<") #'(lt)] [(op "<") #'(lt)]
@ -18,11 +23,6 @@
[(op ",") #'(comma)]) [(op ",") #'(comma)])
(provide op) (provide op)
(define-macro (loop LOOP-ARG ...)
#'(until (zero? (current-byte))
LOOP-ARG ...))
(provide loop)
(define arr (make-vector 30000 0)) (define arr (make-vector 30000 0))
(define ptr 0) (define ptr 0)

Loading…
Cancel
Save