Second Round CURL Wrapper Review
jdrewsen
jdrewsen at nospam.com
Fri Dec 30 11:11:16 PST 2011
On Saturday, 17 December 2011 at 20:01:04 UTC, Jakob Ovrum wrote:
> The docs for onReceiveHeader,
>
> http://freeze.steamwinter.com/D/web/phobos/etc_curl.html#onReceiveHeader
>
> explicitly says that the const string parameters are not valid
> after the function returns. This is all well and good; but a
> minor improvement would be to change the signature to:
>
> @property void onReceiveHeader(void delegate(in char[] key, in
> char[] value) callback);
>
> to add `scope` to the parameters. This documents the fact that
> the constant strings shouldn't be escaped as-is in both code
> and documentation. I suspect many other instances of
> `const(char)[]` could be changed to `in char[]` to better
> document how they use the parameters (I also personally think
> it looks better as it is more concise).
I agree. Actually I thought that 'in' was just an alias of
'const' but now I see that it is actually an alias of 'const
scope'.
More information about the Digitalmars-d
mailing list