This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Call notation | |
var slice = callable.callable(Array.prototype.slice); | |
slice([1, 2, 3, 4], 1, 3) -> [2, 3] | |
// Apply notation | |
var slicea = callable.applicable(Array.prototype.slice); | |
slicea([1, 2, 3, 4], [1, 3]) -> [2, 3] | |
// Call notation binding leading arguments | |
var sliceb = callable.callable(Array.prototype.slice, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var t = sssf.compile("@s(:[1,])"); | |
t('abc') -> 'bc' | |
t({}) -> 'object Object]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssf.format("Hello @", "world") -> "Hello world" | |
// Formatting from an object. | |
ssf.format("Member['a']:@a Member['c']['d']:@c.d", {'a':1, 'c': {'d': 2}}) | |
-> "Member['a']:1 Member['c']['d']:2" | |
// Formatting from an array. | |
ssf.format("Array[0]:@0 Array[1]:@1", ['A', 3]) -> "Array[0]:A Array[1]:3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let FactorialContinuation{val cust}< | |
case \arg: send val ('*' arg cust) ; | |
> | |
let Factorial < | |
case 0 \cust: send cust (1) ; | |
case \val \cust: | |
send val ('-' 1 < | |
case \result: | |
send Factorial (result FactorialContinuation{val cust}) |
NewerOlder