...
The Java VM is still the right target but might be fun to start out having an interpreter written in Java.
Hmm...what would it look like?
Code Block |
---|
Animal subclass: Dog
const int w = 3.
String name = 'Rex'.
float weight = 0.0.
speak [ sys println: 'woof' ]
feed: int food [ weight += food * w ]
walk: Point to from: Point here [
...
]
float howMuchFood [ ^weight / w ]
boolean equals: other [ ^self name == other name ]
|
'.' is separator not terminator
'=' not ':='
hmm...maybe it's ok to have keywords for var, method, types. Nah. You know it's better to use java-style syntax except maybe methods. I like having smalltalk style methods so youcan essentially add keywords at will. The problem is that people will expect Java semantics then. Hm...