david135 / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

problem with letrec* binding value from function argument, through define, too #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the following program:

(import (rnrs))
(define (f a)
  (define b a)
  #t)
(f 1)

or the following:

(import (rnrs))
(define (f a)
  (letrec* ((b a))
    #t))
(f 1)

What is the expected output? What do you see instead?
It should run.  It fails with:

 Condition components:
 1. &assertion
 2. &who             who: letrec*
 3. &message         message: "reference to uninitialized variable on letrec*"
 4. &irritants       irritants: ((a))

 Exception:
     error in raise: returned from non-continuable exception

 Stack trace:
    1. throw: <subr>
    2. (raise c):  compiler-with-library.scm:943
    3. (f a): <unknown location>
    4. eval: <subr>
    5. (<top-level>): <unknown location>

What version of the product are you using? On what operating system?
Mosh 0.2.4rc2.  i686-pc-linux-gnu.

Please provide any additional information below.
It was not happening with 0.2.4rc1.  The following program does NOT fail:

(import (rnrs))
(define a 1)
(letrec* ((b a))
  #t)

Original issue reported on code.google.com by mrc....@gmail.com on 13 Apr 2010 at 7:32

GoogleCodeExporter commented 9 years ago
Fixed on http://www.monaos.org/downloads/mosh-0.2.4rc3.tar.gz 

sewashi% mosh -v
Mosh R6RS scheme interpreter, version 0.2.4rc3
sewashi% cat h.scm
(import (rnrs))
(define (f a)
  (define b a)
  #t)
(f 1)
sewashi% mosh h.scm
sewashi% cat h.scm
(import (rnrs))
(define (f a)
  (letrec* ((b a))
    #t))
(f 1)
sewashi% mosh h.scm

Thank you!

Original comment by hige...@gmail.com on 14 Apr 2010 at 3:02