On Tuesday, 13 February 2018 at 16:55:10 UTC, ixid wrote:
On Tuesday, 13 February 2018 at 13:52:37 UTC, rikki cattermole
wrote:
write exists in both, writeln exists only in std.stdio.
Use named imports to pick which write you want.
It does seem a little silly to have a name clash with such a
On Tuesday, 13 February 2018 at 13:52:37 UTC, rikki cattermole
wrote:
write exists in both, writeln exists only in std.stdio.
Use named imports to pick which write you want.
It does seem a little silly to have a name clash with such a
commonly used function. Would it not be better to rename
On Tuesday, 13 February 2018 at 14:21:31 UTC, bauss wrote:
What you can do is use aliases to use both functions.
import io = std.stdio;
void main()
{
import file = std.file;
file.write("hello");
io.writeln("hello again");
}
that's a nice simple solution.
thanks.
On Tuesday, 13 February 2018 at 13:56:17 UTC, psychoticRabbit
wrote:
On Tuesday, 13 February 2018 at 13:52:37 UTC, rikki cattermole
wrote:
On 13/02/2018 1:46 PM, psychoticRabbit wrote:
So, strange problem below.
The commented-out line will not compile (if I un-comment it),
unless I either mov
On Tuesday, 13 February 2018 at 14:18:05 UTC, ketmar wrote:
psychoticRabbit wrote:
Also, if I do this below, how does the compiler choose the
correct write function?
import std.stdio;
import std.file;
void main()
{
write("hello");
writeln("hello again");
}
it's easy: just take a
psychoticRabbit wrote:
Also, if I do this below, how does the compiler choose the correct write
function?
import std.stdio;
import std.file;
void main()
{
write("hello");
writeln("hello again");
}
it's easy: just take a look at `std.file.write()`. first, it require two
arguments.
On Tuesday, 13 February 2018 at 13:57:38 UTC, ketmar wrote:
`std.file` has function named `write()` too. and local import
completely shadows global imports (i.e. it removes global
imports from overload set for the given scope), hence
`std.stdio.write()` is not available there.
"..local import
On Tuesday, 13 February 2018 at 13:52:37 UTC, rikki cattermole
wrote:
On 13/02/2018 1:46 PM, psychoticRabbit wrote:
So, strange problem below.
The commented-out line will not compile (if I un-comment it),
unless I either move std.stdio into main, or, move std.file
out of main.
Whereas write
psychoticRabbit wrote:
So, strange problem below.
The commented-out line will not compile (if I un-comment it), unless I
either move std.stdio into main, or, move std.file out of main.
Whereas writeln works just fine as is.
-
module test;
import std.stdio;
void main()
On 13/02/2018 1:46 PM, psychoticRabbit wrote:
So, strange problem below.
The commented-out line will not compile (if I un-comment it), unless I
either move std.stdio into main, or, move std.file out of main.
Whereas writeln works just fine as is.
-
module test;
import st
On Tuesday, 13 February 2018 at 13:46:11 UTC, psychoticRabbit
wrote:
So, strange problem below.
The commented-out line will not compile (if I un-comment it),
unless I either move std.stdio into main, or, move std.file out
of main.
Whereas writeln works just fine as is.
-
So, strange problem below.
The commented-out line will not compile (if I un-comment it),
unless I either move std.stdio into main, or, move std.file out
of main.
Whereas writeln works just fine as is.
-
module test;
import std.stdio;
void main()
{
import std.file;
12 matches
Mail list logo