-
Actions…Nao
(April 4th, 2013, 01:38 PM) » Is it me, or do most hooks in Wedge (and SMF) *not* allow modifying the parameters...? Way to give freedom to plugins... :(
Actions…Dragooon (April 4th, 2013, 03:28 PM) » In many cases it won't make a difference to modify parameters. Plus afaik one can always take in parameters as reference and modify them since pass by reference is deprecated? Actions…Arantor (April 4th, 2013, 04:01 PM) » It's as Dragooon says - it works exactly as expected. A lot of people got bitten by this (but curiously enough not me because I wrote my hookable mods properly in the first place) Actions…Nao (April 4th, 2013, 09:27 PM) » but since they're passed by array to add_hook, which then redirects to user_func_call, shouldn't the reference be lost in the middle of the trip..? Actions…Arantor (April 4th, 2013, 09:40 PM) » Nope. It actually doesn't matter two hoots what the calling signature actually is. The receiver's signature (i.e. the actual function) is all that actually matters. Sending it as a reference going into the call_hook is straight syntactic sugar. Actions…Arantor (April 4th, 2013, 09:41 PM) » It's call-time pass-by-ref that's removed, not all pass-by-ref. Provided the receiver is set to receive by-ref, the calling signature becomes pretty much irrelevant.
|