Modules
This documents the certain modules in Jolf. For readability, each space will be replaced by an underscore. Use a space when coding.
Prototype module
These are constructed as (space)(character)(this)(arguments).
String prototypes
_F(string)(function)- foreach overstringchar-by-char withfunction._E(string)- String replace. (NOTE: Useρto save a byte.)_i(string)(thing)-string.indexOf(thing)._h(string1)(string2)- regex search forstring2instring1; returns true if the string is found._s(string)(thing)- searchesstringforthing; literallystring.search(thing)._l(string)(bottom)(top)- slicesstringfrombottomtotop;string.slice(bottom,top)._L(string)(index)-string.slice(index)._S(string)(function)- mapsstringwithfunction._m(string)(regex as string)(flags OR "g")- matchesstringaccording to theregexandflags;string.match(new RegExp(m,o||"g"))._M(string)(regex as string)(flags)-_m, but with mandatory flags._r(string)- trims string (removes leading and trailing whitespace)._R(string)- reverses string. (NOTE: Use_(string), with a literal underscore, to save a byte.)_`(string)(index)- theindexth character instring.
Array prototypes
_e(array)(function)- checks if every value inarray"satisfies"function. (Array.every.)_f(array)(function)- filter array._F(array)(function)- array foreach._h(array)(element)- membership in array._i(array)(thing)- indexof thing in array._r(array)- random element._R(array)- reverse. (NOTE: use_(array)(literal underscore) to reverse an array.)_p(array)- pops element from array. (NOTE: useΧ(uppercase Chi) to pop an element from an array.)_s(array)- shifts element from array. (NOTE: useχ(lowercase Chi) to shift an element from an array.)_S(array)- shuffles an array._land_L- slice an array with 2 and 1 arguments, respectively._m(array)(thing)- ifthingis a function, function map. Otherwise, tries usingthingas jolf then regular JS code. Otherwise, tries to pawn you off to another language._`(array)(value)- fillarraywithvalue.
mathjs module
Called with ! + char.
\x01-getData\x02-imagToArray\x03-displayImg-abs!-acos"-acosh#-acot$-acoth%-acsc&-acsch'-add(-and)-arg*-asec+-asech,-asin--asinh.-atan/-atan20-atanh1-bellNumbers2-bignumber3-bitAnd4-bitNot5-bitOr6-eval7-bool8-catalan9-cbrt:-ceil;-chain<-clone=-combinations>-compare?-compile@-complexA-compositionB-concatC-conjD-cosE-coshF-cotG-cothH-crossI-cscJ-cschK-cubeL-deepEqualM-detN-diagO-distanceP-divideQ-dotR-dotDivideS-dotMultiplyT-dotPowU-equalV-compileW-expX-eyeY-factorialZ-filter[-fix\-permutations]-floor^-forEach_-format`-fractiona-powb-gcdc-helpd-printe-imf-indexg-intersecth-invi-isIntegerj-isNegativek-isNumericl-isPositivem-isZeron-kldivergenceo-largerp-largerEqq-lcmr-leftShifts-logt-undefinedu-undefinedv-lsolvew-lupx-bitXory-mapz-matrix{-max|-mean}-median~-min-mod£-multiply¦-nthRoot§-number¨-ones©-or«-parser¬-partitionSelect-prod°- unassigned±- unassigned²-range³-re·-round»-sin½-sizeͺ-parse΄- unassigned΅-rightArithShiftΆ-rightLogShiftΈ-secΉ-sechΊ-signΌ-sinhΎ-sluΏ-smallerΐ-smallerEqΑ-sortΒ-sparseΓ-sqrtΔ-squareΕ-squeezeΖ-stdΗ-stirlingS2Θ-stringΙ-subsetΚ-subtractΛ-sumΜ-tanΝ-tanhΞ-toΟ-traceΠ-transposeΡ-_typeof-unaryMinusΣ-unaryPlusΤ-unequalΥ-unitΦ-usolveΧ-varianceΨ-xgcdΩ-xorΪ-zeros―-c‘-mode’-multinomial€-norm₯-not
Array Z module
These are called Z<char> in the program. Currently an incomplete list.
a(Za<numA><numB>) - makes an array filled withnumAof lengthnumB. Literally,Zb*[J]j(ifJ = numAandj = numB).A(ZA<num>) - makes a zero array of lengthnum. Compare toZa0<num>andZb*[0]j.b(Zb<array>) - returns the big union of the array, i.e., flattening the array.B(ZB<arrayA><arrayB>) - returns the intersection of two arrays.c(Zc<array><num>) - returnsarraychopped into subarrays of lengthnum. For example,Zc[1,2,3,4,5]2yields[[1,2],[3,4],[5]].C(ZC<array>) - returns the cumulative summation ofarray. For example,ZC[1,2,3,4,5]yields[1,1+2,1+2+3,1+2+3+4,1+2+3+4+5] = [1,3,6,10,15].d(Zd<array>) - returns the differences between the indices ofarray. For example,Zd[1,5,2,3]yields[4,-3,1].D(ZD<str>) - convertsstrinto an array of digts.e(Ze<array><num>) - returns all entries of lengthnuminarray.E(ZE<array><num>) - returns all entries not of lengthnuminarray.f(Zf<array>) - flattens an array.F(ZF<array><num>) - flattens an array, but only to a certain depthnum.g(Zg<array>) - returns cumulative product onarray. SeeZC.G(ZG<array><func><num>) - cumulatively reducesarrayover the functionfuncwith a starting pointnum.h(Zh<any>) - returns "all but the last entry of"any. (For a number, it chops of the last digit.)H(ZH<any>) - returns "all but the first of"any. CompareZh.i(Zi<str>) - returnsstrs lines, but reversed and joined.I- unassignedj(Zj<any><num>) - returns "all but the lastN" ofany. CompareZh.J(ZJ<any><num>) - returns "all but the firstN" ofany. CompareZh.k(Zk<array>) - returns the minimal element ofarray.K(ZK<array>) - returns the maximal element ofarray. (TBA)