Changes between Version 2 and Version 3 of RewritingPMCsInNQP

Show
Ignore:
Timestamp:
06/26/09 07:18:46 (5 years ago)
Author:
cotto
Comment:

add some example L1 code, although any relation to the implemented L1 is probably coincidental

Legend:

Unmodified
Added
Removed
Modified
  • RewritingPMCsInNQP

    v2 v3  
    1111=== nqp syntax === 
    1212{{{ 
     13/* original C code */ 
    1314nextkey   =       key_next( INTERP,  key); /* from hash.pmc:get_number_keyed */ 
    14 $nextkey :=       key_next($INTERP, $key); /* proposed equivalent in nqp */ 
     15 
     16/* possible equivalent nqp-like code */ 
     17$nextkey :=       key_next($INTERP, $key); 
    1518$nextkey := cfunc:key_next($INTERP, $key); /* possible alternative syntax */ 
    1619}}} 
     
    1922 
    2023==== equivalent L1 code ==== 
     24 
    2125{{{ 
    22 ??? 
     26# NOTE: This code may be plausible and it may be terrible. 
     27#       It's late and I wanted to try writing some L1. 
     28c_arg      INTERP 
     29c_arg      key 
     30c_return   nextkey 
     31find_cfunc $P0, 'next_key' 
     32call_cfunc $P0 
    2333}}} 
    2434