from som.primitives.primitives import Primitives
from som.vmobjects.primitive   import Primitive


def _asString(ivkbl, frame, interpreter):
    rcvr = frame.pop()
    frame.push(interpreter.get_universe().new_string(rcvr.get_embedded_string()))


def _equals(ivkbl, frame, interpreter):
    op1 = frame.pop()
    op2 = frame.pop()  # rcvr
    universe = interpreter.get_universe()
    if op1 == op2:
        frame.push(universe.trueObject)
    else:
        frame.push(universe.falseObject)


class SymbolPrimitives(Primitives):

    def install_primitives(self):
        self._install_instance_primitive(Primitive("asString", self._universe,
                                                   _asString))
        self._install_instance_primitive(Primitive("=", self._universe, _equals), False)

from som.primitives.primitives import Primitives
from som.vmobjects.primitive   import Primitive


def _asString(ivkbl, frame, interpreter):
    rcvr = frame.pop()
    frame.push(interpreter.get_universe().new_string(rcvr.get_embedded_string()))


def _equals(ivkbl, frame, interpreter):
    op1 = frame.pop()
    op2 = frame.pop()  # rcvr
    universe = interpreter.get_universe()
    if op1 is op2:
        frame.push(universe.trueObject)
    else:
        frame.push(universe.falseObject)


class SymbolPrimitives(Primitives):

    def install_primitives(self):
        self._install_instance_primitive(Primitive("asString", self._universe,
                                                   _asString))
        self._install_instance_primitive(Primitive("=", self._universe, _equals), False)

Fix Symbol equality to be reference equal
Fix Symbol equality to be reference equal

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
