Erik Veenstra wrote:
> You can't call them *abstract* methods if you implement them
> like this.
> In Java, the presence of methods is checked at compiletime, if
> they are defined "abstract". Your solution only checks the
> presence of these methods at runtime, which is already checked
> by Ruby itself.

I don't want the just same as Java's abstract method.
I know Ruby is dynamic language.
I don't intend to bring checking at compiletime nor strictly typing.


Yukihiro Matsumoto wrote:
> I'm afraid that it doesn't work for some cases, for example:
>
>   class Base
>     def each
>       ...
>     end
>   end
>
>   class Derived < Base
>     include Enumerable
>     ...
>   end
>
> The abstract "each" method defined in Enumerable overrides the "each"
> in the Base class.  I'm not against the idea of abstract (or deferred)
> method, but sometimes it's not that simple.

Oh, I didn't realized that.
How about this?

  class Derived < Base
    alias each_orig each
    include Enumerable
    alias each each_orig
    ...
  end

It's not simple....orz


ara.t.how... / noaa.gov wrote:
>   class Module
>     def abstract_method m
>       define_method(m){|*a| super rescue raise NotImplementedError}
>     end
>   end

It seems to be a good solution.
I'll consider and examine this idea.
Thanks ara.

--
regards,
kwatch