All pastes #330882 Raw Edit

Mine

public text v1 · immutable
#330882 ·published 2007-01-28 11:09 UTC
rendered paste body
: -- ( predField-xt size -- ) \ Ususal field
SWAP DUP ->VECT ( size  )
HERE SWAP ( size here predField-xt )
COMPILE,
SWAP LIT,
POSTPONE +
RET, ;

: <--> ( predField-xt -- ) \ CELL counter-field, and a following array afterwards
DUP ->VECT
HERE SWAP ( here predField-xt )
COMPILE,
POSTPONE DUP
POSTPONE @
POSTPONE +
RET,
;

:NONAME ; \ Starting a flexible structure
   CELL --  f1
1 CHARS --  f2
       <--> len
   CELL --  f3
DROP \ dropping, you can't use this anyway

CREATE t 100 ALLOT

3 t len !

t f1 t - .
t f2 t - .
t len t - .
t f3 t - .