Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Delegates/J/delegates-1.j
Normal file
13
Task/Delegates/J/delegates-1.j
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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'
|
||||
15
Task/Delegates/J/delegates-2.j
Normal file
15
Task/Delegates/J/delegates-2.j
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
obj=:conew'delegator'
|
||||
operation__obj''
|
||||
default implementation
|
||||
setDelegate__obj conew'delegatee1'
|
||||
┌─┐
|
||||
│4│
|
||||
└─┘
|
||||
operation__obj''
|
||||
default implementation
|
||||
setDelegate__obj conew'delegatee2'
|
||||
┌─┐
|
||||
│5│
|
||||
└─┘
|
||||
operation__obj''
|
||||
delegate implementation
|
||||
Loading…
Add table
Add a link
Reference in a new issue