\ DEFER and chaned execution (For the fun).
\ But I don't know how to do that with the actual DEFER definition.
: defer ( -- ) create 0 , does> @execute ;
: defer@ ( xt1 -- xt2 ) >body @ ;
: defer! ( xt2 xt1 -- ) >body ! ;
: +IS
state @ abort" interpret ony"
' dup defer@
:noname >r
compile,
swap
compile,
postpone ;
r> swap defer! ;
\ test
defer initialize
: one ." one" cr ;
' one +is initialize
: two ." two" cr ;
' two +is initialize
________________
Charles Mélice a écrit :
> Why to use >CHAIN, RUNCHAIN ?
>
> \ Execution chain for "Initialize" - last defined, first executed.
>
> : Initialize ( -- )
> do-this ;
>
> : Initialize
> do-that Initialize ;
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and
> bug reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
>
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue Jun 16 2009 - 23:41:16 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.