On Friday, 13 August 2021 at 00:30:59 UTC, Ruby The Roobster
wrote:
When I run the program and close the window, the program still
runs in background mode. I don't know why this happens nor how
to fix it. Does anybody know what's going on?
frame beat me to it, but it may well be that you
On 13/08/2021 9:40 AM, russhy wrote:
also this but it's pretty old: https://github.com/rikkimax/Duml
It was a neat idea duml of mine, but I wouldn't recommend going down the
path of CTFE for this.
Best to write a tool using dmd-fe instead.
On Friday, 13 August 2021 at 00:30:59 UTC, Ruby The Roobster
wrote:
When I run the program and close the window, the program still
runs in background mode. I don't know why this happens nor how
to fix it. Does anybody know what's going on?
AFAIK GetMessage() may return -1 if some error hap
Here is the message loop:
```d
while(GetMessage(&msg, hwnd,0,0)) {
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
```
The WndProc(LRESULT CALLBACK):
```d
extern(Windows)
LRESULT WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
lparam) nothrow
On Thursday, 12 August 2021 at 21:11:24 UTC, JN wrote:
I'd like to see the relationships between my D classes in a
graphical form. Is there any tool that supports that?
found this: https://code.dlang.org/packages/depend
also this but it's pretty old: https://github.com/rikkimax/Duml
I'd like to see the relationships between my D classes in a
graphical form. Is there any tool that supports that?
On Thursday, 12 August 2021 at 18:11:20 UTC, nayy wrote:
Hi
I cannot seems to be able to join the discord server
It gives me the following error: "unable to accept invit"
Is the invitation link expired?
https://dlang.org/community.html https://discord.gg/bMZk9Q4
I joined last week with the
Hi
I cannot seems to be able to join the discord server
It gives me the following error: "unable to accept invit"
Is the invitation link expired? https://dlang.org/community.html
https://discord.gg/bMZk9Q4
On Thursday, 12 August 2021 at 03:46:00 UTC, kinke wrote:
@frame: Please file an issue.
https://issues.dlang.org/show_bug.cgi?id=22205
On 8/12/21 4:32 AM, Paul Backus wrote:
> Qualifying the ctor as `inout` works fine
I can see how a DConf Online presention is shaping up in your head. ;)
http://dconf.org/2021/online/index.html
We need a collective understanding of effective use of such fundamental
concepts.
Ali
On Thursday, 12 August 2021 at 16:12:39 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 15:39:40 UTC, Learner wrote:
[...]
You have forgotten to add a member variable of type `A` to your
`B` struct. If you add one, you will see the following error
message:
[...]
"implicit conversi
On Thursday, 12 August 2021 at 15:39:40 UTC, Learner wrote:
It is not clear to me why the inout generated copy constructor
of the B structure is not able to copy the A structure.
struct A
{
int[] data;
this(ref return scope A rhs){ /*
body */ }
On Thursday, 12 August 2021 at 15:50:05 UTC, Tejas wrote:
On Thursday, 12 August 2021 at 15:39:40 UTC, Learner wrote:
On Thursday, 12 August 2021 at 14:57:16 UTC, Steven
Schveighoffer wrote:
[...]
It is not clear to me why the inout generated copy constructor
of the B structure is not able t
On Thursday, 12 August 2021 at 15:39:40 UTC, Learner wrote:
On Thursday, 12 August 2021 at 14:57:16 UTC, Steven
Schveighoffer wrote:
[...]
It is not clear to me why the inout generated copy constructor
of the B structure is not able to copy the A structure.
[...]
Why will copy constructor
On Thursday, 12 August 2021 at 14:57:16 UTC, Steven Schveighoffer
wrote:
On 8/12/21 10:08 AM, Learner wrote:
On Thursday, 12 August 2021 at 13:56:17 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 12:10:49 UTC, Learner wrote:
That worked fine, but the codebase is @safe:
```d
cast from
On 8/12/21 10:08 AM, Learner wrote:
On Thursday, 12 August 2021 at 13:56:17 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 12:10:49 UTC, Learner wrote:
That worked fine, but the codebase is @safe:
```d
cast from `int[]` to `inout(int[])` not allowed in safe code
```
So copy construct
On Thursday, 12 August 2021 at 13:56:17 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 12:10:49 UTC, Learner wrote:
That worked fine, but the codebase is @safe:
```d
cast from `int[]` to `inout(int[])` not allowed in safe code
```
So copy constructors force me to introduce trusted met
On Thursday, 12 August 2021 at 12:10:49 UTC, Learner wrote:
That worked fine, but the codebase is @safe:
```d
cast from `int[]` to `inout(int[])` not allowed in safe code
```
So copy constructors force me to introduce trusted methods,
while that was not necessary with postblits?
A postblit
On Thursday, 12 August 2021 at 12:28:32 UTC, Learner wrote:
On Thursday, 12 August 2021 at 12:22:22 UTC, Tejas wrote:
On Thursday, 12 August 2021 at 12:19:56 UTC, Tejas wrote:
[...]
Works with ```@safe``` as well
Paul was just trying to make that other answer work, you don't
have to make co
On Thursday, 12 August 2021 at 12:22:22 UTC, Tejas wrote:
On Thursday, 12 August 2021 at 12:19:56 UTC, Tejas wrote:
[...]
Works with ```@safe``` as well
Paul was just trying to make that other answer work, you don't
have to make copy constructors ```@trusted```
Ignore this, it doesn't wor
On Thursday, 12 August 2021 at 12:22:22 UTC, Tejas wrote:
On Thursday, 12 August 2021 at 12:19:56 UTC, Tejas wrote:
[...]
Works with ```@safe``` as well
Paul was just trying to make that other answer work, you don't
have to make copy constructors ```@trusted```
Operations are needed on `ot
On Thursday, 12 August 2021 at 12:19:56 UTC, Tejas wrote:
On Thursday, 12 August 2021 at 11:54:22 UTC, Learner wrote:
[...]
Just add ```inout``` inside ```this(ref inout/*notice the
inout*/ Foo other) inout/*notice the inout*/```
Example code:
```d
struct Foo {
this(ref inout Foo ot
On Thursday, 12 August 2021 at 11:54:22 UTC, Learner wrote:
On Thursday, 12 August 2021 at 10:10:17 UTC, rikki cattermole
wrote:
On 12/08/2021 9:36 PM, Learner wrote:
It seems that there is no easy way to transition from a
postblit to a copy constructor, no?
struct Foo {
this(ref Foo
On Thursday, 12 August 2021 at 11:32:03 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 11:19:34 UTC, drug wrote:
```D
struct A {
int[] data;
this(ref return scope inout A rhs) /* no inout here */ {
data = rhs.data.dup; }
}
```
The problem is that if you qualify the ctor itself
On Thursday, 12 August 2021 at 11:07:24 UTC, drug wrote:
12.08.2021 12:36, Learner пишет:
> It seems that there is no easy way to transition from a
postblit to a
copy constructor, no?
You just need both const and mutable copy ctors to replace
inout one:
```D
struct A {
int[] data;
12.08.2021 14:32, Paul Backus пишет:
This is not true. Qualifying the ctor as `inout` works fine:
https://run.dlang.io/is/Kpzp5M
The problem in this example is that `.dup` always returns a mutable
array, even if the array being copied is `inout`. The solution is to
cast the copy back to the
On Thursday, 12 August 2021 at 10:10:17 UTC, rikki cattermole
wrote:
On 12/08/2021 9:36 PM, Learner wrote:
It seems that there is no easy way to transition from a
postblit to a copy constructor, no?
struct Foo {
this(ref Foo other) {
foreach(i, v; other.tupleof)
On Thursday, 12 August 2021 at 11:19:34 UTC, drug wrote:
```D
struct A {
int[] data;
this(ref return scope inout A rhs) /* no inout here */ {
data = rhs.data.dup; }
}
```
The problem is that if you qualify the ctor itself then if you
pass const/immutable rhs to it then the ctor is cons
12.08.2021 14:07, drug пишет:
12.08.2021 12:36, Learner пишет:
> It seems that there is no easy way to transition from a postblit to a
copy constructor, no?
You just need both const and mutable copy ctors to replace inout one:
```D
struct A {
int[] data;
this(ref return scope A
12.08.2021 12:36, Learner пишет:
> It seems that there is no easy way to transition from a postblit to a
copy constructor, no?
You just need both const and mutable copy ctors to replace inout one:
```D
struct A {
int[] data;
this(ref return scope A rhs) { data = rhs.data.dup; }
On 12/08/2021 9:36 PM, Learner wrote:
It seems that there is no easy way to transition from a postblit to a
copy constructor, no?
struct Foo {
this(ref Foo other) {
foreach(i, v; other.tupleof)
this.tupleof[i] = v;
}
@disable th
On Thursday, 12 August 2021 at 09:14:02 UTC, Paul Backus wrote:
On Thursday, 12 August 2021 at 08:42:27 UTC, Learner wrote:
struct A {
int[] data
this(ref return scope A rhs) { data = ths.data.dup; }
}
Generating an `inout` copy constructor for `struct B`
failed, th
On Thursday, 12 August 2021 at 08:42:27 UTC, Learner wrote:
struct A {
int[] data
this(ref return scope A rhs) { data = ths.data.dup; }
}
Generating an `inout` copy constructor for `struct B`
failed, therefore instances of it are uncopyable
What is an `inout` copy
I have a structure like, used by other structures:
struct A {
int[] data;
this(this) { data = data.dup; }
}
I am trying to upgrade it to use copy constructor:
struct A {
int[] data
this(ref return scope A rhs) { data = ths.data.dup; }
}
Gener
34 matches
Mail list logo