Skip to content

Quick Start

Jayson Harshbarger edited this page Apr 16, 2016 · 8 revisions

F♭ is an experiment. Currently, it can be only be used by cloning the github repo.

git clone https://github.com/Hypercubed/f-flat_node.git
cd f-flat_node
npm install
npm start

The stack

f♭> 1
[ 1 ]

f♭> 2
[ 1 2 ]

f♭> 3
[ 1 2 3 ]

f♭> clr
[  ]

** In the following examples it is assumed the stack is clear **

Math

f♭> 1 1 +
[ 2 ]
f♭> -2 sqrt
[ 0+1.4142135623730950488i ]

Print

f♭> "Hello" println
Hello
[  ]

Conditions

f♭> 1 1 +
[ 2 ]

f♭> 2 =
[ true ]

f♭> "One plus one is two"
[ true 'One plus one is two' ]

f♭> 'One plus one is not two'
[ true 'One plus one is two' 'One plus one is not two' ]

f♭> choose
[ 'One plus one is two' ]

Lists

f♭> [ 20 30 40 ]
[ [ 20 30 40 ] ]

f♭> length
[ 3 ]

Maps

f♭> { hello: "a greeting" }
[ { hello: 'a greeting' } ]

f♭> { goodbye: "a parting" }
[ { hello: 'a greeting' } { goodbye: 'a parting' } ]

f♭> <<
[ { hello: 'a greeting' goodbye: 'a parting' } ]

f♭> @hello
[ 'a greeting' ]

Strings

f♭> "foo"
[ 'foo' ]

f♭> "bar"
[ 'foo' 'bar' ]

f♭> +
[ 'foobar' ]

f♭> 0 @
[ 'f' ]
f♭> "this is a test"
[ 'this is a test' ]

f♭> " "
[ 'this is a test' ' ' ]

f♭> /
[ [ 'this' 'is' 'a' 'test' ] ]
f♭> "this is a test"
[ 'this is a test' ]

f♭> 2 10 slice
[ 'is is a ' ]
Clone this wiki locally