From: dejaspam@... (Bill Atkins) Date: 2004-03-09T20:59:41+09:00 Subject: How do I enforce variable declarations in Ruby? Is there any way to require that all variables and class attributes be predeclared? I'm looking for something similar to Perl's strict pragma. It would prevent bugs like this: class Demo def initialize @count = 0 end def anotherfunc @cout += 1 end def get_count @count end end d = Demo.new puts d.get_count d.anotherfunc d.get_count Note the typo in anotherfunc. This code was intended to output a zero followed by a one, but because of the typo, will output two 0's. Is there any way to prevent errors like this from happening? I find it hard to believe that a language as well-designed as Ruby would lack this simple feature.