1.1 --- a/lib/__builtins__/buffer.py Fri Dec 02 21:16:06 2016 +0100
1.2 +++ b/lib/__builtins__/buffer.py Fri Dec 02 22:26:53 2016 +0100
1.3 @@ -52,7 +52,7 @@
1.4 """
1.5
1.6 if isinstance(s, buffer):
1.7 - _list_concat(self, s)
1.8 + _list_concat(self, s.__data__)
1.9 elif isinstance(s, string):
1.10 _list_append(self, s)
1.11 else:
1.12 @@ -62,7 +62,7 @@
1.13
1.14 "Return a string representation."
1.15
1.16 - return _buffer_str(self)
1.17 + return _buffer_str(self.__data__)
1.18
1.19 def __repr__(self):
1.20
2.1 --- a/lib/__builtins__/character.py Fri Dec 02 21:16:06 2016 +0100
2.2 +++ b/lib/__builtins__/character.py Fri Dec 02 22:26:53 2016 +0100
2.3 @@ -30,7 +30,7 @@
2.4 "Return the value of the given character 'c'."
2.5
2.6 if isinstance(c, string) and len(c) == 1:
2.7 - return _str_ord(c)
2.8 + return _str_ord(c.__data__)
2.9 else:
2.10 raise ValueError(c)
2.11
3.1 --- a/lib/__builtins__/int.py Fri Dec 02 21:16:06 2016 +0100
3.2 +++ b/lib/__builtins__/int.py Fri Dec 02 22:26:53 2016 +0100
3.3 @@ -19,7 +19,7 @@
3.4 this program. If not, see <http://www.gnu.org/licenses/>.
3.5 """
3.6
3.7 -from __builtins__.operator import _binary_op, _negate
3.8 +from __builtins__.operator import _negate
3.9 import native
3.10
3.11 class int(object):
3.12 @@ -30,65 +30,107 @@
3.13
3.14 "Initialise the integer with the given 'number_or_string'."
3.15
3.16 - if isinstance(number_or_string, int):
3.17 + if native._isinstance(number_or_string, int):
3.18 self.__data__ = number_or_string.__data__
3.19 else:
3.20 # NOTE: To be implemented.
3.21 self.__data__ = None
3.22
3.23 def __hash__(self):
3.24 +
3.25 "Return a value for hashing purposes."
3.26 +
3.27 return self
3.28
3.29 + def _binary_op(self, op, other):
3.30 +
3.31 + "Perform 'op' on this int and 'other' if appropriate."
3.32 +
3.33 + if native._isinstance(other, int):
3.34 + return op(self.__data__, other.__data__)
3.35 + else:
3.36 + return NotImplemented
3.37 +
3.38 + def _binary_op_rev(self, op, other):
3.39 +
3.40 + "Perform 'op' on 'other' and this int if appropriate."
3.41 +
3.42 + if native._isinstance(other, int):
3.43 + return op(other.__data__, self.__data__)
3.44 + else:
3.45 + return NotImplemented
3.46 +
3.47 def __iadd__(self, other):
3.48 - "Return a new int for the operation."
3.49 - return _binary_op(self, other, native._int_add)
3.50 +
3.51 + "Return a new int for the addition of this int and 'other'."
3.52 +
3.53 + return self._binary_op(native._int_add, other)
3.54
3.55 def __isub__(self, other):
3.56 - "Return a new int for the operation."
3.57 - return _binary_op(self, other, native._int_sub)
3.58 +
3.59 + "Return a new int for the subtraction of this int and 'other'."
3.60 +
3.61 + return self._binary_op(native._int_sub, other)
3.62
3.63 def __imul__(self, other):
3.64 - "Return a new int for the operation."
3.65 - return _binary_op(self, other, native._int_mul)
3.66 +
3.67 + "Return a new int for the multiplication of this int and 'other'."
3.68 +
3.69 + return self._binary_op(native._int_mul, other)
3.70
3.71 def __idiv__(self, other):
3.72 - "Return a new int for the operation."
3.73 - return _binary_op(self, other, native._int_div)
3.74 +
3.75 + "Return a new int for the division of this int and 'other'."
3.76 +
3.77 + return self._binary_op(native._int_div, other)
3.78
3.79 def __imod__(self, other):
3.80 - "Return a new int for the operation."
3.81 - return _binary_op(self, other, native._int_mod)
3.82 +
3.83 + "Return a new int for the modulo of this int by 'other'."
3.84 +
3.85 + return self._binary_op(native._int_mod, other)
3.86
3.87 def __ipow__(self, other):
3.88 - "Return a new int for the operation."
3.89 - return _binary_op(self, other, native._int_pow)
3.90 +
3.91 + "Return a new int for the exponentiation of this int by 'other'."
3.92 +
3.93 + return self._binary_op(native._int_pow, other)
3.94
3.95 def __iand__(self, other):
3.96 - "Return a new int for the operation."
3.97 - return _binary_op(self, other, native._int_and)
3.98 +
3.99 + "Return a new int for the binary-and of this int and 'other'."
3.100 +
3.101 + return self._binary_op(native._int_and, other)
3.102
3.103 def __ior__(self, other):
3.104 - "Return a new int for the operation."
3.105 - return _binary_op(self, other, native._int_or)
3.106 +
3.107 + "Return a new int for the binary-or of this int and 'other'."
3.108 +
3.109 + return self._binary_op(native._int_or, other)
3.110
3.111 def __ixor__(self, other):
3.112 - "Return a new int for the operation."
3.113 - return _binary_op(self, other, native._int_xor)
3.114 +
3.115 + "Return a new int for the exclusive-or of this int and 'other'."
3.116 +
3.117 + return self._binary_op(native._int_xor, other)
3.118
3.119 __add__ = __radd__ = __iadd__
3.120 __sub__ = __isub__
3.121
3.122 def __rsub__(self, other):
3.123 - "Return a new int for the operation."
3.124 - return _binary_op(other, self, native._int_sub)
3.125 +
3.126 + "Return a new int for the subtraction of this int from 'other'."
3.127 +
3.128 + return self._binary_op_rev(native._int_sub, other)
3.129
3.130 __mul__ = __rmul__ = __imul__
3.131 __div__ = __idiv__
3.132
3.133 def __rdiv__(self, other):
3.134 - "Return a new int for the operation."
3.135 - return _binary_op(other, self, native._int_div)
3.136 +
3.137 + "Return a new int for the division of this int into 'other'."
3.138 +
3.139 + return self._binary_op_rev(native._int_div, other)
3.140
3.141 def __floordiv__(self, other): pass
3.142 def __rfloordiv__(self, other): pass
3.143 @@ -97,56 +139,78 @@
3.144 __mod__ = __imod__
3.145
3.146 def __rmod__(self, other):
3.147 - "Return a new int for the operation."
3.148 - return _binary_op(other, self, native._int_mod)
3.149 +
3.150 + "Return a new int for the modulo of 'other' by this int."
3.151 +
3.152 + return self._binary_op_rev(native._int_mod, other)
3.153
3.154 __pow__ = __ipow__
3.155
3.156 def __rpow__(self, other):
3.157 - "Return a new int for the operation."
3.158 - return _binary_op(other, self, native._int_pow)
3.159 +
3.160 + "Return a new int for the exponentiation of 'other' by this int."
3.161 +
3.162 + return self._binary_op_rev(native._int_pow, other)
3.163
3.164 __and__ = __rand__ = __iand__
3.165 __or__ = __ror__ = __ior__
3.166 __xor__ = __rxor__ = __ixor__
3.167
3.168 def __lt__(self, other):
3.169 - "Return a new boolean for the comparison."
3.170 - return _binary_op(self, other, native._int_lt)
3.171 +
3.172 + "Return whether this int is less than 'other'."
3.173 +
3.174 + return self._binary_op(native._int_lt, other)
3.175
3.176 def __gt__(self, other):
3.177 - "Return a new boolean for the comparison."
3.178 - return _binary_op(self, other, native._int_gt)
3.179 +
3.180 + "Return whether this int is greater than 'other'."
3.181 +
3.182 + return self._binary_op(native._int_gt, other)
3.183
3.184 def __le__(self, other):
3.185 - "Return a new boolean for the comparison."
3.186 +
3.187 + "Return whether this int is less than or equal to 'other'."
3.188 +
3.189 return _negate(self.__gt__(other))
3.190
3.191 def __ge__(self, other):
3.192 - "Return a new boolean for the comparison."
3.193 +
3.194 + "Return whether this int is greater than or equal to 'other'."
3.195 +
3.196 return _negate(self.__lt__(other))
3.197
3.198 def __eq__(self, other):
3.199 - "Return a new boolean for the comparison."
3.200 - return _binary_op(self, other, native._int_eq)
3.201 +
3.202 + "Return whether this int is equal to 'other'."
3.203 +
3.204 + return self._binary_op(native._int_eq, other)
3.205
3.206 def __ne__(self, other):
3.207 - "Return a new boolean for the comparison."
3.208 +
3.209 + "Return whether this int is not equal to 'other'."
3.210 +
3.211 return _negate(self.__eq__(other))
3.212
3.213 def __invert__(self): pass
3.214
3.215 def __neg__(self):
3.216 +
3.217 "Apply the unary negation operator."
3.218 - return native._int_neg(self)
3.219 +
3.220 + return native._int_neg(self.__data__)
3.221
3.222 def __pos__(self):
3.223 +
3.224 "Apply the unary positive operator."
3.225 +
3.226 return self
3.227
3.228 def __str__(self):
3.229 +
3.230 "Return a string representation."
3.231 - return native._int_str(self)
3.232 +
3.233 + return native._int_str(self.__data__)
3.234
3.235 __repr__ = __str__
3.236
3.237 @@ -158,7 +222,10 @@
3.238 def __irshift__(self): pass
3.239
3.240 def __bool__(self):
3.241 +
3.242 "Return whether this int is non-zero."
3.243 - return native._int_ne(self, 0)
3.244 +
3.245 + zero = 0
3.246 + return native._int_ne(self.__data__, zero.__data__)
3.247
3.248 # vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/lib/__builtins__/list.py Fri Dec 02 21:16:06 2016 +0100
4.2 +++ b/lib/__builtins__/list.py Fri Dec 02 22:26:53 2016 +0100
4.3 @@ -66,7 +66,7 @@
4.4
4.5 "Return the length of the list."
4.6
4.7 - return native._list_len(self)
4.8 + return native._list_len(self.__data__)
4.9
4.10 def __add__(self, other): pass
4.11
4.12 @@ -75,7 +75,7 @@
4.13 "Concatenate 'other' to the list."
4.14
4.15 if isinstance(other, list):
4.16 - native._list_concat(self, other)
4.17 + native._list_concat(self, other.__data__)
4.18 else:
4.19 self.extend(other)
4.20 return self
4.21 @@ -92,7 +92,7 @@
4.22
4.23 "Lists are true if non-empty."
4.24
4.25 - return native._list_nonempty(self)
4.26 + return native._list_nonempty(self.__data__)
4.27
4.28 def __iter__(self):
4.29
4.30 @@ -107,13 +107,13 @@
4.31 "Return the item at the normalised (positive) 'index'."
4.32
4.33 self._check_index(index)
4.34 - return native._list_element(self, index)
4.35 + return native._list_element(self.__data__, index)
4.36
4.37 def __set_single_item__(self, index, value):
4.38
4.39 "Set at the normalised (positive) 'index' the given 'value'."
4.40
4.41 self._check_index(index)
4.42 - return native._list_setelement(self, index, value)
4.43 + return native._list_setelement(self.__data__, index, value)
4.44
4.45 # vim: tabstop=4 expandtab shiftwidth=4
5.1 --- a/lib/__builtins__/str.py Fri Dec 02 21:16:06 2016 +0100
5.2 +++ b/lib/__builtins__/str.py Fri Dec 02 22:26:53 2016 +0100
5.3 @@ -19,7 +19,7 @@
5.4 this program. If not, see <http://www.gnu.org/licenses/>.
5.5 """
5.6
5.7 -from __builtins__.operator import _binary_op, _negate
5.8 +from __builtins__.operator import _negate
5.9 from __builtins__.sequence import itemaccess
5.10 import native
5.11
5.12 @@ -54,11 +54,20 @@
5.13
5.14 return result
5.15
5.16 + def _binary_op(self, op, other):
5.17 +
5.18 + "Perform 'op' on this int and 'other' if appropriate."
5.19 +
5.20 + if isinstance(other, basestring):
5.21 + return op(self.__data__, other.__data__)
5.22 + else:
5.23 + return NotImplemented
5.24 +
5.25 def __iadd__(self, other):
5.26
5.27 - "Return a new string for the operation."
5.28 + "Return a string combining this string with 'other'."
5.29
5.30 - return _binary_op(self, other, native._str_add)
5.31 + return self._binary_op(native._str_add, other)
5.32
5.33 __add__ = __radd__ = __iadd__
5.34
5.35 @@ -69,42 +78,45 @@
5.36
5.37 def __lt__(self, other):
5.38
5.39 - "Return a new boolean for the comparison."
5.40 + "Return whether this string is less than 'other'."
5.41
5.42 - return _binary_op(self, other, native._str_lt)
5.43 + return self._binary_op(native._str_lt, other)
5.44
5.45 def __gt__(self, other):
5.46
5.47 - "Return a new boolean for the comparison."
5.48 + "Return whether this string is greater than 'other'."
5.49
5.50 - return _binary_op(self, other, native._str_gt)
5.51 + return self._binary_op(native._str_gt, other)
5.52
5.53 def __le__(self, other):
5.54
5.55 - "Return a new boolean for the comparison."
5.56 + "Return whether this string is less than or equal to 'other'."
5.57
5.58 return _negate(self.__gt__(other))
5.59
5.60 def __ge__(self, other):
5.61
5.62 - "Return a new boolean for the comparison."
5.63 + "Return whether this string is greater than or equal to 'other'."
5.64
5.65 return _negate(self.__lt__(other))
5.66
5.67 def __eq__(self, other):
5.68
5.69 - "Return a new boolean for the comparison."
5.70 + "Return whether this string is equal to 'other'."
5.71
5.72 - return _binary_op(self, other, native._str_eq)
5.73 + return self._binary_op(native._str_eq, other)
5.74
5.75 def __ne__(self, other):
5.76
5.77 - "Return a new boolean for the comparison."
5.78 + "Return whether this string is not equal to 'other'."
5.79
5.80 return _negate(self.__eq__(other))
5.81
5.82 def __len__(self):
5.83 - return native._str_len(self)
5.84 +
5.85 + "Return the length of this string."
5.86 +
5.87 + return native._str_len(self.__data__)
5.88
5.89 def __str__(self):
5.90
5.91 @@ -121,7 +133,7 @@
5.92 return str(b)
5.93
5.94 def __bool__(self):
5.95 - return native._str_nonempty(self)
5.96 + return native._str_nonempty(self.__data__)
5.97
5.98 def endswith(self, s): pass
5.99 def find(self, sub, start=None, end=None): pass
5.100 @@ -146,7 +158,7 @@
5.101 "Return the item at the normalised (positive) 'index'."
5.102
5.103 self._check_index(index)
5.104 - return native._str_substr(self, index, 1)
5.105 + return native._str_substr(self.__data__, index, 1)
5.106
5.107 class string(basestring):
5.108 pass
6.1 --- a/lib/__builtins__/tuple.py Fri Dec 02 21:16:06 2016 +0100
6.2 +++ b/lib/__builtins__/tuple.py Fri Dec 02 22:26:53 2016 +0100
6.3 @@ -36,14 +36,14 @@
6.4
6.5 size = args is not None and len(args) or 0
6.6 self.__data__ = native._list_init(size)
6.7 - native._list_setsize(self, size)
6.8 + native._list_setsize(self.__data__, size)
6.9
6.10 # Populate the tuple.
6.11
6.12 if args is not None:
6.13 i = 0
6.14 for arg in args:
6.15 - native._list_setelement(self, i, arg)
6.16 + native._list_setelement(self.__data__, i, arg)
6.17 i += 1
6.18
6.19 def __getslice__(self, start, end=None):
6.20 @@ -56,7 +56,7 @@
6.21
6.22 "Return the length of the tuple."
6.23
6.24 - return native._list_len(self)
6.25 + return native._list_len(self.__data__)
6.26
6.27 def __add__(self, other): pass
6.28
6.29 @@ -87,7 +87,7 @@
6.30 "Return the item at the normalised (positive) 'index'."
6.31
6.32 self._check_index(index)
6.33 - return native._list_element(self, index)
6.34 + return native._list_element(self.__data__, index)
6.35
6.36 def __set_single_item__(self, index, value):
6.37
7.1 --- a/templates/native.c Fri Dec 02 21:16:06 2016 +0100
7.2 +++ b/templates/native.c Fri Dec 02 22:26:53 2016 +0100
7.3 @@ -103,11 +103,11 @@
7.4
7.5 __attr __fn_native__int_add(__attr __args[])
7.6 {
7.7 - __attr * const self = &__args[1];
7.8 + __attr * const _data = &__args[1];
7.9 __attr * const other = &__args[2];
7.10 - /* self.__data__ and other.__data__ interpreted as int */
7.11 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.12 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.13 + /* _data and other interpreted as int */
7.14 + int i = _data->intvalue;
7.15 + int j = other->intvalue;
7.16
7.17 /* Return the new integer. */
7.18 /* NOTE: No overflow test applied. */
7.19 @@ -116,11 +116,11 @@
7.20
7.21 __attr __fn_native__int_sub(__attr __args[])
7.22 {
7.23 - __attr * const self = &__args[1];
7.24 + __attr * const _data = &__args[1];
7.25 __attr * const other = &__args[2];
7.26 - /* self.__data__ and other.__data__ interpreted as int */
7.27 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.28 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.29 + /* _data and other interpreted as int */
7.30 + int i = _data->intvalue;
7.31 + int j = other->intvalue;
7.32
7.33 /* Return the new integer. */
7.34 /* NOTE: No overflow test applied. */
7.35 @@ -129,11 +129,11 @@
7.36
7.37 __attr __fn_native__int_mul(__attr __args[])
7.38 {
7.39 - __attr * const self = &__args[1];
7.40 + __attr * const _data = &__args[1];
7.41 __attr * const other = &__args[2];
7.42 - /* self.__data__ and other.__data__ interpreted as int */
7.43 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.44 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.45 + /* _data and other interpreted as int */
7.46 + int i = _data->intvalue;
7.47 + int j = other->intvalue;
7.48
7.49 /* Return the new integer. */
7.50 /* NOTE: No overflow test applied. */
7.51 @@ -142,11 +142,11 @@
7.52
7.53 __attr __fn_native__int_div(__attr __args[])
7.54 {
7.55 - __attr * const self = &__args[1];
7.56 + __attr * const _data = &__args[1];
7.57 __attr * const other = &__args[2];
7.58 - /* self.__data__ and other.__data__ interpreted as int */
7.59 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.60 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.61 + /* _data and other interpreted as int */
7.62 + int i = _data->intvalue;
7.63 + int j = other->intvalue;
7.64
7.65 /* Return the new integer. */
7.66 /* NOTE: No overflow test applied. */
7.67 @@ -155,11 +155,11 @@
7.68
7.69 __attr __fn_native__int_mod(__attr __args[])
7.70 {
7.71 - __attr * const self = &__args[1];
7.72 + __attr * const _data = &__args[1];
7.73 __attr * const other = &__args[2];
7.74 - /* self.__data__ and other.__data__ interpreted as int */
7.75 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.76 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.77 + /* _data and other interpreted as int */
7.78 + int i = _data->intvalue;
7.79 + int j = other->intvalue;
7.80
7.81 /* Return the new integer. */
7.82 /* NOTE: No overflow test applied. */
7.83 @@ -168,9 +168,9 @@
7.84
7.85 __attr __fn_native__int_neg(__attr __args[])
7.86 {
7.87 - __attr * const self = &__args[1];
7.88 - /* self.__data__ interpreted as int */
7.89 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.90 + __attr * const _data = &__args[1];
7.91 + /* _data interpreted as int */
7.92 + int i = _data->intvalue;
7.93
7.94 /* Return the new integer. */
7.95 return __new_int(-i);
7.96 @@ -178,11 +178,11 @@
7.97
7.98 __attr __fn_native__int_pow(__attr __args[])
7.99 {
7.100 - __attr * const self = &__args[1];
7.101 + __attr * const _data = &__args[1];
7.102 __attr * const other = &__args[2];
7.103 - /* self.__data__ and other.__data__ interpreted as int */
7.104 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.105 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.106 + /* _data and other interpreted as int */
7.107 + int i = _data->intvalue;
7.108 + int j = other->intvalue;
7.109
7.110 /* Return the new integer. */
7.111 /* NOTE: No overflow test applied. */
7.112 @@ -191,11 +191,11 @@
7.113
7.114 __attr __fn_native__int_and(__attr __args[])
7.115 {
7.116 - __attr * const self = &__args[1];
7.117 + __attr * const _data = &__args[1];
7.118 __attr * const other = &__args[2];
7.119 - /* self.__data__ and other.__data__ interpreted as int */
7.120 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.121 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.122 + /* _data and other interpreted as int */
7.123 + int i = _data->intvalue;
7.124 + int j = other->intvalue;
7.125
7.126 /* Return the new integer. */
7.127 /* NOTE: No overflow test applied. */
7.128 @@ -204,11 +204,11 @@
7.129
7.130 __attr __fn_native__int_or(__attr __args[])
7.131 {
7.132 - __attr * const self = &__args[1];
7.133 + __attr * const _data = &__args[1];
7.134 __attr * const other = &__args[2];
7.135 - /* self.__data__ and other.__data__ interpreted as int */
7.136 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.137 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.138 + /* _data and other interpreted as int */
7.139 + int i = _data->intvalue;
7.140 + int j = other->intvalue;
7.141
7.142 /* Return the new integer. */
7.143 /* NOTE: No overflow test applied. */
7.144 @@ -217,11 +217,11 @@
7.145
7.146 __attr __fn_native__int_xor(__attr __args[])
7.147 {
7.148 - __attr * const self = &__args[1];
7.149 + __attr * const _data = &__args[1];
7.150 __attr * const other = &__args[2];
7.151 - /* self.__data__ and other.__data__ interpreted as int */
7.152 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.153 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.154 + /* _data and other interpreted as int */
7.155 + int i = _data->intvalue;
7.156 + int j = other->intvalue;
7.157
7.158 /* Return the new integer. */
7.159 /* NOTE: No overflow test applied. */
7.160 @@ -230,11 +230,11 @@
7.161
7.162 __attr __fn_native__int_lt(__attr __args[])
7.163 {
7.164 - __attr * const self = &__args[1];
7.165 + __attr * const _data = &__args[1];
7.166 __attr * const other = &__args[2];
7.167 - /* self.__data__ and other.__data__ interpreted as int */
7.168 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.169 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.170 + /* _data and other interpreted as int */
7.171 + int i = _data->intvalue;
7.172 + int j = other->intvalue;
7.173
7.174 /* Return a boolean result. */
7.175 return i < j ? __builtins___boolean_True : __builtins___boolean_False;
7.176 @@ -242,11 +242,11 @@
7.177
7.178 __attr __fn_native__int_gt(__attr __args[])
7.179 {
7.180 - __attr * const self = &__args[1];
7.181 + __attr * const _data = &__args[1];
7.182 __attr * const other = &__args[2];
7.183 - /* self.__data__ and other.__data__ interpreted as int */
7.184 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.185 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.186 + /* _data and other interpreted as int */
7.187 + int i = _data->intvalue;
7.188 + int j = other->intvalue;
7.189
7.190 /* Return a boolean result. */
7.191 return i > j ? __builtins___boolean_True : __builtins___boolean_False;
7.192 @@ -254,11 +254,11 @@
7.193
7.194 __attr __fn_native__int_eq(__attr __args[])
7.195 {
7.196 - __attr * const self = &__args[1];
7.197 + __attr * const _data = &__args[1];
7.198 __attr * const other = &__args[2];
7.199 - /* self.__data__ and other.__data__ interpreted as int */
7.200 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.201 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.202 + /* _data and other interpreted as int */
7.203 + int i = _data->intvalue;
7.204 + int j = other->intvalue;
7.205
7.206 /* Return a boolean result. */
7.207 return i == j ? __builtins___boolean_True : __builtins___boolean_False;
7.208 @@ -266,11 +266,11 @@
7.209
7.210 __attr __fn_native__int_ne(__attr __args[])
7.211 {
7.212 - __attr * const self = &__args[1];
7.213 + __attr * const _data = &__args[1];
7.214 __attr * const other = &__args[2];
7.215 - /* self.__data__ and other.__data__ interpreted as int */
7.216 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.217 - int j = __load_via_object(other->value, __pos___data__).intvalue;
7.218 + /* _data and other interpreted as int */
7.219 + int i = _data->intvalue;
7.220 + int j = other->intvalue;
7.221
7.222 /* Return a boolean result. */
7.223 return i != j ? __builtins___boolean_True : __builtins___boolean_False;
7.224 @@ -278,9 +278,9 @@
7.225
7.226 __attr __fn_native__int_str(__attr __args[])
7.227 {
7.228 - __attr * const self = &__args[1];
7.229 - /* self.__data__ interpreted as int */
7.230 - int i = __load_via_object(self->value, __pos___data__).intvalue;
7.231 + __attr * const _data = &__args[1];
7.232 + /* _data interpreted as int */
7.233 + int i = _data->intvalue;
7.234 int n = i != 0 ? (int) ceil(log10(abs(i)+1)) + 1 : 2;
7.235 char *s = (char *) __ALLOCATE(n, sizeof(char));
7.236
7.237 @@ -293,11 +293,11 @@
7.238
7.239 __attr __fn_native__str_add(__attr __args[])
7.240 {
7.241 - __attr * const self = &__args[1];
7.242 + __attr * const _data = &__args[1];
7.243 __attr * const other = &__args[2];
7.244 - /* self.__data__, other.__data__ interpreted as string */
7.245 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.246 - char *o = __load_via_object(other->value, __pos___data__).strvalue;
7.247 + /* _data, other interpreted as string */
7.248 + char *s = _data->strvalue;
7.249 + char *o = other->strvalue;
7.250 int n = strlen(s) + strlen(o) + 1;
7.251 char *r = (char *) __ALLOCATE(n, sizeof(char));
7.252
7.253 @@ -310,11 +310,11 @@
7.254
7.255 __attr __fn_native__str_lt(__attr __args[])
7.256 {
7.257 - __attr * const self = &__args[1];
7.258 + __attr * const _data = &__args[1];
7.259 __attr * const other = &__args[2];
7.260 - /* self.__data__, other.__data__ interpreted as string */
7.261 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.262 - char *o = __load_via_object(other->value, __pos___data__).strvalue;
7.263 + /* _data, other interpreted as string */
7.264 + char *s = _data->strvalue;
7.265 + char *o = other->strvalue;
7.266
7.267 /* NOTE: Using simple byte-level string operations. */
7.268 return strcmp(s, o) < 0 ? __builtins___boolean_True : __builtins___boolean_False;
7.269 @@ -322,11 +322,11 @@
7.270
7.271 __attr __fn_native__str_gt(__attr __args[])
7.272 {
7.273 - __attr * const self = &__args[1];
7.274 + __attr * const _data = &__args[1];
7.275 __attr * const other = &__args[2];
7.276 - /* self.__data__, other.__data__ interpreted as string */
7.277 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.278 - char *o = __load_via_object(other->value, __pos___data__).strvalue;
7.279 + /* _data, other interpreted as string */
7.280 + char *s = _data->strvalue;
7.281 + char *o = other->strvalue;
7.282
7.283 /* NOTE: Using simple byte-level string operations. */
7.284 return strcmp(s, o) > 0 ? __builtins___boolean_True : __builtins___boolean_False;
7.285 @@ -334,11 +334,11 @@
7.286
7.287 __attr __fn_native__str_eq(__attr __args[])
7.288 {
7.289 - __attr * const self = &__args[1];
7.290 + __attr * const _data = &__args[1];
7.291 __attr * const other = &__args[2];
7.292 - /* self.__data__, other.__data__ interpreted as string */
7.293 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.294 - char *o = __load_via_object(other->value, __pos___data__).strvalue;
7.295 + /* _data, other interpreted as string */
7.296 + char *s = _data->strvalue;
7.297 + char *o = other->strvalue;
7.298
7.299 /* NOTE: Using simple byte-level string operations. */
7.300 return strcmp(s, o) == 0 ? __builtins___boolean_True : __builtins___boolean_False;
7.301 @@ -346,9 +346,9 @@
7.302
7.303 __attr __fn_native__str_len(__attr __args[])
7.304 {
7.305 - __attr * const self = &__args[1];
7.306 - /* self.__data__ interpreted as string */
7.307 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.308 + __attr * const _data = &__args[1];
7.309 + /* _data interpreted as string */
7.310 + char *s = _data->strvalue;
7.311
7.312 /* Return the new integer. */
7.313 return __new_int(strlen(s));
7.314 @@ -356,29 +356,29 @@
7.315
7.316 __attr __fn_native__str_nonempty(__attr __args[])
7.317 {
7.318 - __attr * const self = &__args[1];
7.319 - /* self.__data__ interpreted as string */
7.320 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.321 + __attr * const _data = &__args[1];
7.322 + /* _data interpreted as string */
7.323 + char *s = _data->strvalue;
7.324
7.325 return strlen(s) ? __builtins___boolean_True : __builtins___boolean_False;
7.326 }
7.327
7.328 __attr __fn_native__str_ord(__attr __args[])
7.329 {
7.330 - __attr * const self = &__args[1];
7.331 - /* self.__data__ interpreted as string */
7.332 - char *s = __load_via_object(self->value, __pos___data__).strvalue;
7.333 + __attr * const _data = &__args[1];
7.334 + /* _data interpreted as string */
7.335 + char *s = _data->strvalue;
7.336
7.337 return __new_int((unsigned int) s[0]);
7.338 }
7.339
7.340 __attr __fn_native__str_substr(__attr __args[])
7.341 {
7.342 - __attr * const self = &__args[1];
7.343 + __attr * const _data = &__args[1];
7.344 __attr * const start = &__args[2];
7.345 __attr * const size = &__args[3];
7.346 - /* self.__data__ interpreted as string */
7.347 - char *s = __load_via_object(self->value, __pos___data__).strvalue, *sub;
7.348 + /* _data interpreted as string */
7.349 + char *s = _data->strvalue, *sub;
7.350 /* start.__data__ interpreted as int */
7.351 int i = __load_via_object(start->value, __pos___data__).intvalue;
7.352 /* size.__data__ interpreted as int */
7.353 @@ -403,10 +403,10 @@
7.354
7.355 __attr __fn_native__list_setsize(__attr __args[])
7.356 {
7.357 - __attr * const self = &__args[1];
7.358 + __attr * const _data = &__args[1];
7.359 __attr * const size = &__args[2];
7.360 - /* self.__data__ interpreted as list */
7.361 - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue;
7.362 + /* _data interpreted as list */
7.363 + __fragment *data = _data->seqvalue;
7.364 /* size.__data__ interpreted as int */
7.365 unsigned int n = __load_via_object(size->value, __pos___data__).intvalue;
7.366
7.367 @@ -432,9 +432,9 @@
7.368 {
7.369 __attr * const self = &__args[1];
7.370 __attr * const other = &__args[2];
7.371 - /* self.__data__, other.__data__ interpreted as list */
7.372 + /* self.__data__, other interpreted as list */
7.373 __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue;
7.374 - __fragment *other_data = __load_via_object(other->value, __pos___data__).seqvalue;
7.375 + __fragment *other_data = other->seqvalue;
7.376 __fragment *newdata = data;
7.377 unsigned int size = data->size, capacity = data->capacity;
7.378 unsigned int other_size = other_data->size;
7.379 @@ -461,9 +461,9 @@
7.380
7.381 __attr __fn_native__list_len(__attr __args[])
7.382 {
7.383 - __attr * const self = &__args[1];
7.384 - /* self.__data__ interpreted as fragment */
7.385 - unsigned int size = __load_via_object(self->value, __pos___data__).seqvalue->size;
7.386 + __attr * const _data = &__args[1];
7.387 + /* _data interpreted as fragment */
7.388 + unsigned int size = _data->seqvalue->size;
7.389
7.390 /* Return the new integer. */
7.391 return __new_int(size);
7.392 @@ -471,17 +471,17 @@
7.393
7.394 __attr __fn_native__list_nonempty(__attr __args[])
7.395 {
7.396 - __attr * const self = &__args[1];
7.397 + __attr * const _data = &__args[1];
7.398
7.399 - return __load_via_object(self->value, __pos___data__).seqvalue->size ? __builtins___boolean_True : __builtins___boolean_False;
7.400 + return _data->seqvalue->size ? __builtins___boolean_True : __builtins___boolean_False;
7.401 }
7.402
7.403 __attr __fn_native__list_element(__attr __args[])
7.404 {
7.405 - __attr * const self = &__args[1];
7.406 + __attr * const _data = &__args[1];
7.407 __attr * const index = &__args[2];
7.408 - /* self.__data__ interpreted as fragment */
7.409 - __attr *elements = __load_via_object(self->value, __pos___data__).seqvalue->attrs;
7.410 + /* _data interpreted as fragment */
7.411 + __attr *elements = _data->seqvalue->attrs;
7.412 /* index.__data__ interpreted as int */
7.413 int i = __load_via_object(index->value, __pos___data__).intvalue;
7.414
7.415 @@ -490,11 +490,11 @@
7.416
7.417 __attr __fn_native__list_setelement(__attr __args[])
7.418 {
7.419 - __attr * const self = &__args[1];
7.420 + __attr * const _data = &__args[1];
7.421 __attr * const index = &__args[2];
7.422 __attr * const value = &__args[3];
7.423 - /* self.__data__ interpreted as fragment */
7.424 - __attr *elements = __load_via_object(self->value, __pos___data__).seqvalue->attrs;
7.425 + /* _data interpreted as fragment */
7.426 + __attr *elements = _data->seqvalue->attrs;
7.427 /* index.__data__ interpreted as int */
7.428 int i = __load_via_object(index->value, __pos___data__).intvalue;
7.429
7.430 @@ -679,9 +679,9 @@
7.431
7.432 __attr __fn_native__buffer_str(__attr __args[])
7.433 {
7.434 - __attr * const self = &__args[1];
7.435 - /* self.__data__ interpreted as buffer */
7.436 - __fragment *data = __load_via_object(self->value, __pos___data__).seqvalue;
7.437 + __attr * const _data = &__args[1];
7.438 + /* _data interpreted as buffer */
7.439 + __fragment *data = _data->seqvalue;
7.440 unsigned int size = 0, i, j, n;
7.441 char *s, *o;
7.442