On Tuesday, 12 March 2019 at 05:14:21 UTC, Victor Porton wrote:
Why does this not compile?
import std.typecons;
template FieldInfo(T, Nullable!T default_) {
}
/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17): Error: `alias
T = T;` cannot alias itself, use a qualified name to cr
Why does this not compile?
import std.typecons;
template FieldInfo(T, Nullable!T default_) {
}
/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17):
Error: `alias T = T;` cannot alias itself, use a qualified name
to create an overload set
/usr/lib/ldc/x86_64-linux-gnu/include/d/std
Hi Adam, how do I set the color of the SimpleWindow background?
On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote:
There is Money datatype that can be provided by using a third
party package: https://code.dlang.org/packages/money
But that's only for money, what about math?
Why such fundamental as BigDecimal is still not included into
the D language its
How can I configure a fixed ratio between x and y axes in ggplotd
?
I easily found what I am looking for in ggplot which ggplotd
inspires a lot.
http://www.cookbook-r.com/Graphs/Axes_(ggplot2)/
But ggplotd documentation does not have any info about that. Even
I go through the source code spe
Hi,
I have an error that says "Error: returning `match1(opt)` escapes
a reference to parameter `opt`, perhaps annotate with `return`".
The code is here: https://run.dlang.io/is/ESZDW4 (It's copied at
the end of this post as well)
1) If you remove the inout from line 11. It works.
2) If you
On Monday, 11 March 2019 at 20:11:37 UTC, ag0aep6g wrote:
On Monday, 11 March 2019 at 19:53:53 UTC, jmh530 wrote:
So what information is in the static library that allows this
to take place?
None. The information is in in the source or interface file
(.d/.di). Templates can't be compiled befo
On Mon, Mar 11, 2019 at 07:53:53PM +, jmh530 via Digitalmars-d-learn wrote:
> Suppose I have a file with a simple templated function. I compile that
> to a static library. I then compile another file that uses the library
> into an executable. When compiled to the static library, you don't
> kn
On Monday, 11 March 2019 at 19:53:53 UTC, jmh530 wrote:
So what information is in the static library that allows this
to take place?
None. The information is in in the source or interface file
(.d/.di). Templates can't be compiled before they're instantiated.
Suppose I have a file with a simple templated function. I compile
that to a static library. I then compile another file that uses
the library into an executable. When compiled to the static
library, you don't know in advance what types it will call on the
templated function, so that must be res
On Monday, 11 March 2019 at 17:33:31 UTC, HaraldZealot wrote:
Ah yes, I forget about laziness of `map`. BTW, I have found
other solution, which is more fit to my initial intention.
```d
ReturnType!(std.stdio.File.byLineCopy!(char,
immutable(char)))[] ranges;
foreach(filename; args[1 .. $])
{
On Monday, 11 March 2019 at 17:04:56 UTC, ag0aep6g wrote:
To avoid the re-evaluation, assign `ranges[0]` to a variable
before using it:
auto lines = ranges[0];
writeln(lines.front);
writeln(lines.front);
writeln(lines.front);
That should print the same line three times.
Ah
On Monday, 11 March 2019 at 15:23:53 UTC, HaraldZealot wrote:
```d
File[] files;
foreach(filename; args[1 .. $])
{
files ~= File(filename, "r");
}
auto ranges = files.map!(a => a.byLineCopy);
writeln(ranges[0].front);
writeln(ranges[0].front);
writeln(ranges[0].front);
```
produces
```
1
2
Let assume I have multiple files (like "file1", "file2" and so
on). I need to iterate them simultaneously with some logic. I
have tried to create random access range of ranges, however, it
behaves not as expected. Let "file1" is
```
1
2
3
4
```
Then this code
```d
File[] files;
foreach(filenam
There is Money datatype that can be provided by using a third
party package: https://code.dlang.org/packages/money
But that's only for money, what about math?
Why such fundamental as BigDecimal is still not included into the
D language itself?
There is BigInt.
If it is unavoidable to use Floa
https://github.com/dlang/dub/issues/658
As noted in the above issue, dub runs in the root project
directory for all packages, including dependancies. So if any
project aside from the root project includes a relative path in
it's dub.json, that dub build will break, due to the incorrect
workin
On Monday, 11 March 2019 at 15:03:39 UTC, XavierAP wrote:
What compiler version are you using? I on the other hand was
surprised that I needed the try-catch above, after having
already checked isNumeric. The documentation claims that the
conversion to int or long would truncate, but my compil
On Saturday, 9 March 2019 at 18:11:09 UTC, Jacob Shtokolov wrote:
One of the task was to take a string from STDIN and detect its
type.
There were a few options: Float, Integer, string and "something
else" (which, I think, doesn't have any sense under the scope
of the task).
Another std-base
On Saturday, 9 March 2019 at 18:11:09 UTC, Jacob Shtokolov wrote:
I tried to use std.conv.to and std.conv.parse, but found that
they can't really do this. When I call `data.to!int`, the value
of "123.45" will be converted to int!
Are you sure? This here works for me:
import std.stdio;
import
On Saturday, 9 March 2019 at 18:11:09 UTC, Jacob Shtokolov wrote:
Hi,
Recently, I was trying to solve some funny coding challenges
(https://www.techgig.com).
The questions were really simple, but I found it interesting
because the website allows to use D.
One of the task was to take a string
20 matches
Mail list logo