Delegates: Difference between revisions
→{{header|M2000 Interpreter}}
Line 1,360:
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module
\\ Third version including using the object without delegate.
\\ the delegate is a pointer to group
\\ 1. We pass parameters to function operations$(), $ means that this function return string value
Line 1,411:
\\ Normal Group ' no logging to doc$
N=Thing()
Print N.operation$(
CallbyReference &N
CallbyValue N
N1->N ' N1 is a pointer to a named group
Print N1=>operation$(
CallbyReference2 &N1
CallbyValue2 N1
N1->(N) ' N1 now is a pointer to a float group (a copy of N)
Print N1=>operation$(
CallbyReference2 &N1
CallbyValue2 N1
\\ using named groups (A is a group, erased when this module exit)
A=Delegator()
Line 1,449 ⟶ 1,455:
Clipboard Doc$
}
Version3
</lang>
Line 1,455 ⟶ 1,462:
<pre>
Output:
200
150
60
200
150
60
Default implementation
Delegate implementation: 200
|