dyoo / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
250 stars 30 forks source link

major module variable bug #85

Closed dyoo closed 12 years ago

dyoo commented 12 years ago

One of Jens's programs isolated a bug in module variables. The following program shows the error:


kui ~/Downloads $ cat m1.rkt cat m1.rkt

lang planet dyoo/whalesong

(require (for-syntax racket/base))

(provide x x++ x=0) (define x 0)

(define (set-x v) (set! x v))

(define-syntax (x++ stx)

'(set-x (add1 x)))

(define-syntax (x=0 stx)

'(set-x 0))kui ~/Downloads $ cat m2.rkt

cat m2.rkt

lang planet dyoo/whalesong

(require "m1.rkt")

x x++ x x++ x x++ x x=0 x x++ x++ x++


m2.rkt should show

0
1
2
3
0
3

but only shows all zeros.

dyoo commented 12 years ago

3ed2d19eab900105cffed90e578cf256a67e3687 should correct this.