Skip to content
Jayson Harshbarger edited this page Apr 13, 2016 · 3 revisions

Base Internal Functions

+ (plus)

( x y -> z)

  • list concatenation/function composition
  • boolean or
  • object assign/assoc
  • arithmetic addition
f♭> 1 2 +
[ 3 ]
  • string concatenation

- (minus)

( x y -> z)

f♭> 2 1 -
[ 1 ]
  • boolean xor
  • arithmetic subtraction

* (times)

( x y -> z)

f♭> 2 3 *
[ 6 ]
  • intersparse
  • string join
  • boolean and
  • repeat sequence

/ (forward slash)

( x y -> z)

f♭> 6 2 /
[ 3 ]
  • boolean nand
  • string split
  • array/string slice
  • arithmetic division

>>

right shift

( x y -> z)

> 1 [ 2 3 ] >>
[ 1 2 3 ]
  • unshift/cons
  • object merge
  • Sign-propagating right shift

<<

Left shift

( x y -> z)

f♭> [ 1 2 ] 3 <<
[ [ 1 2 3 ] ]
  • push/snoc
  • object merge
  • Left shift

choose

conditional (ternary) operator

( {boolean} [A] [B] -> {A|B} )

f♭> true 1 2 choose
[ 1 ]

@ (at)

returns the item at the specified index in a sequence

( {seq} {index} -> {item} )

> [ 1 2 3 ] 1 @
[ 2 ]

i

push the imaginary number 0+1i

( -> 0+1i )

infinity

pushes the value Infinity

( -> Infinity )

f♭> i
[ 0+1i ]

cmp

( x y -> z ) pushes 0 if rhs and lhs are equal pushes 1 if lhs is > rhs pushes -1 otherwise

f♭> 1 2 cmp
[ -1 ]
Clone this wiki locally