Thread overview
What does auto std.stdio.File.ByChunkImpl byChunk (ulong chunkSize ); mean?
Aug 03, 2018
kdevel
Aug 03, 2018
Alex
Aug 03, 2018
Adam D. Ruppe
Aug 03, 2018
kdevel
Aug 03, 2018
Adam D. Ruppe
Aug 03, 2018
kdevel
Aug 03, 2018
Jonathan M Davis
August 03, 2018
What does

  auto std.stdio.File.ByChunkImpl byChunk (
     ulong chunkSize
  );

on https://dlang.org/library/std/stdio/file.by_chunk.html mean? Is that
a (forward) declaration of a function named byChunk taking a single
ulong argument name chunkSize. But what does that function return?
August 03, 2018
On Friday, 3 August 2018 at 16:58:26 UTC, kdevel wrote:
> What does
>
>   auto std.stdio.File.ByChunkImpl byChunk (
>      ulong chunkSize
>   );
>
> on https://dlang.org/library/std/stdio/file.by_chunk.html mean? Is that
> a (forward) declaration of a function named byChunk taking a single
> ulong argument name chunkSize. But what does that function return?

The help page you cited says:
"Returns an input range set up to read from the file handle a chunk at a time."
August 03, 2018
On Friday, 3 August 2018 at 16:58:26 UTC, kdevel wrote:
> What does
>
>   auto std.stdio.File.ByChunkImpl byChunk (
>      ulong chunkSize
>   );
>
> on https://dlang.org/library/std/stdio/file.by_chunk.html mean?


It looks like ddox trying to tell you what the auto actually is. But it returns a ByChunkImpl which is just a range that handles the chunk; you are supposed to think of it as just being something you foreach or pass to other ranges.
August 03, 2018
On Friday, 3 August 2018 at 17:06:16 UTC, Adam D. Ruppe wrote:
> On Friday, 3 August 2018 at 16:58:26 UTC, kdevel wrote:
>> What does
>>
>>   auto std.stdio.File.ByChunkImpl byChunk (
>>      ulong chunkSize
>>   );
>>
>> on https://dlang.org/library/std/stdio/file.by_chunk.html mean?
>
>
> It looks like ddox trying to tell you what the auto actually is.

But that indented "code" is not syntactically valid D. Isn't it?
August 03, 2018
On Friday, 3 August 2018 at 17:16:14 UTC, kdevel wrote:
> But that indented "code" is not syntactically valid D. Isn't it?

Right, it would give an error if actually compiled.

But remember, this is documentation that just happens to look like code, so it is intended to be legible by people rather than the compiler.

(that said, it isn't how I would have written it.)
August 03, 2018
On Friday, 3 August 2018 at 17:27:07 UTC, Adam D. Ruppe wrote:
> But remember, this is documentation that just happens to look like code, so it is intended to be legible by people rather than the compiler.

I could not find any elucidation of the meaning of

   auto <type>

when used as a return type of a function.

> (that said, it isn't how I would have written it.)

You would have removed the auto?
August 03, 2018
On Friday, August 03, 2018 17:47:53 kdevel via Digitalmars-d-learn wrote:
> On Friday, 3 August 2018 at 17:27:07 UTC, Adam D. Ruppe wrote:
> > But remember, this is documentation that just happens to look like code, so it is intended to be legible by people rather than the compiler.
>
> I could not find any elucidation of the meaning of
>
>     auto <type>
>
> when used as a return type of a function.

It's not valid D code. The ddoc version of the documentation shows the actual signature:

https://dlang.org/phobos/std_stdio.html#byChunk

If the ddox is supposed to match the actual signature, then it's wrong in that it inserts the actual type (resulting in two return types) and in that it replaced size_t with ulong. If ddox is designed with the idea that it's going to muck with the signature in some manner in attempt to clarify what stuff like auto is inferred as, then what it's supposed to show depends on the ddox developers. But regardless, having two return types is incorrect D code, and what the ddox is showing does not match the actual function signature.

- Jonathan M Davis