# get/set words as a cleaner alternative to variables # create a getter (constant with access to value) : link-@ link-constant # create the getter (behaves as a constant) latestxt # getter xt dup xt>body ; # pointer to variable "( initvalue name -- xt variable )\tCreate a getter ( -- value ) and return a pointer to the variable." , : make-@ [s] anonoumous@ link-@ ; "( initvalue -- xt variable )\tCreate a variable and anonoumous getter xt ( -- value )" , : link-! link enter, # create the getter word postpone literal # compile address postpone do-pass # and '!' as a tailjump postpone ! ; "( variable name -- xt )\tCreate a setter ( value -- ) for a variable (atompointer)." , : make-! [s] anonymous! link-! ; "( variable name -- xt )\tCreate an anonymous setter xt ( value -- ) for a variable (atompointer)." , : make-@! make-@ make-! ; "( initvalue -- var@.xt var!.xt )\tCreate an anonymous getter/setter pair." , : create-@! read link-@ read link-! ; "( initval -- )\tParses 2 words. Create a getter/setter pair.",