From the outside it’s not obvious why ‘public’ would be special like
this, it just happened to be the first name I choose for the method I
was testing at the time. Ruby objects don’t have anything special
called ‘public’ and neither do Java objects, which is why this seemed
interesting to me.
Well had it been a static method I think the answer would have been
that ‘public’ is a method on Module. Since this is calling on an
instance method, I am guessing maybe ‘public’ is in RESERVED_NAMES
when it should be in STATIC_RESERVED_WORDS. Can you file a bug on
this?
The background is that for a small set of important Ruby methods we
will not override their definition in case of conflict. ‘public’ is
in this list.
As a workaround you can use ‘java_send’ to still call the method…
On Mon, Nov 2, 2009 at 2:52 AM, Thomas E Enebo [email protected]
wrote:
Well had it been a static method I think the answer would have been
that ‘public’ is a method on Module. Â Since this is calling on an
instance method, I am guessing maybe ‘public’ is in RESERVED_NAMES
when it should be in STATIC_RESERVED_WORDS. Â Can you file a bug on
this?
The background is that for a small set of important Ruby methods we
will not override their definition in case of conflict. Â ‘public’ is
in this list.
As a workaround you can use ‘java_send’ to still call the method…
For our real system, we are deliberately trying to avoid using names
which are generic enough to cause conflicts (both in JRuby and –
hopefully – in whatever other scripting languages users might use.)
I found this purely by chance and thought it was interesting.
TX
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.