On 9/14/06, Juergen Schreck <[EMAIL PROTECTED]> wrote:
>
> Hi -
>
> MochiKit is so deep that I maybe just can't see or understand whether
> it can do this.
>
> I want to pass some string to a dispatch function which in turn shall
> compute from these strings which function to use to handle the
> problem. It somehow looks like what I want is possible with the
> Adapter Registry, but I don't understand the workings of that enough
> to figure out how. Here's what I sorta had in mind:
>
> var controller = {
> dispatch: function ( foo, bar, baz ) {
> return foo.bar(baz); // of course this won't work :-)
> }
> }
>
>
> Is there anything (outside of 'eval') to do this with?
foo[bar](baz) should work on your example.
--
Leonardo Soto M.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---