What speed advantage comes from a private handler?

Phil Davis revdev at pdslabs.net
Tue Nov 8 20:44:59 EST 2016

Actually here's another situation where I've used 'dispatch' simply to 
avoid a 'do'. But I could as easily use 'send' to get the job done:

function app_helperAppPath pAppName
     dispatch function ( "_helperAppPath_" & the platform ) to me with 
     return the result
end app_helperAppPath

function _helperAppPath_MacOS pAppName
     -- Mac-specific app path discovery code
end _helperAppPath_MacOS

function _helperAppPath_Win32 pAppName
     -- Windows-specific app path discovery code
end _helperAppPath_Win32

Phil Davis

On 11/8/16 5:27 PM, Monte Goulding wrote:
>> On 9 Nov. 2016, at 12:23 pm, Phil Davis <revdev at pdslabs.net> wrote:
>> Use case: You use 'dispatch' as a coding style preference.
>> (That's all I could come up with.)
> ;-)
> Actually thinking on it I can imagine a use case but it fails if you are wanting to dispatch a private handler:
> dispatch “SomethingOverridableInABehaviorInstance” to me
> command SomethingOverridableInABehaviorInstance
>     — default implementation
> end SomethingOverridableInABehaviorInstance
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Phil Davis

More information about the Use-livecode mailing list