in reply to Re: Re^3: Easy dispatch tables.
in thread Easy dispatch tables.
I agree the second and third are more opaque than your snippets, but that's because there's no function that hides the guts - you could define a Foo::_callables() and then it wouldn't look any more intimidating than your examples (of course that's 90% of what you do, anyway).
But really, if I need to call a series of functions, I'd put them in a hash or array. And I really think the UNIVERSAL::can example is the simplest solution for that case.
Which, silly me, can of course be written
and then I think there's really no debate anymore over whether that's simple.Foo->$bar($baz) if Foo->can($bar);
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^5: Easy dispatch tables.
by jryan (Vicar) on Apr 03, 2003 at 21:59 UTC | |
by Aristotle (Chancellor) on Apr 04, 2003 at 15:25 UTC |