class A {
this(T = this)() {
static assert(is(T == B));
}
}
class B {
}
auto b = new B;
Here, T becomes A, which may be reasonable but is completely
useless. Is there a way to obtain the type of the class (or class
instance reference) the method is called on?
On Saturday, 18 February 2017 at 19:45:45 UTC, biozic wrote:
On Saturday, 18 February 2017 at 19:05:14 UTC, Jean Cesar wrote:
This is exactly what I want this code I did to understand how
would apply multiple inheritance in D, C # also process using
interfaces but the difference from C # to D
On Saturday, 18 February 2017 at 21:09:20 UTC, ag0aep6g wrote:
5. Supposing I devote the time and energy and get up to speed
on D, would the core language team be welcoming if I feel like
I can contribute?
Absolutely. Anyone is welcome to contribute. D is very much a
volunteer effort. Also
On Friday, 17 February 2017 at 20:06:19 UTC, berni wrote:
I wonder if it's possible to do something like this:
import std.stdio;
void main(string[] args)
{
if (args[1]=="a")
{
write("A");
scope (exit) write("B");
}
write("C");
}
I expected the output to be ACB not
I'm new here too (never heard of D before 2017).
c). The whole community seems infused with both the Feminism/SJW
I didn't tried out Rust, but that would draw me away too.
(Incidentally it was a comment on alternatives for Rust, that
pointed me to D.)
2. I am also curious as to what would
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
My rudimentary knowledge of the D ecosystem tells me that there
is a GC in D, but that can be turned off. Is this correct?
Technically yes; you will lose core functionality, though, if you
do.
I don't have the complete list at
timmyjose wrote:
Thanks for the very comprehensive response! I think most of my doubts
are cleared now. You're right though that I'm probably worrying too
much about GC with my current use case.
i can tell you that i'm doing things like, for example, ZX Spectrum
emulator and hobbyst
Dne 18.2.2017 v 21:15 timmyjose via Digitalmars-d-learn napsal(a):
Hello folks,
I am interested in learning D (just starting out, did a few of the
exercises on the D tour), and had some questions before I decide to
jump right in. My questions are genuinely motivated by my experiences
and
On Saturday, 18 February 2017 at 21:27:55 UTC, sarn wrote:
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
[...]
Hi :)
[...]
Okay, yes, it's easy to turn off or control the GC. It's also
easy to control memory allocation in general (unlike, say,
Java, where it's
On Saturday, 18 February 2017 at 21:09:20 UTC, ag0aep6g wrote:
Also, some threads online mention that if we do turn off GC,
some of the core std libraries may not fully work. Is this
presumption also correct?
Yes. Whenever a std function returns a new string or some such
it's going to be
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
Hello folks,
Hi :)
2. I am more interested in learning D as a pure systems
programming language so that I can develop my own tools (not
looking to develop an OS, just some grep-scale tools to start
off with). In that regard, I
Thanks for the very comprehensive response! I think most of my
doubts are cleared now. You're right though that I'm probably
worrying too much about GC with my current use case. Also thanks
for the links - they should also come in very handy indeed.
I managed to find some book recommendations
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
2. I am more interested in learning D as a pure systems
programming language so that I can develop my own tools (not
looking to develop an OS, just some grep-scale tools to start
off with). In that regard, I have a few concerns
Just a note - I found something, that works:
import std.stdio;
void main(string[] args)
{
immutable cond = args[1]=="a";
if (cond) write("A");
scope (exit) if (cond) write("B");
write("C");
}
I'm using the immutable variable to avoid, that the condition
changes later.
Hello folks,
I am interested in learning D (just starting out, did a few of
the exercises on the D tour), and had some questions before I
decide to jump right in. My questions are genuinely motivated by
my experiences and expectations, so please forgive me if some
questions don't come across
On Saturday, 18 February 2017 at 19:05:14 UTC, Jean Cesar wrote:
This is exactly what I want this code I did to understand how
would apply multiple inheritance in D, C # also process using
interfaces but the difference from C # to D is that C # already
in the base class you have to define it
On Saturday, 18 February 2017 at 16:27:51 UTC, biozic wrote:
On Saturday, 18 February 2017 at 12:56:51 UTC, wiki wrote:
On Saturday, 18 February 2017 at 09:33:25 UTC, biozic wrote:
A mixin can be used to provide an base implementation for the
methods of an interface, along with data members,
On Saturday, 18 February 2017 at 12:56:51 UTC, wiki wrote:
On Saturday, 18 February 2017 at 09:33:25 UTC, biozic wrote:
A mixin can be used to provide an base implementation for the
methods of an interface, along with data members, so that you
don't have to define it in every class that
Nice, thanks! Will check it out
On Saturday, 18 February 2017 at 09:33:25 UTC, biozic wrote:
On Friday, 17 February 2017 at 23:35:33 UTC, Jean Cesar wrote:
On Friday, 17 February 2017 at 23:31:41 UTC, Adam D. Ruppe
wrote:
On Friday, 17 February 2017 at 23:11:25 UTC, Jean Cesar wrote:
so I changed the code to use interface
On Saturday, 18 February 2017 at 10:37:21 UTC, XavierAP wrote:
Does D provide anything like this? Otherwise, was this ever
considered and were reasons found not to have it?
They are implemented as part of the Mir project. We call them
ndslices.
https://github.com/libmir/mir-algorithm
Docs:
Does D provide anything like this? Otherwise, was this ever
considered and were reasons found not to have it?
I mean at least in C# (not talking about C/C++ at all) you can
declare two kind of multi-dimensional arrays: T[][][] or T[,,].
The first is the same as the D ones, array of arrays
On Friday, 17 February 2017 at 23:35:33 UTC, Jean Cesar wrote:
On Friday, 17 February 2017 at 23:31:41 UTC, Adam D. Ruppe
wrote:
On Friday, 17 February 2017 at 23:11:25 UTC, Jean Cesar wrote:
so I changed the code to use interface but how would I do so
I could use the constructor in the same
23 matches
Mail list logo