[bitc-dev] first try with bitc
Swaroop Sridhar
swaroop at cs.jhu.edu
Tue May 23 11:36:52 EDT 2006
Tom Bachmann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Swaroop Sridhar wrote:
>
>>This is not your mistake, the compiler took an assertion fault here.
>>This error message is not intended to be comprehensible, but to get as
>>much information as possible to help debug the problem. Thanks for
>>noting this problem, I will look into it and send another note.
>>
>
>
> Just in case this helps, if I explicitely declare v to be (vector
> string), bitcc creates wrong c code.
I fixed this issue. There was a bug in printing function types. I have
committed this update, it might take a little while before it propagates
to the server.
Now, the code:
(bitc-version "0.9+")
(import stdio bitc.stdio)
(define (main argv:(vector string))
(let
((print (lambda (s)
(stdio.write-string stdio.stdout s)
(stdio.write-char stdio.stdout #\linefeed)))
(vector-for-each (lambda (f v)
(f "foo")))) ; dummy
(vector-for-each print argv))
(the int32 0))
works OK. Of course, it will only print `foo' rather than the contents
of the vector because of the way it is written.
The real problem is that the polyinstantiator does not (yet) do
polyinstantiation of locals. If the above code were to be written as:
(bitc-version "0.9+")
(import stdio bitc.stdio)
(define (print s)
(stdio.write-string stdio.stdout s)
(stdio.write-char stdio.stdout #\linefeed))
(define (vector-for-each f v)
(f "foo"))
(define (main argv:(vector string))
(vector-for-each print argv)
(the int32 0))
everything works fine (note that the type of v is not explicitly written
in this case).
Thank you for the example. I will try to fix the real problem shortly.
Swaroop.
More information about the bitc-dev
mailing list