Beispiel #1
0
    def rt_equiv(self, other):
        if UT.is_satisfies(RT.IPersistentVector, other):
            if UT.equiv(RT.count.invoke1(self), UT.count(other)) is false:
                return false
            for x in range(self._cnt):
                i = wrap_int(x)
                if RT.equiv(RT.nth.invoke1(self, i), UT.nth(self, i)) is false:
                    return false
            return true
        else:
            if RT.is_satisfies.invoke1(RT.Sequential, other) is false:
                return false
            ms = RT.seq.invoke1(other)

            for x in range(self._cnt):

                if ms is nil or UT.equiv(UT.nth(x, wrap_int(x)),
                                         UT.first(ms)) is false:
                    return false

                ms = UT.next(ms)

            if ms is not nil:
                return false

        return true
    def rt_equiv(self, other):
        if UT.is_satisfies(RT.IPersistentVector, other):
            if UT.equiv(RT.count.invoke1(self), UT.count(other)) is false:
                return false
            for x in range(self._cnt):
                i = wrap_int(x)
                if RT.equiv(RT.nth.invoke1(self, i), UT.nth(self, i)) is false:
                    return false
            return true
        else:
            if RT.is_satisfies.invoke1(RT.Sequential, other) is false:
                return false
            ms = RT.seq.invoke1(other)

            for x in range(self._cnt):

                if ms is nil or UT.equiv(UT.nth(x, wrap_int(x)), UT.first(ms)) is false:
                    return false


                ms = UT.next(ms)

            if ms is not nil:
                return false

        return true
Beispiel #3
0
 def rt_equiv(self, obj):
     if not UT.is_satisfies(RT.Sequential, obj):
         return false
     ms = UT.seq(obj)
     s = UT.seq(self)
     while s is not nil:
         if ms is nil or UT.equiv(UT.first(s), UT.first(ms)) is false:
             return false
         ms = UT.next(ms)
         s = UT.next(s)
     return true if ms is nil else false
Beispiel #4
0
 def rt_equiv(self, obj):
     if not UT.is_satisfies(RT.Sequential, obj):
         return false
     ms = UT.seq(obj)
     s = UT.seq(self)
     while s is not nil:
         if ms is nil or UT.equiv(UT.first(s), UT.first(ms)) is false:
             return false
         ms = UT.next(ms)
         s = UT.next(s)
     return true if ms is nil else false