O$6.0.3 – Calling a method using a private method as a parameter
What I ‘really’ want to do is be able to define a parameter as taking a generic function. Something akin to defining a parameter as a function that takes two doubles returns a double. When making the actual call I could supply any function/method that is of type ‘takes two doubles and returns a double’.
That said, for the time being I’d be happy to just be able to supply a call to a private method as a parameter :-).
> On Jun 2, 2017, at 3:07 PM, “firstname.lastname@example.org” <email@example.com> wrote:
> Assuming a single class, I want to a call a method and use an inline call to a private method as a parameter value. I can successfully use a public method as the parameter (e.g. do method callMe($cinst.$someMethod)) but I don’t really want to make $someMethod part of the public API. I want to make the call the equivalent of: do method callMe(do method someMethod). I realize I could pass the private method name as text and then perform a do method [passedValue] inside the receiving method but the calling syntax is less expressive that way, more prone to typos, and doesn’t pass my personal ‘this is clearly a hack’ test. There are certainly times when passing the method name as text is an appropriate solution (delayed execution etc) but in this case not so much.
> Any thoughts?
> Manage your list subscriptions at lists.omnis-dev.com
Manage your list subscriptions at lists.omnis-dev.com