| 108 | | fprintf(stderr,"[SMOP p6opaque] .^!how not implemented"); |
| 109 | | ret = SMOP__NATIVE__bool_true; |
| | 110 | if (SMOP_RI(capture) == (SMOP__ResponderInterface*)SMOP__NATIVE__capture) { |
| | 111 | SMOP__Object* invocant = SMOP__NATIVE__capture_invocant(interpreter,capture); |
| | 112 | SMOP__Object* set = SMOP__NATIVE__capture_positional(interpreter,capture,0); |
| | 113 | |
| | 114 | if (invocant == SMOP__p6opaque__RI) { |
| | 115 | fprintf(stderr, "[SMOP p6opaque] TODO: p6opaque RI's meta undefined yet\n"); |
| | 116 | ret = SMOP__NATIVE__bool_false; |
| | 117 | } else { |
| | 118 | if (set) |
| | 119 | smop_lowlevel_wrlock(invocant); |
| | 120 | else |
| | 121 | smop_lowlevel_rdlock(invocant); |
| | 122 | |
| | 123 | if (((SMOP__p6opaque_struct*)invocant)->metadata) { |
| | 124 | // we have our own metadata. |
| | 125 | SMOP__Object* old = ((SMOP__p6opaque_struct*)invocant)->metadata->how; |
| | 126 | ret = old; |
| | 127 | if (set) { |
| | 128 | ((SMOP__p6opaque_struct*)invocant)->metadata->how = set; |
| | 129 | ret = set; |
| | 130 | } |
| | 131 | smop_lowlevel_unlock(invocant); |
| | 132 | if (old) SMOP_RELEASE(interpreter, old); |
| | 133 | |
| | 134 | } else if (((SMOP__p6opaque_struct*)invocant)->instanceof) { |
| | 135 | |
| | 136 | // re-dispatch to the instanceof |
| | 137 | SMOP__Object* super = ((SMOP__p6opaque_struct*)invocant)->instanceof; |
| | 138 | smop_lowlevel_unlock(invocant); |
| | 139 | |
| | 140 | if (set) { |
| | 141 | fprintf(stderr, "[SMOP p6opaque] Can't set how on a instance\n"); |
| | 142 | } else { |
| | 143 | |
| | 144 | ret = SMOP__NATIVE__bool_true; |
| | 145 | SMOP__Object* frame; |
| | 146 | SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), |
| | 147 | SMOP__ID__continuation, interpreter); |
| | 148 | $frame = q:sm0p { |
| | 149 | $continuation; |
| | 150 | $super.SMOP__ID__REPR_how(); |
| | 151 | SMOP__SLIME__CurrentFrame.move_capturize(SMOP__SLIME__Capturize.new(2,(1),(),1)); |
| | 152 | $continuation.setr(); |
| | 153 | $interpreter.goto(|$continuation); |
| | 154 | }; |
| | 155 | |
| | 156 | SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), |
| | 157 | SMOP__ID__goto, |
| | 158 | frame); |
| | 159 | } |
| | 160 | |
| | 161 | } else if (set) { |
| | 162 | // create the metadata struct and set the how. |
| | 163 | |
| | 164 | |
| | 165 | } else { |
| | 166 | |
| | 167 | fprintf(stderr,"[SMOP p6opaque] TODO: invalid .^!how call\n"); |
| | 168 | } |
| | 169 | } |
| | 170 | |
| | 171 | if (set) SMOP_RELEASE(interpreter,set); |
| | 172 | SMOP_RELEASE(interpreter,invocant); |
| | 173 | } else { |
| | 174 | fprintf(stderr,"[SMOP p6opaque] TODO: non-native captures\n"); |
| | 175 | ret = SMOP__NATIVE__bool_false; |
| | 176 | } |