From: Pierre Barbier de Reuille Date: 2006-08-17T23:58:22+09:00 Subject: Re: Need - macros feature Henry Savr wrote: > Farrel Lifson wrote: > >> On 17/08/06, Henry Savr wrote: >> >>> def a1 >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >>> >>> >> attr_accessor :a1 # RW >> attr_reader :a1 # R >> attr_writer :a1 # W >> >> Farrel >> > Thank you, > but my question was about MACRO option, so the preprocessor should work > and produce ruby source > The good question is: what for ? In the case of the accessors, the methods are define when the class is evaluated ... but when it is used, there is no difference between accessors defined that way and accessors defined the Hard Way (tm). The Good Thing (tm) with a dynamic language as Ruby is you can safely generate your code (or parametrize it) so as to avoid lot of typing, without any need for another macro-language, so why not using this capability ? Pierre