chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Possible infinite loop in compiler with certain uses


From: Kon Lovett
Subject: Re: [Chicken-users] Possible infinite loop in compiler with certain uses of datatype
Date: Tue, 7 Aug 2007 19:37:21 -0700


On Aug 7, 2007, at 6:03 PM, Ivan Raikov wrote:


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.

Bug in macro expansion. Doesn't have anything to do w/ datatype. Because the constant value is a symbol it gets into an infinite loop w/ 'resolve-atom' & 'walk' mutually recursive.

Best Wishes,
Kon


        -Ivan


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]