chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] specialized-io egg version discrepancy


From: Jeronimo Pellegrini
Subject: Re: [Chicken-users] specialized-io egg version discrepancy
Date: Sat, 9 May 2015 21:02:26 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, May 09, 2015 at 02:25:22PM -0600, Matt Gushee wrote:
> Hi, Jeronimo--

Hi Matt!

> ... except that it appears to do redundant writes, and is *not* what I was
> trying to do. As I said in the original post, I was attempting to use
> write-one-string *within* with-output-to-string, e.g.:
> 
>     (define s
>         (with-output-to-string
>             (lambda () (write-one-string "Blardip!" (current-output-port))))

Oh, now I understand what you meant. It won't work...

> Mind you, I don't know if I would ever do this in a real program. My reason
> for trying it was that I wanted to find out exactly what bytes were written
> - I was wondering if by chance the result would be null-terminated.

> I've since looked at your code, and I see that you've implemented
> write-one-string as a foreign lambda calling fprintf; so I suppose the
> reason for the segfault was that Chicken string ports are not compatible
> with fprintf. 

Yes, exactly. 

> I guess that's a fair tradeoff for improved performance, but
> I would suggest that you add a LIMITATIONS section to the documentation,
> explaining that certain procedures are unsafe, along with whatever details
> of that unsafety you are aware of.

Done!

> Also, one more minor issue with the documentation: I happened to notice
> that you tagged
> 
> specialized-io-error
> +specialized-io-string-buffer-size+
> 
> as [parameter]. But they are not parameters in the Chicken Scheme sense
> [ref: http://api.call-cc.org/doc/chicken/parameters ], they're just global
> variables. It might be a good idea to make them parameters, since then they
> would be thread-local. Either way, they should be documented correctly.

Thanks!
They're parameters in version 1.5 (and this is an incompatible change!).

> Thanks for your work!

Thank you for the bug report!

Version 1.5 should be available soon.

J.



reply via email to

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