On 2/8/20 7:39 PM, realhet wrote:
On Sunday, 9 February 2020 at 00:15:47 UTC, Drug wrote:
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
Hello,
class A{
int i = 42;
}
Is there a way to get that 42? (Input is the class A and the name of
the field 'i')
A.i.init returns 0, so
On 2/8/20 1:20 PM, ag0aep6g wrote:
On 08.02.20 15:57, Steven Schveighoffer wrote:
This kind of stuff is so difficult to reason about and develop as a
library that people will just end up removing dip1000 from their
compilation.
I 100% agree that DIP 1000 is hard to reason about. It's pretty
On Sunday, 9 February 2020 at 00:57:05 UTC, realhet wrote:
On Sunday, 9 February 2020 at 00:41:12 UTC, realhet wrote:
On Sunday, 9 February 2020 at 00:27:21 UTC, Adam D. Ruppe
wrote:
Using what I've learned:
class A{
int i=42;
void init(){ // reInitialize class fields
alias T =
On Sunday, 9 February 2020 at 00:57:05 UTC, realhet wrote:
On Sunday, 9 February 2020 at 00:41:12 UTC, realhet wrote:
On Sunday, 9 February 2020 at 00:27:21 UTC, Adam D. Ruppe
wrote:
mixin([FieldNameTuple!T].map!(n => n~"=(new T)."~n~";").join);
After checking it in the asm debugger, it
On Sunday, 9 February 2020 at 00:41:12 UTC, realhet wrote:
On Sunday, 9 February 2020 at 00:27:21 UTC, Adam D. Ruppe wrote:
Using what I've learned:
class A{
int i=42;
void init(){ // reInitialize class fields
alias T = typeof(this);
mixin([FieldNameTuple!T].map!(n => n~"=(new
On Sunday, 9 February 2020 at 00:27:21 UTC, Adam D. Ruppe wrote:
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
classinfo.m_init can be an option, but maybe there's a nicer
way to do this?
eh the initializer i think is the best. you can sometimes
shortcut it
pragma(msg, (new
On Sunday, 9 February 2020 at 00:15:47 UTC, Drug wrote:
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
Hello,
class A{
int i = 42;
}
Is there a way to get that 42? (Input is the class A and the
name of the field 'i')
A.i.init returns 0, so it doesn't care about the class.
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
classinfo.m_init can be an option, but maybe there's a nicer
way to do this?
eh the initializer i think is the best. you can sometimes
shortcut it
pragma(msg, (new A).i);
which will call the ctor at ctfe and get the value. but if
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
Hello,
class A{
int i = 42;
}
Is there a way to get that 42? (Input is the class A and the
name of the field 'i')
A.i.init returns 0, so it doesn't care about the class.
classinfo.m_init can be an option, but maybe there's a
Hello,
class A{
int i = 42;
}
Is there a way to get that 42? (Input is the class A and the name
of the field 'i')
A.i.init returns 0, so it doesn't care about the class.
classinfo.m_init can be an option, but maybe there's a nicer way
to do this?
Thx!
On Saturday, 8 February 2020 at 10:46:52 UTC, Basile B. wrote:
On Saturday, 8 February 2020 at 03:59:22 UTC, Borax Man wrote:
As linked before, dexed is available here
https://github.com/akira13641/dexed
and I compiled it just a few days ago with success.
It is a fork (check the count of
On 08.02.20 07:27, ag0aep6g wrote:
On 08.02.20 02:38, ag0aep6g wrote:
Simplified, we're looking at this:
struct Joiner
{
int[3] _items;
int[] _current;
}
void main() @safe
{
Joiner j;
j._current = j._items[];
}
[...]
In the first reduction, `j` might be `scope`,
On 2/8/20 12:22 AM, Adnan wrote:
Just a foreword, this is for learning purposes, hence I am not using the
dynamic array or Array!T.
I have a structure that maintains a heap allocated sized array inside.
struct LifoStack(T) {
T[?] data;
}
This `data` is manually resized and copied. Thus
On Saturday, 8 February 2020 at 08:22:46 UTC, Adnan wrote:
Just a foreword, this is for learning purposes, hence I am not
using the dynamic array or Array!T.
I have a structure that maintains a heap allocated sized array
inside.
struct LifoStack(T) {
T[?] data;
}
T[N] is a static array
On 08.02.20 15:57, Steven Schveighoffer wrote:
This kind of stuff is so difficult to reason about and develop as a
library that people will just end up removing dip1000 from their
compilation.
I 100% agree that DIP 1000 is hard to reason about. It's pretty limited
by design, and the
On 2/7/20 8:38 PM, ag0aep6g wrote:
If that code were allowed, you could do this:
struct Joiner
{
Joiner* p;
}
Joiner g;
void main() @safe
{
scope Joiner j;
() @trusted { j.p = } (); /* pretend it's allowed */
g = *j.p; /* dereference and copy */
}
Returning a
On Saturday, 8 February 2020 at 03:59:22 UTC, Borax Man wrote:
As linked before, dexed is available here
https://github.com/akira13641/dexed
and I compiled it just a few days ago with success.
It is a fork (check the count of commits).
The most recent version is here
On Friday, 7 February 2020 at 06:20:09 UTC, novice2 wrote:
import std.conv: to;
string str = "test1";
wstring[] wstr = [to!wstring(str)];
Thank you!
You don't need an IDE for run Dlang. I Use "Sublime Text". Very
good for Dlang.
On 07/02/2020 16:52, Steven Schveighoffer wrote:
> But I still maintain, a hello world program should not need this to
> avoid spawning 6 threads to scan itself.
I agree, see https://issues.dlang.org/show_bug.cgi?id=20567 and
https://github.com/dlang/druntime/pull/2933
Just a foreword, this is for learning purposes, hence I am not
using the dynamic array or Array!T.
I have a structure that maintains a heap allocated sized array
inside.
struct LifoStack(T) {
T[?] data;
}
This `data` is manually resized and copied. Thus the size itself
is not a compile
21 matches
Mail list logo