RosettaCodeData/Task/Delegates/J/delegates-1.j
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

13 lines
391 B
Text

coclass 'delegator'
operation=:3 :'thing__delegate ::thing y'
thing=: 'default implementation'"_
setDelegate=:3 :'delegate=:y' NB. result is the reference to our new delegate
delegate=:<'delegator'
coclass 'delegatee1'
coclass 'delegatee2'
thing=: 'delegate implementation'"_
NB. set context in case this script was used interactively, instead of being loaded
cocurrent 'base'