F-Flat

F♭ (pronounced F-flat) is a toy language.


Project maintained by Hypercubed Hosted on GitHub Pages — Theme by mattgraham

Converts a stack item to a “function” definition

[src]

Internal Vocabulary Words

[src]

defer

Stores a value in the dictionary that raises an error when executed. Used to allocate a word before it is used, for example in mutually-recursive

a: ->

f♭> a: defer
[ ]
[src]

; (def)

stores a definition in the current dictionary

a: [A] ->

f♭> sqr: [ dup * ] ;
[ ]
[src]

use

Move the contents of a map into scope

{A} ->

f♭> { ... } use
[ ]
[src]

vocab

Write the current local vocabulary to the stack

-> {A}

f♭> vocab
[ { ... } ]
[src]

defined?

returns true if the word is defined in the current vocabulary

a: -> bool

f♭> 'sqr' defined?
[ true ]
[src]

see

recalls the definition of a word as a string

a: -> str

f♭> 'sqr' see
[ '[ dup * ]' ]
[src]

show

prints the definition of a word as a formatted string

a: ->

f♭> "sqr" show
[ dup * ]
[ ]
[src]

words

-> [str*]

returns a list of defined words

[src]

locals

-> [str*]

returns a list of locals words

[src]

scoped

-> [str*]

returns a list of local scoped words

[src]

rewrite

{A} [B] -> [C]

rewrites an expression using a set of rewrite rules

[src]