[bitc-dev] first try with bitc
Swaroop Sridhar
swaroop at cs.jhu.edu
Wed May 24 17:45:56 EDT 2006
Tom Bachmann wrote:
>
> (bitc-version "0.9+")
> (import stdio bitc.stdio)
>
> (define (main argv:(vector string))
> (letrec
> ((print (lambda (s)
> (stdio.write-string stdio.stdout s)
> (stdio.write-char stdio.stdout #\linefeed)))
> (iter (lambda (f v i)
> (if (== i (vector-length v))
> ()
> (begin
> (f (vector-nth v i))
> (iter f v (+ i 1))))))
> (vector-for-each (lambda (f v)
> (iter f v 0))))
> (vector-for-each print argv))
> (the int32 0))
>
> But bitcc complains:
>
> echo2.bitc:9:6: Function iter Needs Closure Conversion. [Heap Closure].
> Free Variables are: iter, Bound Variables are: f, v, i,
As noted in the release notes
http://coyotos.org/docs/bitc/relnotes-0.9.html,
inner lambdas that are closed over locals are not yet implemented. If
you define `print' and `iter' as top level forms, this issue goes away.
Closure conversion is not implemented in the bootstrap compiler.
Thanks,
Swaroop.
More information about the bitc-dev
mailing list