Make dur a property?
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Wed Jan 23 10:57:32 PST 2013
On Wed, 23 Jan 2013 19:40:02 +0100
"Adam D. Ruppe" <destructionator at gmail.com> wrote:
> On Wednesday, 23 January 2013 at 18:24:22 UTC, Johannes Pfau
> wrote:
> > This sounds OK, but you can still run into the callable issue
> > if a normal function returns a callable.
>
> I don't think so because delegates require the parens to call
> anyway, and so do opCall objects (without the parens, it is just
> a reference to it).
>
So you want it to work like this?:
void foo() {...}
void delegate() {...} bar;
foo; // call it
bar; // don't call it
Yuck.
It's already bad enough that we have this goofy mess:
int func() {...}
void foo(int a) {...}
void bar(int delegate() dg) {...}
template baz(alias a) {...}
foo(func); // Calls func
bar(&func); // Doesn't call func, just refers to it
baz!(func); // Doesn't call func, just refers to it
baz!(&func); // Error
WTF?
More information about the Digitalmars-d
mailing list