On Sunday, June 2, 2019 9:40:43 PM MDT Rnd via Digitalmars-d-learn wrote:
> On Monday, 3 June 2019 at 00:47:27 UTC, Adam D. Ruppe wrote:
> > On Monday, 3 June 2019 at 00:17:08 UTC, Rnd wrote:
> >> What additional features do classes offer in D?
> >
> > Classes support built-in runtime polymorphism
On Monday, 3 June 2019 at 00:47:27 UTC, Adam D. Ruppe wrote:
On Monday, 3 June 2019 at 00:17:08 UTC, Rnd wrote:
What additional features do classes offer in D?
Classes support built-in runtime polymorphism through
inheritance. structs don't.
As a result of this, classes are a little bit hea
On Monday, 3 June 2019 at 00:17:08 UTC, Rnd wrote:
What additional features do classes offer in D?
Classes support built-in runtime polymorphism through
inheritance. structs don't.
As a result of this, classes are a little bit heavier
resource-wise and are semantically always object referen
I see that struct can have data as well as member functions and
instances can be created. So they sound like classes only.
What additional features do classes offer in D?
On Sunday, 2 June 2019 at 19:38:11 UTC, Amex wrote:
I thought importing single functions were suppose to be faster.
Am I wrong?
That is wrong. Importing is always done of the whole module.
All the `: func` thing does is limit the things introduced to the
namespace.
On Sunday, 2 June 2019 at 07:55:27 UTC, Amex wrote:
A.B
If A is null, crash.
A?.B : writeln("HAHA");
No crash, ignored, equivalent to
if (A is null) writeln("HAHA"); else A.B;
safeAccess from iz does this :
https://github.com/Basile-z/iz/blob/master/import/iz/sugar.d#L1666
On Sunday, 2 June 2019 at 19:38:11 UTC, Amex wrote:
Tired of having to import a single function to call it.
Since
mod.foo(x);
doesn't work since mod is not defined.
we have to do
import mod : foo;
foo(x);
Why not
mod:foo(x)?
or
mod#foo(x)
or
mod@foo(x)
or whatever
Reduces 50% of the
On Sunday, June 2, 2019 11:43:09 AM MDT Anonymouse via Digitalmars-d-learn
wrote:
> On Saturday, 1 June 2019 at 07:46:40 UTC, Jonathan M Davis wrote:
> > For the most part though, you don't declare your own version
> > identifiers. It sometimes makes sense, but usually, version
> > identifiers are
On Sunday, 2 June 2019 at 14:37:48 UTC, Paul Backus wrote:
On Sunday, 2 June 2019 at 07:55:27 UTC, Amex wrote:
A.B
If A is null, crash.
A?.B : writeln("HAHA");
No crash, ignored, equivalent to
if (A is null) writeln("HAHA"); else A.B;
The "optional" package on dub [1] has a .dispatch metho
main.d(217): Error: module `M.Q` from file M\Q.d conflicts with
another module Q from file M\Q.d
the line is simply
import Q : foo;
the problem is that it should have been
import M.Q : foo;
There is no module Q.
The error message is in error! There is no other module.
the module is named
Tired of having to import a single function to call it.
Since
mod.foo(x);
doesn't work since mod is not defined.
we have to do
import mod : foo;
foo(x);
Why not
mod:foo(x)?
or
mod#foo(x)
or
mod@foo(x)
or whatever
Reduces 50% of the lines and reduces the import symbol.
I realize tha
On Sunday, June 2, 2019 1:29:22 PM MDT Jonathan M Davis via Digitalmars-d-
learn wrote:
> On Sunday, June 2, 2019 8:32:16 AM MDT Paul Backus via Digitalmars-d-learn
> wrote:
> > On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote:
> > > Almost certainly, hasElaborateCopyConstructor shoul
On Sunday, June 2, 2019 8:32:16 AM MDT Paul Backus via Digitalmars-d-learn
wrote:
> On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote:
> > Almost certainly, hasElaborateCopyConstructor should be updated
> > to test for both postblit constructors and copy constructors,
> > since its pu
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
That would be slower, and std.algorithm generally disallows easy
but slow functions.
In Java, you can sort a linked list. In D, sort requires an
On Saturday, 1 June 2019 at 07:46:40 UTC, Jonathan M Davis wrote:
For the most part though, you don't declare your own version
identifiers. It sometimes makes sense, but usually, version
identifiers are used for versioning code based on the platform
or architecture that it's compiled on. They'r
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
This will reduce complexity which will attract more people to
this language.
Easy languages have great mass appeal as has been shown with
Ruby
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
It could be done pretty easily, but you will have to learn what
template arguments are eventually anyway. You'll see this pattern
all over, like `
On Sunday, 2 June 2019 at 15:55:46 UTC, Paul Backus wrote:
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic
question. Thanks for your insight.
map and filter are templates in D, and !(...) is D's syntax for
passing arguments to templates
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic question.
Thanks for your insight.
To know more about D you should take the time to do the D tour
[1] which provides you with general knowledge of most of D's
functionalities and vocabular
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic question.
Thanks for your insight.
map and filter are templates in D, and !(...) is D's syntax for
passing arguments to templates:
map!(x => x*x)([1, 2, 3, 4, 5])
^ ^
|
I have recently started using Dlang, hence this basic question.
Thanks for your insight.
On Sunday, 2 June 2019 at 14:44:47 UTC, H. S. Teoh wrote:
On Sun, Jun 02, 2019 at 02:32:16PM +, Paul Backus via
Digitalmars-d-learn wrote: [...]
If std.v2 ever materializes, we'll have an opportunity to fix
papercuts like this. Until then, my preferred workaround is to
use a renaming import
On Sun, Jun 02, 2019 at 02:32:16PM +, Paul Backus via Digitalmars-d-learn
wrote:
[...]
> If std.v2 ever materializes, we'll have an opportunity to fix
> papercuts like this. Until then, my preferred workaround is to use a
> renaming import:
>
> import std.traits: hasNontrivialCopy = hasElabor
On Sunday, 2 June 2019 at 07:55:27 UTC, Amex wrote:
A.B
If A is null, crash.
A?.B : writeln("HAHA");
No crash, ignored, equivalent to
if (A is null) writeln("HAHA"); else A.B;
The "optional" package on dub [1] has a .dispatch method that
does this:
auto d = some(A());
// Dispatc
On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote:
Almost certainly, hasElaborateCopyConstructor should be updated
to test for both postblit constructors and copy constructors,
since its purpose is to test for whether the type has a
user-defined copying function [...] Whether
hasE
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote:
Just base64 decode the PEM data (without the ) and feed it
to RSA.this(ubyte[] publicKey). Ought to be that simple.
I assume the same should apply with private key and private key
constructor (along with a random password of c
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote:
Just base64 decode the PEM data (without the ) and feed it
to RSA.this(ubyte[] publicKey). Ought to be that simple.
That's logic of SSL? Okay, I'll try that first.
Ah, fair enough.
On Saturday, 1 June 2019 at 07:46:40 UTC, Jonathan M Davis wrote:
Like static ifs, version statements are completely a
compile-time construct and having nothing to do with runtime
beyond how they affect the code that's generated.
...
- Jonathan M Davis
Thanks for taking the time.
That's it
On 02.06.19 04:22, David Zhang wrote:
On Saturday, 1 June 2019 at 13:00:50 UTC, ag0aep6g wrote:
How is setting/replacing different from modifying?
e.g.:
S s;
this() { s = ...; }
update(S s) { this.s = s; }
mod(int i) { s.i = i; } // illegal
Kinda like how strings can
A.B
If A is null, crash.
A?.B : writeln("HAHA");
No crash, ignored, equivalent to
if (A is null) writeln("HAHA"); else A.B;
On Saturday, June 1, 2019 5:29:08 PM MDT SrMordred via Digitalmars-d-learn
wrote:
> On Saturday, 1 June 2019 at 21:39:33 UTC, SImen Kjærås wrote:
> > On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote:
> >
> > hasElaborateCopyConstructor checks if the type defines a
> > postblit[0].
>
> Y
32 matches
Mail list logo