Re: RFC 39 (v3) Perl should have a print operator

2000-09-10 Thread Jonathan Scott Duff
On Fri, Sep 08, 2000 at 03:31:54PM -0400, Chaim Frenkel wrote: > Could someone enlighten this poor soul and tell me what I _can_ do > with an error return from a print or close? Surely you'd want to know if your output can't be output (print) and for close, take a look at this: http://ww

Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Ask Bjoern Hansen
On 8 Sep 2000, Chaim Frenkel wrote: > >> Oh, why not? Does anybody actually *ever* check the return value of > >> print? I think it's not as if we'd break a lot of code. > > ABH> uh, what? you don't do much socket programming now, do you? sockets > ABH> breaks all the time. Disks runs out of spa

Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Chaim Frenkel
> "ABH" == Ask Bjoern Hansen <[EMAIL PROTECTED]> writes: >> Oh, why not? Does anybody actually *ever* check the return value of >> print? I think it's not as if we'd break a lot of code. ABH> uh, what? you don't do much socket programming now, do you? sockets ABH> breaks all the time. Disks

Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Bart Lateur
On Fri, 8 Sep 2000 01:18:19 -0700 (PDT), Ask Bjoern Hansen wrote: >I really don't understand why you want to have what's printed. It is handy, sometimes. But I do think that the overhead of creating a longish string every time you print something, which is then simply discarded, is not really a

Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Ask Bjoern Hansen
On Wed, 6 Sep 2000, Bart Lateur wrote: > >Those are not the semantics of print. It returns true (1) if successful, and > >false (undef) otherwise. You cannot change that. If I write print "0", it > >bloody well shan't be returning false. > > Oh, why not? Does anybody actually *ever* check th

Re: RFC 39 (v3) Perl should have a print operator

2000-09-06 Thread Tom Christiansen
>On Tue, 05 Sep 2000 18:37:11 -0600, Tom Christiansen wrote: >>Those are not the semantics of print. It returns true (1) if successf >>false (undef) otherwise. You cannot change that. If I write print "0", it >>bloody well shan't be returning false. >Oh, why not? Does anybody actually *ever*

Re: RFC 39 (v3) Perl should have a print operator

2000-09-06 Thread Bart Lateur
On Tue, 05 Sep 2000 18:37:11 -0600, Tom Christiansen wrote: >Those are not the semantics of print. It returns true (1) if successful, and >false (undef) otherwise. You cannot change that. If I write print "0", it >bloody well shan't be returning false. Oh, why not? Does anybody actually *eve

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Tom Christiansen
>I've found myself wanting this operator several times since I wrote the >RFC - mostly for debugging and indicating progress. Nobody else seems >to be as fond of the syntax as I am, so I will withdraw the RFC. (Its >only virtue is the syntax.) I suggest you create a clever tie module that does

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Jon Ericson
Tom Christiansen wrote: > Again, I can't *ever* remember wanting a function that did this. Rare things > shouldn't have hard-to-figure-out names. Why do you want it? Debugging or > something? Have you tried tie? I've found myself wanting this operator several times since I wrote the RFC - mos

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Nathan Wiger
Jon Ericson wrote: > > I would want it to return @items: > > @sorted = sort print @items; > > I'd prefer a different name (tee?) and keep print as it is. Pretty much all the stuff being discussed right now can be stuck in a module: package Print::Variations; use Exporter; @EXPORT

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Tom Christiansen
>I think that's the idea... and print may return undef if it fails to >print, and the printed string otherwise (always defined, even if it's an >emtpy string). Those are not the semantics of print. It returns true (1) if successful, and false (undef) otherwise. You cannot change that. If I wr

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Tom Christiansen
>This is what I'd consider good style: > my @output = > map { $_->[0] } > sort { $a->[1] cmp $b->[1] } > map { [>$_<, expensive_func($_)] } # print original lines > <>; >(Modified from ) >The main point of this statement is the Sc

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Tom Christiansen
>Jon Ericson wrote: >> >> Agreed. Good style would avoid this problem. The example in the >> synopsis of this RFC should be: >> >> my $output = >"Print this line.\n"<; >Would this be solved if print returned the string it printed? This seems >to be what everyone's getting at: > my $outpu

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Peter Scott
At 04:40 PM 9/5/00 -0700, Jon Ericson wrote: >Bart Lateur wrote: > > For input, the handle is marked as a source: > > > > $data = ; > > > > In order to be symmetrical, your ousput handle should look and act like > > a sink: > > > > >STDOUT< = $data; > > > > There. Now it's symmetri

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Jon Ericson
Bart Lateur wrote: > Also, > > print @items; > > should then return join($,, @items).$\ I would want it to return @items: @sorted = sort print @items; I'd prefer a different name (tee?) and keep print as it is. Jon -- Knowledge is that which remains when what is learned is forgott

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Bart Lateur
On Tue, 05 Sep 2000 16:46:03 -0700, Nathan Wiger wrote: >Would this be solved if print returned the string it printed? This seems >to be what everyone's getting at: > > my $output = print $r->name . " is $age years old\n"; I think that's the idea... and print may return undef if it fails to pr

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Nathan Wiger
Jon Ericson wrote: > > Agreed. Good style would avoid this problem. The example in the > synopsis of this RFC should be: > > my $output = >"Print this line.\n"<; Would this be solved if print returned the string it printed? This seems to be what everyone's getting at: my $output = print

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Jon Ericson
Bart Lateur wrote: > For input, the handle is marked as a source: > > $data = ; > > In order to be symmetrical, your ousput handle should look and act like > a sink: > > >STDOUT< = $data; > > There. Now it's symmetrical. = $data; is symmetrical. I am considering thi

Re: RFC 39 (v3) Perl should have a print operator

2000-09-05 Thread Jon Ericson
Tom Christiansen wrote: > Perl already *has* a print operator: "print". :-) I think what I really want is a tee operator. > The problem with what you have there is that it hides the act of > output within an arbitrarily long circumfix operator whose terminating > portion is potentially very far

Re: RFC 39 (v3) Perl should have a print operator

2000-09-03 Thread Bart Lateur
On 31 Aug 2000 06:22:10 -, Perl6 RFC Librarian wrote: >Perl should have a print operator >Perl supplies an operator for line input - angle brackets. This is no >analogous operator for output. I propose "inverse angle brackets": > >>"Print this line.\n"<; This is not symmetrical. For

Re: RFC 39 (v3) Perl should have a print operator

2000-08-30 Thread Tom Christiansen
>Perl supplies an operator for line input - angle brackets. This is no >analogous operator for output. I propose "inverse angle brackets": >>"Print this line.\n"<; Perl already *has* a print operator: "print". :-) The problem with what you have there is that it hides the act of output wit

RFC 39 (v3) Perl should have a print operator

2000-08-30 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Perl should have a print operator =head1 VERSION Maintainer: Jon Ericson <[EMAIL PROTECTED]> Date: 5 August 2000 Last-Modified: 30 August 2000 Mailing List: [EMAIL PROTECTED] Version: 3 Number: