# REDIRECTIONG OUTPUT : with-output-to-stream >output try execute recover drop-output throw endtry drop-output ; "( xt stream -- )\tExecute code with output to string." doc # PRINTING TO STRING # FIXME: this should be an output stack, with 2 XT's for print + write # and one context slot, in the same way the input works. : with-output-to-string-append dup >r open-string >output try execute recover rdrop drop-output throw endtry r> drop-output ; : with-output-to-string string with-output-to-string-append ; "( xt -- string )\tExecute code with output to string." doc # in brood, all '.' words are replaced by 'p' words, because the dot # is a special symbol to denote pairs in lisp style. this is here just # so i don't need to change my habbit again. and, it makes it sort of # 'dc compatible' : ps .S ; : p . ;