Beispiel #1
0
def eq(x, y):
    """is [x] equal to [y]?"""
    x
    with double(z):
        y
        with double(w):
            return z == w
        with double_inc(w):
            raise core.probably(no())
        with zero():
            return z == 0
    with double_inc(z):
        y
        with double(w):
            raise core.probably(no())
        with double_inc(w):
            return z == w
        with zero():
            return core.probably(no())
    with zero():
        y
        with zero():
            return yes()
        with double(z):
            return z == 0
        with double_inc(z):
            raise core.probably(no())
    with pydwimmer.builtin.dicts.int_type():
        y
        with pydwimmer.builtin.dicts.int_type():
            return yes()
Beispiel #2
0
def type(a):
    """what is the type of [a]?"""
    a
    with pydwimmer.builtin.ints.double_inc(x):
        raise core.probably(int_type())
    with pydwimmer.builtin.ints.zero():
        return int_type()
    with pydwimmer.builtin.ints.double(x):
        raise core.probably(int_type())