On Fri, Sep 15, 2000 at 10:58:26AM +0200, Bart Lateur wrote:
> MJD has a "silly module" which can tie a hash to a function:
> Interpolation.pm. I think I would like a special case, a specific hash
> that is *always* tied to a function that returns the arguments. Make it,
> for example, %$, %@ or %?. These are not in use now, are they?
>
> print "You have to pay $?{money($amount)} dollars.";
I always thought MJD's module was neat, but never had a real desire for
interpolated function calls. If it was part of the core library I may be
inclined to use it more, but I doubt it.
Or maybe an alternative, using &:
"foo &foo(arg, arg, arg) bar"
"foo &{ foo(arg, arg, arg) } bar"
I suspect this has already been discussed and discarded at some point; I
sincerely doubt I'm the only one who came up with it.
Or maybe we need a more generic solution (as someone else suggested, I
forget who). Something that allows the arbitrary execution of code, much
like @{[ ]}, but cleaner. Unfortunately, I can't think of anything
suitable.
Whatever direction this discussion takes, I don't think it should impact the
interpolation of method calls. It'd be nice to find a clean and simple
syntax for calling functions within double-quoted strings, but it's already
clean and simple to call methods.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--