No, the two statements don't do the same thing. The second statement sets the value of the selector property of theObj to whatever is between the parentheses (maybe, if &rest works with property messages; I'm not sure of that). The first statement executes the method (or gets/sets the property) of theObj given by the selector property of the executing object.
Not quite. In the proc999_7 I posted I had actually changed the var names for readability, but that just caused confusion. In either case, the intention is to call a selector that is only known at runtime.
(procedure public (proc999_7 param1 param2 param3) // param2 is a selector value (presumably only known at runtime)
(send param1:param2(rest param3))
)
Why would the calling code use proc999_7? Only if there would otherwise be ambiguity in the syntax - or rather, if the variable name of the variable containing the selector value was actually a selector name.
With code like this:
(send myObj:myVarWithSelectorValue(stuff))
there's no point to using proc999_7, since myVarWithSelectorValue isn't a valid selector (so we know to use the value of the variable instead).
But if your code was:
(send myObj:selector(stuff))
"selector" is a valid selector (#535), so the compiler thinks the code is trying to set the value of the selector property on myObj. But the actual intent is to call a method on myObj, where the method selector is stored in the selector property of the current object. This code appears in the Slider class, which has a "selector" property.
The other usage is in Game:doit. In this case, the variable is "thePanelSelector", but this is a fabricated variable name from my decompiler. That suggests that whatever variable name was used in the original source code at this point conflicted with an actual selector name. So they needed to use proc999_7.
The conclusion to be drawn is that Sierra's syntax suffered from the same ambiguity as SCI Studio's syntax when it comes to invoking selectors that are only known at runtime (which answers a question I had posed earlier in this thread). Thus they required this little helper procedure.