From: Einar Karttunen Date: 2003-02-12T00:45:10+09:00 Subject: Re: CLOS-like system & Ruby On 12.02 00:19, Gour wrote: > I'm not familiar with the CLOS, but just want to re-write one CLisp > application in Ruby (xindy index processsor). Ruby and CL have often different ways of expressing things naturally. So the easiest idioms and patterns will probably differ a bit. CLOS is centered around general functions and multiple dispatch, while Ruby object system uses methods in classes with single dispatch. > a) the ability to define methods at run-time using the macro expansion > mechanism Ruby has eval and the ablity to inject methods into objects. So you can emulate that in ruby to an extent, but it may not be very natural. > b) the "eql"-specialisation feature that allows specialisation of > methods down to single instances of a class, and You can redefine methods on a per object basis in Ruby. This should provide facilities comparable to eql-specialisation. > c) the multi-method dispatching paradigm No. You can play around and simulate multiple dispatching but its not supported in Ruby (or in most other main stream languages). - Einar Karttunen