Show
Ignore:
Timestamp:
07/03/08 23:23:38 (5 months ago)
Author:
ruoso
Message:

[smop] still more work on p6opaque, few bugs fixed, some slime bugs still.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/src/p6opaque.sm0p

    r21182 r21201  
    115115        fprintf(stderr, "[SMOP p6opaque] TODO: p6opaque RI's meta undefined yet\n"); 
    116116        ret = SMOP__NATIVE__bool_false; 
     117      } else if (SMOP_RI(invocant) != (SMOP__ResponderInterface*)SMOP__p6opaque__RI) { 
     118        fprintf(stderr, "[SMOP p6opaque] call to repr method with non p6opaque invocant\n"); 
     119        ret = SMOP__NATIVE__bool_false; 
    117120      } else { 
    118121        if (set) 
     
    140143          if (set) { 
    141144            fprintf(stderr, "[SMOP p6opaque] Can't set how on a instance\n"); 
     145            SMOP_RELEASE(interpreter,set); 
    142146          } else { 
    143147 
     
    145149            SMOP__Object* frame; 
    146150            SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    147                                                        SMOP__ID__continuation, interpreter); 
     151                                                       SMOP__ID__continuation, SMOP_REFERENCE(interpreter,interpreter)); 
    148152            $frame = q:sm0p { 
    149153              $continuation; 
     
    161165        } else if (set) { 
    162166          // create the metadata struct and set the how. 
    163          
    164  
     167          SMOP__p6opaque_LOWL_metadata* m = calloc(1,sizeof(SMOP__p6opaque_LOWL_metadata)); 
     168          assert(m); 
     169          m->how = set; 
     170          ((SMOP__p6opaque_struct*)invocant)->metadata = m; 
     171          smop_lowlevel_unlock(invocant); 
     172 
     173          ret = SMOP_REFERENCE(interpreter, set); 
    165174        } else { 
    166  
    167175          fprintf(stderr,"[SMOP p6opaque] TODO: invalid .^!how call\n"); 
    168176        } 
     
    182190    SMOP__Object* frame; 
    183191    SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    184                                                SMOP__ID__continuation, interpreter); 
     192                                               SMOP__ID__continuation,  
     193                                               SMOP_REFERENCE(interpreter,interpreter)); 
    185194    $frame = q:sm0p { 
    186195      $capture;