From: Matthew Kerwin <matthew@...> Date: 2012-11-12T06:38:38+09:00 Subject: [ruby-core:49235] Re: [ruby-trunk - Feature #7328] Move ** operator precedence under unary + and - --047d7b338dd3ede1b904ce3f0112 Content-Type: text/plain; charset=ISO-8859-1 Can I just point out that everyone is using asterisks and carets and arguing about standard mathematical notation? I reckon the biggest factor driving this discussion should be existing behaviour. Changing how operators behave is probably the single biggest thing that defines and thus changes a language. If you were writing a new language, however, I'd find this disussion and its outcome fascinating. On Nov 12, 2012 6:37 AM, "marcandre (Marc-Andre Lafortune)" < ruby-core@marc-andre.ca> wrote: > > Issue #7328 has been updated by marcandre (Marc-Andre Lafortune). > > > Hi, > > trans (Thomas Sawyer) wrote: > > "Thomas: Please check your facts, e.g. > http://en.wikipedia.org/wiki/Order_of_operations#Exceptions_to_the_standard > " > > > > 1) I did not make this issue. > > My understanding is that the original poster was wondering why the > precedence was like that and that he would have preferred it the other way. > Alexey answered correctly that the reason was because of the order or > operations in mathematics. > > I only wanted to suggest that before contradicting someone it was a good > idea to check the facts, in particular if one isn't extremely familiar with > the field. I didn't mean to offend and I'm sorry if I did. > > ---------------------------------------- > Feature #7328: Move ** operator precedence under unary + and - > https://bugs.ruby-lang.org/issues/7328#change-32791 > > Author: boris_stitnicky (Boris Stitnicky) > Status: Rejected > Priority: Normal > Assignee: > Category: > Target version: > > > I would like to ask to consider decreasing ** operator precedence just > below that of -/+ unary operators. I know that other languages (eg. Python) > have ** operator bind tighter than negation, but seeing -1 ** 0.5 give the > result -1 and having to type parenthesis (-1) ** 0.5... Even if it's not > worth changing, I'd like to hear this rationalized. I've asked about > rationalization of this on SO, and nobody seems to know why this precedence > is the way it is. > > > -- > http://bugs.ruby-lang.org/ > > --047d7b338dd3ede1b904ce3f0112 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <p>Can I just point out that everyone is using asterisks and carets and arg= uing about standard mathematical notation?</p> <p>I reckon the biggest factor driving this discussion should be existing b= ehaviour. Changing how operators behave is probably the single biggest thin= g that defines and thus changes a language.</p> <p>If you were writing a new language, however, I'd find this disussion= and its outcome fascinating.</p> <div class=3D"gmail_quote">On Nov 12, 2012 6:37 AM, "marcandre (Marc-A= ndre Lafortune)" <<a href=3D"mailto:ruby-core@marc-andre.ca">ruby-c= ore@marc-andre.ca</a>> wrote:<br type=3D"attribution"><blockquote class= =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd= ing-left:1ex"> <br> Issue #7328 has been updated by marcandre (Marc-Andre Lafortune).<br> <br> <br> Hi,<br> <br> trans (Thomas Sawyer) wrote:<br> > "Thomas: Please check your facts, e.g. <a href=3D"http://en.wikip= edia.org/wiki/Order_of_operations#Exceptions_to_the_standard" target=3D"_bl= ank">http://en.wikipedia.org/wiki/Order_of_operations#Exceptions_to_the_sta= ndard</a>"<br> ><br> > 1) I did not make this issue.<br> <br> My understanding is that the original poster was wondering why the preceden= ce was like that and that he would have preferred it the other way. Alexey = answered correctly that the reason was because of the order or operations i= n mathematics.<br> <br> I only wanted to suggest that before contradicting someone it was a good id= ea to check the facts, in particular if one isn't extremely familiar wi= th the field. I didn't mean to offend and I'm sorry if I did.<br> <br> ----------------------------------------<br> Feature #7328: Move ** operator precedence under unary + and -<br> <a href=3D"https://bugs.ruby-lang.org/issues/7328#change-32791" target=3D"_= blank">https://bugs.ruby-lang.org/issues/7328#change-32791</a><br> <br> Author: boris_stitnicky (Boris Stitnicky)<br> Status: Rejected<br> Priority: Normal<br> Assignee:<br> Category:<br> Target version:<br> <br> <br> I would like to ask to consider decreasing ** operator precedence just belo= w that of -/+ unary operators. I know that other languages (eg. Python) hav= e ** operator bind tighter than negation, but seeing -1 ** 0.5 give the res= ult -1 and having to type parenthesis (-1) ** 0.5... Even if it's not w= orth changing, I'd like to hear this rationalized. I've asked about= rationalization of this on SO, and nobody seems to know why this precedenc= e is the way it is.<br> <br> <br> --<br> <a href=3D"http://bugs.ruby-lang.org/" target=3D"_blank">http://bugs.ruby-l= ang.org/</a><br> <br> </blockquote></div> --047d7b338dd3ede1b904ce3f0112--