1.1 --- a/templates/ops.c Mon Feb 27 11:57:15 2017 +0100
1.2 +++ b/templates/ops.c Mon Feb 27 14:41:27 2017 +0100
1.3 @@ -41,33 +41,33 @@
1.4
1.5 /* Direct retrieval operations, returning and setting attributes. */
1.6
1.7 -__attr __load_via_object(__ref obj, int pos)
1.8 +__attr __load_via_object__(__ref obj, int pos)
1.9 {
1.10 return obj->attrs[pos];
1.11 }
1.12
1.13 -__attr __load_via_class(__ref obj, int pos)
1.14 +__attr __load_via_class__(__ref obj, int pos)
1.15 {
1.16 - return __load_via_object(__get_class(obj), pos);
1.17 + return __load_via_object__(__get_class(obj), pos);
1.18 }
1.19
1.20 -__attr __get_class_and_load(__ref obj, int pos)
1.21 +__attr __get_class_and_load__(__ref obj, int pos)
1.22 {
1.23 if (__is_instance(obj))
1.24 - return __load_via_class(obj, pos);
1.25 + return __load_via_class__(obj, pos);
1.26 else
1.27 - return __load_via_object(obj, pos);
1.28 + return __load_via_object__(obj, pos);
1.29 }
1.30
1.31 /* Direct storage operations. */
1.32
1.33 -int __store_via_object(__ref obj, int pos, __attr value)
1.34 +int __store_via_object__(__ref obj, int pos, __attr value)
1.35 {
1.36 obj->attrs[pos] = value;
1.37 return 1;
1.38 }
1.39
1.40 -int __get_class_and_store(__ref obj, int pos, __attr value)
1.41 +int __get_class_and_store__(__ref obj, int pos, __attr value)
1.42 {
1.43 /* Forbid class-relative assignments. */
1.44
1.45 @@ -89,12 +89,12 @@
1.46
1.47 __ref __get_class(__ref obj)
1.48 {
1.49 - return __load_via_object(obj, __pos___class__).value;
1.50 + return __load_via_object(obj, __class__).value;
1.51 }
1.52
1.53 __attr __get_class_attr(__ref obj)
1.54 {
1.55 - return __load_via_object(obj, __pos___class__);
1.56 + return __load_via_object(obj, __class__);
1.57 }
1.58
1.59 /* Attribute testing operations. */
1.60 @@ -114,17 +114,17 @@
1.61 return obj == type ? obj : 0;
1.62 }
1.63
1.64 -__ref __test_common_instance(__ref obj, int pos, int code)
1.65 +__ref __test_common_instance__(__ref obj, int pos, int code)
1.66 {
1.67 return __HASATTR(__get_class(obj), pos, code) ? obj : 0;
1.68 }
1.69
1.70 -__ref __test_common_object(__ref obj, int pos, int code)
1.71 +__ref __test_common_object__(__ref obj, int pos, int code)
1.72 {
1.73 - return __test_common_type(obj, pos, code) || __test_common_instance(obj, pos, code) ? obj : 0;
1.74 + return __test_common_type__(obj, pos, code) || __test_common_instance__(obj, pos, code) ? obj : 0;
1.75 }
1.76
1.77 -__ref __test_common_type(__ref obj, int pos, int code)
1.78 +__ref __test_common_type__(__ref obj, int pos, int code)
1.79 {
1.80 return __HASATTR(obj, pos, code) ? obj : 0;
1.81 }
1.82 @@ -134,36 +134,36 @@
1.83 __attr __check_and_load_via_object_null(__ref obj, int pos, int code)
1.84 {
1.85 if (__HASATTR(obj, pos, code))
1.86 - return __load_via_object(obj, pos);
1.87 + return __load_via_object__(obj, pos);
1.88 else
1.89 return __NULL;
1.90 }
1.91
1.92 -__attr __check_and_load_via_class(__ref obj, int pos, int code)
1.93 +__attr __check_and_load_via_class__(__ref obj, int pos, int code)
1.94 {
1.95 - return __check_and_load_via_object(__get_class(obj), pos, code);
1.96 + return __check_and_load_via_object__(__get_class(obj), pos, code);
1.97 }
1.98
1.99 -__attr __check_and_load_via_object(__ref obj, int pos, int code)
1.100 +__attr __check_and_load_via_object__(__ref obj, int pos, int code)
1.101 {
1.102 if (__HASATTR(obj, pos, code))
1.103 - return __load_via_object(obj, pos);
1.104 + return __load_via_object__(obj, pos);
1.105
1.106 __raise_type_error();
1.107 return __NULL;
1.108 }
1.109
1.110 -__attr __check_and_load_via_any(__ref obj, int pos, int code)
1.111 +__attr __check_and_load_via_any__(__ref obj, int pos, int code)
1.112 {
1.113 __attr out = __check_and_load_via_object_null(obj, pos, code);
1.114 if (out.value == 0)
1.115 - out = __check_and_load_via_class(obj, pos, code);
1.116 + out = __check_and_load_via_class__(obj, pos, code);
1.117 return out;
1.118 }
1.119
1.120 /* Attribute testing and storage operations. */
1.121
1.122 -int __check_and_store_via_class(__ref obj, int pos, int code, __attr value)
1.123 +int __check_and_store_via_class__(__ref obj, int pos, int code, __attr value)
1.124 {
1.125 /* Forbid class-relative assignments. */
1.126
1.127 @@ -171,11 +171,11 @@
1.128 return 0;
1.129 }
1.130
1.131 -int __check_and_store_via_object(__ref obj, int pos, int code, __attr value)
1.132 +int __check_and_store_via_object__(__ref obj, int pos, int code, __attr value)
1.133 {
1.134 if (__HASATTR(obj, pos, code))
1.135 {
1.136 - __store_via_object(obj, pos, value);
1.137 + __store_via_object__(obj, pos, value);
1.138 return 1;
1.139 }
1.140
1.141 @@ -185,9 +185,9 @@
1.142 return 0;
1.143 }
1.144
1.145 -int __check_and_store_via_any(__ref obj, int pos, int code, __attr value)
1.146 +int __check_and_store_via_any__(__ref obj, int pos, int code, __attr value)
1.147 {
1.148 - if (__check_and_store_via_object(obj, pos, code, value))
1.149 + if (__check_and_store_via_object__(obj, pos, code, value))
1.150 return 1;
1.151
1.152 /* Forbid class-relative assignments. */
1.153 @@ -218,7 +218,7 @@
1.154 attribute context's class, inspecting the context instance for
1.155 compatibility. */
1.156
1.157 - if (__test_common_instance(context, __TYPEPOS(attrcontext), __TYPECODE(attrcontext)))
1.158 + if (__test_common_instance__(context, __TYPEPOS(attrcontext), __TYPECODE(attrcontext)))
1.159 return 1;
1.160 else
1.161 __raise_type_error();
1.162 @@ -298,7 +298,7 @@
1.163 or type instance contexts for type methods. */
1.164
1.165 if ((context == 0) || __is_instance(context) || __type_method_invocation(context, target))
1.166 - return __load_via_object(target.value, __ATTRPOS(__fn__)).fn;
1.167 + return __load_via_object(target.value, __fn__).fn;
1.168 else
1.169 return __unbound_method;
1.170 }
1.171 @@ -311,7 +311,7 @@
1.172 or type instance contexts for type methods. */
1.173
1.174 if ((context == 0) || __is_instance(context) || __type_method_invocation(context, target))
1.175 - return __check_and_load_via_object(target.value, __ATTRPOS(__fn__), __ATTRCODE(__fn__)).fn;
1.176 + return __check_and_load_via_object__(target.value, __ATTRPOS(__fn__), __ATTRCODE(__fn__)).fn;
1.177 else
1.178 return __unbound_method;
1.179 }