D - Proposal: overloading of ! and # and $ etc.
- Yan (4/4) Feb 08 2004 I would like to propose a possibility to
- Matthew (4/8) Feb 08 2004 To do what?
- mosfox yandex.ru (17/27) Feb 09 2004 If we have more complicated objects than ints and reals and bools
- Andy Friesen (4/22) Feb 09 2004 eeeeek.
- Yan (4/26) Feb 09 2004 dot(dot(dot(dot(a,dot(b,dot(c,d))),e),f),g) ... %-/
- Andy Friesen (10/21) Feb 09 2004 For one, I've never been a subscriber of the Perlish notion of attaching...
- J Anderson (5/8) Feb 09 2004 C uses allot of symbols with arbitrary meanings too. It's just that
- Andy Friesen (5/14) Feb 09 2004 Right, but I won't get anywhere by suggesting that ! be dropped in
- Mark J. Brudnak (12/15) Feb 09 2004 FWIW I think it would be a mistake to add more ASCII characters as
- davepermen (5/21) Feb 09 2004 unicode is useless on a keyboard. thats why ascii only should be used. t...
- Matthew (5/37) Feb 09 2004 I'm assuming you're continuing in an ironic vein, as that's just monstro...
- Matthias Becker (1/3) Feb 09 2004 Hey, that's unfair! Why $ but not €?
- davepermen (5/8) Feb 09 2004 and what about £ ?
- Ben Hinkle (20/20) Feb 09 2004 for more amusement along these lines check out
- davepermen (5/25) Feb 09 2004 i know that yet.. what about the one with the \\ comments? :D
I would like to propose a possibility to Thanx Yan
Feb 08 2004
To do what? Please provide examples of what you intend, so we can give you opinions "Yan" <Yan_member pathlink.com> wrote in message news:c0695d$2b15$1 digitaldaemon.com...I would like to propose a possibility to Thanx Yan
Feb 08 2004
If we have more complicated objects than ints and reals and bools (for example - vectors, armies, rockets, planets...), then we would have more possible operations on them. Some of such operations will be used frequently. Remember scalar and cross products of vectors. You could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only? We find in specification "Since ++e is defined to be semantically equivalent to (e += 1), the expression ++e is rewritten as (e += 1), and then checking for operator overloading is done. The situation is analogous for --e". But who says that e is such an object that operation ++ is comutative? Example: Army a1 = new Army(); a1++; // to add 1 soldier on the right flank ++a1; // to add 1 soldier on the left flank In article <c06f1p$2kkr$2 digitaldaemon.com>, Matthew says...To do what? Please provide examples of what you intend, so we can give you opinions "Yan" <Yan_member pathlink.com> wrote in message news:c0695d$2b15$1 digitaldaemon.com...I would like to propose a possibility to Thanx Yan
Feb 09 2004
mosfox yandex.ru wrote:If we have more complicated objects than ints and reals and bools (for example - vectors, armies, rockets, planets...), then we would have more possible operations on them. Some of such operations will be used frequently. Remember scalar and cross products of vectors. You could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only?How about a method called 'dot'? :)We find in specification "Since ++e is defined to be semantically equivalent to (e += 1), the expression ++e is rewritten as (e += 1), and then checking for operator overloading is done. The situation is analogous for --e". But who says that e is such an object that operation ++ is comutative? Example: Army a1 = new Army(); a1++; // to add 1 soldier on the right flank ++a1; // to add 1 soldier on the left flankeeeeek. -- andy
Feb 09 2004
In article <c08aj5$2l2v$1 digitaldaemon.com>, Andy Friesen says...mosfox yandex.ru wrote:dot(dot(dot(dot(a,dot(b,dot(c,d))),e),f),g) ... %-/ ..OR... ((a (b (c d)) e) f) gIf we have more complicated objects than ints and reals and bools (for example - vectors, armies, rockets, planets...), then we would have more possible operations on them. Some of such operations will be used frequently. Remember scalar and cross products of vectors. You could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only?How about a method called 'dot'? :)We find in specification "Since ++e is defined to be semantically equivalent to (e += 1), the expression ++e is rewritten as (e += 1), and then checking for operator overloading is done. The situation is analogous for --e". But who says that e is such an object that operation ++ is comutative? Example: Army a1 = new Army(); a1++; // to add 1 soldier on the right flank ++a1; // to add 1 soldier on the left flankeeeeek. -- andy
Feb 09 2004
Yan wrote:In article <c08aj5$2l2v$1 digitaldaemon.com>, Andy Friesen says...For one, I've never been a subscriber of the Perlish notion of attaching some arbitrary meaning to an arbitrary operator because it's convenient. (I'm not a fan of Perl in general, but I digress) For another, I thought dotting two vectors yielded a scalar, in this particular case. Lastly, neither of those two examples are the least bit intelligible, but at least I can guess that the dot product operation is involved in the first. -- andyHow about a method called 'dot'? :)dot(dot(dot(dot(a,dot(b,dot(c,d))),e),f),g) ... %-/ ..OR... ((a (b (c d)) e) f) g
Feb 09 2004
Andy Friesen wrote:For one, I've never been a subscriber of the Perlish notion of attaching some arbitrary meaning to an arbitrary operator because it's convenient. (I'm not a fan of Perl in general, but I digress)C uses allot of symbols with arbitrary meanings too. It's just that people have gotten use to them. -- -Anderson: http://badmama.com.au/~anderson/
Feb 09 2004
J Anderson wrote:Andy Friesen wrote:Right, but I won't get anywhere by suggesting that ! be dropped in favour of 'not' and so forth. I'll settle for nipping it in the bud, as it were. :) -- andyFor one, I've never been a subscriber of the Perlish notion of attaching some arbitrary meaning to an arbitrary operator because it's convenient. (I'm not a fan of Perl in general, but I digress)C uses allot of symbols with arbitrary meanings too. It's just that people have gotten use to them.
Feb 09 2004
<snip>You could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only?FWIW I think it would be a mistake to add more ASCII characters as operators. UNICODE provides a rich set of mathematical symbols which are available for use. To create a dot product operator, the unicode symbol for "DOT" (unicode 22C5) should be used. To create a cross product operator, the UNICODE symbol for "CROSS PRODUCT" (unicode 00D7) should be used. This is what I had in mind when I posted the following: http://www.digitalmars.com/drn-bin/wwwnews?D/19736 Also, IMO overloaded operators should not be used unless they have a clear meaning in mathmatics and make code easier to read. Mark. <snip>
Feb 09 2004
unicode is useless on a keyboard. thats why ascii only should be used. there is no need for anything more. it just makes typing much more hell. "Mark J. Brudnak" <mjbrudna oakland.edu> schrieb im Newsbeitrag news:c08vi8$198c$1 digitaldaemon.com...<snip>forYou could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only?FWIW I think it would be a mistake to add more ASCII characters as operators. UNICODE provides a rich set of mathematical symbols which are available for use. To create a dot product operator, the unicode symbol"DOT" (unicode 22C5) should be used. To create a cross product operator, the UNICODE symbol for "CROSS PRODUCT" (unicode 00D7) should be used. This is what I had in mind when I posted the following: http://www.digitalmars.com/drn-bin/wwwnews?D/19736 Also, IMO overloaded operators should not be used unless they have a clear meaning in mathmatics and make code easier to read. Mark. <snip>
Feb 09 2004
<mosfox yandex.ru> wrote in message news:c08a6g$2kld$1 digitaldaemon.com...If we have more complicated objects than ints and reals and bools (for example - vectors, armies, rockets, planets...), then we would havemorepossible operations on them. Some of such operations will be used frequently. Remember scalar and cross products of vectors. You could overload "*" operator to get scalar product. Why not to overload " " operator in order to get cross product? Or i must use "%" or "~" only? We find in specification "Since ++e is defined to be semantically equivalent to (e += 1), the expression ++e is rewritten as (e += 1), and then checking for operator overloading is done. The situation is analogous for --e". But who says that e is such an object that operation ++ is comutative? Example: Army a1 = new Army(); a1++; // to add 1 soldier on the right flank ++a1; // to add 1 soldier on the left flankI'm assuming you're continuing in an ironic vein, as that's just monstrous nonsense. Any serious code review of such code would mark it "must try again".In article <c06f1p$2kkr$2 digitaldaemon.com>, Matthew says...To do what? Please provide examples of what you intend, so we can give you opinions "Yan" <Yan_member pathlink.com> wrote in message news:c0695d$2b15$1 digitaldaemon.com...I would like to propose a possibility to Thanx Yan
Feb 09 2004
I would like to propose a possibility toHey, that's unfair! Why $ but not €?
Feb 09 2004
and what about £ ? and then we have °, and § and ¬ and ¦ and ¢ and ¨ ? :D "Matthias Becker" <Matthias_member pathlink.com> schrieb im Newsbeitrag news:c07skh$1uhc$1 digitaldaemon.com...I would like to propose a possibility toHey, that's unfair! Why $ but not €?
Feb 09 2004
for more amusement along these lines check out http://www.research.att.com/~bs/whitespace98.pdf "davepermen" <davepermen hotmail.com> wrote in message news:c07srf$1uut$1 digitaldaemon.com... | and what about £ ? | | and then we have °, and § and ¬ and ¦ and ¢ and ¨ ? | | :D | | "Matthias Becker" <Matthias_member pathlink.com> schrieb im Newsbeitrag | news:c07skh$1uhc$1 digitaldaemon.com... | > >I would like to propose a possibility to | > | > Hey, that's unfair! Why $ but not ?? | > | > | |
Feb 09 2004
i know that yet.. what about the one with the \\ comments? :D here is the comment \\ x = 10; :D "Ben Hinkle" <bhinkle4 juno.com> schrieb im Newsbeitrag news:c0846h$2b01$1 digitaldaemon.com...for more amusement along these lines check out http://www.research.att.com/~bs/whitespace98.pdf "davepermen" <davepermen hotmail.com> wrote in message news:c07srf$1uut$1 digitaldaemon.com... | and what about £ ? | | and then we have °, and § and ¬ and ¦ and ¢ and ¨ ? | | :D | | "Matthias Becker" <Matthias_member pathlink.com> schrieb im Newsbeitrag | news:c07skh$1uhc$1 digitaldaemon.com... | > >I would like to propose a possibility to | > | > Hey, that's unfair! Why $ but not ?? | > | > | |
Feb 09 2004