return null
end
+ # Execute a full `callsite` for given `args`
+ # Use this method, instead of `send` to execute and control the aditionnal behavior of the call-sites
+ fun callsite(callsite: nullable CallSite, arguments: Array[Instance]): nullable Instance
+ do
+ return send(callsite.mproperty, arguments)
+ end
+
# Execute `mproperty` for a `args` (where `args[0]` is the receiver).
# Return a falue if `mproperty` is a function, or null if it is a procedure.
# The call is polimotphic. There is a message-seding/late-bindng according to te receiver (args[0]).
var vari = v.frame.map[self.variable.as(not null)]
var value = v.expr(self.n_value)
if value == null then return
- var res = v.send(reassign_callsite.mproperty, [vari, value])
+ var res = v.callsite(reassign_callsite, [vari, value])
assert res != null
v.frame.map[self.variable.as(not null)] = res
end
args.add(i)
end
- var res = v.send(callsite.mproperty, args)
+ var res = v.callsite(callsite, args)
return res
end
end
var value = v.expr(self.n_value)
if value == null then return
- var read = v.send(callsite.mproperty, args)
+ var read = v.callsite(callsite, args)
assert read != null
- var write = v.send(reassign_callsite.mproperty, [read, value])
+ var write = v.callsite(reassign_callsite, [read, value])
assert write != null
args.add(write)
- v.send(write_callsite.mproperty, args)
+ v.callsite(write_callsite, args)
end
end
end
end
# Super init call
- var res = v.send(callsite.mproperty, args)
+ var res = v.callsite(callsite, args)
return res
end
if i == null then return null
args.add(i)
end
- var res2 = v.send(callsite.mproperty, args)
+ var res2 = v.callsite(callsite, args)
if res2 != null then
#self.debug("got {res2} from {mproperty}. drop {recv}")
return res2
if value == null then return
var mproperty = self.mproperty.as(not null)
var attr = v.read_attribute(mproperty, recv)
- var res = v.send(reassign_callsite.mproperty, [attr, value])
+ var res = v.callsite(reassign_callsite, [attr, value])
assert res != null
assert recv isa MutableInstance
recv.attributes[mproperty] = res