24 Sep 10:24
TIP 301 obsolescence (Was: TIPs I'd like to see done)
From: Andreas Leitgeb <avl@...>
Subject: TIP 301 obsolescence (Was: TIPs I'd like to see done)
Newsgroups: gmane.comp.lang.tcl.core
Date: 2008-09-24 08:24:52 GMT
Subject: TIP 301 obsolescence (Was: TIPs I'd like to see done)
Newsgroups: gmane.comp.lang.tcl.core
Date: 2008-09-24 08:24:52 GMT
"Alexandre Ferrieux" <alexandre.ferrieux@...> wrote: > With 304, it is now trivially done: > lassign [chan pipe] pr pw > set ch [open "|cmd <@ $pr" r] > close $pr > ... > close $pw > set final_word [read $ch] IMHO, splitting channels just for solving this problem was an entirely wrong approach. I'm not opposing the idea of "chan pipe", but I just think it's a bad solution for the original problem. Just compare the above-quoted kludge with how a concise solution could have worked out: set ch [open "|cmd" r+]; # puts $ch ... close -w $ch ;# or whatever other color for the bikeshed set final_words [read $ch] close $ch Between the two "close"s, the channel would behave as if it had originally been opened with "r" Btw., has there ever been any reasonable usecase for closing just the read-side but still allowing to write? > I said "almost" because there is also the important case of sockets > and the shutdown() syscall, allowing to close independently halves of > its duplex channel.(Continue reading)
Donal.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
was to remind the programmer of the necessity of a [close]
anyway, under assumption (d). Can you then give your opinion on (c)
vs. (d) ?
-Alex
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
RSS Feed