[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:04346] DATA and rewind.

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-08-08 14:13:04 UTC
List: ruby-talk #4346
The DATA file refers to information after __END__ in a ruby program.
Fair enough.  So I would expect to be able to rewind it, if I wish to
scan the information several times.  I did not expect this:

brains hgs 124 %> chmod u+x !$
chmod u+x DATA.rb
brains hgs 125 %> ./!$
./DATA.rb
If a thing is worth doing
It is worth doing twice.
#!/usr/local/bin/ruby -w

# Test to see how DATA copes with rewind.

# Created 08-AUG-2000
# Author Hugh G. Sasse <hgs@dmu.ac.uk>

print DATA.readlines
DATA.rewind
print DATA.readlines

__END__
If a thing is worth doing
It is worth doing twice.
brains hgs 126 %> 

This is with 
brains hgs 126 %> ruby --version
ruby 1.4.4 (2000-04-14) [sparc-solaris2.5.1]
brains hgs 127 %> 

The Principle of Least Surprise would suggest this is not a feature.  Or
is it?   I can see what is happening, I'm not really sure that it should.

	Hugh
	hgs@dmu.ac.uk


In This Thread

Prev Next