datastack-states ( stack quot -- stack seq )


Vocabulary
continuations.extras

Inputs
stackan array
quota quotation with stack effect ( ... -- ... )


Outputs
stackan array
seqan array


Word description
Executes an array of words with an input, preserving intermediary values, taking a quotation and a seq containing inputs for the quotation. Will execute the words in the quotation and store any intermediary values into the outputted seq. Returns a seq containing the words executed as well as any produced output. Can be used together with simple-table. as a form of super simple printf-style debugging.

Examples
USING: ascii continuations.extras kernel prettyprint sequences ; { "Hello World!" } [ [ Letter? ] filter >lower dup reverse = ] datastack-states simple-table.
{ "Hello World!" } [ Letter? ] { "Hello World!" ~quotation~ } filter { "HelloWorld" } >lower { "helloworld" } dup { "helloworld" "helloworld" } reverse { "helloworld" "dlrowolleh" } = --- Data stack: { f }


Definition