Reputation: 11
How do I use OR and AND operators in RPN (Reverse Polish Notation) ?
I have something like this:
"type" valueOf "XY" ==
this means if the type is XY then something happens. Now I want to add another option to "XY", lets say "AB". From what I know it should look something like this
"type" valueOf "XY" "AB" || ==
but of course it isn't. Where is my problem?
Upvotes: 1
Views: 318
Reputation: 363627
What you've written amounts to
valueOf("type") == "XY" || "AB"
which does not express what I suspect you mean in any notation. What you meant was probably
valueOf("type") == "XY" || valueOf("type") == "AB"
so try to translate that to RPN.
Upvotes: 3