From: Ken Bloom Date: 2008-04-11T10:10:14+09:00 Subject: Re: Stack Level Too Deep? On Thu, 10 Apr 2008 19:21:32 -0500, Julian Leviston wrote: > On 11/04/2008, at 10:10 AM, Ken Bloom wrote: >> On Thu, 10 Apr 2008 18:00:15 -0500, Ryan Lewis wrote: >>> I have a User class that handles users as structs and adds them to a >>> hash within the class. Anyways, I was making a Remove functions for >>> it. >>> Here's my code: >>> >>> [code] >>> class User < Struct.new(:username, :password) >> >>> def remove() >>> self.remove() ### => Stack Level Too Deep. >>> end >>> end >> >> The remove() method just keeps calling itself. I think you wanted >> def remove() >> self.class.remove(self.username) >> end > > Or maybe super()? You'll get a NoMethodError if you call super(), because you're not overriding an existing remove method --Ken -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/