Re: rfc: pow-operator
| From: | Tjerk Meesters | Date: | Sun, 24 Nov 2013 06:58:36 +0000 |
| Subject: | Re: rfc: pow-operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70347@lists.php.net to get a copy of this message | ||
On Sun, Nov 24, 2013 at 8:31 AM, Kris Craig <kris.craig@gmail.com> 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".
>
To support the latter "-3 ** 2 == 9" we would require a unary minus that
has a higher precedence than the exponent operator and as such falls
outside of the scope of this RFC.
That said, I'm not even sure whether we can support a unary minus with the
current parser.
>
> Without those options, my vote would be a firm No.
>
> --Kris
>
>
> On Sat, Nov 23, 2013 at 9:43 AM, Derick Rethans <derick@php.net> wrote:
>
>> On Sat, 23 Nov 2013, Tjerk Meesters wrote:
>>
>> > Hi guys,
>> >
>> > I'm done drafting the RFC for the exponential operator:
>> > https://wiki.php.net/rfc/pow-operator
>> >
>> > Since this is a language feature, voting will only start in two weeks
>> from
>> > now.
>>
>> Something that I missed in there, are you thinking of adding:
>>
>> **=
>>
>> in there too, just like we have:
>>
>> $a += 5;
>>
>> cheers,
>> Derick
>>
>> --
>> http://derickrethans.nl |
>> http://xdebug.org
>> Like Xdebug? Consider a donation:
>> http://xdebug.org/donate.php
>> twitter: @derickr and @xdebug
>> Posted with an email client that doesn't mangle email: alpine
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--
--
Tjerk