\ xts 05.2.27 NAB
\ original 2001.4.17 JCF
\ xtvalue / xtto, etc.
\ the xts may be stored in a console
\ session and used after MakePRC.

needs core-ext

module xts

public:

: xtvalue ( xt "<spaces>name" -- )
    :
    SWAP
    [COMPILE] literalxt
    [COMPILE] ;
;

:NONAME
    4 + cs!
;

private:

: (xtto) ( xt xt -- ) [ SWAP ]
    STATE @ IF
        [COMPILE] literalxt
        [ OVER ] literalxt
        COMPILE,
    ELSE
        [ swap compile, ]
    THEN
;

public:

: xtto ' (xtto) ; IMMEDIATE

: xts ( n*xt n -- xt )
    :NONAME >R
    for COMPILE, next
    R> [COMPILE] ;
;

: xtfifo ( xt valxt -- )
    DUP >R EXECUTE
    2 xts R> (xtto)
;

: xtlifo ( xt valxt -- )
    DUP >R EXECUTE
    SWAP 2 xts R> (xtto)
;

end-module
