expected error occured:TypeError: variable 'x' cannot take number value in 'x:string:nocast'
expected error occured:TypeError: variable 'x' cannot take list value in 'x:string:nocast'
first
second
third
filterNames(['aaaa', 'bbb', 'ccccc'], 4).join(',') .. AAAA,CCCCC
0
1
2
this must be first
this must be second
a=1 b=[2,3,4]
a=1 b=2 c=3 d=4 e=[]
a=1 b=[2,3,4,5]
a=1 b=2 c=3 d=4 e=[5]
a=1 b=[2,3,4,5,6]
a=1 b=2 c=3 d=4 e=[5,6]
a=1 b=[2,3,4,5,6,7,8,9,10]
a=1 b=2 c=3 d=4 e=[5,6,7,8,9,10]
foo:1 bar:0 hoge:0
foo:0 bar:1 hoge:0
foo:0 bar:0 hoge:1
foo:1 bar:1 hoge:0
foo:1 bar:0 hoge:1
foo:0 bar:1 hoge:1
foo:1 bar:1 hoge:1
hello world
f(x, y, z) = {|x, y, z| x * y * z }
f(5, 7, 8) .. 280
expected error occurs: TypeError: variable 'x' cannot take string value in 'x:number'
1
2
3
4
5
6
7
8
9
10
12345678910
aaaabbbb
aaaabbbb
ccccdddd
eeeeffff
aaaabbbb
ccccdddd
eeeeffff
str.mid * [[0, 1], [0, 2], [0, 5], [6, -1]] .. ['H', 'He', 'Hello', 'World']
f(1 .. 10) .. 55
message from object-1
message from object-2
message from object-3
message from object-1
message from object-2
message from object-3
message from object-1
message from object-2
message from object-3
nil
expr
%{a => `println('hello')}
%{a => `println('hello')}
3
f(% { a => 1, b => 2, c => 3, d => 4 }%) .. a=1 b=2 c=3 d=4 %{}
f(% { a => 1, b => 2 }%, % { c => 3, d => 4 }%) .. a=1 b=2 c=3 d=4 %{}
f(% { a => 1, b => 2 }%, % { c => 3 }%, d => 4) .. a=1 b=2 c=3 d=4 %{}
f(1, 2, 3, 4, % { a => 1, b => 2, c => 3, d => 4 }%) .. a=1 b=2 c=3 d=4 %{a => 1, b => 2, c => 3, d => 4}
f(1, 2, 3, 4, % { 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 }%) .. a=1 b=2 c=3 d=4 %{'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4}
f(1, % { a => 1, b => 2, c => 3, d => 4 }%) .. a=1 %{a => 1, b => 2, c => 3, d => 4}
expected error occurs: ValueError: dictionary assignment is not effective
expected error occurs: ValueError: dictionary assignment is not effective
funcorg() = { }
funcnew() = { }
funcnew1() = { }
[a, b] = [1, 1]
[a, b] = [1, 2]
[a, b] = [1, default]
[a, b] = [2, 1]
[a, b] = [2, 2]
[a, b] = [2, default]
[a, b] = [default, 1]
[a, b] = [default, 2]
[a, b] = [default, default]
f(x) .. 15
f(a, b, c, d, e:number) = {|a, b, c, d, e| a + b + c + d + e }
f(1, 2, 3, 4, 5) .. 15
f([1, 2, 3], [4, 5, 6]) .. [[1, 4], [2, 5], [3, 6]]
g([1, 2, 3], [4, 5, 6]) .. [[1, [4, 5, 6]], [2, [4, 5, 6]], [3, [4, 5, 6]]]
f(1 .. 10) .. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
f(1 .. 10) .. ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
f(1 .. 10) .. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
100
expected error occurs: TypeError: variable 'm' cannot take number value in 'm:match'
expected error occurs: TypeError: variable 'm' cannot take string value in 'm:match'
f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) .. a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 %{}
f(1, 2, 3, [4 .. 10]*) .. a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 %{}
f(1, 2, 3, [4 .. 6]*, 7, 8, 9, 10) .. a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 %{}
f(1, 2, 3, [4 .. 6]*, 7, [8 .. 10]*) .. a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 %{}
f([1 .. 3]*, [4 .. 6]*, 7, [8 .. 10]*) .. a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 %{}
f .. string#left(len?:number):map
f(3) .. hel
f(5) .. hello
f(9) .. hello wor
['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh']::left * 2 .. ['fi', 'se', 'th', 'fo', 'fi', 'si', 'se']
[['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh']:*left * 2] .. ['fi', 'se', 'th', 'fo', 'fi', 'si', 'se']
f(a, b, c, d, rest*, dict%) = { format('a=%d b=%d c=%d d=%d rest=%s dict=%s', a, b, c, d, rest, dict):nomap }
f(1, 2, 3, 4, 5, 6) .. a=1 b=2 c=3 d=4 rest=[5, 6] dict=%{}
f(1, 2, 3, 4, 5, 6, e => 2, f => 3) .. a=1 b=2 c=3 d=4 rest=[5, 6] dict=%{e => 2, f => 3}
f(a, b, c, d, dict%) = format('a=%d b=%d c=%d d=%d dict=%s', a, b, c, d, dict)
f(1, 2, 3, 4) .. a=1 b=2 c=3 d=4 dict=%{}
f(1, 2, d => 4, c => 4) .. a=1 b=2 c=4 d=4 dict=%{}
f(a => 1, b => 2, c => 3, d => 4) .. a=1 b=2 c=3 d=4 dict=%{}
f(c => 3, a => 1, b => 2, d => 4) .. a=1 b=2 c=3 d=4 dict=%{}
f(b => 2, c => 3, d => 4, a => 1, e => 1) .. a=1 b=2 c=3 d=4 dict=%{e => 1}
f(d => 4, 1, 2, 3) .. a=1 b=2 c=3 d=4 dict=%{}
f(d => 4, 1, 2, 3, e => 5, f => 6, g => 7) .. a=1 b=2 c=3 d=4 dict=%{e => 5, f => 6, g => 7}
a=2, b=nil:0, c=nil:0
a=2, b=3:1, c=nil:0
a=2, b=3:1, c=def:1
a=2, b=10, c=abc
a=2, b=3, c=abc
a=2, b=3, c=def
a=2, b=3, c=[4, 5, 6, 7]
a=2, b=3, c=[]
a=2, b=3, c=[4, 5, 6, 7]
expected error occurs: TypeError: not enough arguments
test of closure
 3 4 5 6 7 8
 5  3  2  4
 6  4  3  5
 7  5  4  6
 8  6  5  7
 9  7  6  8
10  8  7  9
11  9  8 10
12 10  9 11
13 11 10 12
14 12 11 13
  0  1  2  3  4  5  6  7  8  9 10
-0.139708
f(x) = x
g(x):void = x
f(2) .. 2
g(2) .. nil
f($x, $y) = { $x < $y }
f(1, 3) .. true
f(4, 3) .. false
f($a, $b, $c, $d, $e, $f, $g, $h, $i, $j) = { $a + $b + $c + $d + $e + $f + $g + $h + $i + $j }
f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) .. 55
math.acos(num):map .. [1.5708, 1.45946, 1.3467, 1.23096, 1.11024, 0.981765, 0.841069, 0.679674, 0.475882, 0]
math.asin(num):map .. [0, 0.111341, 0.224093, 0.339837, 0.460554, 0.589031, 0.729728, 0.891123, 1.09491, 1.5708]
math.atan(num):map .. [0, 0.110657, 0.218669, 0.321751, 0.418224, 0.507099, 0.588003, 0.661043, 0.726642, 0.785398]
math.ceil(num):map .. [-2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 2]
math.cos(num):map .. [-0.416147, -0.0291995, 0.362358, 0.696707, 0.921061, 1, 0.921061, 0.696707, 0.362358, -0.0291995, -0.416147]
math.cosh(num):map .. [3.7622, 2.57746, 1.81066, 1.33743, 1.08107, 1, 1.08107, 1.33743, 1.81066, 2.57746, 3.7622]
math.exp(num):map .. [0.135335, 0.201897, 0.301194, 0.449329, 0.67032, 1, 1.49182, 2.22554, 3.32012, 4.95303, 7.38906]
math.abs(num):map .. [2, 1.6, 1.2, 0.8, 0.4, 0, 0.4, 0.8, 1.2, 1.6, 2]
math.floor(num):map .. [-2, -2, -2, -1, -1, 0, 0, 0, 1, 1, 2]
math.sin(num):map .. [-0.909297, -0.999574, -0.932039, -0.717356, -0.389418, 0, 0.389418, 0.717356, 0.932039, 0.999574, 0.909297]
math.sinh(num):map .. [-3.62686, -2.37557, -1.50946, -0.888106, -0.410752, 0, 0.410752, 0.888106, 1.50946, 2.37557, 3.62686]
math.sqrt(num):map .. [1.41421j, 1.26491j, 1.09545j, 0.894427j, 0.632456j, 0, 0.632456, 0.894427, 1.09545, 1.26491, 1.41421]
math.tan(num):map .. [2.18504, 34.2325, -2.57215, -1.02964, -0.422793, 0, 0.422793, 1.02964, 2.57215, -34.2325, -2.18504]
math.tanh(num):map .. [-0.964028, -0.921669, -0.833655, -0.664037, -0.379949, 0, 0.379949, 0.664037, 0.833655, 0.921669, 0.964028]
math.log(num):map .. [0, 0.693147, 1.09861, 1.38629, 1.60944, 1.79176, 1.94591, 2.07944, 2.19722, 2.30259]
math.log10(num):map .. [0, 0.30103, 0.477121, 0.60206, 0.69897, 0.778151, 0.845098, 0.90309, 0.954243, 1]
5 .. should be 5
