digitalmars.D - the return value of "with"
- Shawn Liu (8/8) Nov 28 2005 Can the following statements be valid?
- David Medlock (14/25) Nov 28 2005 Actually I was thinking of asking Walter to make any with statements
Can the following statements be valid? Foo foo; foo.setData( with(new SomeObj(Arguments)) { // some init to SomeObj } // end of with ); // end of setData
Nov 28 2005
Shawn Liu wrote:Can the following statements be valid? Foo foo; foo.setData( with(new SomeObj(Arguments)) { // some init to SomeObj } // end of with ); // end of setDataActually I was thinking of asking Walter to make any with statements which are passed a null reference to be skipped, as this would simplify the many times we check for null before setting members: a = getResource(); if ( a is null ) return; with(a) { ... lotsa stuff here ... } becomes with( getResource() ) { ..stuff here.. } but that may be 'semantic overloading' taken too far, hehe. -DavidM
Nov 28 2005