Re: rfc: pow-operator
| From: | Andrea Faulds | Date: | Sun, 24 Nov 2013 00:51:52 +0000 |
| Subject: | Re: rfc: pow-operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70336@lists.php.net to get a copy of this message | ||
On 24/11/13 00:31, Kris Craig wrote:
We should be following standard Order of Operations here. As such, the option of no associativity should be included. Furthermore, there needs to be a voting option regarding how to deal with even exponents of negative bases; i.e. treat "-3 ^ 2" as "-3 ^ 2 == 9" or as "-(3 ^ 2) == -9". Without those options, my vote would be a firm No.I am worried that adding so many options might cause problems. Is it fair if it passes 3/4, but there is only a plurality for, say, left-associativity or right-associativity? What if someone votes for it, but would not have voted for it were it to be left-associative? I suggest that either Tjerk makes a decision for us and offers a straight Yes/No choice, or he limits the choices to very few and combines them, so: * Yes, right-associative * Yes, left-associative * No Oh, and for my personal thoughts on the matter: I know ** from Python, and I think (2 ** (3 ** 2)) is more useful than ((2 ** 3) ** 2), so I'd like (-2 ** 3 ** 2) to be -(2 ** (3 ** 2)), just as Python does it. -- Andrea Faulds http://ajf.me/