From: Robert Klemme Date: 2006-02-02T06:42:39+09:00 Subject: Re: local variable and closure Sch�le Daniel wrote: > Hello Robert, > >> Btw, what are you trying to accomplish? Somehow I have the feeling >> that your code might be more complex than needed. Especially the >> use of a global variable irritates me. > > complexity was the intention of my code :) :-) > no really, I am playing with metaprogramming, also I wanted to know > how to implement own functions like "attr_accessor" One way: class Module def i_am_in_class_scope(*a) p a end end >> class Foo >> i_am_in_class_scope :foo, :bar >> end [:foo, :bar] => nil > btw is there special name for this kind of functions? > functions that are executed in the class scope and can refer with > "self" to the class they are inside. I'd call them "class instance methods". Kind regards robert