On Sat, Sep 03, 2005 at 10:31:08AM -0400, Patrick LeBoutillier wrote:
> Tim,
> 
> On 9/2/05, Tim Bunce <[EMAIL PROTECTED]> wrote:
> 
> > without the cast() is says:
> > 
> >     main::java::util::Vector::1=HASH(0x194b834) at test.pl line 21.
> >     You are not allowed to invoke method hasMoreElements in class 
> > java.util.Vector$1: null at (eval 14) line 76
> >      at test.pl line 22
> 
> Seems you have stumbled onto a special case that Inline::Java does not
> handle correctly. [...]

Thanks for the details.

> I did not know that it was possible to do this, i.e. extend/implement
> a public class/interface in a non-public way.
> 
> I guess the real way to solve this problem is to change the way
> Inline::Java returns class type and uses casts. Instead of returning
> the real object type to Perl and have the user cast to force the more
> generic type, maybe it should return the type that the method returns
> and have the user cast to force the more specific type. But then that
> would make Inline::Java more Java-ish and less Perl-ish... I'm not
> sure which is best.

Possibly both for different kinds of apps.

> For know you can keep using cast like you did, but you shouldn't have
> to do it to often. This is the first time I've heard of something like
> this.

That's good news. Thanks. I'll push on and let you know of any other
bumps I find.

> Also, I'd like to point out that you could make your life a whole lot
> simpler by accessing your database directly from Perl. You should
> really take a look at DBI. It's great.  ;)

DBI? Oh, yeah, that rings a bell.

All will become clear(er) in time...

Tim.

Reply via email to