March 13, 2004 Re: with/struct | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sigbjørn Lund Olsen | Sigbjørn Lund Olsen wrote: > >> I like "with". I go out of my way to use it. I'd use it for structs, too, if the compiler allowed it. > > > Never used with. What's it for? It facilitates referring to the same object repeatedly. I'll quote another's work to make my point: [Without "with"] fileSelector = new Button (this) fileSelector.caption ("&File Selector"); fileSelector.onClick.add (&fileSelectorClick); fileSelector.alignLeft (true); fileSelector.gridAddRow (0, r); fileSelector.sticky ("<>^"); [With "with"] with (fileSelector = new Button (this)) { caption ("&File Selector"); onClick.add (&fileSelectorClick); alignLeft (true); gridAddRow (0, r); sticky ("<>^"); } That explains it for me... [...] > Cheers, > Sigbjørn Lund Olsen -- Justin http://jcc_7.tripod.com/d/ |
March 13, 2004 Re: with/struct | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | Well, the conclusion is, nothing good come out of this discussion. Nobody agrees with me and you guys now put me closer to the radial idiot mark :) I guess I sound much smarter if I keep my mounth close ;) it's also interesting that nobody complains on dig's API. It's so strange! probably it's a windows thing and I'm just not used to it. Ant |
Copyright © 1999-2021 by the D Language Foundation