with-brain-flak ( ..A seq q: ( ..A s -- ..B s' ) -- ..B seq' )
Introduction to brain-flak

Prev:<brain-flak> ( seq -- state )


Vocabulary
brain-flak

Inputs
seqa sequence
qa quotation with stack effect ( ..A s -- ..B s' )


Outputs
seq'a sequence


Word description
Wrapper around quotations transforming a brain-flak state. Creates a newbrain-flakinstance from seq, runs q on it and extracts the final active stack into a new sequence of the same type as seq.

Examples
USING: kernel brain-flak prettyprint ; "({{}})" compile-brain-flak { 2 1 3 7 } [ swap call( state -- state' ) ] with-brain-flak .
{ 13 }

USING: brain-flak prettyprint ; { 1 2 } [ b-f"(({}({}))[({}[{}])])" ] with-brain-flak .
{ 2 1 }


See also
<brain-flak>

Definition