Handbook
Glossary
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
seq
a
sequence
q
a
quotation
with stack effect
( ..A s -- ..B s' )
Outputs
seq'
a
sequence
Word description
Wrapper around quotations transforming a brain-flak state. Creates a new
brain-flak
instance 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
USING:
accessors
kernel
sequences
;
IN:
brain-flak
:
with-brain-flak
( ..A seq q: ( ..A s -- ..B s' ) -- ..B seq' )
swap
[
<brain-flak>
swap
call
active>>
]
keep
clone-like
;
inline