On Wednesday, 11 March 2015 at 00:00:39 UTC, dnoob wrote:
Hello,
I am parsing some text and I have the following;
string text = "some very long text";
foreach(line; splitter(text, [13, 10]))
{
foreach(record; splitter(line, '*'))
{
foreach(field; splitter(record
On Wednesday, 11 March 2015 at 04:10:51 UTC, Taylor Hillegeist
wrote:
On Wednesday, 11 March 2015 at 03:55:21 UTC, Rikki Cattermole
wrote:
On 11/03/2015 4:16 p.m., Taylor Hillegeist wrote:
So I found http://ec-lang.org/ it seems alot like D, But it
has a
company backing it. It just seems inter
I'm trying to define a boilerplate mixin for class constructor to generate
code such as:
this(T1 a1, T2 a2){this.a1=a1; this.a2=a2;}
The following works, but fails if one field is from a superclass, with an
error such as:
template instance GenThis!(b, a) GenThis!(b, a) is nested in both B and A.
On Wednesday, 11 March 2015 at 03:55:21 UTC, Rikki Cattermole
wrote:
On 11/03/2015 4:16 p.m., Taylor Hillegeist wrote:
So I found http://ec-lang.org/ it seems alot like D, But it
has a
company backing it. It just seems interesting.
There is almost no meta programming support. Let alone CTFE.
On 11/03/2015 4:16 p.m., Taylor Hillegeist wrote:
So I found http://ec-lang.org/ it seems alot like D, But it has a
company backing it. It just seems interesting.
There is almost no meta programming support. Let alone CTFE.
And no generics in the form of e.g. Java's is not the same as D's
meta
So I found http://ec-lang.org/ it seems alot like D, But it has a
company backing it. It just seems interesting.
https://issues.dlang.org/show_bug.cgi?id=14275
Looks like bug, investigating.
On Tuesday, 10 March 2015 at 22:37:29 UTC, Ali Çehreli wrote:
On 03/10/2015 03:16 PM, Meta wrote:
> Just add a condition variable.
>
> import std.stdio;
> import std.algorithm;
> import std.parallelism;
>
> void main() {
>
> int b = 2;
>
> auto a = [1, 2, 2, 3];
>
> if (find(a, b)
Hello,
I am parsing some text and I have the following;
string text = "some very long text";
foreach(line; splitter(text, [13, 10]))
{
foreach(record; splitter(line, '*'))
{
foreach(field; splitter(record, '='))
{
foreach(v
On Tue, 10 Mar 2015 23:17:01 +, Namespace wrote:
> Is this intended?
i doubt so. `struct Foo` is definitely `public`, so there shouldn't be
any problems with access rights.
signature.asc
Description: PGP signature
On Tuesday, 10 March 2015 at 17:42:37 UTC, Ali Çehreli wrote:
You are right again. :) However, putting the lazy-taking
function "outside" the whole expression makes it visible right
away, making easy for me to realize that the execution order
may be different from common chains.
"lazy" aka "n
I'm unsure, but I think this code should work:
module A.B.Foo;
import core.stdc.stdio : printf;
struct Foo {
package(A) void foo() {
printf("Hallo\n");
}
}
package(A) void bar() {
printf("Hallo\n");
}
and
module A.C.Bar;
import A.B.Foo;
void main() {
Foo f
On Tuesday, 10 March 2015 at 22:43:08 UTC, Ali Çehreli wrote:
The following is the program that does NOT use taskPool.map. I
am also changing the name of a variable because the local
'chunks' looked like std.range.chunks.
import std.stdio;
import std.algorithm;
import std.parallelism;
import s
On 03/10/2015 03:34 PM, Ali Çehreli wrote:
> It is possible by accessing the actual range by chunks:
Sorry, I posted a jumbled program that does not compile.
The following is the program that does NOT use taskPool.map. I am also
changing the name of a variable because the local 'chunks' looked
On Tuesday, 10 March 2015 at 22:34:34 UTC, Ali Çehreli wrote:
It is possible by accessing the actual range by chunks:
import std.stdio;
import std.algorithm;
import std.parallelism;
import std.range;
import std.conv;
void main()
{
const size_t elementCount = 895640;
int[] a = iota(elem
On 03/10/2015 03:16 PM, Meta wrote:
> Just add a condition variable.
>
> import std.stdio;
> import std.algorithm;
> import std.parallelism;
>
> void main() {
>
> int b = 2;
>
> auto a = [1, 2, 2, 3];
>
> if (find(a, b).length != 0)
> writeln("Yes_");
>
> auto found =
On 03/10/2015 01:41 PM, Dennis Ritchie wrote:
Hi.
How to parallelize a large array to check for the presence of an element
matching the value with the data?
std.stdio;
std.algorithm;
std.parallelism;
void main() {
int[] a = new int[100];
foreach (i, ref elem; a)
elem =
On Tuesday, 10 March 2015 at 22:11:57 UTC, Dennis Ritchie wrote:
On Tuesday, 10 March 2015 at 21:27:42 UTC, Dennis Ritchie wrote:
Thanks.
No, it does not suit me, because of the parallel array in a
foreach loop there is no break.
import std.stdio;
import std.algorithm;
import std.parallelis
On Tuesday, 10 March 2015 at 22:11:57 UTC, Dennis Ritchie wrote:
No, it does not suit me, because of the parallel array in a
foreach loop there is no break.
I already understood everything: found = true;
On Tuesday, 10 March 2015 at 21:27:42 UTC, Dennis Ritchie wrote:
Thanks.
No, it does not suit me, because of the parallel array in a
foreach loop there is no break.
import std.stdio;
import std.algorithm;
import std.parallelism;
void main() {
int b = 2;
auto a = [1, 2, 2,
On Tuesday, 10 March 2015 at 22:00:29 UTC, safety0ff wrote:
On Tuesday, 10 March 2015 at 21:56:39 UTC, Xinok wrote:
I'm inclined to believe this is a bug.
https://issues.dlang.org/show_bug.cgi?id=11048
Thanks for the link, and I didn't mean to post this in D.learn.
>.<
On Tuesday, 10 March 2015 at 21:56:39 UTC, Xinok wrote:
I'm inclined to believe this is a bug.
https://issues.dlang.org/show_bug.cgi?id=11048
The following code fails to compile because unpredictableSeed is
impure:
void main()
{
foreach(i; 0..10) writeln(pureRandom);
}
pure uint pureRandom()
{
auto r = Random(unpredictableSeed);
return r.front;
}
However, make unpredictableSeed a defau
On Tuesday, 10 March 2015 at 19:11:22 UTC, André wrote:
Hi,
in this minified example I try to expand the variadic parmaters
of
foo to bar:
import std.typecons;
void foo(T ...)(T args)
{
bar(args.expand);
}
void bar(int i, string s){}
void main()
{
foo(1, "a");
}
I got the syn
On Tuesday, 10 March 2015 at 21:15:17 UTC, safety0ff wrote:
On Tuesday, 10 March 2015 at 20:41:14 UTC, Dennis Ritchie wrote:
Hi.
How to parallelize a large array to check for the presence of
an element matching the value with the data?
Here's a simple method (warning: has pitfalls):
import s
On Tuesday, 10 March 2015 at 20:41:14 UTC, Dennis Ritchie wrote:
Hi.
How to parallelize a large array to check for the presence of
an element matching the value with the data?
Here's a simple method (warning: has pitfalls):
import std.stdio;
import std.parallelism;
void main()
{
int[] a
On Tuesday, 10 March 2015 at 20:41:14 UTC, Dennis Ritchie wrote:
Hi.
How to parallelize a large array to check for the presence of
an element matching the value with the data?
std.stdio;
std.algorithm;
std.parallelism;
You forgot a couple "import"s here.
void main() {
int[] a = n
Hi.
How to parallelize a large array to check for the presence of an
element matching the value with the data?
std.stdio;
std.algorithm;
std.parallelism;
void main() {
int[] a = new int[100];
foreach (i, ref elem; a)
elem = i;
/*if (find(parallel(
On 03/10/2015 11:05 AM, Ali Çehreli wrote:
In other words, the result of the implicit conversion is an rvalue
Steven Schveighoffer says there is no rvalue in this case; "an enum is a
derivative":
https://issues.dlang.org/show_bug.cgi?id=14269#c14
Ali
too many trees in front of my eyes.
Thanks for the answers.
Kind regards
André
On Tuesday, 10 March 2015 at 19:16:23 UTC, Adam D. Ruppe wrote:
On Tuesday, 10 March 2015 at 19:11:22 UTC, André wrote:
Is there a simple way to get it working?
The simplest: just write `bar(args);` - the variadic
On Tue, 10 Mar 2015 19:11:21 +, André wrote:
> Hi,
>
> in this minified example I try to expand the variadic parmaters of foo
> to bar:
>
> import std.typecons;
>
> void foo(T ...)(T args)
> {
> bar(args.expand);
> }
>
> void bar(int i, string s){}
>
> void main()
> {
> foo(1
On Tuesday, 10 March 2015 at 19:11:22 UTC, André wrote:
Is there a simple way to get it working?
The simplest: just write `bar(args);` - the variadic arguments
will automatically expand.
Hi,
in this minified example I try to expand the variadic parmaters of
foo to bar:
import std.typecons;
void foo(T ...)(T args)
{
bar(args.expand);
}
void bar(int i, string s){}
void main()
{
foo(1, "a");
}
I got the syntax error: no property 'expand' for type '(int,
string)'
I
On 03/10/2015 01:37 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> However, the code in question still shouldn't compile because while a
Bits
> variable may be implicitly convertible to ulong, it _isn't_ a ulong,
In other words, the result of the implicit conversion is an rvalue,
creat
On Tuesday, 10 March 2015 at 14:41:00 UTC, Logan Capaldo wrote:
On Monday, 9 March 2015 at 22:15:43 UTC, Ali Çehreli wrote:
You are right. I had the same observation at minute 11:27
below, where I warn against UFCS with assumeWontThrow:
http://www.youtube.com/watch?feature=player_detailpage&v
On Monday, 9 March 2015 at 22:15:43 UTC, Ali Çehreli wrote:
You are right. I had the same observation at minute 11:27
below, where I warn against UFCS with assumeWontThrow:
http://www.youtube.com/watch?feature=player_detailpage&v=oF8K4-bieaw#t=687
Ali
Sorry, which is right? I know ifThrown
On Tuesday, 10 March 2015 at 10:36:21 UTC, ketmar wrote:
On Tue, 10 Mar 2015 10:27:13 +, John Colvin wrote:
struct S {
int a;
this(T)(T v)
{
this = v;
}
void foo(T)(T v) {
import std.conv : to;
a = v.to!
On Monday, 9 March 2015 at 14:25:54 UTC, Michael Robertson wrote:
On Friday, 6 March 2015 at 02:41:19 UTC, Bennet wrote:
I wrote a custom OBJ file importer which worked fairly well
however was not robust enough to support everything. I've
decided to give AssImp a shot. I followed some tutorials
On Tuesday, 10 March 2015 at 10:27:14 UTC, John Colvin wrote:
struct S
{
int a;
this(T)(T v)
{
this = v;
}
void foo(T)(T v)
{
import std.conv : to;
a = v.to!int;
}
alias foo this;
}
vo
On Tue, 10 Mar 2015 10:27:13 +, John Colvin wrote:
> struct S {
> int a;
> this(T)(T v)
> {
> this = v;
> }
> void foo(T)(T v) {
> import std.conv : to;
> a = v.to!int;
> }
> alias foo this;
> }
>
> void bar(S
struct S
{
int a;
this(T)(T v)
{
this = v;
}
void foo(T)(T v)
{
import std.conv : to;
a = v.to!int;
}
alias foo this;
}
void bar(S s){}
void main()
{
S s0;
s0 = "3"; //
Thanks a lot!
Kind regards
André
On Tuesday, 10 March 2015 at 09:25:02 UTC, Meta wrote:
On Tuesday, 10 March 2015 at 08:37:46 UTC, Jonathan M Davis
wrote:
It's the base type that isn't implicitly convertible to the
enum type.
Err, yes. I had that the wrong way around. Anyway, I filed an
is
Thanks a lot!
Kind regards
André
On Tuesday, 10 March 2015 at 08:40:28 UTC, Jonathan M Davis wrote:
On Tuesday, March 10, 2015 07:24:52 Andre via
Digitalmars-d-learn wrote:
Hi,
with the new beta I get the warning I should use
std.algorithm.sort instead the .sort property. I thought the
std.al
On Tuesday, 10 March 2015 at 08:37:46 UTC, Jonathan M Davis wrote:
It's the base type that isn't implicitly convertible to the
enum type.
Err, yes. I had that the wrong way around. Anyway, I filed an
issue.
https://issues.dlang.org/show_bug.cgi?id=14269
On Tue, 10 Mar 2015 01:31:39 -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> it's the sort of thing that could easily be decided and then not
> actually happen for ages (e.g. it was decided years ago that delete
> would be deprecated, but it still isn't).
sometimes i'm irritated by this,
On Sunday, 8 March 2015 at 21:41:44 UTC, FG wrote:
Except that with this solution you will confuse empty strings
with ints.
The idea was to only make it memory-safe without union.
On Tuesday, March 10, 2015 07:24:52 Andre via Digitalmars-d-learn wrote:
> Hi,
>
> with the new beta I get the warning I should use
> std.algorithm.sort instead the .sort property. I thought the
> std.algorithm.sort method is used in this example?
>
> void main()
> {
> import std.algorithm: sort,
On Tuesday, March 10, 2015 08:19:27 Meta via Digitalmars-d-learn wrote:
> On Tuesday, 10 March 2015 at 07:04:48 UTC, Andre wrote:
> > Hi,
> >
> > following coding raises a compiler error with the beta of 2.067.
> > Is this error intended or not?
> > It is working if I change first line of main to:
On Monday, March 09, 2015 22:29:23 Meta via Digitalmars-d-learn wrote:
> On Monday, 9 March 2015 at 22:00:46 UTC, ketmar wrote:
> > i remember that deprecation was rejected. maybe this is false
> > memory,
> > though.
> >
> > btw, there are legit uses of comma, in c-style `for`, for
> > example. th
On Tuesday, 10 March 2015 at 07:04:48 UTC, Andre wrote:
Hi,
following coding raises a compiler error with the beta of 2.067.
Is this error intended or not?
It is working if I change first line of main to: ulong bits;
enum Bits: ulong
{
none = 0
}
bool hasBit(ref ulong rBits, ulong rBit
.array
.sort
buildin arrays have a .sort-property that is called.
Hi,
with the new beta I get the warning I should use
std.algorithm.sort instead the .sort property. I thought the
std.algorithm.sort method is used in this example?
void main()
{
import std.algorithm: sort, uniq, map;
import std.array: array;
string[] a
Hi,
following coding raises a compiler error with the beta of 2.067.
Is this error intended or not?
It is working if I change first line of main to: ulong bits;
enum Bits: ulong
{
none = 0
}
bool hasBit(ref ulong rBits, ulong rBit)
{
return cast(bool)(rBits & rBit);
}
void main
54 matches
Mail list logo