christoff-buerger / racr

Metacompiler library supporting incremental transformation based on reference attribute grammar controlled rewriting.
MIT License
30 stars 9 forks source link

Chez Scheme fails test suite #85

Closed christoff-buerger closed 7 years ago

christoff-buerger commented 7 years ago

Chez Scheme 9.5 fails the following four test cases of the ttc-2015-fuml-activity-diagrams example when tests/execute.bash is run:

Note: Other R6RS Scheme systems pass these tests, in particular Petite Chez Scheme (the Chez Scheme interpreter); most likely the Chez Scheme compiler is bugged.

christoff-buerger commented 7 years ago

The problems seems to be due to a bug of Chez Scheme's compiler regarding empty, opaque, sealed records used to construct unique entities; looks like the compiler is optimising and reducing all constructed instances to a single unique instance, for which reason in turn eq? fails. Petite Chez Scheme is not suffering from this bug, i.e., it is not doing these broken optimisations.

For example, in Petite Chez Scheme we have:

> (define-record-type atom     (sealed #t)(opaque #t))
> (define r1 (make-atom))
> (define r2 (make-atom))
> (eq? r1 r2)
#f
> 

But in Chez Sheme (the compiler) we have:

> (define-record-type atom     (sealed #t)(opaque #t))
> (define r1 (make-atom))
> (define r2 (make-atom))
> (eq? r1 r2)
#t
> 
christoff-buerger commented 7 years ago

Added a workaround in the ttc-2015-fuml-activity-diagrams example for Chez Scheme. All tests pass now.