compile-brain-flak ( string -- quote: ( state -- state' ) )
Introduction to brain-flak

Next:b-f"


Vocabulary
brain-flak

Inputs
stringa string


Outputs
quotea quotation with stack effect ( state -- state )


Word description
Compiles a brain-flak program instringinto a quotation that can be run on abrain-flakstate object. Syntax and semantics of brain-flak are explained inIntroduction to brain-flak.

Errors
Throws an error when the string is not a correct brain-flak program

Examples
USING: accessors brain-flak kernel prettyprint ; "({{}})" compile-brain-flak { 2 1 3 7 } <brain-flak> swap call( state -- state' ) active>> .
V{ 13 }

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


See also
b-f", with-brain-flak

Definition