Make dur a property?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Wed Jan 23 11:29:39 PST 2013


On Wed, 23 Jan 2013 23:03:32 +0400
Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:

> 23-Jan-2013 22:57, Nick Sabalausky пишет:
> > 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
> 
> This is a call, arguably bad style
> 
> >      bar; // don't call it
> 
> compile-time error, as statement has no side-effects?
> (and we have this kind of check even now)
> 
> 
> 

int foo() {...}
int delegate() {...} bar;

auto x = foo; // call it
auto y = bar; // don't call it




More information about the Digitalmars-d mailing list