Re: RFC 30 (v2) STDIN, STDOUT, and STDERR should be renamed

2000-08-16 Thread Nick Ing-Simmons

Michael Fowler [EMAIL PROTECTED] writes:
On Sat, Aug 12, 2000 at 08:49:00AM -, Perl6 RFC Librarian wrote:
 In addition, this RFC recommends deprecating select(), since it is no
 longer needed with the new fileobject approach described in RFC 14.

You should probably mention here that the single-arg form of select() is the
one you're suggesting for deprecation, and not the four-arg form.

The 4 arg form will be deprecated somewhere else. Splitting the function 
is a good idea...

-- 
Nick Ing-Simmons




Re: RFC 30 (v2) STDIN, STDOUT, and STDERR should be renamed

2000-08-16 Thread Nathan Wiger

Graham Barr wrote:

 
 Create a new handle, like $DEFOUT. Then there would be no need
 for selectsaver either as you would do the equiv. of
 
   local($DEFOUT) = $newhandle;

Just submitted an RFC on this exact idea.

-Nate



Re: RFC 30 (v2) STDIN, STDOUT, and STDERR should be renamed

2000-08-12 Thread Chris Nandor

At 9:45 -0700 2000.08.12, Nathan Wiger wrote:
For other stuff, like print(), instead of using the "currently selected
filehandle", just always have it print to $STDOUT unless something's
specified. So:

   $oldstdout = $STDOUT;
   $STDOUT = $myfileobject;
   print "Hello, world!";   # always prints to $STDOUT, which in
# this case is a copy of $myfileobject

   $STDOUT = $oldstdout;
   print "Hello, world again!";

The rule is easier ("print always goes to $STDOUT, whatever that
contains") and there's not select() overhead. Everything else should be
object methods, making stuff clearer still.

And it is also a pain in the butt.

  select *LOG;
  do_stuff();

  sub do_stuff {
 print "this stuff goes somewhere\n";
 print STDOUT "we printed stuff somewhere\n";
  }

You're saying, I suppose, that we should just pass the *LOG filehandle to
do_stuff().  But I'd rather not.


In any case, that's the idea. I'm not necessarily heartset on it, but I
do think it makes things simpler and faster. The "currently selected
filehandle" is something every beginner I've talked to has a ton of
trouble comprehending.

Hm.  It is something they don't even have to know about.  Don't tell them
about select(), and they don't have to use it.  Same as now.  Let's not
cripple the language for the sake of beginners.  If we have to be more
verbose in Perl 6 than in Perl 5, many people are going to stick with Perl
5.  Implicit arguments and behaviors are important.


Autoflush is another story.  Everything, from autoflush to input record
separator to output record separator and onward, must be per-filehandle, I
think.  I'd rather we didn't have to resort to a method to do it, though.
Object-oriented syntax should be optional, not required, for basic
functionality in the core language.

Thanks,

-- 
Chris Nandor   | [EMAIL PROTECTED]  | http://pudge.net/
Andover.Net| [EMAIL PROTECTED] | http://slashcode.com/