# HG changeset patch # User Paul Boddie # Date 1480714013 -3600 # Node ID c07a749f5bd041fbb767292a377725cddded9b49 # Parent f61d81fb98117a9cc9449e2f8a64e1eec978a1b5 Use __data__ attributes with native functions apart from when __data__ needs replacing (such as in the list append and concatenation functions). diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/buffer.py --- a/lib/__builtins__/buffer.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/buffer.py Fri Dec 02 22:26:53 2016 +0100 @@ -52,7 +52,7 @@ """ if isinstance(s, buffer): - _list_concat(self, s) + _list_concat(self, s.__data__) elif isinstance(s, string): _list_append(self, s) else: @@ -62,7 +62,7 @@ "Return a string representation." - return _buffer_str(self) + return _buffer_str(self.__data__) def __repr__(self): diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/character.py --- a/lib/__builtins__/character.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/character.py Fri Dec 02 22:26:53 2016 +0100 @@ -30,7 +30,7 @@ "Return the value of the given character 'c'." if isinstance(c, string) and len(c) == 1: - return _str_ord(c) + return _str_ord(c.__data__) else: raise ValueError(c) diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/int.py --- a/lib/__builtins__/int.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/int.py Fri Dec 02 22:26:53 2016 +0100 @@ -19,7 +19,7 @@ this program. If not, see . """ -from __builtins__.operator import _binary_op, _negate +from __builtins__.operator import _negate import native class int(object): @@ -30,65 +30,107 @@ "Initialise the integer with the given 'number_or_string'." - if isinstance(number_or_string, int): + if native._isinstance(number_or_string, int): self.__data__ = number_or_string.__data__ else: # NOTE: To be implemented. self.__data__ = None def __hash__(self): + "Return a value for hashing purposes." + return self + def _binary_op(self, op, other): + + "Perform 'op' on this int and 'other' if appropriate." + + if native._isinstance(other, int): + return op(self.__data__, other.__data__) + else: + return NotImplemented + + def _binary_op_rev(self, op, other): + + "Perform 'op' on 'other' and this int if appropriate." + + if native._isinstance(other, int): + return op(other.__data__, self.__data__) + else: + return NotImplemented + def __iadd__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_add) + + "Return a new int for the addition of this int and 'other'." + + return self._binary_op(native._int_add, other) def __isub__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_sub) + + "Return a new int for the subtraction of this int and 'other'." + + return self._binary_op(native._int_sub, other) def __imul__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_mul) + + "Return a new int for the multiplication of this int and 'other'." + + return self._binary_op(native._int_mul, other) def __idiv__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_div) + + "Return a new int for the division of this int and 'other'." + + return self._binary_op(native._int_div, other) def __imod__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_mod) + + "Return a new int for the modulo of this int by 'other'." + + return self._binary_op(native._int_mod, other) def __ipow__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_pow) + + "Return a new int for the exponentiation of this int by 'other'." + + return self._binary_op(native._int_pow, other) def __iand__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_and) + + "Return a new int for the binary-and of this int and 'other'." + + return self._binary_op(native._int_and, other) def __ior__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_or) + + "Return a new int for the binary-or of this int and 'other'." + + return self._binary_op(native._int_or, other) def __ixor__(self, other): - "Return a new int for the operation." - return _binary_op(self, other, native._int_xor) + + "Return a new int for the exclusive-or of this int and 'other'." + + return self._binary_op(native._int_xor, other) __add__ = __radd__ = __iadd__ __sub__ = __isub__ def __rsub__(self, other): - "Return a new int for the operation." - return _binary_op(other, self, native._int_sub) + + "Return a new int for the subtraction of this int from 'other'." + + return self._binary_op_rev(native._int_sub, other) __mul__ = __rmul__ = __imul__ __div__ = __idiv__ def __rdiv__(self, other): - "Return a new int for the operation." - return _binary_op(other, self, native._int_div) + + "Return a new int for the division of this int into 'other'." + + return self._binary_op_rev(native._int_div, other) def __floordiv__(self, other): pass def __rfloordiv__(self, other): pass @@ -97,56 +139,78 @@ __mod__ = __imod__ def __rmod__(self, other): - "Return a new int for the operation." - return _binary_op(other, self, native._int_mod) + + "Return a new int for the modulo of 'other' by this int." + + return self._binary_op_rev(native._int_mod, other) __pow__ = __ipow__ def __rpow__(self, other): - "Return a new int for the operation." - return _binary_op(other, self, native._int_pow) + + "Return a new int for the exponentiation of 'other' by this int." + + return self._binary_op_rev(native._int_pow, other) __and__ = __rand__ = __iand__ __or__ = __ror__ = __ior__ __xor__ = __rxor__ = __ixor__ def __lt__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._int_lt) + + "Return whether this int is less than 'other'." + + return self._binary_op(native._int_lt, other) def __gt__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._int_gt) + + "Return whether this int is greater than 'other'." + + return self._binary_op(native._int_gt, other) def __le__(self, other): - "Return a new boolean for the comparison." + + "Return whether this int is less than or equal to 'other'." + return _negate(self.__gt__(other)) def __ge__(self, other): - "Return a new boolean for the comparison." + + "Return whether this int is greater than or equal to 'other'." + return _negate(self.__lt__(other)) def __eq__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._int_eq) + + "Return whether this int is equal to 'other'." + + return self._binary_op(native._int_eq, other) def __ne__(self, other): - "Return a new boolean for the comparison." + + "Return whether this int is not equal to 'other'." + return _negate(self.__eq__(other)) def __invert__(self): pass def __neg__(self): + "Apply the unary negation operator." - return native._int_neg(self) + + return native._int_neg(self.__data__) def __pos__(self): + "Apply the unary positive operator." + return self def __str__(self): + "Return a string representation." - return native._int_str(self) + + return native._int_str(self.__data__) __repr__ = __str__ @@ -158,7 +222,10 @@ def __irshift__(self): pass def __bool__(self): + "Return whether this int is non-zero." - return native._int_ne(self, 0) + + zero = 0 + return native._int_ne(self.__data__, zero.__data__) # vim: tabstop=4 expandtab shiftwidth=4 diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/list.py --- a/lib/__builtins__/list.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/list.py Fri Dec 02 22:26:53 2016 +0100 @@ -66,7 +66,7 @@ "Return the length of the list." - return native._list_len(self) + return native._list_len(self.__data__) def __add__(self, other): pass @@ -75,7 +75,7 @@ "Concatenate 'other' to the list." if isinstance(other, list): - native._list_concat(self, other) + native._list_concat(self, other.__data__) else: self.extend(other) return self @@ -92,7 +92,7 @@ "Lists are true if non-empty." - return native._list_nonempty(self) + return native._list_nonempty(self.__data__) def __iter__(self): @@ -107,13 +107,13 @@ "Return the item at the normalised (positive) 'index'." self._check_index(index) - return native._list_element(self, index) + return native._list_element(self.__data__, index) def __set_single_item__(self, index, value): "Set at the normalised (positive) 'index' the given 'value'." self._check_index(index) - return native._list_setelement(self, index, value) + return native._list_setelement(self.__data__, index, value) # vim: tabstop=4 expandtab shiftwidth=4 diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/str.py --- a/lib/__builtins__/str.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/str.py Fri Dec 02 22:26:53 2016 +0100 @@ -19,7 +19,7 @@ this program. If not, see . """ -from __builtins__.operator import _binary_op, _negate +from __builtins__.operator import _negate from __builtins__.sequence import itemaccess import native @@ -54,11 +54,20 @@ return result + def _binary_op(self, op, other): + + "Perform 'op' on this int and 'other' if appropriate." + + if isinstance(other, basestring): + return op(self.__data__, other.__data__) + else: + return NotImplemented + def __iadd__(self, other): - "Return a new string for the operation." + "Return a string combining this string with 'other'." - return _binary_op(self, other, native._str_add) + return self._binary_op(native._str_add, other) __add__ = __radd__ = __iadd__ @@ -69,42 +78,45 @@ def __lt__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is less than 'other'." - return _binary_op(self, other, native._str_lt) + return self._binary_op(native._str_lt, other) def __gt__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is greater than 'other'." - return _binary_op(self, other, native._str_gt) + return self._binary_op(native._str_gt, other) def __le__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is less than or equal to 'other'." return _negate(self.__gt__(other)) def __ge__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is greater than or equal to 'other'." return _negate(self.__lt__(other)) def __eq__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is equal to 'other'." - return _binary_op(self, other, native._str_eq) + return self._binary_op(native._str_eq, other) def __ne__(self, other): - "Return a new boolean for the comparison." + "Return whether this string is not equal to 'other'." return _negate(self.__eq__(other)) def __len__(self): - return native._str_len(self) + + "Return the length of this string." + + return native._str_len(self.__data__) def __str__(self): @@ -121,7 +133,7 @@ return str(b) def __bool__(self): - return native._str_nonempty(self) + return native._str_nonempty(self.__data__) def endswith(self, s): pass def find(self, sub, start=None, end=None): pass @@ -146,7 +158,7 @@ "Return the item at the normalised (positive) 'index'." self._check_index(index) - return native._str_substr(self, index, 1) + return native._str_substr(self.__data__, index, 1) class string(basestring): pass diff -r f61d81fb9811 -r c07a749f5bd0 lib/__builtins__/tuple.py --- a/lib/__builtins__/tuple.py Fri Dec 02 21:16:06 2016 +0100 +++ b/lib/__builtins__/tuple.py Fri Dec 02 22:26:53 2016 +0100 @@ -36,14 +36,14 @@ size = args is not None and len(args) or 0 self.__data__ = native._list_init(size) - native._list_setsize(self, size) + native._list_setsize(self.__data__, size) # Populate the tuple. if args is not None: i = 0 for arg in args: - native._list_setelement(self, i, arg) + native._list_setelement(self.__data__, i, arg) i += 1 def __getslice__(self, start, end=None): @@ -56,7 +56,7 @@ "Return the length of the tuple." - return native._list_len(self) + return native._list_len(self.__data__) def __add__(self, other): pass @@ -87,7 +87,7 @@ "Return the item at the normalised (positive) 'index'." self._check_index(index) - return native._list_element(self, index) + return native._list_element(self.__data__, index) def __set_single_item__(self, index, value): diff -r f61d81fb9811 -r c07a749f5bd0 templates/native.c --- a/templates/native.c Fri Dec 02 21:16:06 2016 +0100 +++ b/templates/native.c Fri Dec 02 22:26:53 2016 +0100 @@ -103,11 +103,11 @@ __attr __fn_native__int_add(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -116,11 +116,11 @@ __attr __fn_native__int_sub(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -129,11 +129,11 @@ __attr __fn_native__int_mul(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -142,11 +142,11 @@ __attr __fn_native__int_div(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -155,11 +155,11 @@ __attr __fn_native__int_mod(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -168,9 +168,9 @@ __attr __fn_native__int_neg(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as int */ + int i = _data->intvalue; /* Return the new integer. */ return __new_int(-i); @@ -178,11 +178,11 @@ __attr __fn_native__int_pow(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -191,11 +191,11 @@ __attr __fn_native__int_and(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -204,11 +204,11 @@ __attr __fn_native__int_or(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -217,11 +217,11 @@ __attr __fn_native__int_xor(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return the new integer. */ /* NOTE: No overflow test applied. */ @@ -230,11 +230,11 @@ __attr __fn_native__int_lt(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return a boolean result. */ return i < j ? __builtins___boolean_True : __builtins___boolean_False; @@ -242,11 +242,11 @@ __attr __fn_native__int_gt(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return a boolean result. */ return i > j ? __builtins___boolean_True : __builtins___boolean_False; @@ -254,11 +254,11 @@ __attr __fn_native__int_eq(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return a boolean result. */ return i == j ? __builtins___boolean_True : __builtins___boolean_False; @@ -266,11 +266,11 @@ __attr __fn_native__int_ne(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__ and other.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; - int j = __load_via_object(other->value, __pos___data__).intvalue; + /* _data and other interpreted as int */ + int i = _data->intvalue; + int j = other->intvalue; /* Return a boolean result. */ return i != j ? __builtins___boolean_True : __builtins___boolean_False; @@ -278,9 +278,9 @@ __attr __fn_native__int_str(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as int */ - int i = __load_via_object(self->value, __pos___data__).intvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as int */ + int i = _data->intvalue; int n = i != 0 ? (int) ceil(log10(abs(i)+1)) + 1 : 2; char *s = (char *) __ALLOCATE(n, sizeof(char)); @@ -293,11 +293,11 @@ __attr __fn_native__str_add(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__, other.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; - char *o = __load_via_object(other->value, __pos___data__).strvalue; + /* _data, other interpreted as string */ + char *s = _data->strvalue; + char *o = other->strvalue; int n = strlen(s) + strlen(o) + 1; char *r = (char *) __ALLOCATE(n, sizeof(char)); @@ -310,11 +310,11 @@ __attr __fn_native__str_lt(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__, other.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; - char *o = __load_via_object(other->value, __pos___data__).strvalue; + /* _data, other interpreted as string */ + char *s = _data->strvalue; + char *o = other->strvalue; /* NOTE: Using simple byte-level string operations. */ return strcmp(s, o) < 0 ? __builtins___boolean_True : __builtins___boolean_False; @@ -322,11 +322,11 @@ __attr __fn_native__str_gt(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__, other.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; - char *o = __load_via_object(other->value, __pos___data__).strvalue; + /* _data, other interpreted as string */ + char *s = _data->strvalue; + char *o = other->strvalue; /* NOTE: Using simple byte-level string operations. */ return strcmp(s, o) > 0 ? __builtins___boolean_True : __builtins___boolean_False; @@ -334,11 +334,11 @@ __attr __fn_native__str_eq(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__, other.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; - char *o = __load_via_object(other->value, __pos___data__).strvalue; + /* _data, other interpreted as string */ + char *s = _data->strvalue; + char *o = other->strvalue; /* NOTE: Using simple byte-level string operations. */ return strcmp(s, o) == 0 ? __builtins___boolean_True : __builtins___boolean_False; @@ -346,9 +346,9 @@ __attr __fn_native__str_len(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as string */ + char *s = _data->strvalue; /* Return the new integer. */ return __new_int(strlen(s)); @@ -356,29 +356,29 @@ __attr __fn_native__str_nonempty(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as string */ + char *s = _data->strvalue; return strlen(s) ? __builtins___boolean_True : __builtins___boolean_False; } __attr __fn_native__str_ord(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as string */ + char *s = _data->strvalue; return __new_int((unsigned int) s[0]); } __attr __fn_native__str_substr(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const start = &__args[2]; __attr * const size = &__args[3]; - /* self.__data__ interpreted as string */ - char *s = __load_via_object(self->value, __pos___data__).strvalue, *sub; + /* _data interpreted as string */ + char *s = _data->strvalue, *sub; /* start.__data__ interpreted as int */ int i = __load_via_object(start->value, __pos___data__).intvalue; /* size.__data__ interpreted as int */ @@ -403,10 +403,10 @@ __attr __fn_native__list_setsize(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const size = &__args[2]; - /* self.__data__ interpreted as list */ - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue; + /* _data interpreted as list */ + __fragment *data = _data->seqvalue; /* size.__data__ interpreted as int */ unsigned int n = __load_via_object(size->value, __pos___data__).intvalue; @@ -432,9 +432,9 @@ { __attr * const self = &__args[1]; __attr * const other = &__args[2]; - /* self.__data__, other.__data__ interpreted as list */ + /* self.__data__, other interpreted as list */ __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue; - __fragment *other_data = __load_via_object(other->value, __pos___data__).seqvalue; + __fragment *other_data = other->seqvalue; __fragment *newdata = data; unsigned int size = data->size, capacity = data->capacity; unsigned int other_size = other_data->size; @@ -461,9 +461,9 @@ __attr __fn_native__list_len(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as fragment */ - unsigned int size = __load_via_object(self->value, __pos___data__).seqvalue->size; + __attr * const _data = &__args[1]; + /* _data interpreted as fragment */ + unsigned int size = _data->seqvalue->size; /* Return the new integer. */ return __new_int(size); @@ -471,17 +471,17 @@ __attr __fn_native__list_nonempty(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; - return __load_via_object(self->value, __pos___data__).seqvalue->size ? __builtins___boolean_True : __builtins___boolean_False; + return _data->seqvalue->size ? __builtins___boolean_True : __builtins___boolean_False; } __attr __fn_native__list_element(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const index = &__args[2]; - /* self.__data__ interpreted as fragment */ - __attr *elements = __load_via_object(self->value, __pos___data__).seqvalue->attrs; + /* _data interpreted as fragment */ + __attr *elements = _data->seqvalue->attrs; /* index.__data__ interpreted as int */ int i = __load_via_object(index->value, __pos___data__).intvalue; @@ -490,11 +490,11 @@ __attr __fn_native__list_setelement(__attr __args[]) { - __attr * const self = &__args[1]; + __attr * const _data = &__args[1]; __attr * const index = &__args[2]; __attr * const value = &__args[3]; - /* self.__data__ interpreted as fragment */ - __attr *elements = __load_via_object(self->value, __pos___data__).seqvalue->attrs; + /* _data interpreted as fragment */ + __attr *elements = _data->seqvalue->attrs; /* index.__data__ interpreted as int */ int i = __load_via_object(index->value, __pos___data__).intvalue; @@ -679,9 +679,9 @@ __attr __fn_native__buffer_str(__attr __args[]) { - __attr * const self = &__args[1]; - /* self.__data__ interpreted as buffer */ - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue; + __attr * const _data = &__args[1]; + /* _data interpreted as buffer */ + __fragment *data = _data->seqvalue; unsigned int size = 0, i, j, n; char *s, *o;