Warning: session_start(): open(/var/lib/php/sessions/sess_cdnr8ftasitalmi2ej0ism3tgk, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!include once #1034034 // Gazelle 22 Function Include for Scripts
please include class IF1.
please include class IF0.
svoid test_leftArrowScript_lambdas() {
// IF1 with global function (l)
var test = new TestFunctionValues(l1 leftArrowVerbose);
test.io([[map (IF1 l) (ll "hey ho" "world")]], ll(6, 5)).runAndClear();
// IF1 with global function & currying (plus)
new TestFunctionValues(l1 leftArrowVerbose)
.io([[map (IF1 plus 5) (ll 2 12)]], ll(7, 17))
.run();
// IF0 with method on implicit object
class X {
int i = 1;
int next() { ret i++; }
}
new GazelleV_LeftArrowScriptParser parser;
parser.allowTheWorld(new X, mc());
assertEqualsVerbose(ll(1, 2, 3), parser.parse("repF 3 (IF0 next)")!);
// lambda from script-defined function!
test.io([[
def twice x { joinWithSpace x x }
map (IF1 twice) (ll "yes" "no")
]], ll("yes yes", "no no"));
// ...and once again with curried arguments
test.io([[
def subFrom100 a b c { minus 100 (intSum a b c) }
map (IF1 subFrom100 10 5) (ll 2 22)
]], ll(83, 63));
test.runAndClear();
}