Changes between Version 5 and Version 6 of RewritingPMCsInNQP

Show
Ignore:
Timestamp:
07/02/09 06:57:05 (13 years ago)
Author:
cotto
Comment:

change existing example to minimize changes to nqp, add pmc_new

Legend:

Unmodified
Added
Removed
Modified
  • RewritingPMCsInNQP

    v5 v6  
    1717$nextkey :=       key_next($INTERP, $key); 
    1818 
    19 /* possible alternative syntax */ 
    20 $nextkey := cfunc:key_next($INTERP, $key); 
    21  
    22 /* Another alternative syntax. Doesn't require parsing adjustment, iiuc. Any function in "C" namespace */ 
     19/* Alternative syntax requiring special-case treatement of "c" namespace */ 
    2320$nextkey :=    c::key_next($INTERP, $key); 
    2421}}} 
     
    5148 
    5249The equivalent L1 code will need to deal with C calling conventions and efficiently looking up (and caching) the appropriate symbol. 
     50 
     51== PMC Creation == 
     52 
     53=== nqp syntax === 
     54{{{ 
     55/* original C code */ 
     56PMC *p = pmc_new(INTERP, enum_class_Env); 
     57 
     58/* possible nqp function */ 
     59my $p := pmc_new('Env'); /* 
     60}}}