Hi all,
It seems that the chicken compiler goes into an infinite loop (or
takes a really long time) when trying to compile the following code:
(require-extension datatype)
(define-constant Red 'Red)
(define-constant Black 'Black)
(define (color? x) (or (eq? x 'Red) (eq? x 'Black)))
(define-datatype tree tree?
(Empty)
(Tree (color color?) (left tree?) (key identity) (value
identity) (right tree?)))
(define (test root)
(cases tree root
(Empty () (Tree Red (Empty) key value (Empty)))
(Tree (color a yk y b) a)))
Removing the definitions of the constants Red and Black, or changing
their values to something other than 'Red and 'Black, respectively,
fixes the problem. I don't know enough about the implementation of the
datatype macros, but if this is not due to a bug in the macroexpansion
code, it would be nice if this situation can be automatically
detected.