Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
1
Task/Call-a-function/Phix/call-a-function-1.phix
Normal file
1
Task/Call-a-function/Phix/call-a-function-1.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{} = myfunction()
|
||||
4
Task/Call-a-function/Phix/call-a-function-2.phix
Normal file
4
Task/Call-a-function/Phix/call-a-function-2.phix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{cities,populations} = columize(muncipalities)
|
||||
{{},populations} = columize(muncipalities) -- discard result[1]
|
||||
{cities,{}} = columize(muncipalities) -- discard result[2]
|
||||
{cities} = columize(muncipalities) -- ""
|
||||
6
Task/Call-a-function/Phix/call-a-function-3.phix
Normal file
6
Task/Call-a-function/Phix/call-a-function-3.phix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
function myfunction(integer a, string b="default")
|
||||
return {a,b}
|
||||
end function
|
||||
--? myfunction() -- illegal, compile-time error
|
||||
?myfunction(1) -- displays {1,"default"}
|
||||
?myfunction(2,"that") -- displays {2,"that"}
|
||||
2
Task/Call-a-function/Phix/call-a-function-4.phix
Normal file
2
Task/Call-a-function/Phix/call-a-function-4.phix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
?myfunction(b:="then",a:=3) -- displays {3,"then"}
|
||||
--?myfunction(b:="though") -- compile-time error
|
||||
2
Task/Call-a-function/Phix/call-a-function-5.phix
Normal file
2
Task/Call-a-function/Phix/call-a-function-5.phix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
constant integer r_my_func = routine_id("myroutine")
|
||||
?call_func(r_my_func,{1}) -- displays {1,"default"}
|
||||
1
Task/Call-a-function/Phix/call-a-function-6.phix
Normal file
1
Task/Call-a-function/Phix/call-a-function-6.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
s = append(s,item)
|
||||
Loading…
Add table
Add a link
Reference in a new issue