From af389dd56438e69202c55f9a7f5262314dce3767 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 23 Oct 2012 17:31:16 -0600 Subject: [PATCH] working around the case bug --- js-assembler/assemble-open-coded.rkt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js-assembler/assemble-open-coded.rkt b/js-assembler/assemble-open-coded.rkt index cecdc62..b5f856f 100644 --- a/js-assembler/assemble-open-coded.rkt +++ b/js-assembler/assemble-open-coded.rkt @@ -16,6 +16,13 @@ (define MAX-JAVASCRIPT-ARGS-AT-ONCE 100) +;; Workaround for a regression in Racket 5.3.1: +(define-syntax-rule (mycase op ((x ...) b ...) ...) + (let ([v op]) + (cond + [(or (eqv? v 'x) ...) b ...] ...))) + + (: open-code-kernel-primitive-procedure (CallKernelPrimitiveProcedure Blockht -> String)) (define (open-code-kernel-primitive-procedure op blockht) (let*: ([operator : KernelPrimitiveName/Inline (CallKernelPrimitiveProcedure-operator op)] @@ -36,7 +43,7 @@ (build-list (length operands) (lambda: ([i : Natural]) i)) operands (CallKernelPrimitiveProcedure-typechecks? op))]) - (case operator + (mycase operator [(+) (cond [(empty? checked-operands) (assemble-numeric-constant 0)]