[plt-scheme] module-based language and defining primitives?

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Thu Feb 8 18:01:04 EST 2007

Hi everyone,

Someone recently sent me a bug report on Simply Scheme, and after looking 
at the problem a bit, I haven't the foggiest what's going on.


The following test code will break under Pretty Big:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; In Pretty Big
(require (planet "simply-scheme.ss" ("dyoo" "simply-scheme.plt")))

(define (accumulate combiner null-value term a next b)
   (if (> a b)
       null-value
       (combiner (term a)
                 (accumulate combiner null-value term (next a) next b))))

(accumulate + 0 (lambda (x) x) 1 add1 10)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Somehow, the inner definition of accumulate is being bound to the one 
that's built into Simply Scheme; that is, I'm seeing let vs letrec 
behavior on definitions.  This makes no sense, though, since the Macro 
Stepper and Check Syntax both know that the inner reference to accumulate 
should be to the defined function.

I'm not doing too much special in Simply Scheme --- it's just a module 
language --- so I'm at a loss.  Any suggestions?  Thanks!


Posted on the users mailing list.