Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
15
Task/Function-prototype/Lua/function-prototype.lua
Normal file
15
Task/Function-prototype/Lua/function-prototype.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
function Func() -- Does not require arguments
|
||||
return 1
|
||||
end
|
||||
|
||||
function Func(a,b) -- Requires arguments
|
||||
return a + b
|
||||
end
|
||||
|
||||
function Func(a,b) -- Arguments are optional
|
||||
return a or 4 + b or 2
|
||||
end
|
||||
|
||||
function Func(a,...) -- One argument followed by varargs
|
||||
return a,{...} -- Returns both arguments, varargs as table
|
||||
end
|
||||
1
Task/Function-prototype/Perl-6/function-prototype-10.pl6
Normal file
1
Task/Function-prototype/Perl-6/function-prototype-10.pl6
Normal file
|
|
@ -0,0 +1 @@
|
|||
sub foo (@, &:(Str --> Int)) {...}
|
||||
1
Task/Function-prototype/Perl-6/function-prototype-9.pl6
Normal file
1
Task/Function-prototype/Perl-6/function-prototype-9.pl6
Normal file
|
|
@ -0,0 +1 @@
|
|||
sub foo ([$, @]) {...}
|
||||
Loading…
Add table
Add a link
Reference in a new issue