15.10.2010 19:43, Andrej Mitrovic wrote:
Related: A nice alternative for quickly using anonymous objects is using the with statement, e.g.:with (new Foo) { foo(); // ... more code } And after the with block the object doesn't exist anymore. Or you could bind it to some internal reference and keep it there,
I must ask, how can this binding be achieved?
which wouldn't destroy it after exiting the with block. Many of the DFL GUI library code samples work this way, and it's quite a nice syntax imo.
