Polymorphism: Difference between revisions
Content added Content deleted
(Added Kotlin) |
|||
Line 2,884: | Line 2,884: | ||
return {x,r} -- {point,r} |
return {x,r} -- {point,r} |
||
end if |
end if |
||
return {{x,y},r} |
return {{x,y},r} -- {point,r} |
||
-- (or {new_point(x,y),r} if you prefer) |
|||
end function |
end function |
||
point p = new_point(4,5) |
point p = new_point(4,5) |
||
circle |
circle c1 = new_circle(p,6), |
||
c2 = new_circle(4,5,6} |
|||
?p |
|||
?c1 |
|||
? |
?c2</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
{4,5} |
{{4,5},6} |
||
{{4,5},6} |
{{4,5},6} |
||
</pre> |
</pre> |