Debian Codegraph @

ipl/packs/loadfuncpp/examples/methodcall.icn

raw
1
2 link loadfuncpp
3
4
5 record thing(val, method)
6
7 procedure method(x)
8 object := self() | stop("not bound to a record")
9 object.val := x
10 end
11
12 procedure main()
13
14 obj := thing()
15 obj.method := bindself(method, obj)
16
17 write(image(obj.method))
18
19 obj.method(99)
20
21 write( obj.val )
22 end
23