[racket] Trace rejects set!

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Mon Oct 10 13:27:15 EDT 2011

At Mon, 10 Oct 2011 10:09:49 -0700 (PDT),
michael rice wrote:
> I'm looking at some old Scheme code and find that the code still
> works under (#lang racket) but trace is unhappy with  the use of set!
> in the traced function.
> set!: cannot modify a constant: next-leaf-generator

I added `(trace next-leaf-generator)' to your code, and everything ran
fine. What exactly did you try adding to the code you included?

Also, which version of Racket are you using?

>  I also tried (#lang r5rs) but  it's unhappy with my require.
> (require racket/trace) => expand: unbound identifier in module in: require

`#lang r5rs' is R5RS, and pretty much nothing else, so no `require'.
You can work around it by using `#%require'. Using `#lang racket' is
usually the right thing to do instead.


Posted on the users mailing list.