From 5ba6234a08970f94f051220f3355ba58624931c2 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 29 Aug 2016 11:51:47 -0700 Subject: [PATCH] resume in bf functions --- beautiful-racket/br/demo/bf/bf-expander-imperative.rkt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beautiful-racket/br/demo/bf/bf-expander-imperative.rkt b/beautiful-racket/br/demo/bf/bf-expander-imperative.rkt index e92e2fc..909e65c 100644 --- a/beautiful-racket/br/demo/bf/bf-expander-imperative.rkt +++ b/beautiful-racket/br/demo/bf/bf-expander-imperative.rkt @@ -9,6 +9,11 @@ #'(void OP-OR-LOOP-ARG ...)) (provide bf-program) +(define-macro (loop "[" OP-OR-LOOP-ARG ... "]") + #'(until (zero? (current-byte)) + OP-OR-LOOP-ARG ...)) +(provide loop) + (define-macro-cases op [(op ">") #'(gt)] [(op "<") #'(lt)] @@ -18,11 +23,6 @@ [(op ",") #'(comma)]) (provide op) -(define-macro (loop LOOP-ARG ...) - #'(until (zero? (current-byte)) - LOOP-ARG ...)) -(provide loop) - (define arr (make-vector 30000 0)) (define ptr 0)