2016-03-28 13:27:03 +00:00
|
|
|
|
2017-01-09 12:52:37 +00:00
|
|
|
#include 'Moo.moo'.
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
////////////////////////////////////////////////////////////////#
|
|
|
|
// MAIN
|
|
|
|
////////////////////////////////////////////////////////////////#
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 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.
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
extend Apex
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
extend SmallInteger
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-01-06 09:53:40 +00:00
|
|
|
method getTrue: anInteger
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
^anInteger + 9999.
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method inc
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
^self + 1.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
class TestObject(Object)
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-04-24 09:20:27 +00:00
|
|
|
var(#class) Q, R.
|
|
|
|
var(#classinst) a1, a2.
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
class MyObject(TestObject)
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-04-24 09:20:27 +00:00
|
|
|
var(#classinst) t1, t2.
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) main2
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
'START OF MAIN2' dump.
|
|
|
|
t1 value.
|
|
|
|
'END OF MAIN2' dump.
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) main1
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
'START OF MAIN1' dump.
|
|
|
|
self main2.
|
|
|
|
t2 := [ 'BLOCK #2' dump. ^200].
|
|
|
|
'END OF MAIN1' dump.
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) main
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
|
|
|
'START OF MAIN' dump.
|
|
|
|
t1 := ['BLOCK #1' dump. ^100].
|
|
|
|
self main1.
|
|
|
|
'END OF MAIN' dump.
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|