From: avi@...4.com (Avi Bryant) Date: 2002-04-07T07:16:29+09:00 Subject: Re: Is eval a code/design smell? Sean Middleditch writes: >Accessors, of coure, can be made directly into methods at compile time. Compile time? When's that?? I think you're misunderstanding what I'm saying about attr_accessor. As soon as the method attr_accessor is run, the method is module_eval'd into existence (actually, it's in C, so the parse nodes are generated directly, but in this case that makes no difference at all - don't tell me I couldn't write a perfectly safe version of the same thing that generated text instead). It's not like eval() is used every time the accessor is called, which is how you seemed to be interpreting what I was saying. But I really have no idea what you mean by compile time. Hours into the run of a ruby script, user input could trigger a call to attr_accessor. There is no way for a compiler to anticipate this. Ruby doesn't, and couldn't, without substantially changing the semantics, have a compile stage.Maybe you mean at parse-time, but I don't think we want the parser generating methods.