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
15
Task/Compound-data-type/Phix/compound-data-type.phix
Normal file
15
Task/Compound-data-type/Phix/compound-data-type.phix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
enum x,y
|
||||
type point(object p)
|
||||
return sequence(p) and length(p)=y and atom(p[x]) and atom(p[y])
|
||||
end type
|
||||
|
||||
point p = {175,3.375}
|
||||
|
||||
p[x] -= p[y]*20
|
||||
|
||||
puts(1,"point p is ")
|
||||
?p
|
||||
printf(1,"p[x]:%g, p[y]:%g\n",{p[x],p[y]})
|
||||
|
||||
p[x] = 0 -- fine
|
||||
p[y] = "string" -- run-time error
|
||||
Loading…
Add table
Add a link
Reference in a new issue