Item1 | Item2 | → | Real3 |
This operation takes two items from the stack and pushes a real value which is 1 if the two items are the same, otherwise a 0 is pushed onto the stack. An item is the same if it is the same type and the same value.
Unlike the == operation, this operation can be used to compare symbols and expressions. The == operation does not compare an expression itself and instead will form a new expression which will be evaluated when the expression is evaluated. So, SAME is the only way to compare whether two expressions are identical or not. Note that an expressions must match exactly to be considered the same so 'x + y' is not the same as 'y + x' although they are effectively the same.