LocalsCore

By Andrew Owen
Released under the MIT license

Notes:

Words for manipulating local variables

set-local ( val name -- )

Set name to val

get-local ( name -- val )

Get the value associated with a local value

get-locals ( -- )

Push a stack frame for locals onto the locals stack

drop-locals ( -- )

Pop a frame of locals off the locals stack

each-local ( quot [ k v - .. ] -- locals.. )

Run a quotation for each local in the current stack frame SEE: quot>dict

incr-local-var ( name -- )

Increment the integer at :name, if it exists. Error otherwise

decr-local-var ( name -- )

Decrement the integer at :name, if it exists. Error otherwise

change ( quot varName -- .. )

prefix: $: ( quot varName -- )

prefix: -- ( name -- )

prefix: ++ ( name -- )

prefix: $ ( name -- val )

prefix: : ( val name -- )

prefix: _: ( dict name -- val )