www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - the return value of "with"

reply Shawn Liu <Shawn_member pathlink.com> writes:
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
parent David Medlock <noone nowhere.com> writes:
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 setData
 
 
Actually 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