Re: UFCS doesn't work in some cases

2014-09-10 Thread Danyal Zia via Digitalmars-d-learn
On Tuesday, 9 September 2014 at 18:46:31 UTC, ketmar via Digitalmars-d-learn wrote: UFCS is not working for nested functions. this is not a bug, it was designed this way. the same for 'with', i believe. Apparently it is a bug that UFCS doesn't work with 'with' statement.

Re: UFCS doesn't work in some cases

2014-09-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Sep 2014 13:58:18 + Danyal Zia via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Apparently it is a bug that UFCS doesn't work with 'with' statement. my fault, i thought that it shouldn't. i'm still not Guru. too bad, will work. ;-) signature.asc Description:

UFCS doesn't work in some cases

2014-09-09 Thread Danyal Zia via Digitalmars-d-learn
Hi, I don't know if this has been mentioned before, but I found two strange cases where UFCS doesn't work. Case # 1: When the functions for UFCS are defined inside main scope class Rect { int x = 20; int y = 20; } void main() { import std.stdio : writeln; int

Re: UFCS doesn't work in some cases

2014-09-09 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Sep 2014 17:58:14 + Danyal Zia via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Case # 1: When the functions for UFCS are defined inside main scope UFCS is not working for nested functions. this is not a bug, it was designed this way. the same for 'with', i

Re: UFCS doesn't work in some cases

2014-09-09 Thread Mathias LANG via Digitalmars-d-learn
On Tuesday, 9 September 2014 at 17:58:16 UTC, Danyal Zia wrote: As far as I know, UFCS are designed to make it easy to extend the class for specific applications, however, without the ability to use UFCS for those cases, it limits its usefulness. Are these oversights/bugs? Or is their any