From: Curt Sampson Date: 2005-04-13T15:21:52+09:00 Subject: Scope in Method Definitions Presumably there's some theory behind this, but this is a seeming inconsistency in the language that I don't understand. foo = "foo" C = Class.new() { def method1; puts foo; end define_method(:method2) { puts foo } } C.new.method2 # prints "foo" C.new.method1 # NameError: undefined local variable or method `foo' Can someone explain why this is sensible behaviour? cjs -- Curt Sampson +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA