Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4026

Re: Cross access between instance variables

From Johannes Held <johannes.held@informatik.uni-erlangen.de>
Newsgroups comp.lang.ruby
Subject Re: Cross access between instance variables
Date 2011-05-06 10:23 +0200
Message-ID <92hpeiFe2mU1@mid.dfncis.de> (permalink)
References <1304622204.2610.22.camel@AMD64X2.fritz.box>

Show all headers | View raw


On 05.05.2011 21:06, Stefan Salewski wrote:
> But now we really need many tanks, each with very many fishes.
> Currently it seems to be a bit strange giving each of thousands
> fishes a reference to its tank.
You can control the fishes within the tank. Every fish is saved in an 
array in tank. The tank queries every fish for it's mood …

http://pastie.org/1870880

> Another solution may be to give the .tell_state() function a tank
> parameter each time when we call it. (A tank-temperature parameter
> is not a good idea, because we may need more, light, food...)
Why not? Pass them via a hash?
IMO there's no need for a fish to know its tank.


--
Johannes

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Cross access between instance variables Stefan Salewski <mail@ssalewski.de> - 2011-05-05 14:06 -0500
  Re: Cross access between instance variables Josh Cheek <josh.cheek@gmail.com> - 2011-05-05 14:47 -0500
  Re: Cross access between instance variables Johannes Held <johannes.held@informatik.uni-erlangen.de> - 2011-05-06 10:23 +0200
    Re: Cross access between instance variables Stefan Salewski <mail@ssalewski.de> - 2011-05-07 16:27 -0500
      Re: Cross access between instance variables Hassan Schroeder <hassan.schroeder@gmail.com> - 2011-05-07 18:27 -0500
        Re: Cross access between instance variables John Feminella <johnf@bitsbuilder.com> - 2011-05-07 18:36 -0500
          Re: Cross access between instance variables Hassan Schroeder <hassan.schroeder@gmail.com> - 2011-05-07 19:31 -0500
            Re: Cross access between instance variables John Feminella <johnf@bitsbuilder.com> - 2011-05-07 19:51 -0500

csiph-web