I understand that it is a single message send, but to know how to handle the
message at runtime, the parser needs to somehow determine where the
implementation of that message is. It must do a lookup based on multiple
keys(at, and put), which is really confusing. "methods" are easy to look up
because they only have one name, but messages have one name which is split
amongst each argument.

Simple concatenation does not make sense, since {at: x, put: y} and {a: x,
tput: y} are different messages.

The only way I can think of this being implemented "easily" is by storing a
table of entries {num_args, arg_names, impl_ref}, and then have the function
"send" do a linear search over this table until it finds an entry with
num_args = 2, each arg_name matching the argument name keys in order, and
then calling the impl_ref with the array of values without the names.

I'm wondering if there is a way to do this without having to loop over every
single message the object has, then every message its' parent object has,
and so on, just to find which function you actually want to call.

View this message in context: 
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to