January 10, 2002 Was : New Operator Idea: *== Now : Cut Operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | > give up so easy. =) We tried to convince him to change it already once, but... well you can see the results =) I will try to convince his with filosophy. If Hegel could write a compiler they could say : write a efficient, simple and correct version of what already is good ? And now look at this sequence : & -> && : For and bitwise you have similar and logical | -> || : For or bitwise you have similar or logical ! -> !! : For not bitwise you have similar not logical And "bingo" the "~" will &*$@%%ßÏ. The question here is good have less characters as part of language. The first example is the italians and russians keyboards. And this character change position in any different keyboard and his position is not so good... > Concatenation is already defined by ~. Large amount of code has already being written using this style. Also, Walter seems Sed or M4 this problem nicely "Pavel Minayev" <evilone@omen.ru> escreveu na mensagem news:a1hqg6$1g9h$1@digitaldaemon.com... > "Juarez Rudsatz" <juarez@correio.com> wrote in message news:a1ho6p$1erl$1@digitaldaemon.com... > > > I don't understand yet the difference between '~' and '!'. > > uint a = 1; > ~a == 0b11111111111111111111111111111110; > !a == 0; > > > The concatenation could use another symbol. There are no tradition on '~=' > . > > Concatenation is already defined by ~. Large amount of code has > already being written using this style. Also, Walter seems > to like his invention - personally, me too, now - and won't > give up so easy. =) We tried to convince him to change it > already once, but... well you can see the results =) > > > |
January 10, 2002 Re: New Operator Idea: *== Now : Cut Operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | That *almost* works, but since ! is an unary operator, it would preclude the possibility of writing !!x to mean "convert x to boolean". This is often useful in C++ since you can explicitly cast something to bool indirectly through the ! operator which is much shorter to say if (!!p) than it is to say if(bool(p)) etc to get around compiler warnings (I always leave most of them on). So admittedly it's not anything crucial that I couldn't do without. I bet that's something to do with why K&R decided against it for C. I don't think a "large amount of code has already been written using this style" is a worthy excuse not to make a change since there are only alpha compilers, nobody but a few of the people here (Walter!) has a huge investment in D source. I don't think the D compiler is yet written in D, is it? ;) If a change is for the best, it's probably worth doing. However there's a large amount of C/C++ code written using that style, that will need lots of search-and-replacing or manual translating. Or I wonder if he meant he personally is too used to typing ~ to mean binary not that he couldn't adjust if it were changed? Hmm.... I favor making a strong language. Its resemblance to C is, to me, fortuitous, but not critical. Sean "Juarez Rudsatz" <juarez@correio.com> wrote in message news:a1is6p$24og$1@digitaldaemon.com... > > > give up so easy. =) We tried to convince him to change it already once, but... well you can see the results =) > > I will try to convince his with filosophy. If Hegel could write a compiler they could say : write a efficient, simple and correct version of what already is good ? > > And now look at this sequence : > > & -> && : For and bitwise you have similar and logical > | -> || : For or bitwise you have similar or logical > ! -> !! : For not bitwise you have similar not logical > > And "bingo" the "~" will &*$@%%ßÏ. > > The question here is good have less characters as part of language. The first example is the italians and russians keyboards. And this character > change position in any different keyboard and his position is not so good... > > > Concatenation is already defined by ~. Large amount of code has already being written using this style. Also, Walter seems > > Sed or M4 this problem nicely |
January 11, 2002 Re: New Operator Idea: *== (array value comparison operator) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | Juarez Rudsatz a écrit :
> I don't understand yet the difference between '~' and '!'.
> If they have same meaning, why not remove '~' from D spec ?
> The concatenation could use another symbol. There are no tradition on '~=' .
>
In C++:
!(true) = false = 0
~(true) = 0xfffffffe
Roland
|
Copyright © 1999-2021 by the D Language Foundation