I found what Nemiver is much better for debugging D programs.
With GDB I've got many problems, don't remember exactly. Thou
I've used it through ddd, so maybe it's ddd problems, not exactly
GDB's
On Friday, 26 November 2021 at 00:41:34 UTC, Elronnd wrote:
you are right. thanks
On Thursday, 25 November 2021 at 22:00:15 UTC, Alexey wrote:
I would want an static 'switch here',
I mean something like
```D
static switch (v.mode)
{
default:
static assert(false, "v.mode" is invalid)
case "gs_w_d":
// etc...
}
```
for example, I have the code (code in sample generates different
types of Properties dependingly on struct's mode value):
```D
struct PropSetting
{
string mode;
string type;
string var_name;
string title_name;
string default_value;
}
mixin template
On Wednesday, 24 November 2021 at 04:51:03 UTC, Alexey wrote:
On Wednesday, 24 November 2021 at 04:48:46 UTC, Alexey wrote:
oh, also I completely missed what you need it to work without
Enter key presses. so here is fixed version
```D
import std.stdio;
import core.sys.posix.termios;
void
On Wednesday, 24 November 2021 at 04:48:46 UTC, Alexey wrote:
writefln(0x"%c (%1$x %1$d) is inputed", c);
sorry:
```diff
10c10
On Friday, 19 November 2021 at 17:36:55 UTC, BoQsc wrote:
Let's say I want to write a simple program that asks for an
input of a single character.
After pressing a single key on a keyboard, the character is
printed out and the program should stop.
```D
import std.stdio;
void main()
{
On Wednesday, 17 November 2021 at 14:51:58 UTC, Abby wrote:
Hello I would like to create validation mixin or mixin template
which would return on error.
Something like this:
```
mixin template Validate(a, b)
{
if(a > b)
{
writeln("invalid input");
return false;
}
}
On Sunday, 14 November 2021 at 17:42:18 UTC, Imperatorn wrote:
Try task() instead of task!()
worked! huge thanks!
On Sunday, 14 November 2021 at 16:40:58 UTC, Andrey Zherikov
wrote:
Just do `auto t1 = task()` in `threadCreator` then.
Error: value of `this` is not known at compile time
```D
import std.stdio;
import std.parallelism;
class TC
{
void threadFunc()
{
import core.thread;
On Sunday, 14 November 2021 at 14:24:00 UTC, Andrey Zherikov
wrote:
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` instead of `Task`: `auto t1 = task!threadFunc;`
I need
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
Go example for contrast. Ideally, I'd like something similar;
```Go
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
auto t1 = Task!threadFunc;
if this line rewritten as `auto t1 = Task!(TC.threadFunc, this);`
```text
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(451):
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
./t.d(22): Error: template instance
`std.parallelism.Task!(threadFunc)` error instantiating
thou documentation says `a function
On Monday, 27 September 2021 at 16:10:54 UTC, Adam D Ruppe wrote:
This is by design, overloads only consider things declared in
the same place.
see here https://dlang.org/articles/hijack.html
thanks, Adam
I'd also like to ask about similar code.
If I'm writing code like so, I'm getting
On Monday, 27 September 2021 at 14:54:41 UTC, Alexey wrote:
hello.
here I have some code sample.
consequently, If I want C3 to inherit form C2, I'll have to
forward template to from C1 to C2 by hand:
```D
import std.stdio;
class C1
{
void writetext()
{
hello.
here I have some code sample.
I'm not sure if this is my incorrect code or incorrect dmd
behavior.
Intention is C2 to inherit C1's `void writetext(alias A1)()` and
instantiate it with `this.writetext!(typeof(this))();`
```D
import std.stdio;
class C1
{
void writetext()
{
On Sunday, 22 August 2021 at 12:20:56 UTC, Alexey wrote:
On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote:
Hello
```D
interface Int
{
void coolFunc();
}
class C1
{
void coolFunc()
{
return;
}
}
class C2 : C1, Int
{
}
void main()
{
auto c = new C2;
}
```
On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote:
Hello
```D
interface Int
{
void coolFunc();
}
class C1
{
void coolFunc()
{
return;
}
}
class C2 : C1, Int
{
}
void main()
{
auto c = new C2;
}
```
dmd says it's not Ok:
t.d(14): Error: class `t.C2`
On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote:
Hello
```D
interface Int
{
void coolFunc();
}
class C1
{
void coolFunc()
{
return;
}
}
class C2 : C1, Int
{
}
void main()
{
auto c = new C2;
}
```
dmd says it's not Ok:
t.d(14): Error: class `t.C2`
On Saturday, 21 August 2021 at 23:14:14 UTC, Alexey wrote:
I want `this` inside of C1::coolFunc to return C2 if called as
C2::coolFunc
so executing `cast(C2) this !is null` inside of C1::coolFunc
would work
If this would work, I'd farther used this like so
```D
interface Int
{
void
I want `this` inside of C1::coolFunc to return C2 if called as
C2::coolFunc
so executing `cast(C2) this !is null` inside of C1::coolFunc
would work
On Saturday, 21 August 2021 at 22:56:40 UTC, Bastiaan Veelo wrote:
On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote:
Hello
```D
interface Int
{
void coolFunc();
}
class C1
{
void coolFunc()
{
return;
}
}
class C2 : C1, Int
{
}
void main()
{
auto c = new
Hello
```D
interface Int
{
void coolFunc();
}
class C1
{
void coolFunc()
{
return;
}
}
class C2 : C1, Int
{
}
void main()
{
auto c = new C2;
}
```
dmd says it's not Ok:
t.d(14): Error: class `t.C2` interface function `void coolFunc()`
is not implemented
how to
On Saturday, 24 July 2021 at 18:10:07 UTC, Alexey wrote:
I've tried to use ```typeof(t) is cast(t)null```, but compiler
exits with error and so this can't be used for checking this
issue.
The goal I with to achieve by this check - is to use template
and to assign value to variable basing on
I've tried to use ```typeof(t) is cast(t)null```, but compiler
exits with error and so this can't be used for checking this
issue.
The goal I with to achieve by this check - is to use template and
to assign value to variable basing on it's ability to accept null
as a value.
some testing
Does Visual Studio 2019 support D development?
If yes, please give me instructions on how to work in this
environment.
27 matches
Mail list logo