News for hackers. Stuff that matters.
Re:Red Programming Language by iArnold on Sunday November 16, 2014 @03:09PM (#8615250)
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

Re:Red Programming Language by doublerebel on Wednesday November 19, 2014 @01:49AM (#8628615)
Just 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.
Re:Red Programming Language by justin66 on Sunday November 16, 2014 @08:28PM (#8616362)
Does 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.
Re:Red Programming Language by dockimbel on Sunday November 16, 2014 @10:38PM (#8616746)
Both 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