Correct error in mutator quote

This commit is contained in:
Jay McCarthy 2010-10-28 11:11:23 -06:00
parent 05832af083
commit ac4fb05f0c
3 changed files with 35 additions and 3 deletions

View File

@ -229,13 +229,13 @@
(define-syntax mutator-quote
(syntax-rules ()
[(_ (a . d))
(mutator-anf-app collector:cons (mutator-quote a) (mutator-quote d))]
(mutator-app collector:cons (mutator-quote a) (mutator-quote d))]
[(_ s)
(mutator-anf-app collector:alloc-flat 's)]))
(mutator-app collector:alloc-flat 's)]))
(define-syntax (mutator-datum stx)
(syntax-case stx ()
[(_ . e)
(quasisyntax/loc stx (mutator-anf-app collector:alloc-flat (#%datum . e)))]))
(quasisyntax/loc stx (mutator-app collector:alloc-flat (#%datum . e)))]))
(define-syntax (mutator-top-interaction stx)
(syntax-case stx (require provide mutator-define mutator-define-values test/value=? import-primitives)

View File

@ -0,0 +1,29 @@
#lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 28)
1 2
(define x
(cons 'apple-pie ; 2 + 3
(cons 'pumpkin-pie ; 2 + 3
empty))) ; 2
; Need 12 cells
1 2
(define y
'(apple-pie pumpkin-pie))
; Need 24 cells
(define (equal? l r)
(cond
[(and (empty? l) (empty? r))
#t]
[(and (cons? l) (cons? r))
(and (equal? (first l) (first r))
(equal? (rest l) (rest r)))]
[(and (symbol? l) (symbol? r))
(symbol=? l r)]
[else
#f]))
; Need 2 more for the proc
; Need 2 more for the ans
(equal? x y)

View File

@ -52,4 +52,7 @@
(bad (heap-loc head) 62 47 "at line 19")
END
(test-mutator (build-path here "other-mutators" "quote.rkt"))
=error> "alloc: out of space"
)