[plt-scheme] circular definitions

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Mon Jul 20 09:23:29 EDT 2009

Hello.  
What is the motivation to treat circular definitions differently 
between top-level definitions and local letrec's? 
I mean:

;This causes an error immediately.
(define x0 x0) 

;This does not cause an error. 
(define x1 (letrec ([tmp tmp]) tmp)) 

;This does not cause an error too. 
(define-signature u^ (x2))
(define-unit u@ (import) (export u^) (define x2 x2))
(define-values/invoke-unit/infer u@) 

The third example particularly motivated me to think about why the
different treatment is necessary/preferable in respect of the
implementation and the language design.

Best,
Keiko



Posted on the users mailing list.