From: Dave Thomas Date: 2001-10-25T22:00:23+09:00 Subject: [ruby-talk:23287] Re: Ruby macros "Aleksei Guzev" writes: > Parameterized classes are "object-oriented macros" ;) > Macros are not needed while one can pass a class to a function. The original discussion about macros at RubyConf started with some talk about writing interfaces to web services in Ruby. The problem there is that you needed to pass to the web services information on the intended types of parameters, along with the return type of a method. The 'is' construct came about as a way of doing this: def calc_payroll(emp_id is IDL::Integer, name is IDL::String) is IDL::Exported ... end or somesuch. As macros, these would allow information on the names and intended types of parameters to be collected as the method is defined, but would not affect the underlying syntax of the language too much (just the addition of the _is_ keyword). In the above example, there is no typing going on at the Ruby level: all that we've done is help the IDL stuff generate a typed interface to the outside world. Once you have this "is" construct, you can keep finding uses for it, things like require "nqxml" is version(:>=, 1.2) and so on. I'm not sure how you could do all this with parameterized classes (tidily). Dave