Impl Display for ConstSubr

This commit is contained in:
Shunsuke Shibayama 2022-09-03 23:39:29 +09:00
parent f4cb9f67a5
commit 174b37d60c
4 changed files with 24 additions and 15 deletions

View file

@ -1,13 +1,13 @@
@Inheritable
Point2D = Class {x = Int; y = Int}
Point2D.
new x, y = Self::__new__ {x; y}
new x, y = Point2D::__new__ {x; y}
norm ref self = self::x**2 + self::y**2
Point3D = Inherit Point2D, Additional := {z = Int}
Point3D.
@Override
new x, y, z = Self::__new__ {x; y; z}
new x, y, z = Point3D::__new__ {x; y; z}
@Override
norm ref self = self::x**2 + self::y**2 + self::z**2