This language reference was recovered and many bugfixes to it have been lost. If you notice any errors or if descriptions aren't clear enough please notify me. I want to keep this as accurate and complete as possible.

Builtin Types

The following builtin types exist:

Builtins

deepmap means that the command automatically maps over blocks. deepzip means, that the command automatically zipsWith over blocks. deepfilter means that the command automatically filters blocks. (strings usually too). deepzip2 means, that the command automatically box cycles non block arguments if the other argument is a block and then deepzips.

NameIdentArgsDescription
AbsabInt a
Double a
Abs a
Add.+Int a, Int bRegular integer addition (a + b)
.+Double a, Double bAddition (a + b)
.+Double a, Int b(a + b)
.+Int a, Double b(a + b)
.+Str a, Str bString concatenation (a ++ b)
.+Block a, Block bBlock concatenation (a ++ b)
.+Char a, Char bAppend chars to form a string
.+Str a, Char bAppend char to string
.+Int b, Str a
Int b, Block a
Str a,Int b
Block a,Int b
Take b characters from a
AddX_+Int a, Int bReturns a block with a and b
_+Double a, Double bReturns a block with a and b
_+Str a, Str bString concatenation (a ++ b)
_+Block a, Block bBlock concatenation (a ++ b)
_+Char a, Char bAppend chars to form a string
_+Str a, Char b
Char a, Str b
Append char to string
_+Str a, Int b
Int a, Str b
Append int to string
_+Block a, Any bAppend b to a
AllalDefined as m[r&
AllAlphaaaDefined as {rd}m[al
AllAlphaNumanDefined as {ri}m[al
AllDigitadDefined as {><}m[al
And&&Int a, Int bBitwise and
&&deepzip2 (int)
AndLsr&Defined as {&&}r[
AnyayDefined as m[r|
Append[+Block a, Any b
Int a, Int b
Append b to a
[+Str a,Char bAppend b to a
ApplyapBlock f, Int idx, Block xs
Int idx, Block f, Block xs
Applies f to the element in xs at index idx
ApplyRegex~aString a, Block f, String regexApply the function f to every substring that matched the regex.
"123b23"{<-}"[0-9]+"~a results in "321b32"
AverageavBlock aDefined as ^^ ++ \/ L[ pd ./
avDouble aFloor a
Average2AVDefined as PDav
AsinTSDouble a
Int a
asin
TSdeepmap
AcosTCDouble a
Int a
acos
TCdeepmap
AtanTTDouble a
Int a
atan
TTdeepmap
BlockAccess!!Block a, Int n
Str a, Int n
Return the nth element
BoxbxAny aPut a in an empty block
BoxCyclebcDefined as bxcy
BoxSPbsDefined as bxsp
BoxSP2BSDefined as bxspsh
BinomialDCumulativeBcInt n, Double prb, Double cbinomial distribution cumulative
BinomialDPropabilityBpInt n, Double prb, Int nthbinomial distribution probability
CeilingclDefined as pdpd
ChoosechDefined as \/n!!!
ChooseWordsCWDefined as wdch
ChiSquaredDCumulativeccInt df, Double cchisquared distribution cumulative
ChiSquaredDDensitycdInt df, Double cchisquared distribution density
ChiSquaredDQuantilecqInt df, Double cchisquared distribution quantile
ChiSquaredTestctDefined as ^^x/?-2?^\/0.0?+?/++
ChunksOfcoBlock a, Int n
Str a, Int n
Int a, Int n
Split a into chunks of size n
ChunkyCOBlock a, Int n
Str a, Int n
Int a, Int n
Create n-grams. "abc"2CO is {"ab" "bc"}
CoolMapM-Defined as \/bxcy\/z[{p^+]e!}m[. Example: 2{{?i}{?d}}M-
CoerceAdd?+Double a, Int b
Int a, Double b
Defined as pd.+
?+Str a, Int b
Int a, Str b
Defined as Sh.+
?+Str a, Double b
Double a, Str b
Defined as Sh.+
?+Block a, Int b
Int a, Block b
Defined as bxcy?+
?+Block a, Double b
Double a, Block b
Defined as bxcy?+
?+Block a, Str b
Str a, Block b
Defined as bxcy?+
?+Block a, Block bDefined as {^p?+}Z[
CoerceDiv?/Double a, Int b
Int a, Double b
Defined as pd./
?/Str a, Int b
Int a, Str b
Defined as Sh./
?/Str a, Double b
Double a, Str b
Defined as Sh./
?/Block a, Int b
Int a, Block b
Defined as bxcy?/
?/Block a, Double b
Double a, Block b
Defined as bxcy?/
?/Block a, Str b
Str a, Block b
Defined as bxcy?/
?/Block a, Block bDefined as {^p?/}Z[
CoerceFactorial?!Int aDefined as ropd
?!Block aDefined as {?!}m[
CoerceMul?*Double a, Int b
Int a, Double b
Defined as pd.*
?*Str a, Int b
Int a, Str b
Defined as Sh.*
?*Str a, Double b
Double a, Str b
Defined as Sh.*
?*Block a, Int b
Int a, Block b
Defined as bxcy?*
?*Block a, Double b
Double a, Block b
Defined as bxcy?*
?*Block a, Str b
Str a, Block b
Defined as bxcy?*
?*Block a, Block bDefined as {^p?*}Z[
CoercePow?^Double a, Int b
Int a, Double b
Defined as pd.*
?^Block a, Int b
Int a, Block b
Defined as bxcy?*
?^Block a, Double b
Double a, Block b
Defined as bxcy?*
?^Block a, Str b
Str a, Block b
Defined as bxcy?*
?^Block a, Block bDefined as {^p?^}Z[
CoerceSub?-Double a, Int b
Int a, Double b
Defined as pd.-
?-Str a, Int b
Int a, Str b
Defined as Sh.-
?-Str a, Double b
Double a, Str b
Defined as Sh.-
?-Block a, Int b
Int a, Block b
Defined as bxcy?-
?-Block a, Double b
Double a, Block b
Defined as bxcy?-
?-Block a, Str b
Str a, Block b
Defined as bxcy?-
?-Block a, Block bDefined as {^p?-}Z[
CoerceSqrt?sInt aDefined as pdr@
?sBlock aDefined as {?s}m[
CoerceInc?iDouble aDefined as 1.0?+
?iBlock aDefined as {?i}m[
CoerceDec?dDouble aDefined as 1.0?-
?dBlock aDefined as {?d}m[
CollectStackCLCollects the whole stack in a Block and pushes the Block to the stack
CollectStackReverseClDefined as CL<-
Concat\[aDefined as {_+}r[
ConcatMap\mDefined as m[\[
Contains~[Block a, Any bDoes a contain b?
~[Str a, Char bDoes a contain b?
~[Int a, Int bDoes a contain the digits of b?
~[Str a, Str bDoes a contain b?
CondcnAny a, Block condsconds is a block with conditions at even indices and what happens at odd indices. I.e. 3 {{15.%n!} "FizzBuzz" {5.%n!} "Fizz" {3.%n!} "Buzz"}cn
If no condition matches it returns a.
Continuationc!Block aContinuation with a
ContinuationManyC!Block a, Int nRuns the continuation a exactly n times
ContinuationManyReverse!CDefined as C!#<
ConvertBaseB!Int n, Int bconvert n to base b (result is a string)
B!deepzip2 (int,string)
B!String n, Int bParse n as an number in base b (result is an int)
ConvertBase2b2Defined as 2B!
ConvertBase16b6Defined as 16B!
ConvertBase10b0Defined as 10B!
CombinationsCBBlock a, Int n
Str a, Int n
Int a, Int n
Generate a list of combinations of a of length n
CombinationsUpTocbBlock a, Int n
Str a, Int n
Int a, Int n
Generate a list of combinations of a up to length n
ComparecmAny a, Any bCompare a with b (1 for greater, 0 for equal, -1 else)
Compare 2CMDefined as ^^bx(\/)[+\/[+(\/)[+(cm)[+ Can be used to construct a comparison function for sortBy. (L[)CMsb sorts by length.
It generates a block of the form {xx \/ xx \/ cm} where xx is the command passed as argument.
Compare 3CmDefined as^^(\/)[+\/.+{\/cm}.+
Esentially it behaves the same as Compare 2 but takes a block with
multiple commands.
CosTcDouble a
Int a
cosinus
Tcdeepmap
CheckckDefined as n!n!
CrossProductcpBlock a, Block b
Str a, Str b
Crossproduct (a x b)
CountCNDefined as: {*==}fl (where * is the argument supplied to CN)
CyclecyBlock a
Str a
Repeat a infinite times
cyInt aConvert to string and then cycle
Decrement-.Int aDecrement a--
-.Char aPrevious char (chr(ord(a)-1))
-.Str a
Block a
Prepend head of a to a
DeleteIndicesdiDefined as (RA)\/[[(RA)[+e!
DiffLs\\Block a, Block b
Str a,Str b
Int a, Int b
List difference (a \\ b)
DigitsdgInt n, Int bReturns the digits of n base b. E.g. 14 3dg={1 1 2}
DimArrayAccessd!Defined as (!!)\/[[(!!)[+e!
DimArraySetD!Block arr, Block adr, Any eSets the element in arr at position adr to e (see DimArrayAccess)
Div./Int a, Int bRegular integer division (a / b)
./Double a, Double bDivision (a / b)
./Double a, Int b(a / b)
./Int a, Double b(a / b)
./Str a,Str bIf a starts with b, remove b from a
DividesdvDefined as .%n!
DropWhiledwBlock p
Block ls
drop elements from ls as long as p holds true
dwBlock p
Str s
Defined as **dw\[
DropWhileSwappedDWDefined as \/dw
Dup^^
J
Duplicate top most element on the stack
DupSwap^/Defined as ^^ \/
EmptyBlockToStresConverts an empty block to an empty string. Else it does nothing
Equal==Any a, Any bComparision (a == b)
Evale!Block aEval a block
EvalManyE!Defined as .*\[e!
EveryNthenStr a, Int n
Block a, Int n
Int a, Int n
Returns a block/str/int containing every nth element/char/digit
ExponentialDCumulativeecDouble lambda, Double cexponential distribution cumulative
ExponentialDDensityedDouble lambda, Double cexponential distribution density
ExponentialDQuantileeqDouble lambda, Double cexponential distribution quantile
FactorsfcInt aReturn a block with every number a is divisible by
Order of the block returned is smallest first.
fcStr a
Block a
Least common element
Filterf[Block f, Str a
Block f, Block a
Filters a list according to the predicate f (must return 1 or 0)
FilterFromOneFODefined as \/1\/r@\/f[
FilterFromZeroFZDefined as \/0\/r@\/f[
FilterLengthflDefined as f[L[
FilterLinesW[Defined as \/ln\/f[un
FilterMapFMBlock f, Block mBehaves as f FILTER m MAP ({f}f[{m}m[).
FilterWordsw[Defined as \/WD\/f[wd
FilterWordsBfwDefined as f[wd
FilterUnlinesfuDefined as f[un
FindIndexfiBlock a, Block f
Str a, Block f
Find index of element where f returns true.
FindIndexEqFiBlock a, Any p
Str a, Char p
Find index of an element equal to p
FindIndicesfIBlock a, Block f
Str a, Block f
Like FindIndex but does not stop on the first match but instead returns a list of indices.
FindElementfeBlock a, Block f
Str a, Block f
Find an element where f is true and return it
FlattenFLBlock xsCompletely flatten xs
FloorfoDefined as avpd
FlipBitsfpInt aFlip all bits in a
FormatFFPretty a, Int bChanges the format of a according to b
FormatFromFormatFfn/aDefined as FF ff
FrequencyListf:Returns a Block of Blocks with {count element}. Counts how many times each element occurs in a list.
Defined as sg{^^L[\/-]bx\/+]}m[<>
FrequencyListPercentageF:Like FrequencyList but contains relative percentages. Defined as f:u[\/PD^^++?/\/z[
FromFormatffPretty aExtracts the string out of the pretty
GenerateListOGODefined as POP1\/R@PUSHm[
GenerateListZGZDefined as POP0\/R@PUSHm[
Geq>=Any a, Any b a >= b
Gcdg_Int a, Int bgcd(a,b)
g_Block a
Str a
Defined as ^^-]\/[-\/
Greater.>Any a, Any bComparision (a > b)
GrepgrDefined as {~=}\/+]\/ln\/f[un
GeometricDCumulativegcDouble succrate, Double cshifted geometric distribution cumulative
GeometricDPropabilitygpDouble succrate, Int nthshifted geometric distribution probability
Group=[Block aGroup (equal consecutive) elements in a
GroupBygbBlock xs, Block f
Block str, Block f
Group by a comparison function f.
GroupBy2gBBlock xs, Block f
Block str, Block f
Group by a function f where f takes one argument.
{1 2 3 5 7 4 8 2 0}{3.>}gB yields {{1 2 3} {5 7 4 8} {2 0}}
GroupLengthglDefined as =[L[
GroupNubgnDefined as =[{-]}m[
GroupSortgsDefined as =[><
GroupWithLengthgwDefined as =[{^^L[\/-]bx\/+]}m[
Head-]Block a
Int a
First element
-]Str aFirst character
HeadTail-~Defined as -][-
HidehdHide element and move to the bottom of the stack
Hide2HDHide element but keep on top
HyperGeometricDCumulativehcInt m, Int l, Int k, Double cshifted hypergeometric distribution cumulative
k elements, l population, m elements of one kind
HyperGeometricDPropabilityhpInt m, Int l, Int k, Int nthshifted hypergeometric distribution probability
IsErrorisReturn 1 on error 0 else
IfElseieBlock a, Block b, Int cIf c then a else b
IffifBlock b, Int aIf a then execute b, else pop a and pop b
ifInt a, Block bIf a then execute b, else pop a and pop b
ImplodeimDefined as {++}r[
Increment+.Int aIncrement (a++)
+.Char aNext char (chr(ord(a)+1))
+.Str a
Block a
Append last of a to a
InfixOf~~Block a, Block bDoes a contain b (as a consecutive subsequence)?
Init~]Block a
Int a
All except the last element
~]Str aAll except the last character
~]Int aAll except last digit
InitsiTStr xs
Block xs
Generates all inits.
{1 2 3}iT results in {{} {1} {1 2} {1 2 3}}
InitTail~-n/aDefined as ~][-
IntercalateicDefined as [[\[
IntercalateSwappedICDefined as \/ic
IntersectionINBlock a, Block b
Str a,Str b
Int a, Int b
Intersection
Intersperse[[Any a, Block b
Char a,String b
Inserts a between every two element in b
IntersperseSwapped[]Defined as \/[[
InsertAtiaStr ls, Char e, Int idx
Block ls, Any e, Int idx
Insert element e into ls at index idx
ItitRemoves everything from the stack except the element on the top.
Last[~Block a
Int a
Last element of the block
Lcml_Int a, Int blcm(a,b)
l_Block a
Str a
Defined as ^^-]\/[-\/
LengthL[Block aLength of a
L[Str aLength of a
L[Int aConvert to char (chr a)
L[Char aReturn case of a as 'A or 'a
Leq<=Any a, Any b a <= b
LeftPadlpDefined as x/Shx/\/x/x/\/P[
LineslnStr aSplits a string into lines
lnInt aNumber of digits in an integer
LoadldInt nLoad the nth hidden element from the bottom of the stack (put on top)
Load2LDDefined as lde!
LoglgDouble a
Int a
log(a) (natural logarithm)
Log2LGDefined as lg\/lg./
LogBase2l2Defined as 2\/LG.
LogBase10l0Defined as 10\/LG.
LoopLONot much known about this builtin. However: One example usage is:
{1 2 3 4 5 4}0{.>}LO results in {1 2 3 4 5}
LoopIndicesLISame thing as Loop but returns the indices of the elements instead of their values.
Example usage: {0 0 2 3 4 5 4}0{==}LI results in {0 1}
Mapm[Block ls, Block fApply f to every element in ls and collect the result in a block
m[Str ls, Block fDefined as \/ XX \/ m[ \[
MapDup[mDefined as (^^)+]m[
MapParse[MDefined as (ps)+]m[
MapPrettyM[Defined as m[ sh
MapProductmpDefined as m[pd
MapPushMPDefined as m[p^
MapPushMany^mPrepends ^p then maps.
MapPushManyReversem^Prepends p^ then maps.
MapString]mDefined as {*Sh}m[ (append Sh)
MapSummsDefined as m[++
MapWordsmwDefined as m[wd
MapUnlinesmuDefined as m[ln
MapToPrettyM]Defined as {sh}m[
MapToPrettyFromFormatm]Defined as {shff}m[
Matches~=String a, String regex1 if regex matches, else 0
MatchesAll~?String a, String regexReturns a block of all substrings that matched the regex.
"123b23""[0-9]+"~? results in {"123" "23"}
MatchesList=~String a, String regexReturns a list of subexpression matches
MatchRegex~&String a, String regexReturns a list with three elements. Everything before the match, the match and everything after it.
"ab123cde""[0-9]+"~& results in {"ab" "123" "cde"}
MatrixMultiplicationmmBlock a,Block bMatrix multiplication
Max>.Any a, Any bMax(a,b)
Maximum>]Block aMaximum(a)
>]Str a
Int a
Biggest character
MaximumBy>mDefined as Cmsb<--]
Min<.Any a, Any bMin(a,b)
Minimum<]Block aMinimum(a)
<]Str a
Int a
Smalles character
MinimumBy<mDefined as Cmsb-]
Modulo.%Int a, Int ba `mod` b
.%deepzip (int)
MoveMVInt nMoves the n-th element of the stack to the top
MkAndm&BlsqBlock a, BlsqBlock bDefined as ^^ae!\/be!&& (bold stuff refers to the arguments passed)
MkOrm|BlsqBlock a, BlsqBlock bDefined as ^^ae!\/be!|| (bold stuff refers to the arguments passed)
MkXorm$BlsqBlock a, BlsqBlock bDefined as ^^ae!\/be!$$ (bold stuff refers to the arguments passed)
Mul.*Int a, Int bRegular integer multiplication (a * b)
.*Double a, Double bMultiplication (a * b)
.*Str a, Int nReturns a block containing n copies of a
.*Char a, Int nReturns a string containing n copies of a
.*Block a, Int nReturns a block containing n copies of a
.*Double a, Int b(a * b)
.*Int a, Double b(a * b)
MultiplesOfmoDefined as 1R@\/?* (infinite block of multiples)
.*Str a,Str breverse b++a
NegatengDefined as -1?*
NubNBBlock a
Str a
Int a
Remove duplicate elements
NullnuDefined as L[n!
NormalDCumulativencDouble mean, Double std, Double cnormal distribution cumulative
NormalDDensityndDouble mean, Double std, Double cnormal distribution density
NormalDQuantilenqDouble mean, Double std, Double cnormal distribution quantile
Notn!Int aBoolish not
n!Block a
Str a
Most common element
NotEqual!=Defined as == n!
NotZero?nzDefined as z?n!
nCrnrInt n, Int knCr(n,k)
nrdeepzip (int)
Or||Int a, Int bBitwise or
||deepzip2 (int)
OrLsr|Defined as {||}r[
PadLeftP[Str a, Int c, Char b
Block a, Int c, Any b
Pad (left) a to length c with b
PadRight[PStr a, Int c, Char b
Block a, Int c, Any b
Pad (right) a to length c with b
ParsepsStr aParses the string as a Burlesque expression and returns a Block
psdeepmap
ParseEvalpeDefined as pse!
ParseIdPILike Parse but only returns the Head of the Block
PartialpaBlock xs, Block fPartial generates inits from xs and applies f to each of those.
{1 2 3 4}{++}pa results in {1 3 6 10}.
This builtin is horribly slow.
PartitionptBlock xs, Block p
Str xs, Block p
Partitions a block (or str) into two blocks containing elements
which satisfy p and not satisfying p. (Like doing two filter passes with p and with NOT p).
PoissonDCumulativepcDouble lambda, Double cpoisson distribution cumulative
PoissonDPropabilityppDouble lambda, Int nthpoisson distribution probability
PopvvRemove top most element from the stack
PopSwapv/Defined as vv \/
Pow**Int a, Int bRegular integer power (a ^ b)
**Double a, Double bDouble power (a ** b)
**Block a, Block bMerge blocks
**Str a, Str bMerge strings
**Char aordinal a. (ord a).
PlusMinuspmDefined as .+.-
PrefixOf~!Block a, Block bIs b a prefix of a?
~!Int a, Int bIs b a prefix of a?
~!Str a, Str bIs b a prefix of a?
Prettysh
Q
Any aConvert to pretty type (FormatNormal)
PrettyPrettysHDefined as SHsh
PrettyFormatFromFormatSHn/aDefined as \/ sh \/ Ff
PrettyFromFormatShn/aDefined as sh ff
Prepend+]String a, Char b
Block a,Any b
Int a,Int b
Prepends b to a
PrimeFactorsfCInt aPrime factorization of a (8 = 2 * 2 * 2)
fCDouble aa * a (multiplies a with a)
fCdeepmap
ProductpdBlock aDefined as {.*}r[. Returns Int 1 on empty list.
pdDouble aCeiling a
pdInt aConvert to double
ProductManyPDDefined as {pd}m[
PushMany^pStr a
Block a
Push every element to the stack
PushManyReversep^n/aLike ^p but in reverse order
RandomIntsrnInt seed, Int low, Int highReturns an infinite block of random (by seed) ints with range (low,high).
RandomDoublesRNInt seed, Double low, Double highReturns an infinite block of random (by seed) doubles with range (low,high).
Ranger@Int a, Int bA block containing natural numbers from a to b (range a b)
r@Char a, Char bSame, except for characters
r@Double aSquare root
r@String aAll permutations of a
r@Block aAll permutations of a
RangeFromOneroDefined as 1\/r@
RangeFromZerorzDefined as 0\/r@
RangeInfR@Int aA block containing natural numbers from a to Infinity
R@Str a
Block a
All subsequences of a
RangeInfFromZeror0Defined as 0R@
RangeInfFromOner1Defined as 1R@
RangeConcatr\Defined as r@\[
RangeModulormInt x, Block [Int lo, Int hi]Bound x into range (lo,hi) using modulo
(((x - lo) `mod` (succ (hi-lo))) + lo)
ReadIntriInt aIdentity for integers
riStr aTries to convert a string to an integer
riChar aIs Alpha numeric?
rideepmap
ReadDoublerdDouble aIdentity for doubles
rdStr aTries to convert a string to an double
rdChar aIs Alpha?
rddeepmap
ReadArrayraStr aTries to read an array in [,] notation
raChar Is space?
radeepmap
Reducer[Block ls, Block fReduce ls with f
RemoveAtRABlock ls, Int idx
Str ls, Int idx
Remove element at index idx from ls
RABlock ls
Str ls
Defined as sapd2.0./av!!
Reverse<-Int aReverses the digits of the integer
<-Str aReverses the string
<-Block aReverses the block
<-Char aInvert case
ReverseStack#<Reverses the stack
Replacer~Block ls, Any old, Any newReplaces old in ls with new
r~Str ls, Char old, Char newReplaces old in ls with new
r~Str ls, Str old, Str newReplaces old in ls with new
r~Int ls, Int old, Int newReplaces old in ls with new (digitwise)
ReplaceRegexR~Str s, Str repl, Str regexRegex replace
RightPadrpDefined as x/Shx/\/x/x/\/[P
Roundr_Double a, Int bRound a to b decimal places
r_Block a, Int bDefined as {b r_}m[
Round2R_Defined as 0r_pd
RotatertDefined as l_\/+]
Rotate2RTDefined as g_[+
RotationsiRStr xs
Block xs
Generates all rotations.
{1 2 3}iR results in {{1 2 3} {2 3 1} {3 1 2}}
SamesmDefined as ^^-]{*==}al. (Checks whether all elements in a list are equal to the head i.e. are the same)
SelectIndicessiBlock ls, Block adr
Str ls, Block adr
Select elements from ls by indices in adr. "ABCD"{1 0 3}si => "BAD"
SelectLinesslDefined as \/ln\siun
SelectWordsswDefined as \/WD\/siwd
SelectIfSIDefined as zi:^p)-]si
SetAtsaStr ls, Char e, Int idx
Block ls, Any e, Int idx
Set element in ls at index idx to e
saBlock ls
Str ls
Defined as ^^L[
SignumsnInt a
Double a
Signum a
SimpleFormatf~Defined as \/"~";;\/{Sh}m[**\[
Smaller.<Any a, Any bComparision (a < b)
Sort><Str a
Block a
Int a
Sort a
><Char aIs digit?
SortEqual=sDefined as ><\/><==
SortedsoDefined as ^^><==
SortedNubSnDefined as {><}m[NB
SortedReverseNubsNDefined as {<>}m[NB
SortedReverseSODefined as ^^<>==
SortReverse<>Defined as ><<-
SortBysbBlock ls, Block f
Str ls, Block f
SortBy f (f must return 0 (equal), 1 (greater) or -1 (smaller))
SortByComparingscDefined as CMsb
SortGroupsgDefined as ><=[
SinTsDouble a
Int a
sinus
Tsdeepmap
SpecialInputSPStr aCan be used to read 2D-Input. Defined as ln{}[M
SpecialInputPrettyspDefined as SPsh
SPBlock aCan be used to write 2D-Output. Defined as {{Sh}m[wd}m[un
Split;;String str, String bSplit string by b
;;Block ls, Block bSplit ls by b
;;Int ls, Int bSplit ls by b
SplitRegexsrStr regex, Str sSplit s by regex
SplitRegex2~;Str a, Str regexLike MatchesRegex2, but the resulting list does not contain the actual match.
StandardDeviationSDObviously defined as vr?s
StudentTDCumulativeScDouble param, Double cStudentT distribution cumulative
StudentTDDensitySdDouble param, Double cStudentT distribution density
StudentTDQuantileSqDouble param, Double cStudentT distribution quantile
StrEqIgnoreCases=Defined as zz\/zz\/==
StringAdd|+Defined as PIjPIj?+
StringDiv|/Defined as PIjPIj?/
StringMul|*Defined as PIjPIj?*
StringSub|-Defined as PIjPIj?-
StringInc|iDefined as PI?i
StringDec|dDefined as PI?d
StringUnlinesSuDefined as m]ln
StringWordsSwDefined as m]wd
StripLeftS[Block a, Any b
Str a, Char b
Strip (left) b from a
S[Int aa * a (multiplies a with a)
StripRight[SBlock a, Any b
Str a, Char b
Strip (right) b from a
StrStrssDefined as ^^L[x/\/CO\/Fi . Returns the index of a substring in a string.
like C's strstr
Sub.-Int a, Int bRegular integer subtraction (a - b)
.-Double a, Double bSubtraction (a - b)
.-Str a, Str bString de-concatenation. If a "endsWith" b, remove b from a.
.-Block a, Block bBlock de-concatenation. If a "endsWith" b, remove b from a.
.-Int b, Str a
Block a, Int b
Str a,Int b
Block a,Int b
Drop b characters from a
.-Double a, Int b(a - b)
.-Int a, Double b(a - b)
SubstringssuStr s
Int s
Block s
all substrings of s sorted by length
SuffixOf!~Block a, Block bIs b a suffix of a?
!~Int a, Int bIs b a suffix of a?
!~Str a, Str bIs b a suffix of a?
Sum++Block aDefined as {.+}r[. Returns Int 0 on empty list
++Int a,Int bConcatenate digits.
Swap\/
j
Swap elements on top of the stack.
SwapDup/^Defined as \/ ^^
SwapPop/vDefined as \/ vv
Tail[-Block a
Int a
All except first element.
[-Str aAll except first character
[-Char aConvert to string
[-Int aAll except first digit
TailsiSStr xs
Block xs
Generates all tails.
{1 2 3}iS results in {{1 2 3} {2 3} {3} {}}
TakeWhiletwBlock p
Block ls
take elements from ls as long as p holds true
twBlock p
Str s
Defined as **tw\[
TakeWhileSwappedTWDefined as \/tw
TanTtDouble a
Int a
tangens
Ttdeepmap
ToDoubletdStr s
Int s
Double s
Convert to double
ToInttiStr s
Int s
Double s
Convert to int
ToLowerzzStr a
Char a
to lower case
zzdeepmap
ToUpperZZStr a
Char a
to upper case
ZZdeepmap
ThatthRemoves everything from the stack except the element on the bottom
TransposetpBlock aTranspose block of blocks (Matrix transpose)
TrimLeftt[Str aTrim left
t[deepmap
TrimRightt]Str aTrim right
t]deepmap
TrimLeftRightttStr aDefined as t[ t]
TrimLinestlDefined as ln{tt}m[un
TypeOftoAny aReturns the type of a as Str
UndigitsugList digits, Int baseReverses what Digits (dg) does.
UngroupU[Ungroups. (Reverses what f: does, except for the order, because f: sorts).
Defined as {p^.*}\m
UnionUNBlock a, Block b
Str a,Str b
Int a, Int b
Union
UniformDCumulativeucDouble low, Double high, Double cuniform distribution cumulative
UniformDDensityudDouble low, Double high, Double cuniform distribution density
UniformDQuantileuqDouble low, Double high, Double cuniform distribution quantile
UniqueU_Defined as ^^NB==
Unlinesunn/aDefined as "\n" \/ [[ \[
UnlinesPrettyuNDefined as unsh
Unzipu[Unzips. (Reverses what z[ does). Defined as ^^{-]}m[\/{[~}m[
VariancevrDefined as ^^^^avbx(?-)[+m[2?^++\/L[-.?/
Version??Version string
WordswdStr aDefined as " ";;
wdBlock aDefined as ' \/[[\[
wdaDefined as \/]]
Words2WDStr aSplits a string into a list of words. (This also treats other whitespaces which the regular wd does not).
Words3wDDefined as wdsh
Whilew!Block f, Block pWhile p execute f. (p is expected to leave an Int on top of the stack)
Executing p does not affect the global stack.
w!Block fSame effect as {f}{}w!
WithLineswln/aDefined as \/ ln \/ m[ un
WithLinesStringWlDefined as {*Sh}WL (appends Sh)
WithLinesPrettyWLn/aDefined as wl sh
WithLinesParsePrettywLn/aDefined as {ps*}WL (prepends ps to block)
WithWordswwn/aDefined as \/ WD \/ m[ wd
WithWordsPrettyWWn/aDefined as wwsh
Xor$$Int a, Int bBitwise xor
$$deepzip2 (int)
XplodeXXStr aConvert a to a block of characters
XXInt aConvert a to a block of digits
XXDouble aConvert a to block containing ceiling a and floor a
XXChar aConvert a to a string
XXBlock aIdentity
XSwapx/If the stack order is [a,b,c] XSwap changes it to [b,c,a]
Zero?z?Returns 1 if the argument passed was zero, an empty string, an empty list or a null byte.
Zipz[Block a, Block b
Str a,Str b
Block a, Str b
Str a,Block b
Zips
ZipIndicesziDefined as 0R@\/z[
ZipWithZ[Defined as z[\/m[
ZipWithPushZ]Defined as {^p*}Z[. Prepends ^p.
Since 1.7.4

Syntax

 
Special :: oneOf ",)@:%"
Double :: { digit }+ , "." , { digit }+
Int :: { digit }+
Char :: "'" , anyChar
String :: "\"" , { anyChar }* , "\""
Block :: "{" , { Expression }* , "}"
Quoted :: "(", ExpressionSingle , ")"
Identifier :: noneOf "1234567890{},' \"" , anyChar
SingleIdent :: oneOf "jJQ"
ExpressionSingle :: { SingleIdent | Block | Int | Char | String | Quoted | Identifier }
Expression = { ExpressionSingle }*

Format / Pretty

If you write a Burlesque program like "Hello, world!" you will see, that the output is also "Hello, world!" and not Hello, world!. Stuff is printed the same way you enter it in code unless you change it to the 'Pretty' type. The sh command for example does this. "Hello, world!"sh outputs Hello, world!. Keep in mind that sh changes the type to Pretty, so it's not a string anymore and you can not treat it as a string. A pretty value can have different formattings and currently the following exist:

{1 2 3}sh1FF is [1,2,3]. {1 2 3}sh0FF is [1, 2, 3]. {1 2 3}sh2FF is [1 2 3].

Lazy

Burlesque is a lazy programming language which means that it only evaluates stuff that is necessary to evaluate. A good example for this is the RangeInf command. 1R@"ABCD"z[ generates an infinite list 1..Infinity and zips it with "ABCD". However, its support for lazyness is limited and does not extend to every command.

Hack mode

Hack mode was an experimental feature that never made it into production.

Store load shortcuts

These are: a -> 0, b -> 1, c -> 2. For Load: #*. For Load2: !*. For Store: `*. Replace * with the corresponding letter. Example: 5 6hd#a.+`a33#a.+.Hides 6, loads it, adds it to 5, stores the result, push 33, load 0, add => 44.

Coerce commands

Coerce commands fall back to their none coerce corresponding commands if the arguments do not match!

Commands taking Int

Int is unbounded. However, some commands only work with bounded integers. Unbounded integers are automatically converted. This conversion from unbouded -> bounded can have side-effects.

Math constants

Pi : pi => 3.141592653589793
e : ee => 2.718281828459045

Special

For , read the FAQ. ) is the block map modifier. It encloses the next token inside a map statement. Therefore

 
blsq ) {"abc" "dba"})<-
{"cba" "abd"}
: is the block filter modifier.
blsq ) "abc98a8"{><}f[
"988"
blsq ) "abc98a8":><
"988"
@ has multiple functions. When prefixed to an ident, it converts the ident into two characters.
blsq ) @az
'z
'a
When @ is prefixed to a character it converts the character to an infinite string containing only said character.
blsq ) @'z100.+
"zzzzzzzzzzzzzzzzzzzzzzzzzz ......
zzzzzzzzzzzzzzzzzzzzz"
When @ is prefixed to an integer it is converted to a double.
blsq ) @5
5.0

Advanced manipulation functions

Global state stack

Since Burlesque 1.7.3 you can use state even inside maps/filters etc. (However, this doesn't work for sortBy yet). Burlesque 1.7.3 now runs with two stacks.

Global state stack commands

Example
blsq ) 5Pp4Pp{1 1 1 1 1}{pPp/}m[
{4 1 5 1 4 1 5 1 4 1}