Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Call-a-function/Langur/call-a-function-1.langur
Normal file
2
Task/Call-a-function/Langur/call-a-function-1.langur
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.x()
|
||||
# call user-defined function
|
||||
2
Task/Call-a-function/Langur/call-a-function-2.langur
Normal file
2
Task/Call-a-function/Langur/call-a-function-2.langur
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
write(.key, ": ", .value)
|
||||
# call built-in with parentheses
|
||||
2
Task/Call-a-function/Langur/call-a-function-3.langur
Normal file
2
Task/Call-a-function/Langur/call-a-function-3.langur
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
write .key, ": ", .value
|
||||
# call built-in with unbounded list
|
||||
3
Task/Call-a-function/Langur/call-a-function-4.langur
Normal file
3
Task/Call-a-function/Langur/call-a-function-4.langur
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
writeln "numbers: ", join ", ", [.a1, .a2, .a3, .a4]
|
||||
# unbounded lists on writeln and join
|
||||
# later function join takes remaining arguments
|
||||
3
Task/Call-a-function/Langur/call-a-function-5.langur
Normal file
3
Task/Call-a-function/Langur/call-a-function-5.langur
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
writeln "numbers: ", join(", ", [.a1, .a2, .a3, .a4]), " === "
|
||||
# unbounded list on writeln
|
||||
# join using parentheses so it doesn't take remaining arguments
|
||||
7
Task/Call-a-function/Langur/call-a-function-6.langur
Normal file
7
Task/Call-a-function/Langur/call-a-function-6.langur
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
val .sum = foldfrom(
|
||||
f(.sum, .i, .c) .sum + toNumber(.c, 36) x .weight[.i],
|
||||
0,
|
||||
pseries len .code,
|
||||
split ZLS, .code,
|
||||
)
|
||||
# split, pseries, and len using unbounded lists, ending before comma preceding line return
|
||||
4
Task/Call-a-function/Langur/call-a-function-7.langur
Normal file
4
Task/Call-a-function/Langur/call-a-function-7.langur
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for .key in sort(keys .tests) {
|
||||
...
|
||||
}
|
||||
# unbounded list on keys bounded by closing parenthesis of sort
|
||||
Loading…
Add table
Add a link
Reference in a new issue