#1622 with statement

jessevdam Thu 25 Aug 2011

javascript has a nice with statement, of which I think it can also be easily implemented into fantom.

with(someObj)
{ //a simple it block  
  field1 = "somevalue"
  field2 = "someval2"
  it.field3 = "someval3"
}

peter Thu 25 Aug 2011

Isn't this the same as sys::Obj.with ?

i.e.

someObj.with
{
  field1 = "somevalue"
  ...
}

jessevdam Thu 25 Aug 2011

ah thanks sorry I missed that one

Login or Signup to reply.