xx and re-running

2004-07-22 Thread James Mastros
Recently on perlmonks, at http://perlmonks.org/index.pl?node_id=375255, someone (DWS, actually) brought up the common error of expecting x (in particular, listy x, which is xx in perl6) to not create aliases. What he was doing in particular, I don't have any expectation of making it work, but

Re: :)

2004-07-22 Thread David Storrs
On Sat, Jul 17, 2004 at 06:23:50PM -0400, Austin Hastings wrote: On Saturday, 17 July, 2004 01:53 Sat, Jul 17, 2004, Juerd wrote: Do we have a :) operator yet? It's an adverbial modifier on the core expression type. Does nothing, but it acts as a line terminator when nothing but

Re: Why do users need FileHandles?

2004-07-22 Thread David Storrs
On Sun, Jul 18, 2004 at 05:36:58PM -0700, Dave Whipp wrote: truncate Vs append would be infered from usage (assign = truncate). One might be able to infer read Vs write in a similar way -- open the file based on the first access; re-open it (behind the scenes) if we write it after reading it.

Re: Why do users need FileHandles?

2004-07-22 Thread David Storrs
On Sun, Jul 18, 2004 at 08:39:09PM -0500, Rod Adams wrote: Case 1: So I wanted to do a read/write scan, so I create my TextFile, start reading in data, so the file is opened for reading. Then, I come to the part where I want to update something, so I do a write command. Suddenly the file

Re: Why do users need FileHandles?

2004-07-22 Thread David Storrs
On Mon, Jul 19, 2004 at 03:37:12PM -0500, Rod Adams wrote: I think part of the mental jam (at least with me), is that the read/write, exclusive, etc, are very critical to the act of opening the file, not only an after the fact restriction on what I can do later. If I cannot open a file for

Re: Why do users need FileHandles?

2004-07-22 Thread Deborah Pickett
On Tue, 20 Jul 2004 07.25, Austin Hastings wrote: --- Rod Adams [EMAIL PROTECTED] wrote: If I cannot open a file for writing (permissions, out of space, write locked, etc), I want to know the instant I attempt to open it as such, _not_ when I later attempt to write to it. Having all

Re: scalar subscripting

2004-07-22 Thread Hans Ginzel
Hello, I wish to be consistent with shall, so `.' is literal dot in double strings. I prefer $file.ext or ${file}.ext. For method calls ``$()'' could be used: $($foo.bar). Perhaps, what does ${foo.bar} mean? Best regards Hans

Re: String interpolation

2004-07-22 Thread Matt Diephouse
Larry Wall wrote: Actually, I've been rethinking this whole mess since last week, and am seriously considering cranking up the Ruby-o-meter here just a tad. At the moment I'm inclined to say that the *only* interpolators in double quotes are: \n, \t etc. $foo @foo[$i] %foo{$k}

Re: String interpolation

2004-07-22 Thread Johan Vromans
Larry Wall [EMAIL PROTECTED] writes: : my $d=a; : print --$d--{my $d = b }--$d--\n; Yes, that is correct. I'm afraid things like this will keep many popular editors and IDEs from implementing perl6 support... -- Johan

Re: String interpolation

2004-07-22 Thread Juerd
Matt Diephouse skribis 2004-07-20 20:06 (-0400): This is close to the new form() syntax as well, which could be considered a plus. I for one won't complain about adding the good things from Ruby back in to Perl. Ehm, no, that means that if you want to interpolate something into the format

Re: String interpolation

2004-07-22 Thread Michele Dondi
On Tue, 20 Jul 2004, Damian Conway wrote: Larry wrote: Actually, I've been rethinking this whole mess since last week, and am seriously considering cranking up the Ruby-o-meter here just a tad. [snip] I can't say I'm keen on making {...} special in strings. I felt that the $(...) and

Re: :)

2004-07-22 Thread Robin Berjon
David Storrs wrote: On Sat, Jul 17, 2004 at 06:23:50PM -0400, Austin Hastings wrote: On Saturday, 17 July, 2004 01:53 Sat, Jul 17, 2004, Juerd wrote: Do we have a :) operator yet? It's an adverbial modifier on the core expression type. Does nothing, but it acts as a line terminator when nothing

Re: :)

2004-07-22 Thread Michele Dondi
On Thu, 22 Jul 2004, Robin Berjon wrote: Do we have a :) operator yet? [snip] We could mimick XQuery where it is the comment terminator. Well, since it's *optimistically* smiling, it could turn off warnings for the statement it refers to. Michele -- [...] is like requiring to play tennis

Re: :)

2004-07-22 Thread Adam D. Lopresto
On Thu, 22 Jul 2004, Michele Dondi wrote: On Thu, 22 Jul 2004, Robin Berjon wrote: Do we have a :) operator yet? [snip] We could mimick XQuery where it is the comment terminator. Well, since it's *optimistically* smiling, it could turn off warnings for the statement it refers to.

Is there a tuple? -- WAS: RE: :)

2004-07-22 Thread Austin Hastings
--- Adam D. Lopresto [EMAIL PROTECTED] wrote: The modifier to turn off warnings on a line would be ;), winking at us to let us know it's up to something. I wondered about paren-after-semi, and thought about Cfor(;;). Which led me to C@array[a;b;c], then to (a;b;c;), which let me to this: Given

Re: Why do users need FileHandles?

2004-07-22 Thread Dave Whipp
David Storrs [EMAIL PROTECTED] wrote (apparently may days ago): Race condition: what if something deletes the file between the moment that perl closes the file and the moment that it re-opens it? Is there a cross-platform way to do an atomic reopen? I'm not sure if you need to close it before

Re: Why do users need FileHandles?

2004-07-22 Thread Dave Whipp
David Storrs [EMAIL PROTECTED] wrote # Print file, inefficiently print $default.readline for 1..$default.lines; print it efficiently: print $default; # Append a line $rw .= an additional line\n; $rw ~= \n unless $rw.chars[-1] eq \n; $rw ~= an additional line\n; #

Re: Why do users need FileHandles?

2004-07-22 Thread chromatic
On Mon, 2004-07-19 at 14:04, David Storrs wrote: Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should be integrated into the core for efficiency. You must have amazingly fast hard drives. -- c

Re: Why do users need FileHandles?

2004-07-22 Thread Austin Hastings
--- chromatic [EMAIL PROTECTED] wrote: On Mon, 2004-07-19 at 14:04, David Storrs wrote: Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should be integrated into the core for efficiency. You must have amazingly fast hard

Re: Why do users need FileHandles?

2004-07-22 Thread JOSEPH RYAN
- Original Message - From: David Storrs [EMAIL PROTECTED] Date: Monday, July 19, 2004 5:04 pm Subject: Re: Why do users need FileHandles? Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should be integrated into the core for

Re: Why do users need FileHandles?

2004-07-22 Thread Luke Palmer
JOSEPH RYAN writes: - Original Message - From: David Storrs [EMAIL PROTECTED] Date: Monday, July 19, 2004 5:04 pm Subject: Re: Why do users need FileHandles? Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should be

Re: xx and re-running

2004-07-22 Thread JOSEPH RYAN
- Original Message - From: James Mastros [EMAIL PROTECTED] Date: Sunday, July 18, 2004 5:03 am Subject: xx and re-running Recently on perlmonks, at http://perlmonks.org/index.pl?node_id=375255, someone (DWS, actually) brought up the common error of expecting x (in particular,

Re: xx and re-running

2004-07-22 Thread Luke Palmer
JOSEPH RYAN writes: When I think about your description of xxx, I summarized it in my head as Call a coderef a certain number of times, and then collect the results. That's pretty much what map is, except that xxx is infix and map is prefix. @results = { ... } xxx 100;

Re: String interpolation

2004-07-22 Thread Dave Mitchell
On Wed, Jul 21, 2004 at 04:37:29PM -0700, Larry Wall wrote: We allowed/required @foo to interpolate in Perl 5, and it catches a certain number of people off guard regularly, including yours truly. So I can argue [EMAIL PROTECTED] both ways. Currently @foo[] is a syntax error. maybe @foo[] in

Re: String interpolation

2004-07-22 Thread Dan Hursh
Larry Wall wrote: No Yes -- --- @foo@foo[1] %bar%bar{a} or %bar«a» $foo.bar$foo.bar() foofoo(1) I may have missed it, but what are the contexts in these cases? I'm thinking the first two are easily scalar. Are the second list

Re: String interpolation

2004-07-22 Thread David Storrs
On Wed, Jul 21, 2004 at 04:37:29PM -0700, Larry Wall wrote: No Yes -- --- @foo@foo[1] %bar%bar{a} or %bar«a» $foo.bar$foo.bar() foo foo(1) In this worldview, $foo is an exception only because it doesn't naturally have a

Re: Why do users need FileHandles?

2004-07-22 Thread Dan Hursh
Luke Palmer wrote: JOSEPH RYAN writes: - Original Message - From: David Storrs [EMAIL PROTECTED] Date: Monday, July 19, 2004 5:04 pm Subject: Re: Why do users need FileHandles? Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should

Re: Why do users need FileHandles?

2004-07-22 Thread JOSEPH RYAN
- Original Message - From: Dan Hursh [EMAIL PROTECTED] Date: Thursday, July 22, 2004 3:07 pm Subject: Re: Why do users need FileHandles? Luke Palmer wrote: JOSEPH RYAN writes: - Original Message - From: David Storrs [EMAIL PROTECTED] Date: Monday, July 19, 2004 5:04

Re: Why do users need FileHandles?

2004-07-22 Thread David Green
Luke Palmer [EMAIL PROTECTED] wrote on July 22, 2004: Even more philosophical is what is core? I believe the standard definition is Anything I want to use goes in the core; anything everyone else wants goes wherever there's room left over. ... So making it go in the core may just mean that it's