Changeset 187 for trunk/thune/scripts

Show
Ignore:
Timestamp:
06/20/06 05:09:27 (3 years ago)
Author:
krobillard
Message:

Thune - Major improvement to the handling of local function values.
Locals can now be passed to inner functions and caught when returned.
Functions are no longer tied to the thread which created them.

The localArgBlk has been eliminated and locals are now stored on the stack.
To accomodate this, the data stack is now separate from the control stack
and grows upwards. This also means that functions can no longer access the
stack below the function call. A limit of one returned value is in place.

To regain full stack usage, locals could be stored on the control stack.
The only downside would be an extra copy of arguments from the data to
the control stack.

ur_wordCell() is now a function rather than a macro.

uc_do() has been merged into ur_eval() and 'do is now implemented as an opcode.

. & .s now use uc_console_out() rather than dprint.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/scripts/replace.t

    r184 r187  
    3333[ 
    3434    none :rules 
     35    none :a 
     36    none :b 
     37    none :conv 
     38][ 
     39    dup ['reverse (drop [b a]) ([a b])] case :conv 
     40    read swap 
    3541 
    36 /* 
    37     [rules [a (b prin) |] copy 'a infuse join tail prev mark.eol drop] 
    38     'a 'b foreach 
     42    [] copy :rules 
     43    parse.white conv [ 
     44        rules [a (b prin) |] copy 'a infuse join tail prev mark.eol drop 
     45    ] 
     46    foreach 
     47    rules [:tok skip (tok first prin)] join 
    3948 
    40     none dup :wa :wb 
    41     [ 
    42         rules wa append 
    43               wb [none prin] paren! as 1 poke copy append 
    44               '| word! as append prev mark.eol 
    45               drop 
    46     ] 'wa 'wb foreach 
    47 */ 
    48  
    49     [ 
    50         dup second rules swap append drop 
    51             first  [none prin] paren! as 1 poke copy 
    52         rules swap append '| word! as append prev mark.eol drop 
    53         next 
    54     ] :reverse 
    55  
    56     [ 
    57         dup first  rules swap append drop 
    58             second [none prin] paren! as 1 poke copy 
    59         rules swap append '| word! as append prev mark.eol drop 
    60         next 
    61     ] :normal 
    62  
    63     normal :conv 
    64  
    65     [ 
    66         [] copy :rules 
    67         parse.white conv iter 
    68         rules [:tok skip (tok first prin)] join 
    69     ] 
    70     proc :make-rules        ; (words ['reverse]-- ) 
    71 ][ 
    72     dup ['reverse (drop reverse) normal] case :conv 
    73     read swap make-rules parse.some drop 
     49    parse.some drop 
    7450] 
    7551proc.env :find&replace      ; (words file ['reverse] -- )