https://run.dlang.io/is/zRcj59
```
alias Alg = Algebraic!(int, string);
void main()
{
int n = 2;
Alg value;
value = n == 2 ? 2 : "string";
}
```
The original code used SumType but the effect is the same.
I suppose that I could write the following:
```
if(n == 2) value = 2
On 24.03.19 13:45, Francesco Mecca wrote:
```
alias Alg = Algebraic!(int, string);
void main()
{
int n = 2;
Alg value;
value = n == 2 ? 2 : "string";
}
```
The original code used SumType but the effect is the same.
I suppose that I could write the following:
```
if(n == 2
On Sunday, 24 March 2019 at 12:45:13 UTC, Francesco Mecca wrote:
https://run.dlang.io/is/zRcj59
```
alias Alg = Algebraic!(int, string);
void main()
{
int n = 2;
Alg value;
value = n == 2 ? 2 : "string";
}
```
The original code used SumType but the effect is the same.
I suppo
On Sunday, 24 March 2019 at 12:45:13 UTC, Francesco Mecca wrote:
https://run.dlang.io/is/zRcj59
```
alias Alg = Algebraic!(int, string);
void main()
{
int n = 2;
Alg value;
value = n == 2 ? 2 : "string";
}
```
The original code used SumType but the effect is the same.
I suppo
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
I've seen operator overloading done 3 different ways. In the
examples I provide they all compile and work as far as I can
tell. Is there any major difference between using a static if vs
a regular if, or any situation that one would be better than the
other?
struct Something1
{
Something1
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
You could post the code also, personnaly I'm always almost at 2
meters from my screen, with zoom, so
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
You could post the code also, personnaly I'm always almost at 2
meters from my screen, with zoom, so I can't read the code...
On Sunday, 27 December 2015 at 16:01:37 UTC, TheDGuy wrote:
Sry:
if((x1 < 0) & (x2 >= 0)){
This looks like a bug, with & instead of &&.
-- Simon
On Sunday, 27 December 2015 at 16:39:18 UTC, SimonN wrote:
On Sunday, 27 December 2015 at 16:01:37 UTC, TheDGuy wrote:
Sry:
if((x1 < 0) & (x2 >= 0)){
This looks like a bug, with & instead of &&.
-- Simon
It looks like the debugger is not working correctly because i
On Sunday, 27 December 2015 at 16:41:10 UTC, TheDGuy wrote:
It looks like the debugger is not working correctly because i
changed the code to this:
[...]
and the same problem appears.
I can't watch youtube here. What numbers does your input
generate? Which 'if' doesn't fire? What results woul
does your input
generate? Which 'if' doesn't fire? What results would you like
instead?
-- Simon
I don't understand why my program goes into the if statement if
the debugger shows, that the variable "discriminant" is below
zero even though:
"if(discriminant > 0)"?
On Sunday, 27 December 2015 at 16:52:39 UTC, TheDGuy wrote:
I don't understand why my program goes into the if statement if
the debugger shows, that the variable "discriminant" is below
zero even though:
"if(discriminant > 0)"?
I have a hard time believing this.
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
Tell me one thing, what is the value returned?
Well It's working here: http://dpaste.dzfl.pl/18b27ea26b08
Maybe you would like to change the code above to l
fl.pl/18b27ea26b08
Maybe you would like to change the code above to look like
yours and see what happens?
Bubba.
Okay, thanks. It actually returned the right value but it looked
like as if it would jump into the 2nd if-statement (as you can
see on the video). Strange...
On 12/27/2015 07:53 AM, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
YouTube says that the video has been removed by the user. That's exactly
the reason why I don't like even dpaste. There is no guarantee that such
threads will be useful forever.
On Sunday, 27 December 2015 at 22:51:27 UTC, Ali Çehreli wrote:
On 12/27/2015 07:53 AM, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
YouTube says that the video has been removed by the user.
That's exactly the reason why I don't like even dpaste.
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
You could post the code also, personnaly I'm always almost at 2
meters from my screen, with zoom, so
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
You could post the code also, personnaly I'
On Sunday, 27 December 2015 at 23:24:55 UTC, TheDGuy wrote:
On Sunday, 27 December 2015 at 22:51:27 UTC, Ali Çehreli wrote:
On 12/27/2015 07:53 AM, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/watch?v=j_VCa-5VeP8
YouTube says that the video has been removed by the us
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
Any idea what i am doing wrong?
https://www.youtube.com/wa
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
On Monday, 28 December 2015 at 18:12:24 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On
On Monday, 28 December 2015 at 18:33:16 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:12:24 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On
On Monday, 28 December 2015 at 19:22:00 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:33:16 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:12:24 UTC, jkpl wrote:
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On
Get used to it :) Unfortunately, DMD is not emitting the best
debug information. The program flow is correct, but the line
info is not, that's why the execution step will not be
triggered in the real location of the source code.
The simplest example is this:
import std.stdio;
void foo(int x)
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:
On Tuesday, 5 January 2016 at 23:52:05 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote:
On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote:
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote:
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:
I have used an if-else statement to create an alias to avoid code
duplication but it doesn't let me access it outside the if
statement. Is there a way to solve this?
On Wednesday, February 06, 2013 07:24:10 Jeremy DeHaan wrote:
> I've seen operator overloading done 3 different ways. In the
> examples I provide they all compile and work as far as I can
> tell. Is there any major difference between using a static if vs
> a regular if, or any situation that one wo
On Wednesday, 6 February 2013 at 06:38:11 UTC, Jonathan M Davis
wrote:
On Wednesday, February 06, 2013 07:24:10 Jeremy DeHaan wrote:
I've seen operator overloading done 3 different ways. In the
examples I provide they all compile and work as far as I can
tell. Is there any major difference betwe
On Wednesday, February 06, 2013 08:41:14 Jeremy DeHaan wrote:
> Out of curiosity, what exactly happens when we don't constrain
> what operators are being overloaded? Is it undefined behavior or
> will the program just not compile?
With no template constraint, a template will match anything with th
On Wednesday, 5 August 2020 at 09:05:36 UTC, Flade wrote:
I have used an if-else statement to create an alias to avoid
code duplication but it doesn't let me access it outside the if
statement. Is there a way to solve this?
You're probably looking for static if:
static if
On Wednesday, 5 August 2020 at 09:25:23 UTC, Simen Kjærås wrote:
On Wednesday, 5 August 2020 at 09:05:36 UTC, Flade wrote:
I have used an if-else statement to create an alias to avoid
code duplication but it doesn't let me access it outside the
if statement. Is there a way to solve
On Wednesday, 5 August 2020 at 09:32:58 UTC, Flade wrote:
Thanks! You see it should work but the thing is. I'm using it
inside a function. I'm checking for one of the function's
parameter (if parameter == false) and it says that "the
variable `parameter` cannot be read at compile time. Do you
On Wednesday, 5 August 2020 at 09:39:47 UTC, Simen Kjærås wrote:
On Wednesday, 5 August 2020 at 09:32:58 UTC, Flade wrote:
Thanks! You see it should work but the thing is. I'm using it
inside a function. I'm checking for one of the function's
parameter (if parameter == false) and it says that "
I'm lacking knowledge on how to achieve what I want and getting
an error.
What is the correct way to do what I tried to achieve in this
code?
Everything was intuitive until I started to add notice variable
to the writeln. Rdmd says variable `notice` is shadowing
variable.
rdmd output:
C:\Us
On Wednesday, 27 May 2020 at 11:03:51 UTC, BoQsc wrote:
I'm lacking knowledge on how to achieve what I want and getting
an error.
What is the correct way to do what I tried to achieve in this
code?
Everything was intuitive until I started to add notice variable
to the writeln. Rdmd says variab
On Wednesday, 27 May 2020 at 11:13:09 UTC, Simen Kjærås wrote:
On Wednesday, 27 May 2020 at 11:03:51 UTC, BoQsc wrote:
I'm lacking knowledge on how to achieve what I want and
getting an error.
What is the correct way to do what I tried to achieve in this
code?
Everything was intuitive until I s
40 matches
Mail list logo