On Thu, Apr 24, 2008 at 4:32 PM, Charles Oliver Nutter <
[EMAIL PROTECTED]> wrote:

> mnwicket wrote:
>
> > So I understand that jruby can create a class impl at any time...but can
> > it
> > handle the above situation...the difference being the impl is an
> > abstract
> > class.
> >
>
> Ahh I see....well we can extend abstract classes, but I don't think we
> have a shortcut syntax that would work for it. What would you expect this to
> look like?


Something like this would be fun:

link = Link.new
link.on_click do |evt|
  ...
end

I'm not sure of the drawbacks, but It would be good if JRuby allowed to
instantiate abstract classes. We could provide abstract method
implementations with blocks.

link = Link.new
link.on_click_must do |evt|  # just to not collide with original on_click
call
  ...
end

There are many things to consider here. What if I forgot to implement some
abstract method?

Cheers,
-- 
Fabio Kung
http://www.fabiokung.com

Caelum - Ensino e Soluções em Computação
http://www.caelum.com.br

Reply via email to