Re: rfc: pow-operator
| From: | Sherif Ramadan | Date: | Sun, 24 Nov 2013 01:49:14 +0000 |
| Subject: | Re: rfc: pow-operator | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70341@lists.php.net to get a copy of this message | ||
For a comparative list of languages that implement the exponent operator as
either right-associative or left-associative I've gathered the following,
non-exhaustive list (see quasi-bibliography below)...
| Right-associative | Left-associative |
+--------------------+--------------------+
| Perl | VB |
| Python | BASIC |
| Tcl | Octave |
| Freemat | Matlab |
| Scilab | D |
| Sage | |
| Mathematica | |
| Haskell | |
| R | |
| Ruby | |
| Bash | |
+--------------------+--------------------+
Lanaguages that don't have an exponent operator
------------------------------------------------
C
C++
C#
Java
Javascript
ActionScript
----
Languages that don't have exponent operators seem to have routes from
C-style languages where
at the time no machine instruction existed for the operation and so instead
a library routine
was used.
Certainly PHP would benefit from an exponent operator here and I don't
think going against the trend
of languages making it right-associative in order to make power-towering
easier for the user is
necessarily a bad idea.
Just my 0.00000002 cents!
--- Qausi-bibliography ---
https://plus.google.com/u/0/104277466162910953762/posts/e3jCt51VfmD
http://perldoc.perl.org/perlop.html
http://www.tcl.tk/cgi-bin/tct/tip/274.html
http://book.realworldhaskell.org/read/getting-started.html