Re: Angle quotes and pointy brackets

2004-12-01 Thread Jon Ericson
Larry Wall <[EMAIL PROTECTED]> writes: > On Tue, Nov 30, 2004 at 03:03:38PM -0800, Jon Ericson wrote: > : while(<>) {...} > You left out the most important phrase: > > "or whatever we decide is the correctest idiom." I saw that, but I didn't know what to make of it. The Perl 5 idiom is p

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: Angle quotes and pointy brackets

2004-12-01 Thread Larry Wall
On Wed, Dec 01, 2004 at 09:55:32AM +, Matthew Walton wrote: : >I neglected to mention that the smart quoter should also recognize : >pair notation and handle it. : : I've been trying to get my brain round that, but I can't quite figure : out what you mean. Pair notation is, as I understand it

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 we almost have something like

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 .. $#array) {

Re: Angle quotes and pointy brackets

2004-12-01 Thread John Siracusa
On Wed, 01 Dec 2004 07:41:18 GMT, Smylers <[EMAIL PROTECTED]> wrote: > John Siracusa writes: > > > Call me crazy, but at this point I'm prone to stick with what I've done in > > Perl 5 for years: > > > > $var{'key1'}{'key2'}[3]{'key3'} > > In which case do that, since it'll still work in Perl

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: Angle quotes and pointy brackets

2004-12-01 Thread Smylers
Matthew Walton writes: > Pair notation is, as I understand it, when you get > > key => value That can now also be written as: :key or, where value is 1, simply as: :key I suspect it was this form that Larry was referring to. Smylers

Re: Angle quotes and pointy brackets

2004-12-01 Thread Juerd
Matthew Walton skribis 2004-12-01 10:11 (+): > Well that depends... are you intending to write programs, or drive the > world insane? Yes. Juerd

Re: Angle quotes and pointy brackets

2004-12-01 Thread Matthew Walton
Juerd wrote: Matthew Walton skribis 2004-12-01 9:55 (+): Yes, that would be fun... almost worth throwing out a compiler warning for that, especially if we've still got use warnings. Something like Warning: «{ }» creates empty list It should generate a warning similar to the warning of inte

Re: Angle quotes and pointy brackets

2004-12-01 Thread Juerd
Matthew Walton skribis 2004-12-01 9:55 (+): > Yes, that would be fun... almost worth throwing out a compiler warning > for that, especially if we've still got use warnings. Something like > > Warning: «{ }» creates empty list It should generate a warning similar to the warning of inte

Re: Angle quotes and pointy brackets

2004-12-01 Thread Matthew Walton
Larry Wall wrote: I thought so. : I don't think I've ever used a hash slice in my life. Is there something : wrong with me? No, a lot of people are naturally monoindexous. I like that word. : >* The :w splitting happens after interpolation. So : > : > « foo $bar @baz » : > : > can end up

Re: Angle quotes and pointy brackets

2004-12-01 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Smylers) wrote: >David Green writes: >> I'm not even sure what those double-quotation marks are doing -- [...] >Look back at how Larry defined the guillemets: [...] >So the double-quotes in there are "shell-like", though I guess if you >don't ha

Re: Angle quotes and pointy brackets

2004-12-01 Thread Smylers
David Green writes: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Larry Wall) wrote: > > >* The :w splitting happens after interpolation. So > >« foo $bar @baz » > >can end up with lots of words, while > >« foo "$bar" "@baz" » > > is guaranteed to end up wit

Iteration Again (was «Re: Angle quotes and pointy brackets»)

2004-12-01 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Brent 'Dax' Royal-Gordon) wrote: >I'm going to pull a Larry and think out >loud for a minute here. Note that I speak authoritatively here, Noted. Or not. =) >Treating it like an array is wrong. >On the other hand, what if a filehandle *is* an

Re: Angle quotes and pointy brackets

2004-12-01 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Larry Wall) wrote: >Here's the proposal. >First the bad news: >* We accept that the C<< < >> operator requires whitespace >around it, and be prepared to be burned in effigy occasionally. I wouldn't go that far, although when I inevitably

Re: Angle quotes and pointy brackets

2004-12-01 Thread Smylers
Larry Wall writes: > The basic problem with «...» is that most of its uses were turning out > to be more useful that the corresponding <...>. ... and I think I'm > ready to propose a Great Angle Bracket Renaming. I very much like your proposal. (Though whether you were actually ready to propose