in reply to callback or call now?
Your solution implies that all scalars will be scalar coderefs,
at least for some set of keys. And Then this set of
keys, or its universal nature, must be unmistakeable
otherwise your attempted idiomatic meaning becomes lost
because it is just normal code.
If parameters may be needed you will need to deal with array references or such anyway.
A good programmers' idiom is complete in itself, like an idiomatic phrase in natural language.
Your meaning exists in one place, but must be interpreted
in another. This plays against its utility.
I would be more explicit:
$foo => \&immediate, $bar => sub { "immediate" }, $bey => [ \&immediate, $arg, ], $mah => [ -defer, \&delayed, ],
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: callback or call now?
by John M. Dlugosz (Monsignor) on Oct 17, 2002 at 14:59 UTC | |
by rir (Vicar) on Oct 17, 2002 at 17:12 UTC | |
by John M. Dlugosz (Monsignor) on Oct 17, 2002 at 18:13 UTC | |
by rir (Vicar) on Oct 17, 2002 at 21:30 UTC |