3 ms·
As the person that replied to your second point on the SO question there, I have to add something here. There are other calculators made in Rebol. (Search rebo
by iArnold 12y ago
As the person that replied to your second point on the SO question there, I have to add something here.
There are other calculators made in Rebol. (Search rebol.org site scripts for those). Having this calculator adapted for the math operator precedence would be too farfetched, for the example merely shows how much can be done with so little code.
The other is that I do not have the ultimate say in what Rebol and or Red should do with math operator precedence, I have nothing to say about that to be exact ;-)
(I am free to express my opinion on the subject). What I state there still holds for me, the operator precendence is imho arbitrary, and not necessary at all, counterintuitive for kids, and (I am a mathematician) the world can do without these rules. With operator precendence I have no other choice then to use ellipses when I have 3 * 4 + 1 and I meant I wanted to add 1 to 4 before multiplying by 3: 3 * (4 + 1) in Rebol I can write 1 + 4 * 3 and I do NOT have to use "(" and ")" to achieve what I intended saving me four keystrokes.
Regards,
Arnold
- justin66 12y agoDoes the operator precedence convention of treating addition and multiplication equally apply to all of Red? All of REBOL? Or is it just that program? Thanks.
- dockimbel 12y agoBoth Rebol and Red use that convention. It sounds weird at first look, but proved to be a relief in practice (no need to remember any specific precedence rule). Though, we plan to provide a small math-oriented DSL for writing expressions using standard math conventions. It would look like this: >> print 1 + 2 * 3 == 9 >> print math [1 + 2 * 3] == 7
- doublerebel 12y agoJust saw this. That is not my SO question -- I'm just a lifetime programmer who has never seen rewriting of operator precedence in the tens of languages I've used.