Closed p5pRT closed 20 years ago
This patch makes binmode FH\, ":utf8" work with the readline operator. It sits on top of the previous one.
Simon Cozens writes:
This patch makes binmode FH\, ":utf8" work with the readline operator.
I do not think we want to do this. I do not use TCL for many years\, but my impression is that TCL users *pray* for the fconfigure command. Using this one command\, one can change *all* the characteristics of the stream with a consistent and easy-to-remember syntax.
I think we want:
a) add
$fh->configure(buffering => ???\, crlf => ???\, encoding => ???\, block => ?\, buffersize => ???);
method (possibly with fine tuning between I/ and /O parts);
b) Have a cheaper (in the sense of not loading IO.pm) way of access to ->configure();
While 'a' does not contradict overloading binmode()\, it would be nicer to have a kind of a 'builtin' ->configure.
Ilya
Ilya Zakharevich writes: : Simon Cozens writes: : > : > This patch makes binmode FH\, ":utf8" work with the readline operator. : : I do not think we want to do this. I do not use TCL for many years\, : but my impression is that TCL users *pray* for the fconfigure command. : Using this one command\, one can change *all* the characteristics of : the stream with a consistent and easy-to-remember syntax.
It is impossible to know what all the characteristics of the stream are. The idea of a discipline is that you can swap it in and it will do magic that the designers of the system never imagined\, much like source filters.
: I think we want: : : a) add : : $fh->configure(buffering => ???\, crlf => ???\, encoding => ???\, : block => ?\, buffersize => ???); : : method (possibly with fine tuning between I/ and /O parts); : : b) Have a cheaper (in the sense of not loading IO.pm) way of access : to ->configure(); : : While 'a' does not contradict overloading binmode()\, it would be nicer : to have a kind of a 'builtin' ->configure.
I think this is somewhat orthogonal to disciplines. You're imagining one complex discipline that is highly configurable. I'm thinking of smaller\, stackable\, hot-swappable disciplines that will be simple and fast. But I suppose there's no reason not to have a complex discipline that is more configurable\, if you want to invent one.
Larry
On Mon\, Apr 03\, 2000 at 07:50:01AM -0700\, Larry Wall wrote:
It is impossible to know what all the characteristics of the stream are. The idea of a discipline is that you can swap it in and it will do magic that the designers of the system never imagined\, much like source filters.
Why does it preclude having a ->configure method in a discipline?
: a) add : : $fh->configure(buffering => ???\, crlf => ???\, encoding => ???\, : block => ?\, buffersize => ???);
I think this is somewhat orthogonal to disciplines. You're imagining one complex discipline that is highly configurable.
I'm not imagining anything. The configuration above is what we do *now* by zillions of absolutely different and mostly obscure way. Well\, we do not have 'encoding'\, but we have irs/ors "instead". ;-)
Eventually a filehandle would become a stack of disciplines. Each of the disciplines may have a configuration methods. But this does not preclude having a ->configure method which acts on *the whole stack*\, and not on separate disciplines.
The configuration above is what people do with "plain" systemish filehandles. Many (most?) of filehandles are going to be either naked systemish handles\, or stacks which terminate in such a systemish handle. When you ->configure() a stack\, the configuration-hash may be filtered by each discipline of the stack. Most disciplines would be able to pass unrecognised options down the chain. Ergo: many (most?) filehandles will support the above configuration options.
I'm thinking of smaller\, stackable\, hot-swappable disciplines that will be simple and fast.
You cannot go simpler and smaller than system filedescriptors.
Ilya
Migrated from rt.perl.org#2970 (status was 'resolved')
Searchable as RT2970$