[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Possible infinite loop in compiler with certain uses of
From: |
Ivan Raikov |
Subject: |
[Chicken-users] Possible infinite loop in compiler with certain uses of datatype |
Date: |
Wed, 08 Aug 2007 10:03:31 +0900 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
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.
-Ivan
- [Chicken-users] Possible infinite loop in compiler with certain uses of datatype,
Ivan Raikov <=