January 31, 2012 Re: indent style for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 30/01/2012 02:24, H. S. Teoh wrote:
<snip>
> And I'd love to have my integer set class
> be able to use ∪ and ∩ instead of verbose operations like x.union(y) and
> x.intersection(y).
<snip>
My utility library uses | and &. Think of the possible values of the type you're creating a set of as being like the bits of a number, and then it makes sense.
Stewart.
|
January 31, 2012 Re: indent style for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | On Tue, Jan 31, 2012 at 02:43:57AM +0000, Stewart Gordon wrote: > On 30/01/2012 02:24, H. S. Teoh wrote: > <snip> > >And I'd love to have my integer set class > >be able to use ∪ and ∩ instead of verbose operations like x.union(y) and > >x.intersection(y). > <snip> > > My utility library uses | and &. Think of the possible values of the type you're creating a set of as being like the bits of a number, and then it makes sense. [...] Funny you should mention that; my integer set class represents set members as bits, and set operations are implemented as bitwise operations. :) Still, though, it'd be nice to have actual set notation. But I was only being half-serious. T -- BREAKFAST.COM halted...Cereal Port Not Responding. -- YHL |
January 31, 2012 Re: indent style for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On Sun, 29 Jan 2012 21:20:01 +0100, Timon Gehr wrote: > On 01/29/2012 08:26 PM, Marco Leise wrote: >> Am 29.01.2012, 16:23 Uhr, schrieb Trass3r <un@known.com>: >> >>>> Am I mistaken? If no, am I missing some major spaces advantages? If no, lets use tabs. Perhaps, there is no tool that will convert (convert right, not somehow, see article) tabs<->spaces in D code. >>> >>> There wouldn't be any problem if people were able to use tabs for indentation and spaces for alignment, i.e. in cases like if (cond1 && cond2) >>> >>> But people are dumb and many project leaders "take no risks" and require spaces everywhere instead of doing it properly. >> >> If it cheers you up, I use that style. Once you get used to 'smart tabs' it is like using spaces. Just now and then I catch myself using tabs on the alignment for local variable comments: >> >> int foo; // does something (tabs) >> int bar; // something else (spaces) >> >> Then again "tabs for indentation only" is a simple rule, that would have turned the tabs into spaces in this example - if editors supported it. > > *Real* editors can be configured to support smart tabs. So a butterfly. -- Yep, I'm afraid that I have a blog : zardoz.es |
Copyright © 1999-2021 by the D Language Foundation