TDPL says it should work for any type.
http://d.puremagic.com/issues/show_bug.cgi?id=3382
2010/9/1 Nick Sabalausky a...@a.a:
dsimcha dsim...@yahoo.com wrote in message
news:i5jtdn$1g4...@digitalmars.com...
Isn't this a core language feature that's in the spec but is only
currently
Philippe Sigaud philippe.sig...@gmail.com wrote:
I also have a template that gets the list of all members of an aggregate
type (classes, structs and, well, modules, in a way), even the
constructors,
even the overloaded members, separated by type, and list them with their
names and associated
Torarin torar...@gmail.com wrote in message
news:mailman.31.1283345570.858.digitalmar...@puremagic.com...
2010/9/1 Nick Sabalausky a...@a.a:
dsimcha dsim...@yahoo.com wrote in message
news:i5jtdn$1g4...@digitalmars.com...
Isn't this a core language feature that's in the spec but is only
On Wed, Sep 1, 2010 at 20:59, Nick Sabalausky a...@a.a wrote:
Torarin torar...@gmail.com wrote in messageTDPL says it should work
for any type.
http://d.puremagic.com/issues/show_bug.cgi?id=3382
/me squeals with excitement like a schoolgirl
Any type, really? Even the basic built-in types,
It says: If a.fun(b, c, d) is seen but fun is not a member of a's
type, D rewrites that as fun(a, b, c, d) and tries that as well.
So I guess it's possible it won't work with numerical types because
they can never have members.
2010/9/1 Philippe Sigaud philippe.sig...@gmail.com:
On Wed, Sep 1,
On Wed, Sep 1, 2010 at 15:25, Simen kjaeraas simen.kja...@gmail.com wrote:
Philippe Sigaud philippe.sig...@gmail.com wrote:
I also have a template that gets the list of all members of an aggregate
type (classes, structs and, well, modules, in a way), even the
constructors,
even the
On Wed, Sep 1, 2010 at 21:47, Torarin torar...@gmail.com wrote:
It says: If a.fun(b, c, d) is seen but fun is not a member of a's
type, D rewrites that as fun(a, b, c, d) and tries that as well.
So I guess it's possible it won't work with numerical types because
they can never have members.
2010/9/1 Philippe Sigaud philippe.sig...@gmail.com:
I just tried this:
int i;
writeln(i.max); // writes int.max !
So it seems you can access the type properties through a value of that type.
Man, I learnt two new things in two minutes...
Yay, looks pretty good, then! :)
Torarin torar...@gmail.com wrote in message
news:mailman.37.1283370434.858.digitalmar...@puremagic.com...
It says: If a.fun(b, c, d) is seen but fun is not a member of a's
type, D rewrites that as fun(a, b, c, d) and tries that as well.
So I guess it's possible it won't work with numerical
On Wed, Sep 1, 2010 at 22:18, Nick Sabalausky a...@a.a wrote:
Regression(2.020) Array member call syntax can't find matches in current
class
http://d.puremagic.com/issues/show_bug.cgi?id=4525
When I converted some D1 code to D2 recently, I actually had to *remove*
many of my
On 2010-08-31 03:04, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes and and structs. I've started to prototype it
(http://dsource.org/projects/scrapple
On 2010-09-01 14:52, Torarin wrote:
TDPL says it should work for any type.
http://d.puremagic.com/issues/show_bug.cgi?id=3382
2010/9/1 Nick Sabalauskya...@a.a:
dsimchadsim...@yahoo.com wrote in message
news:i5jtdn$1g4...@digitalmars.com...
Isn't this a core language feature that's in the
Jacob Carlborg d...@me.com wrote in message
news:i5mg57$2sh...@digitalmars.com...
On 2010-09-01 14:52, Torarin wrote:
TDPL says it should work for any type.
http://d.puremagic.com/issues/show_bug.cgi?id=3382
2010/9/1 Nick Sabalauskya...@a.a:
dsimchadsim...@yahoo.com wrote in message
Nick Sabalausky:
But I also remember a certain someone (me!...plus some others) saying that
.1 and 1. float literals are completely worthless and in the face of
ambiguity with *useful* things, they need to DIE DIE DIE!!!
See the second part of this (closed) enhancement request of mine :-)
bearophile bearophileh...@lycos.com wrote in message
news:i5mhnk$301...@digitalmars.com...
Nick Sabalausky:
But I also remember a certain someone (me!...plus some others) saying
that
.1 and 1. float literals are completely worthless and in the face of
ambiguity with *useful* things, they
On 2010-08-31 05:17, Andrei Alexandrescu wrote:
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for
Phobos that
would contain meta-implementations of commonly needed boilerplate code
for
mixing into classes and and structs. I've started
On 2010-08-31 05:49, dsimcha wrote:
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos that
would contain meta-implementations of commonly needed boilerplate
On Tue, 31 Aug 2010 19:13:17 +0400, Jacob Carlborg d...@me.com wrote:
On 2010-08-31 05:17, Andrei Alexandrescu wrote:
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for
Phobos that
would contain meta-implementations of commonly needed
dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes and and structs. I've started to prototype it
(http://dsource.org/projects/scrapple/browser/trunk
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article
Instead of std.mixins, perhaps it is better to fold the code with std.typecons
or create new modules as needed (std.pattern?).
I initially thought std.mixins would be a good idea, since it would be a
one-stop
shop for all kinds
dsimcha wrote:
...
My suggestion is to include a mixin for unrolling loops.
I thought about this. Simple loop unrolling doesn't seem like a very useful
optimization on modern hardware because branch prediction and pipelining have
gotten so good. It can still be useful if you also change
Hello dsimcha,
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
article
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for
Phobos that would contain meta-implementations of commonly needed
boilerplate code for mixing
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jiap$rv...@digitalmars.com...
dsimcha wrote:
...
My suggestion is to include a mixin for unrolling loops.
I thought about this. Simple loop unrolling doesn't seem like a very
useful
optimization on modern hardware because
Nick Sabalausky wrote:
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jiap$rv...@digitalmars.com...
dsimcha wrote:
...
My suggestion is to include a mixin for unrolling loops.
I thought about this. Simple loop unrolling doesn't seem like a very
useful
optimization on
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article
Nick Sabalausky wrote:
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jiap$rv...@digitalmars.com...
dsimcha wrote:
...
My suggestion is to include a mixin for unrolling loops.
I thought about this. Simple
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jmlc$13l...@digitalmars.com...
Nick Sabalausky wrote:
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jiap$rv...@digitalmars.com...
dsimcha wrote:
It can still be useful if you also change the loop body a
little, for
dsimcha:
I thought about this. Simple loop unrolling doesn't seem like a very useful
optimization on modern hardware because branch prediction and pipelining have
gotten so good. It can still be useful if you also change the loop body a
little,
for example using multiple accumulators to
Nick Sabalausky wrote:
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jmlc$13l...@digitalmars.com...
Nick Sabalausky wrote:
Lutger lutger.blijdest...@gmail.com wrote in message
news:i5jiap$rv...@digitalmars.com...
dsimcha wrote:
It can still be useful if you also change the
== Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article
std.typecons is full of good stuff. I learnt quite a lot reading it. The Any
code gave many hours of reading, compiling the resulting code in my head, so
to say. Then I went a little mad ;)
My initial suggestion for your OP
Philippe Sigaud wrote:
...
I want this to work or something like it, is it possible?
enum test = [1,2, 3];
foreach(i; 0..test.length) {
pragma(msg, to!string(test[i]) );
}
Well, 0..someEnum is not recognized by the compiler. The workaround is to
create a typetuple of the correct
On Wed, Sep 1, 2010 at 00:05, Lutger lutger.blijdest...@gmail.com wrote:
wtf it works! That's a cool trick / workaround, thanks.
That'd be cool if this worked too:
foreach(i,_; test) // since test is iterable
or even:
foreach(i,_; typeof(test)) // int[3] - consider it as (int,int,int) and
On Tuesday, August 31, 2010 14:49:43 dsimcha wrote:
Isn't this a core language feature that's in the spec but is only currently
implemented for arrays? I thought eventually uniform function call syntax
was coming for classes and structs, too.
There are people who keep asking for it, but as
Lutger:
wtf it works! That's a cool trick / workaround, thanks.
See bug 4085
Bye,
bearophile
dsimcha dsim...@yahoo.com wrote in message
news:i5jtdn$1g4...@digitalmars.com...
Isn't this a core language feature that's in the spec but is only
currently
implemented for arrays? I thought eventually uniform function call syntax
was
coming for classes and structs, too.
I've been
== Quote from Nick Sabalausky (a...@a.a)'s article
dsimcha dsim...@yahoo.com wrote in message
news:i5hkea$2su...@digitalmars.com...
I've been toying for a long time with the idea of a std.mixins for Phobos
that
would contain meta-implementations of commonly needed boilerplate code
dsimcha dsim...@yahoo.com wrote in message
news:i5hkea$2su...@digitalmars.com...
I've been toying for a long time with the idea of a std.mixins for Phobos
that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes and and structs. I've started
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes and and structs. I've started to prototype it
(http://dsource.org/projects/scrapple
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes and and structs. I've started to prototype it
(http://dsource.org/projects/scrapple
dsimcha dsim...@yahoo.com wrote in message
news:i5hs3o$9e...@digitalmars.com...
== Quote from Nick Sabalausky (a...@a.a)'s article
Definitely trace and traceVal/traceValCT from my lib:
http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/util/mixins.d
Every time I work on D
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos
that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 8/30/10 20:04 PDT, dsimcha wrote:
I've been toying for a long time with the idea of a std.mixins for Phobos
that
would contain meta-implementations of commonly needed boilerplate code for
mixing into classes
41 matches
Mail list logo