Very helpful reply Morton. Understand case a lot more now. One thing.
STDIN.getc
what exactly is STDIN? Does it belong to a class or is it a constant?
looking through ri I noticed that Kernel.getc is now obsolete. Any idea
why this is?
cheers
Very helpful reply Morton. Understand case a lot more now. One thing.
STDIN.getc
what exactly is STDIN? Does it belong to a class or is it a constant?
looking through ri I noticed that Kernel.getc is now obsolete. Any idea
why this is?
cheers
Glad to be of help.
STDIN is indeed a constant defined in Module and its value is the standard input stream (which is an instance of IO). To me the strange thing is that Kernel#gets is OK, but Kernel#getc is deprecated.
Regards, Morton
On Jul 19, 2006, at 8:05 AM, simonh wrote:
Very helpful reply Morton. Understand case a lot more now. One thing.
STDIN.getc
what exactly is STDIN? Does it belong to a class or is it a constant?
looking through ri I noticed that Kernel.getc is now obsolete. Any idea
why this is?cheers
Glad to be of help.
STDIN is indeed a constant defined in Module and its value is the standard input stream (which is an instance of IO). To me the strange thing is that Kernel#gets is OK, but Kernel#getc is deprecated.
Regards, Morton
Well Kernel#gets is ARGF#gets. ARGF is (in general) for writing well-behaved filters. Well-behaved filters work on a line by line basis usually. However ARGF.getc is not deprecated. This makes me think Kernel#getc is not ARGF.getc, but probably STDIN.getc. This is inconsistant with Kernel#gets and could thought to be confusing. Hence its deprecation. Just one man's theory.
On Jul 19, 2006, at 11:35 AM, Morton Goldberg wrote:
On Jul 19, 2006, at 8:05 AM, simonh wrote:
Very helpful reply Morton. Understand case a lot more now. One thing.
STDIN.getc
what exactly is STDIN? Does it belong to a class or is it a constant?
looking through ri I noticed that Kernel.getc is now obsolete. Any idea
why this is?cheers
Very confusing. Surely it would have been easier to keep getc as a
Kernel method. gets and getc are both very similar. Could someone ask
Matz when next they see him?
Well Kernel#gets is ARGF#gets. ARGF is (in general) for writing well-
behaved filters. Well-behaved filters work on a line by line basis
usually. However ARGF.getc is not deprecated. This makes me think
Kernel#getc is not ARGF.getc, but probably STDIN.getc. This is
inconsistant with Kernel#gets and could thought to be confusing.
Hence its deprecation. Just one man's theory.