Re: qq:i

2004-12-01 Thread Luke Palmer
Larry Wall writes: > Or maybe we just stick with what we already allow: > > my $name = 'add'; > my $code = q[ > sub \qq[$name] ($left, $right) { > return $left + $right; >} > ]; > > After all, that's why we put \q interpolation into '' in the first place. Ahh

Re: qq:i

2004-12-01 Thread Matt Diephouse
On Wed, 1 Dec 2004 08:56:49 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: > Or maybe we just stick with what we already allow: > > my $name = 'add'; > my $code = q[ > sub \qq[$name] ($left, $right) { > return $left + $right; > } > ]; > > After all, that's w

Re: qq:i

2004-12-01 Thread Larry Wall
On Wed, Dec 01, 2004 at 11:41:37AM -0500, Matt Diephouse wrote: : So... maybe we can pass a parameter saying what we want to use to interpolate? : : my $name = 'add'; : my $code = q:c<«>[ : sub «$name» ($left, $right) { : return $left + $right; :} : ]; : # prints "

Re: qq:i

2004-12-01 Thread Matt Diephouse
On Wed, 1 Dec 2004 00:22:25 +, Jonathan Paton <[EMAIL PROTECTED]> wrote: > Jim, > > > qq:i {} is just like qq{} except that when it interpolates variables, > > those which are undefined are preserved literally. > > Interesting idea except for the flaw. I think

Re: qq:i

2004-12-01 Thread Jonathan Paton
Jim, > qq:i {} is just like qq{} except that when it interpolates variables, > those which are undefined are preserved literally. I think surprise might be a problem. E.g. my $index = 0; eval qq:i { my @array = A .. Z; sub example { for my $index (0 .. $

Re: qq:i

2004-12-01 Thread Austin Hastings
John Macdonald wrote: The problem with "interpolate if you can or leave it alone for later" is that when later comes around you're in a quandry. Is the string "$var" that is in the final result there because it was "$var" in the original and couldn't be interpolated, or was it a $foo that had its v

Re: qq:i

2004-11-30 Thread Smylers
Jim Cromie writes: > since the qq:X family has recently come up, Id like to suggest another. > > qq:i {} is just like qq{} except that when it interpolates variables, > those which are undefined are preserved literally. So then when doing maintenance on some code I can break it by

Re: qq:i

2004-11-30 Thread John Macdonald
On Tue, Nov 30, 2004 at 05:54:45PM -0700, Luke Palmer wrote: > Jim Cromie writes: > > > > since the qq:X family has recently come up, Id like to suggest another. > > > > qq:i {} is just like qq{} except that when it interpolates variables, > > those which are

Re: qq:i

2004-11-30 Thread Luke Palmer
Jim Cromie writes: > > since the qq:X family has recently come up, Id like to suggest another. > > qq:i {} is just like qq{} except that when it interpolates variables, > those which are undefined are preserved literally. Eeeew. Probably going to shoot this down. But let

Re: qq:i

2004-11-30 Thread Juerd
Jim Cromie skribis 2004-11-30 16:53 (-0700): >my @args = @{$template{args}}; >my $body = $template{body}; >eval sub qq:i{ > my ($self, @args) = @_; > $body; >} Please explain what you want it to do with @args there. Juerd

qq:i

2004-11-30 Thread Jim Cromie
since the qq:X family has recently come up, Id like to suggest another. qq:i {} is just like qq{} except that when it interpolates variables, those which are undefined are preserved literally. its purpose would be to support the construction of strings for subsequent eval'g, particularly