summaryrefslogtreecommitdiff
path: root/ipl/packs/loadfuncpp/examples/methodcall.icn
blob: ab48d06bc93ddb63ccef23951dceb64682683aa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

link loadfuncpp


record thing(val, method)

procedure method(x)
	object := self() | stop("not bound to a record")
	object.val := x
end

procedure main()
	
	obj := thing()
	obj.method := bindself(method, obj)
	
	write(image(obj.method))
	
	obj.method(99)
	
	write( obj.val )
end