> How is there less confusion in RPN than in infix notation ;-) You're
> reminding me of old computer classes :p Take a calculator and press
> Enter too many times!

no () and no operators priorities (which are not even implemented
uniformly among programming languages... Here, let's have some fun:

[23:52:13]@tiga:~/Films☻ $ irb
irb(main):001:0> p 6/2*1+2
5
=> 5
irb(main):002:0>
[23:52:31]@tiga:~/Films☻ $ python
Python 2.6.6 (r266:84292, Nov 27 2010, 17:27:14)
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print 6/1*1+2
8
>>>
)

So if I want the same result I need () which I end up using even when
not strictly necessary, even more keystrokes :P
_______________________________________________
POST RULES : http://wiki.hanoilug.org/hanoilug:mailing_list_guidelines
_______________________________________________
HanoiLUG mailing lists: http://lists.hanoilug.org/
HanoiLUG wiki: http://wiki.hanoilug.org/
HanoiLUG blog: http://blog.hanoilug.org/

Trả lời cho