FiM++ Wiki:Proposals/Object-Orientation
< FiM++ Wiki:Proposals
58pages on
this wiki
this wiki
How to make the language allow for custom objects.
Goal is to provide the following Java-like capability:
public class Hat { }
import Hat; public class Applejack { public static Hat hat; }
import Applejack; public class MainClass { public static void main(String[] args) { Applejack.hat = new Hat(); } }
Kyli Rouge
Edit
Separate a
, an
, and the
from the type declarations and put them along with is
, has
, had
, and was
. Add a new keyword ['s
/’s
] to denote objects owned by another object (identical to Java's .
). Revise rules for variable, method, and class names so that they can still contain apostrophes, but not 's
or ’s
Dear
Princess Celestia
:
Hat
.
Your faithful student
,
Kyli Rouge
.
Remember when I wrote about
Hat
?
Dear
Princess Celestia
:
Applejack
!
Did you know that
hat
was
nothing
?
Your faithful student
,
Kyli Rouge
.
Remember when I wrote about
Applejack
?
Dear
Princess Celestia
:
MainClass
!
Today I learned
the declaring of AJ
.
Did you know that
Applejack
‘s
hat
was a
Hat
?
That's all about
the declaring of AJ
.
Your faithful student
,
Kyli Rouge
.