chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] [patch] write-string fails to check type of its para


From: Felix Winkelmann
Subject: Re: [Chicken-users] [patch] write-string fails to check type of its params
Date: Tue, 18 May 2004 08:12:20 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

Alejandro Forero Cuervo wrote:
The following (broken) code, when compiled, gives a strange error:


(declare (uses extras))
(write-string "hey" (open-output-file "/tmp/foo"))


I get:


Error: (make-string) size is negative: -536889320


Evidently, make-string is failing to  check that its optional NUM
parameter is a fixnum.

Enclosed is  a patch to have  it perform the check  (made against
1.45, but excluding  the changes in extras.c from  it; that means
extras.c needs  to be  regenerated after  the patch  is applied).
With the patch, the above code gives:


Error: (write-string) bad argument type - not a fixnum: #<output port /tmp/foo>

Thanks, Aljandro. Much appreciated!



Took me a while to figure out what was going on. :)



cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]