From: Sm sm Date: 2012-05-14T22:42:10+09:00 Subject: Re: Accessing child variables Jeremy W. wrote in post #1060683: >> My error is as follows: >> >> stack level too deep (SystemStackError) > > This is a hint to you that a method you are calling is calling itself. > > If you look at your implementation of myarray, you have "@myarray = > myarray". This means that when you call myarray, it's calling itself > over and over again. This is recursion and in this situation, this is > bad. > > At the top of your class you have "attr_accessor :myarray" > > That in effect defines the following two methods: > def myarray > return @myarray > end > > def myarray=(arr) > @myarray = arr > end > > Your method of "myarray" is overriding the default one and causing the > problem. Try removing it and see if that fixes it. > > Jeremy Walker Hi Jeremy Thanks for the tip. I understand my error and I believe it is the same for my "c" method as it is also included in the attr_accessor. I have removed these and I now have the following: "undefined method `myarray' for nil:NilClass (NoMethodError)" This error is referring to puts my_top.c.myarray.inspect Any ideas? Do I have a scoping issue here? -- Posted via http://www.ruby-forum.com/.