Skip to content

Commit

Permalink
updated rosette/base/module.rkt to be compatible with the change in l…
Browse files Browse the repository at this point in the history
…etrec semantics in Racket 6.1
  • Loading branch information
emina committed Sep 2, 2014
1 parent 4733826 commit f47209d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 10 additions & 4 deletions rosette/base/module.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(require (for-syntax racket/dict syntax/parse syntax/id-table (only-in racket pretty-print)
(only-in "lift.rkt" drop@))
racket/require
racket/require racket/undefined
(filtered-in drop@ "box.rkt")
(only-in racket/splicing splicing-let splicing-let-values))

Expand All @@ -17,8 +17,14 @@
(let* ([core (local-expand #'(#%plain-module-begin forms ...) 'module-begin '())]
[vars (find-mutated-vars core)]
[transformed (box-mutated-vars core vars)])
;(printf "vars:~a\n" (dict->list vars))
;(printf "core:\n") (pretty-print (syntax->datum core))
;(printf "transformed:\n") (pretty-print (syntax->datum transformed))
;(call-with-output-file "bad.rkt"
; (lambda (out) (parameterize ([current-output-port out])
;(printf "transformed:\n")
; (pretty-print (syntax->datum transformed))))
; #:mode 'text
; #:exists 'replace)
transformed)]))

(define-syntax (@#%top-interaction stx)
Expand Down Expand Up @@ -165,7 +171,7 @@
(cond [(any-mutated? vs)
(let ([ves (syntax->list #'((var ...) ...))])
(quasisyntax/loc stx
(letrec-values ([#,vs (values #,@vs)])
(letrec-values ([#,vs (apply values (make-list #,(length vs) undefined))])
#,@(for/list ([v vs] #:when (mutated? v))
#`(set! #,v (box #,v)))
#,@(for/fold ([result '()]) ([ve ves] [e es])
Expand All @@ -187,7 +193,7 @@
(cond [(any-mutated? vs)
(let ([ves (syntax->list #'((var ...) ...))])
(quasisyntax/loc stx
(letrec-syntaxes+values stx-decls ([#,vs (values #,@vs)])
(letrec-syntaxes+values stx-decls ([#,vs (apply values (make-list #,(length vs) undefined))])
#,@(for/list ([v vs] #:when (mutated? v))
#`(set! #,v (box #,v)))
#,@(for/fold ([result '()]) ([ve ves] [e es])
Expand Down
6 changes: 6 additions & 0 deletions test/stats/all-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,9 @@
[2014.08.14 15:29:54] [rosette/test/all-tests.rkt run-all] [cpu=16798, real=27473, gc=3021]
[2014.08.14 15:32:22] [rosette/test/all-tests.rkt run-z3] [cpu=75629, real=147249, gc=1118]
[2014.08.14 15:33:07] [rosette/test/all-tests.rkt run-bv] [cpu=23038, real=44811, gc=454]
[2014.09.02 15:09:41] [rosette/test/all-tests.rkt run-all] [cpu=6272, real=8837, gc=664]
[2014.09.02 15:10:51] [rosette/test/all-tests.rkt run-z3] [cpu=45853, real=69484, gc=2195]
[2014.09.02 15:11:11] [rosette/test/all-tests.rkt run-bv] [cpu=12289, real=20704, gc=240]
[2014.09.02 16:16:38] [rosette/test/all-tests.rkt run-all] [cpu=6075, real=8352, gc=710]
[2014.09.02 16:17:38] [rosette/test/all-tests.rkt run-z3] [cpu=39190, real=60147, gc=907]
[2014.09.02 16:17:56] [rosette/test/all-tests.rkt run-bv] [cpu=11805, real=18579, gc=339]

0 comments on commit f47209d

Please sign in to comment.