"chain of executions"

chain EXTENSIONS
* link, ( list -- )
 : link,        here over @ a, swap ! ;

EXTENSIONS chain ordinary primitive

chain-link

[] no special info, see general notes

EXTENSIONS chain threadstate variable

* .chain ( chain* -- )

show chain - compare with WORDS

EXTENSIONS chain ordinary primitive

* .chains ( -- )

show all chains registered in the system - compare with VLIST

EXTENSIONS chain ordinary primitive

* chain-add ( chain* "word-to-add" -- )

add chain item, for normal setup, at end of do-chain
 : chain-add ' >r begin dup @ while @ repeat here swap ! 0 , r> , ;
 ( chain-add begin dup @ while @ repeat  here swap ! 0, ' , )

EXTENSIONS chain ordinary primitive

* chain-add-before ( chain* "word-to-add" -- )

add chain item, for reverse chain like BYE
 : chain-add-before ' >r here over @ , r> , swap ! ;
 ( chain-add-before link, ' , )

EXTENSIONS chain ordinary primitive

* do-chain ( chain* -- )

execute chain
 : do-chain being @ ?dup while dup>r cell+ @execute r> repeat ;

EXTENSIONS chain ordinary primitive

* new-chain ( "name" -- )

create a new chain and register in chain-link
 : new-chain create: 0 , ['] noop , chain-link link, ;
layout of a chain:
/cell field ->chain.link
/cell field ->chain.exec
/cell field ->chain.next

EXTENSIONS chain defining primitive

xdo-chain

[] no special info, see general notes

EXTENSIONS chain forthword synonym

new-sys-chain

[] no special info, see general notes

EXTENSIONS chain forthword synonym

/* P4_DVaH ("semicolon-chain", semicolon_chain), */