Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-10 Thread Michele Dondi
On Fri, 3 Dec 2004, Larry Wall wrote: On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: : This whole issue kind of makes me go 'ugh'. One of the things I like : best about Perl is the amazing simplicity of the input construct. Hmm. while () {...} for .lines {...} Looks like

Re: Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-07 Thread Matthew Walton
Austin Hastings wrote: I'll guess that you're pointing at .:send_one($_); Which supposedly uses topic to resolve .:send_one into $this.send_one. If that works, then I'm happy -- I like being able to control topic and $_ differently. But if Cfor changes topic, then what? OUTER::.:send_one($_);

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Austin Hastings
Larry Wall wrote: But here's the kicker. The null filename can again represent the standard filter input, so we end up with Perl 5's while () {...} turning into for = {...} Two more issues: idiom, and topification = Topification: There are cases in P5 when I *don't* want while ()

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread David Wheeler
On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote: for = {...} I dub the...the fish operator! :-) David

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 09:06:22AM -0800, David Wheeler wrote: : On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote: : :for = {...} : : I dub the...the fish operator! : : :-) Mmm. Next thing you'll know, people will name their files oddly just so they can write things like: for =///º

Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : Two more issues: idiom, and topification : : = Topification: : : There are cases in P5 when I *don't* want : : while () {...} : : but prefer : : while ($input = ) {...} : : so that I can have something else be the

while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : = Idiom: : : The other concern is idiom. Using Cfor suggests start at the : beginning, continue to the end. OTOH, using Cwhile is a little : weaker -- keep doing this until it's time to stop. Obviously they'll : usually be

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Larry Wall
Or even the dead fish operator: while =###x - $net {...} And here's a flounder: while =: Larry

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Austin Hastings
David Wheeler wrote: On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote: for = {...} I dub the...the fish operator! :-) Back before there was a WWW, I used an editor called tgif. It was written in france, and part of the idiom was to have two GUI buttons showing respectively the head ( * )

Re: Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Luke Palmer
Larry Wall writes: Currently it does. There have been some rumblings in the design team that maybe it shouldn't. But it occurs to me that this might be another spot to have our cake and eat it to. We could say that for @foo - $input { ... $input ... } doesn't set the topic in the

Re: while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Jonathan Scott Duff
On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote: On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : Can we ditch Cfor in the examples in favor of Cwhile, for a while? :) Okay. Have an example: while =$IN - $line {...} I think that works. I'm back to

Re: while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote: : On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote: : On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : : Can we ditch Cfor in the examples in favor of Cwhile, for a while? :) : : Okay. Have an

Re: while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Jonathan Scott Duff
On Mon, Dec 06, 2004 at 10:59:18AM -0800, Larry Wall wrote: On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote: : On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote: : On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : : Can we ditch Cfor in the

Re: Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Matthew Walton
Luke Palmer wrote: The remaining problem is what to do about unary dot. Repeated here for the, er, benefit? of p6l: class Duple { has $.left; has $.right; method perform (oper) { oper($.left); oper($.right); } } Let's change that

Re: Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Luke Palmer
Matthew Walton writes: Luke Palmer wrote: The remaining problem is what to do about unary dot. Repeated here for the, er, benefit? of p6l: class Duple { has $.left; has $.right; method perform (oper) { oper($.left); oper($.right);

Re: Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Austin Hastings
Luke Palmer wrote: class MyStream { has $.stream; method :send_one ($item) { $.stream.send($item); } method send ([EMAIL PROTECTED]) { .:send_one(BEGIN); for @data { .:send_one($_); }

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
Okay, maybe I should have gone to bed, but I kept thinking about this. I'm starting to suspect it's time to haul out the operator I've been holding in reserve for lo these many years now, the unary =. Suppose we say that it iterates iterators, but also it recognizes certain things that aren't

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: : Might even just be a global multi sub that defaults to $*ARGS: : : multi sub *lines (IO ?$handle = $*ARGS) {...} : multi sub *lines (Str $filename) {...} : multi sub *lines (IO @handle) {...} : multi sub *lines (Str

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Herbert Snorrason
On Sat, 4 Dec 2004 01:37:00 -0800, Larry Wall [EMAIL PROTECTED] wrote: for =$*IN {...} for =$*ARGS {...} Yay. A generalised form of the input operator, which can create even handier idioms for simple file processing. Maybe I wasn't clear enough. My issue wasn't specifically with '.lines'

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Rod Adams
Larry Wall wrote: So you can say for =$*IN {...} for =$*ARGS {...} for =foo.c {...} for =foo.c foo.h {...} for =«$foo.c $foo.h» {...} for =['foo.c', 'foo.h'] {...} for =['.myrc', @*ARGS] {...} for [EMAIL PROTECTED] {...} for = {...} The simplicity is nice, but the

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Luke Palmer
Rod Adams writes: Okay, this rant is more about the \s\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a$b $c$d ) {...} if( $a $b $c $d ) {...} In line2, my mind has to stop and ask: is that ($a $b) ($c $d), or $a ($b $c) $d. It

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Stéphane Payrard
On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: : This whole issue kind of makes me go 'ugh'. One of the things I like : best about Perl is the amazing simplicity of the input construct. Hmm. while ()

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams [EMAIL PROTECTED] wrote: Larry Wall wrote: for =$*IN {...} for =$*ARGS {...} for =foo.c {...} for =foo.c foo.h {...} for =$foo.c $foo.h {...} for =['foo.c', 'foo.h'] {...} for =['.myrc', @*ARGS] {...} for [EMAIL PROTECTED] {...}

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams [EMAIL PROTECTED] wrote: Okay, this rant is more about the \s\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a$b $c$d ) {...} if( $a $b $c $d ) {...} In line2, my mind has to stop and ask: is that

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 11:02:38PM +0300, Alexey Trofimenko wrote: : hm. we have short and strange FH, for input.. (and for some reason, it : is bracketing! there's no sense at all in it) : ..but we have long (and even looking slightly OOish, in perl5 sense) print : FH for output, and noone

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread John Macdonald
On Sat, Dec 04, 2004 at 11:08:38PM +0300, Alexey Trofimenko wrote: On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams [EMAIL PROTECTED] wrote: Okay, this rant is more about the \s\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a$b $c$d ) {...}

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 01:24:41PM -0800, Larry Wall wrote: : I suppose we could also have : : for words {...} : for tokens {...} : for paragraphs {...} : for chunks(, :delim(/^^===+\h*\n/)) {...} : : etc. I see a problem with for words {...} since there's likely to be

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: : This whole issue kind of makes me go 'ugh'. One of the things I like : best about Perl is the amazing simplicity of the input construct. Hmm. while () {...} for .lines {...} Looks like a wash to me. : Replacing that