2016-03-28 13:27:03 +00:00
|
|
|
|
|
|
|
#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)
|
|
|
|
{
|
|
|
|
|
2016-04-30 05:56:35 +00:00
|
|
|
#method(#class) main2
|
|
|
|
{
|
|
|
|
| k |
|
|
|
|
k := ['this is test-011' dump. Exception signal. 8888 dump. ]
|
2016-05-01 13:49:36 +00:00
|
|
|
on: Exception do: [ :ex | 'Exception occurred' dump. ex dump. 'Getting back to' dump. ex return: 9999. 'AFTER RETURN' dump. ].
|
|
|
|
|
|
|
|
k dump.
|
|
|
|
'END OF test-011' dump.
|
|
|
|
}
|
|
|
|
|
|
|
|
#method(#class) test3
|
|
|
|
{
|
|
|
|
| k j |
|
|
|
|
j := 20.
|
|
|
|
k := [
|
|
|
|
'>>> TEST3 METHOD >>> ' dump.
|
|
|
|
j dump.
|
|
|
|
(j < 25) ifTrue: [Exception signal].
|
|
|
|
'OOOOOOOOOOOOOOOOOOOOOOO' dump.
|
|
|
|
'JJJJJJJJJJJJJJ' dump.
|
|
|
|
] on: Exception do: [ :ex | 'Exception occurred' dump. j := j + 1. ex resume. ].
|
2016-04-30 05:56:35 +00:00
|
|
|
|
|
|
|
k dump.
|
|
|
|
'END OF test-011' dump.
|
|
|
|
}
|
|
|
|
|
2016-03-28 13:27:03 +00:00
|
|
|
#method(#class) main
|
|
|
|
{
|
2016-04-30 05:56:35 +00:00
|
|
|
'>>>>> BEGINNING OF MAIN' dump.
|
|
|
|
|
2016-05-01 13:49:36 +00:00
|
|
|
[ self main2 ] on: Exception do: [ :ex | 'EXCEPTION CAUGHT IN MAIN....' dump. "ex pass" ].
|
|
|
|
|
|
|
|
'##############################' dump.
|
|
|
|
self test3.
|
2016-04-30 05:56:35 +00:00
|
|
|
'>>>>> END OF MAIN' dump.
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|
|
|
|
}
|