digitalmars.D.learn - What does auto std.stdio.File.ByChunkImpl byChunk (ulong chunkSize );
- kdevel (9/9) Aug 03 2018 What does
- Alex (4/14) Aug 03 2018 The help page you cited says:
- Adam D. Ruppe (5/10) Aug 03 2018 It looks like ddox trying to tell you what the auto actually is.
- kdevel (2/11) Aug 03 2018 But that indented "code" is not syntactically valid D. Isn't it?
- Adam D. Ruppe (6/7) Aug 03 2018 Right, it would give an error if actually compiled.
- kdevel (5/9) Aug 03 2018 I could not find any elucidation of the meaning of
- Jonathan M Davis (13/20) Aug 03 2018 It's not valid D code. The ddoc version of the documentation shows the
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?
Aug 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."
Aug 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.
Aug 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:But that indented "code" is not syntactically valid D. Isn't it?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.
Aug 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.)
Aug 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?
Aug 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: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 DavisBut 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.
Aug 03 2018