struct S
{
R opDispatch(string name, R, T...)(T parameters)
{
return R.init;
}
}
void main()
{
auto s = S();
auto r0 = s.foo!("foo", int)("hello");// does not
compile
auto r1 = s.bar!("bar", double)(100);
static assert (is (typeof(r0) == int));
stat
On 11/02/2013 03:41 PM, TheFlyingFiddle wrote:
> The problem i am faced with is that i need a way to figure out the
> return value of opDispatch by the invokation call.
If I now understand you correctly, what initially confused my was
"invocation call." Because "invocation" makes me think about
Can you provide a little more complete code please. Otherwise,
the return type is available to typeof:
import std.stdio;
struct S
{
auto opDispatch(string name, T...)(T parameters)
{
writef("S.%s:", name);
foreach (parameter; parameters) {
writef(" %s", param
On 11/02/2013 03:41 PM, TheFlyingFiddle wrote:
I'm currently working on a IReflectionable interface
Currently the usage is as follows
class Foo : IReflectionable
{
mixin ReflectionImpl;
void bar(int a) { /* do something */ }
int baz(string a) { return a.length; }
}
unittest
{
IR
If AAs don't have any hidden penalty, like causing the garbage
collector to thrash, then that's the way to go
Any time you insert an item into an AA it might allocate. So it
might cause a garbage collection cycle. I'm unsure what you mean
by "causing the garbage collector to trash" memory leea
On 11/02/2013 05:16 PM, TheFlyingFiddle wrote:
On Saturday, 2 November 2013 at 23:58:07 UTC, Charles Hixson wrote:
On 11/02/2013 04:49 PM, TheFlyingFiddle wrote:
What are you going to be using the collection for?
It's basically a lookup table used for translating external codes
(essentially
On Saturday, 2 November 2013 at 23:58:07 UTC, Charles Hixson
wrote:
On 11/02/2013 04:49 PM, TheFlyingFiddle wrote:
What are you going to be using the collection for?
It's basically a lookup table used for translating external
codes (essentially arbitrary) into id#s used internally. There
ar
On 11/02/2013 04:49 PM, TheFlyingFiddle wrote:
What are you going to be using the collection for?
It's basically a lookup table used for translating external codes
(essentially arbitrary) into id#s used internally. There are LOTS of
id#s that don't correspond to ANY external code, and nearly
What are you going to be using the collection for?
On Friday, 1 November 2013 at 20:08:15 UTC, Philippe Sigaud wrote:
What I'm trying to explain is that reduce takes two arguments:
the growing
value and the current front. In your case, the current front is
indeed a
2-tuple, but that's an unrelated issue.
You're trying to get:
reduce!( (firstE
I'm contemplating an associative array that will eventually grow to be
an estimated 64KB in size, assuming it's about half full. It would then
be holding around 90,000 entries. Is this reasonable, or should I go
with a sorted array, and do binary searches? I estimate that binary
searches wou
On Saturday, 2 November 2013 at 23:01:51 UTC, H. S. Teoh wrote:
On Sat, Nov 02, 2013 at 09:45:26PM +0100, TheFlyingFiddle wrote:
I'm basically wondering why the __traits keyword looks so
horrible.
Because the intention is that users would not use it directly,
but via
nicer standard library w
On Sat, Nov 02, 2013 at 09:45:26PM +0100, TheFlyingFiddle wrote:
> I'm basically wondering why the __traits keyword looks so horrible.
Because the intention is that users would not use it directly, but via
nicer standard library wrappers (e.g. std.traits in Phobos).
T
--
I don't trust computer
I'm currently working on a IReflectionable interface
Currently the usage is as follows
class Foo : IReflectionable
{
mixin ReflectionImpl;
void bar(int a) { /* do something */ }
int baz(string a) { return a.length; }
}
unittest
{
IReflectionable foo = new Foo();
alias void delega
On Saturday, 2 November 2013 at 22:01:11 UTC, Namespace wrote:
That looks beautiful to you?
In my ideal world, object.d would alias the __ versions back to
the regular ones. (Really, it is int, long, etc. that I'd do like
this, just like string. for, if, etc. are fine the way they are.)
The
On Saturday, 2 November 2013 at 22:02:51 UTC, Maxim Fomin wrote:
Statement that in D __identifiers are reserved is dubious as
nothing stops users from defining them
Yeah, but still, you aren't supposed to do it so you can't really
complain when it breaks.
On Saturday, 2 November 2013 at 21:28:46 UTC, Adam D. Ruppe wrote:
On Saturday, 2 November 2013 at 20:45:28 UTC, TheFlyingFiddle
wrote:
I'm basically wondering why the __traits keyword looks so
horrible.
I think it looks beautiful and wished all the keywords used the
leading underscores.
Th
On Saturday, 2 November 2013 at 21:28:46 UTC, Adam D. Ruppe wrote:
On Saturday, 2 November 2013 at 20:45:28 UTC, TheFlyingFiddle
wrote:
I'm basically wondering why the __traits keyword looks so
horrible.
I think it looks beautiful and wished all the keywords used the
leading underscores.
Th
Thanks for the comprehensive answer.
On Saturday, 2 November 2013 at 20:45:28 UTC, TheFlyingFiddle
wrote:
I'm basically wondering why the __traits keyword looks so
horrible.
I think it looks beautiful and wished all the keywords used the
leading underscores.
The reason is that the __keywords are reserved, so they don't
conflic
(TL;DR: when to avoid enum?)
From the dlang.org page on enums;
Enum declarations are used to define a group of constants. They
come in these forms:
Named enums, which have an EnumTag.
Anonymous enums, which do not have an EnumTag.
Manifest constants.
Quoth Dmitry Olshansky in my thread on ct
I'm basically wondering why the __traits keyword looks so
horrible.
On 2013-11-01 16:47, Colin Grogan wrote:
I have a project I may need to write that is pretty performance
intensive, but also needs to be quite customiseable.
We previously had this done with Perl, and the customising came from
adding functions to a file and the main script would call those
funct
I will respond later with more information. Here is just the quick ones. :)
On 11/02/2013 01:34 AM, Philippe Sigaud wrote:
> Where can I get a view of the internal .ddoc file you used for the macro
> definitions?
They are the ones that end with .ddoc here:
https://code.google.com/p/ddili/sou
On Sat, Nov 2, 2013 at 12:08 AM, Ali Çehreli wrote:
> On 11/01/2013 03:51 PM, Philippe Sigaud wrote:
>
> > What did you use to generate your website, btw?
>
> It is a completely static web site (except the Google translate widget)
> that is produced by ddoc and a couple of Makefiles.
This is s
25 matches
Mail list logo