[ruby-talk:00376] Re: Store and load

From: Akira Endo <akendo@...3.rim.or.jp>
Date: 1999-06-03 03:59:23 UTC
List: ruby-talk #376
Hi,

In [ruby-talk:00375] Re: Store and load
gotoken@math.sci.hokudai.ac.jp (GOTO Kentaro) wrote:

> I don't think IO#>> is useful because `io >> a >> b' is not easier to
> read for me.  Would you show me some examples of use?

Yes, the point is that ruby variables have no typing, so the strings
(or streams) themselves should know the type.
In 'a = b = ""; io >> a >> b', you can not expect that a and b get
strings from the stream.  It may be much better to have scanf("%d%s", a, b)
to read, though the need for defining local variables still remains. 

bye
Akira

In This Thread