45 lines
696 B
Smalltalk
45 lines
696 B
Smalltalk
|
|
||
|
#include 'Stix.st'.
|
||
|
|
||
|
#################################################################
|
||
|
## MAIN
|
||
|
#################################################################
|
||
|
|
||
|
## TODO: use #define to define a class or use #class to define a class.
|
||
|
## use #extend to extend a class
|
||
|
## using #class for both feels confusing.
|
||
|
|
||
|
#extend Apex
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
#extend SmallInteger
|
||
|
{
|
||
|
#method getTrue: anInteger
|
||
|
{
|
||
|
^anInteger + 9999.
|
||
|
}
|
||
|
|
||
|
#method inc
|
||
|
{
|
||
|
^self + 1.
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#class TestObject(Object)
|
||
|
{
|
||
|
#dcl(#class) Q R.
|
||
|
#dcl(#classinst) a1 a2.
|
||
|
}
|
||
|
|
||
|
|
||
|
#class MyObject(TestObject)
|
||
|
{
|
||
|
|
||
|
#method(#class) main
|
||
|
{
|
||
|
['this is test-011' dump. Exception signal. ] on: Exception do: [ :ex | 'Exception occurred' dump ].
|
||
|
}
|
||
|
}
|