On Monday, 27 August 2018 at 14:59:20 UTC, SG wrote:
On Monday, 27 August 2018 at 07:59:17 UTC, Simen Kjærås wrote:
That's the null propagation operator (?.). What SG asked for
is the null-coalescing operator (??). Of course, this can also
be implemented in D (albeit with a slight more
On Monday, 27 August 2018 at 19:36:29 UTC, aliak wrote:
Then Nullable!(int*) would be the same as int*. Or even better
maybe is to give a compiler error when you try and stuff a
nullable type inside a Nullable. Because ... why?
Isn't it arguable, whether this is desired? I mean, in the
On Monday, 27 August 2018 at 00:15:18 UTC, Jonathan M Davis wrote:
On Sunday, August 26, 2018 5:10:29 PM MDT Nicholas Wilson via
So, soon™?
Bah humbug. Was afraid of this :p
Yeah. Hopefully, we're able to disable moving at some point in
the near future. However, right now, it's definitely
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote:
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole
wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
The big difference is that in there I could do:
int? i = null;
string j = null;
var
On Monday, 27 August 2018 at 09:50:01 UTC, Andrey wrote:
Hello,
This code doesn't compile:
---
import std.meta;
import std.stdio;
enum Option : string
{
First = "-first" ,
Second = "-second",
Qwerty = "-qwerty"
}
On Monday, 27 August 2018 at 09:50:01 UTC, Andrey wrote:
alias Pair(alias key, alias value) = AliasSeq!(key, value);
alias Pairs = AliasSeq!(Pair!(Option.First,
handler!(Option.First)), Pair!(Option.Second,
handler!(Option.Second)), handler);
You can't nest AliasSeqs. If you examine Pairs
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote:
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole
wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
Shouldn't it be in the standard library?
I think it's worth it to create a feature request
I can't get the from template [0] to work in the following
situation, is it possible?
---
module m;
import std.stdio;
package template from(string moduleName) {
mixin("import from = " ~ moduleName ~ ";");
}
version(works) {
struct S {}
void t(from!"m".S param) {}
auto a =
On Monday, 27 August 2018 at 07:59:17 UTC, Simen Kjærås wrote:
That's the null propagation operator (?.). What SG asked for is
the null-coalescing operator (??). Of course, this can also be
implemented in D (albeit with a slight more horrible syntax):
Exactly, and I know it is an example, but
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
The big difference is that in there I could do:
int? i = null;
string j = null;
var k = null;
and test all like:
i == null;
j
On Monday, 27 August 2018 at 12:54:59 UTC, SG wrote:
On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole
wrote:
Templates make it the easiest way, since common patterns, like
arrays, classes and pointers have the exact same null check
syntax.
I see.
That code is only for classes. C#
On 28/08/2018 12:54 AM, SG wrote:
The same thing for struct in C#
Struct S{
public int? i;
}
S.i == null; // This works nicely.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/index
So Nullable in D and C# is basically the same except C#'s has language
On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole wrote:
Templates make it the easiest way, since common patterns, like
arrays, classes and pointers have the exact same null check
syntax.
I see.
That code is only for classes. C# also has structs which are a
value type. Which it
On Monday, 27 August 2018 at 09:57:18 UTC, Sobaya wrote:
On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote:
On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote:
I'm using dcompute(https://github.com/libmir/dcompute).
In the development, I have got to use math functions such as
sqrt in
On Monday, 27 August 2018 at 11:56:08 UTC, Kamil Koczurek wrote:
Mixins seem to be an overkill here. Maybe something like this
would suffice:
data[index + 1 .. index + 5].map!(k => k[0]).array == ""
Here there is dynamic code, with memory allocs.
I found solution:
On Monday, 27 August 2018 at 11:52:02 UTC, Andrey wrote:
Hello again,
I have this part of code:
...
if(index + 3 >= data.length || data[index + 1][0] == '&' ||
data[index + 2][0] == '&' || data[index + 3][0] == '&' ||
data[index + 4][0] == '&')
{
writeln("Some text...");
}
I don't want
Hello again,
I have this part of code:
...
if(index + 3 >= data.length || data[index + 1][0] == '&' ||
data[index + 2][0] == '&' || data[index + 3][0] == '&' ||
data[index + 4][0] == '&')
{
writeln("Some text...");
}
I don't want to write manually these four "or" conditions because
in
On Monday, 27 August 2018 at 09:57:18 UTC, Sobaya wrote:
On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote:
On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote:
I'm using dcompute(https://github.com/libmir/dcompute).
In the development, I have got to use math functions such as
sqrt in
On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote:
On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote:
I'm using dcompute(https://github.com/libmir/dcompute).
In the development, I have got to use math functions such as
sqrt in @compute function.
But LDC says "can only call
Hello,
This code doesn't compile:
---
import std.meta;
import std.stdio;
enum Option : string
{
First = "-first" ,
Second = "-second",
Qwerty = "-qwerty"
}
void handler(Option option)(string[] args, ref ushort
On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote:
I'm using dcompute(https://github.com/libmir/dcompute).
In the development, I have got to use math functions such as
sqrt in @compute function.
But LDC says "can only call functions from other @compute
modules in @compute code", so
I'm using dcompute(https://github.com/libmir/dcompute).
In the development, I have got to use math functions such as sqrt
in @compute function.
But LDC says "can only call functions from other @compute modules
in @compute code", so can't I call any math functions with
dcompute?
Is there
On Saturday, 25 August 2018 at 19:16:26 UTC, Jacob Carlborg wrote:
On 2018-08-25 15:33, SG wrote:
Hi,
1) I program in C# and I'm wondering if there is something
like ?? (Null-Coalescing Operator) in D? (I remember some
proposals in the past).
Not in the language but it can be implemented
On Saturday, 25 August 2018 at 19:16:26 UTC, Jacob Carlborg wrote:
On 2018-08-25 15:33, SG wrote:
Hi,
1) I program in C# and I'm wondering if there is something
like ?? (Null-Coalescing Operator) in D? (I remember some
proposals in the past).
Not in the language but it can be implemented
24 matches
Mail list logo