[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04234] @ variables not updated within method?

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-07-27 17:33:57 UTC
List: ruby-talk #4234
I have a program, too large to post here, and an object in it with a
variable:

@chunks = Hash.new([])

in my initialize() method

It is a hash of arrays.  I am finding that it is not updated when 
it should be.  @chunks.inspect always seems to give me 

{}

even though I do update various elements.  At the same time, as I access
the keys I can get at the contents of the arrays, but sometimes the wrong
keys are updated.  I am only filling the hash with strings and numbers, so
they should be easily displayed with inspect.

Are there any catches I should be looking out for when doing this sort of 
thing?

	Hugh
	hgs@dmu.ac.uk



In This Thread

Prev Next