Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Bart Lateur
On Thu, 14 Sep 2000 18:37:22 -0500, David L. Nicol wrote: print "Today's weather will be ${weather-temp} degrees and sunny."; which would follow the "You want something funny in your interpolated scalar's name or reference, you put it in curlies" rule. I too feel that an approach like

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Michael G Schwern
On Thu, Sep 14, 2000 at 05:31:44PM -0500, David L. Nicol wrote: A possibility that does not appear in RFC222.1 is to put tho whole accessor expression inside curlies: print "Today's weather will be ${weather-temp} degrees and sunny."; which would follow the "You want something funny

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Michael Fowler
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 %?.

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Bart Lateur
On Fri, 15 Sep 2000 01:36:50 -0800, Michael Fowler wrote: Or maybe an alternative, using : "foo foo(arg, arg, arg) bar" "foo { foo(arg, arg, arg) } bar" Ah, yes, {...}, I kinda like that. Unfortunately, in regexes, /{1,3}/ means matching 1 to three ampersands. There's a slight

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread David L. Nicol
Michael Fowler wrote: 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

Re: RFC - Interpolation of method calls

2000-09-15 Thread David L. Nicol
The only decision, then, is to decide which context to use; if it deparses to concatenation then it seems logical to use scalar context. This also makes sense in that you can force list context with @{[ $weather-temp ]} if you really wanted it. $ perl -le 'sub w{wantarray?"WA":"WS"};print

Re: RFC - Interpolation of method calls

2000-09-15 Thread Michael Fowler
On Fri, Sep 15, 2000 at 07:24:39PM -0500, David L. Nicol wrote: The only decision, then, is to decide which context to use; if it deparses to concatenation then it seems logical to use scalar context. This also makes sense in that you can force list context with @{[ $weather-temp ]} if