On Saturday, 27 January 2018 at 21:27:44 UTC, kdevel wrote:
On Saturday, 27 January 2018 at 20:33:46 UTC, Jonathan M Davis
wrote:
Shall I file a bug report?
Yes.
https://issues.dlang.org/show_bug.cgi?id=18319
Thanks.
Addressed and already merged:
https://github.com/dlang/phobos/pull/6080
On Saturday, 27 January 2018 at 20:33:46 UTC, Jonathan M Davis
wrote:
Shall I file a bug report?
Yes.
https://issues.dlang.org/show_bug.cgi?id=18319
On Saturday, January 27, 2018 20:11:29 kdevel via Digitalmars-d-learn wrote:
> On Saturday, 27 January 2018 at 18:34:35 UTC, Jonathan M Davis
>
> wrote:
> >> The example still does not compile.
> >
> > That has nothing to do with enforce. std.stdio.readln does not
> > take a FILE*. In general, you
On Saturday, 27 January 2018 at 18:34:35 UTC, Jonathan M Davis
wrote:
The example still does not compile.
That has nothing to do with enforce. std.stdio.readln does not
take a FILE*. In general, you shouldn't mix core.stdc.stdio and
std.stdio.
The code is from the official documentation:
-
On Saturday, January 27, 2018 17:57:54 kdevel via Digitalmars-d-learn wrote:
> On Saturday, 27 January 2018 at 16:10:29 UTC, Jonathan M Davis
>
> wrote:
> > On Saturday, January 27, 2018 13:29:00 kdevel via
> >
> > Digitalmars-d-learn wrote:
> >> What's wrong here? And why is the "selective import"
On Saturday, 27 January 2018 at 16:10:29 UTC, Jonathan M Davis
wrote:
On Saturday, January 27, 2018 13:29:00 kdevel via
Digitalmars-d-learn wrote:
What's wrong here? And why is the "selective import" of
enforce necessary?
Because you named your module enforce. As such, by default,
referring t
On Saturday, January 27, 2018 13:29:00 kdevel via Digitalmars-d-learn wrote:
> What's wrong here? And why is the "selective import" of enforce
> necessary?
Because you named your module enforce. As such, by default, referring to
enforce inside of the module refers to the module. Having the selecti
https://dlang.org/phobos/std_exception.html#enforce and also
https://dlang.org/library/std/exception/enforce.html present this
example:
---
auto f = enforce(fopen("data.txt"));
auto line = readln(f);
enforce(line.length, "Expected a non-empty line.");
---
fopen, readln and enforce need imports