Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Variadic-function/EMal/variadic-function.emal
Normal file
17
Task/Variadic-function/EMal/variadic-function.emal
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
^|EMal supports variadic functions in more than one way|^
|
||||
fun print = void by text mode, List args do
|
||||
writeLine("== " + mode + " ==")
|
||||
for each var arg in args do writeLine(arg) end
|
||||
end
|
||||
fun printArgumentsList = void by List args
|
||||
print("accepting a list", args)
|
||||
end
|
||||
fun printArgumentsUnchecked = void by some var args
|
||||
print("unchecked variadic", args)
|
||||
end
|
||||
fun printArgumentsChecked = void by text subject, logic isTrue, int howMany, some text values
|
||||
print("checked variadic", var[subject, isTrue, howMany, +values]) # unary plus on lists does list expansion
|
||||
end
|
||||
printArgumentsList(var["These are the ", true, 7, "seas", "of", "Rhye"])
|
||||
printArgumentsUnchecked("These are the ", true, 7, "seas", "of", "Rhye")
|
||||
printArgumentsChecked("These are the ", true, 7, "seas", "of", "Rhye")
|
||||
Loading…
Add table
Add a link
Reference in a new issue