On Monday, 31 October 2016 at 04:35:35 UTC, WhatMeWorry wrote:
First, are there any other languages that has this feature?
The few I know, certainly don't.
I've seen hacks to do the same thing in C++. They're not pretty,
though.
And how would you compare and contrast these this(s) with
I am fascinated with D's module static this.
I have shamelessly stolen Ali's code directly from his book.
module cat;
static this() {
// ... the initial operations of the module ...
}
static ~this() {
// ... the final operations of the module ...
}
First, are there any other languages that
On 10/30/2016 05:14 PM, Lodovico Giaretta via Digitalmars-d-learn wrote:
On Monday, 31 October 2016 at 00:08:59 UTC, Charles Hixson wrote:
So now I removed the repository version of dmd and dub, downloaded
DMD64 D Compiler v2.072.0-b2, used dkpg to install it, and appear to
get the same
On Sunday, 30 October 2016 at 23:47:54 UTC, Ali Çehreli wrote:
On 10/30/2016 01:50 PM, Alfred Newman wrote:
[...]
Here is something along the lines of what others have suggested:
auto parse(R, S)(R range, S separators) {
import std.algorithm : splitter, filter, canFind;
import
On Monday, 31 October 2016 at 00:08:59 UTC, Charles Hixson wrote:
So now I removed the repository version of dmd and dub,
downloaded DMD64 D Compiler v2.072.0-b2, used dkpg to install
it, and appear to get the same errors.
(Well, actually I removed the commenting out of the code, but
it
So now I removed the repository version of dmd and dub, downloaded DMD64
D Compiler v2.072.0-b2, used dkpg to install it, and appear to get the
same errors.
(Well, actually I removed the commenting out of the code, but it
compiles and runs properly with ldc2.)
On 10/30/2016 11:02 AM,
While working on a solution for Alfred Newman's thread, I came up with
the following interim solution, which compiled but failed:
auto parse(R, S)(R range, S separators) {
import std.algorithm : splitter, filter, canFind;
import std.range : empty;
static bool pred(E, S)(E e, S s) {
Just as a test I tried it with ldc, and, as expected, there wasn't any
problem.
On 10/30/2016 11:02 AM, Charles Hixson via Digitalmars-d-learn wrote:
dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
on debian testing.
dub is installed
On 10/30/2016 01:50 PM, Alfred Newman wrote:
Hello,
I'm migrating some Python code to D, but I stuck at a dead end...
Sorry to provide some .py lines over here, but I got some doubts about
the best (fastest) way to do that in D.
Executing the function parsertoken("_My input.string", " _,.",
On 10/30/2016 04:03 PM, Lodovico Giaretta via Digitalmars-d-learn wrote:
On Sunday, 30 October 2016 at 18:02:28 UTC, Charles Hixson wrote:
dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
on debian testing.
dub is installed via
On Sunday, 30 October 2016 at 20:50:47 UTC, Alfred Newman wrote:
Hello,
I'm migrating some Python code to D, but I stuck at a dead
end...
Sorry to provide some .py lines over here, but I got some
doubts about the best (fastest) way to do that in D.
The "splitter" generic function sounds
On Sunday, 30 October 2016 at 20:50:47 UTC, Alfred Newman wrote:
Hello,
I'm migrating some Python code to D, but I stuck at a dead
end...
Sorry to provide some .py lines over here, but I got some
doubts about the best (fastest) way to do that in D.
Executing the function parsertoken("_My
On Sunday, 30 October 2016 at 18:02:28 UTC, Charles Hixson wrote:
dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
on debian testing.
dub is installed via apt-get.
Should I revert to an earlier version? Or what?
The program:
import
Hello,
I'm migrating some Python code to D, but I stuck at a dead end...
Sorry to provide some .py lines over here, but I got some doubts
about the best (fastest) way to do that in D.
Executing the function parsertoken("_My input.string", " _,.",
2) will result "input".
On Sunday, 30 October 2016 at 18:26:54 UTC, arturg wrote:
you cant mutate capacity directly because its only a getter but
you could use arr.reserve(someVal);
Thx!
On Sunday, 30 October 2016 at 18:10:09 UTC, Nordlöw wrote:
Is there a recommended way to create a builtin D array with a
given capacity?
I'm aware of the `.capacity` property.
Is it ok to mutate it?
you cant mutate capacity directly because its only a getter but
you could use
On Sunday, 30 October 2016 at 18:10:09 UTC, Nordlöw wrote:
Is it ok to mutate it?
I just checked. It is not.
Is there a recommended way to create a builtin D array with a
given capacity?
I'm aware of the `.capacity` property.
Is it ok to mutate it?
dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
on debian testing.
dub is installed via apt-get.
Should I revert to an earlier version? Or what?
The program:
importstd.stdio;
voidmain()
{//int[]t1;
//t1~=
On Wednesday, 26 October 2016 at 19:03:45 UTC, Ali Çehreli wrote:
On 10/26/2016 08:03 AM, Paolo Invernizzi wrote:
[...]
If you mean D's AAs, then that is already implemented:
void main() {
auto a = [ "hello" : 1, "world" : 2 ];
auto b = [ "world" : 2, "hello" : 1 ];
assert(a ==
20 matches
Mail list logo