Re: Open and pipe

2005-05-05 Thread Graham Barr
On May 4, 2005, at 8:13 AM, Uri Guttman wrote: AS> Why? Because IO::Socket.new takes parameters that are built out of its AS> entire inheritance tree, so a change to IO::Handle might radically AS> modify the signature of the constructor. makes sense. we should look at the p5 IO:: tree and

Re: Open and pipe

2005-05-04 Thread Uri Guttman
> "J" == Juerd <[EMAIL PROTECTED]> writes: J> Rob Kinyon skribis 2005-05-04 11:20 (-0400): >> $h.print() goes to $h.out >> $h.readline() goes to $h.in >> $h.warn() goes to $h.err >> Making the tri-directional trifecta complete. J> It's sort-of consistent, but I don't like it, bec

Re: Open and pipe

2005-05-04 Thread Juerd
Rob Kinyon skribis 2005-05-04 11:20 (-0400): > $h.print() goes to $h.out > $h.readline() goes to $h.in > $h.warn() goes to $h.err > Making the tri-directional trifecta complete. It's sort-of consistent, but I don't like it, because warnings are much more complicated than just things that are print

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
> Rob Kinyon skribis 2005-05-04 11:02 (-0400): > > Would that mean that a filehandle opened readonly would throw an > > exception if you attempted to either print or warn on it? > > I don't know what warning on a filehandle should be or do, but ignoring > that bit, yes, an exception would be the r

Re: Open and pipe

2005-05-04 Thread Juerd
Gaal Yahas skribis 2005-05-04 18:15 (+0300): > Yes, if $h is the not-very-primitive version of IO. Surely the type of > $h.in is not the same as $h itself? Why not? $h does IO::Handle::Tridirectional, and $h.in does not, even though $h and $h.in are-a IO::Handle. Or whatever the classes will be,

Re: Open and pipe

2005-05-04 Thread Juerd
Rob Kinyon skribis 2005-05-04 11:02 (-0400): > Would that mean that a filehandle opened readonly would throw an > exception if you attempted to either print or warn on it? I don't know what warning on a filehandle should be or do, but ignoring that bit, yes, an exception would be the right thing t

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
On Wed, May 04, 2005 at 04:59:21PM +0200, Juerd wrote: > > Ah yes, that's another thing I was wondering about: what does opening a > > pipe return. If it's a one-way pipe, okay, this may be a single handle; > > but for bidirectional opens, we need $in, $out, and $err handles; and > > That'd be tri

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
Would that mean that a filehandle opened readonly would throw an exception if you attempted to either print or warn on it? On 5/4/05, Juerd <[EMAIL PROTECTED]> wrote: > Gaal Yahas skribis 2005-05-04 17:24 (+0300): > > Ah yes, that's another thing I was wondering about: what does opening a > > pipe

Re: Open and pipe

2005-05-04 Thread Juerd
Gaal Yahas skribis 2005-05-04 17:24 (+0300): > Ah yes, that's another thing I was wondering about: what does opening a > pipe return. If it's a one-way pipe, okay, this may be a single handle; > but for bidirectional opens, we need $in, $out, and $err handles; and That'd be tridirectional, then.

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
On Wed, May 04, 2005 at 08:47:17AM -0400, Aaron Sherman wrote: > I would expect "open" to be a bit of an anachronism in P6, but still > used fairly often. For the most part, I would expect that: > > my IO $read_fh = '/some/path' => 'r'; # Get an IO::File (is IO) > my IO $write_fh = '/o

Re: Open and pipe

2005-05-04 Thread Uri Guttman
> "AS" == Aaron Sherman <[EMAIL PROTECTED]> writes: AS> On Mon, 2005-05-02 at 22:51, Uri Guttman wrote: >> > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: >> LW> multi sub opensocket ( LW> Str +$mode = 'rw', LW> Str +$encoding = 'auto', LW> Str [EMAIL PROTECTED]) returns IO

Re: Open and pipe

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 08:47:17AM -0400, Aaron Sherman wrote: : I would expect "open" to be a bit of an anachronism in P6, but still : used fairly often. For the most part, I would expect that: : : my IO $read_fh = '/some/path' => 'r'; # Get an IO::File (is IO) : my IO $write_fh = '/o

Re: Open and pipe

2005-05-04 Thread Aaron Sherman
On Mon, 2005-05-02 at 16:13, Mark Reed wrote: > On 2005-05-02 15:52, "Juerd" <[EMAIL PROTECTED]> wrote: > > > Gaal Yahas skribis 2005-05-02 22:25 (+0300): > >> > open 'ls', '|-'; # or even > >> > open 'ls', :pipe => 'from' > > > > I dislike the hard-to-tell-apart symbols '<'

Re: Open and pipe

2005-05-04 Thread Aaron Sherman
On Mon, 2005-05-02 at 22:51, Uri Guttman wrote: > > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: > > LW> multi sub opensocket ( > LW> Str +$mode = 'rw', > LW> Str +$encoding = 'auto', > LW> Str [EMAIL PROTECTED]) returns IO; > > a

Re: Open and pipe

2005-05-03 Thread Larry Wall
On Tue, May 03, 2005 at 11:22:06AM +0200, Juerd wrote: : I didn't know io was blessed already. It pretty much is, just not the subsequent overloading of > and <. We'll use ==> and <== instead. Larry

Re: Open and pipe

2005-05-03 Thread Juerd
Luke Palmer skribis 2005-05-03 1:34 (-0600): > > for @files { open; say uc for =$_; close; } > Wait, so you want open to both open the filename in $_ /and/ set $_ to > the opened filehandle? You are right. The example code makes no sense at all. > say uc for =io($_); I didn't know io wa

Re: Open and pipe

2005-05-03 Thread Luke Palmer
Juerd writes: > > : > I don't think the command should default to $_ > > : Why?! > > Because $_ is primarily for the use of inner loops, not outer loops, > > and open tends to be in the outer loop rather than the inner loop. > > As someone who tries to write clean code, I agree that the outer loop

Re: Open and pipe

2005-05-03 Thread Juerd
Larry Wall skribis 2005-05-02 15:53 (-0700): > : Starting to look a lot like PHP there. > And I care about that because PHP is such an unsuccessful language? :-) > I'd just like all the opens to sort to the same place in the manual. One of my biggest problems with PHP is that it puts in the name

Re: Open and pipe

2005-05-02 Thread Larry Wall
On Mon, May 02, 2005 at 03:53:42PM -0700, Larry Wall wrote: : On Tue, May 03, 2005 at 12:32:58AM +0200, Juerd wrote: : : How about : : : : &open ::= &File::open : : &URI::open : : &Sys::Pipe::open : : : : And put the other aliases in the module that CGI.pm-:standard-ishly : : pollutes

Re: Open and pipe

2005-05-02 Thread Larry Wall
On Mon, May 02, 2005 at 10:51:57PM -0400, Uri Guttman wrote: : > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: : : LW> multi sub opensocket ( : LW> Str +$mode = 'rw', : LW> Str +$encoding = 'auto', : LW> Str [EMAIL PROTECTED]) retur

Re: Open and pipe

2005-05-02 Thread Uri Guttman
> "MF" == Matt Fowles <[EMAIL PROTECTED]> writes: MF> Currying obviates the need for everything but a sub callback. If you MF> want a callback to a method, curry the object. If you want private MF> data, curry the data. After you are done currying you will have a MF> simple sub to p

Re: Open and pipe

2005-05-02 Thread Matt Fowles
All~ On 5/3/05, Uri Guttman <[EMAIL PROTECTED]> wrote: > > "MF" == Matt Fowles <[EMAIL PROTECTED]> writes: > > MF> All~ > MF> On 5/2/05, Uri Guttman <[EMAIL PROTECTED]> wrote: > >> > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: > >> > LW> multi sub opensocket ( > LW> Str +$m

Re: Open and pipe

2005-05-02 Thread Uri Guttman
> "MF" == Matt Fowles <[EMAIL PROTECTED]> writes: MF> All~ MF> On 5/2/05, Uri Guttman <[EMAIL PROTECTED]> wrote: >> > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: >> LW> multi sub opensocket ( LW> Str +$mode = 'rw', LW> Str +$encoding = 'auto', LW> Str [EMAIL PROTECTED])

Re: Open and pipe

2005-05-02 Thread Matt Fowles
All~ On 5/2/05, Uri Guttman <[EMAIL PROTECTED]> wrote: > > "LW" == Larry Wall <[EMAIL PROTECTED]> writes: > > LW> multi sub opensocket ( > LW> Str +$mode = 'rw', > LW> Str +$encoding = 'auto', > LW> Str [EMAIL PROTECTED]) retu

Re: Open and pipe

2005-05-02 Thread Uri Guttman
> "LW" == Larry Wall <[EMAIL PROTECTED]> writes: LW> multi sub opensocket ( LW> Str +$mode = 'rw', LW> Str +$encoding = 'auto', LW> Str [EMAIL PROTECTED]) returns IO; and how will that support async (non-blocking) connects? or

Re: Open and pipe

2005-05-02 Thread Larry Wall
On Tue, May 03, 2005 at 12:32:58AM +0200, Juerd wrote: : Larry Wall skribis 2005-05-02 14:23 (-0700): : > multi sub open ( : > multi sub openuri ( : > multi sub openpipe ( : > multi sub openshell ( : : Starting to look a lot like PHP there. And I care about that because PHP is

Re: Open and pipe

2005-05-02 Thread Juerd
Larry Wall skribis 2005-05-02 14:23 (-0700): > multi sub open ( > multi sub openuri ( > multi sub openpipe ( > multi sub openshell ( Starting to look a lot like PHP there. How about &open ::= &File::open &URI::open &Sys::Pipe::open And put the other aliases in th

Re: Open and pipe

2005-05-02 Thread Larry Wall
On Mon, May 02, 2005 at 02:23:36PM -0700, Larry Wall wrote: : : [1] Should this be "Perl(..5) style"? : : I think that'd be "Perl-{1..5} style", as it currently stands, and : assuming you want to use the "use" syntax. Also, we haven't specced Er, make that Perl-(1..5) instead. One week in Russi

Re: Open and pipe

2005-05-02 Thread Larry Wall
On Mon, May 02, 2005 at 10:25:08PM +0300, Gaal Yahas wrote: : Here's a basic proposal for the open and pipe builtins. It was discussed : on #perl6 today and seemed okay to the people there. I'd like to hear : your comments, since the internals side of much of this is ready and is : looking for an i

Re: Open and pipe

2005-05-02 Thread Mark Reed
On 2005-05-02 16:35, "Juerd" <[EMAIL PROTECTED]> wrote: > What are the characters around the code supposed to be, by the way? Your > mailer tells my mailer that you're sending iso-8859-1, but I seriously > doubt that. > Argh. Bad Entourage, no biscuit. Back to Mail as soon as I get Tiger inst

Re: Open and pipe

2005-05-02 Thread Juerd
Mark Reed skribis 2005-05-02 16:13 (-0400): > Holy matter of opinion, Batman. Œ<Œ and Œ>¹ are much easier to tell apart > than Œr¹ and Œw¹; Obviously we disagree. What are the characters around the code supposed to be, by the way? Your mailer tells my mailer that you're sending iso-8859-1, but I

Re: Open and pipe

2005-05-02 Thread Mark Reed
I take some of that back ­ actually, left-to-right directionality has almost nothing to do with understanding the < and > symbols. The arrow points in the direction information is flowing, which is left-to-right for > but right-to-left for <. I mean, ³>filename² is pointing at the file, so the i

Re: Open and pipe

2005-05-02 Thread Mark Reed
On 2005-05-02 15:52, "Juerd" <[EMAIL PROTECTED]> wrote: > Gaal Yahas skribis 2005-05-02 22:25 (+0300): >> > open 'ls', '|-'; # or even >> > open 'ls', :pipe => 'from' > > I dislike the hard-to-tell-apart symbols '<' and '>' for modes. 'r' and > 'w' are much easier, and get r

Re: Open and pipe

2005-05-02 Thread Juerd
Gaal Yahas skribis 2005-05-02 22:25 (+0300): > open 'ls', '|-'; # or even > open 'ls', :pipe => 'from' I dislike the hard-to-tell-apart symbols '<' and '>' for modes. 'r' and 'w' are much easier, and get rid of the awful left/right "mnemonic" that fails to make sense to GUI u