dyoo/whalesong — Issue #85: major module variable bug
Author: dyoo
Created: 2012-02-22 18:47:51+00:00
State: open

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.