Ok I got it, temporary blindness. I was simply (if that could be called 
simply) forgetting that we where declaring a new package for the Java 
class. 

Is there a way to declare package less functions in Java? (yes my Java is 
rusty)

PBS (the build system is not object oriented (for a very good reason that 
is making my life difficult) so I mainly need to declare functions that I 
can use later, not classes.

I also need to run Java scripts that interact with the build system, not 
only defining functions.

I quickly read how to use perl from java from perl; I need to export some 
functions to the java script (how to add rules, etc...). I'd like to do 
that in an external file that I can 'import'.

The whole idea with dynamic packages was that the user don't have to deal 
with where the rules it defines go (in which package as they have to go to 
diffrent packages) the functions used to add the rules know what package 
calls them and do the right thing. This is going to be more difficult when 
calling from java as I now need to pass back the java "package" to the 
perl functions (they get the information from 'caller()'. I can add a set 
of functions specialy tailored for Java of course but that means the 
syntax will look diffrent but that might be a good exercise as I am 
starting to feel the limits of the system I am using.

It would be a good thing to be able to tell Inline::Java where to put the 
classes that are defined. I don't completelyt agree with you when you say 
it's an Inline tag not an I::J. It doesn't realy matter. And I don't think 
we'll get a new Inline release only for that.

Cheers, Nadim.

PS: this is starting to be fun.

On Monday 31 May 2004 20:39, Patrick LeBoutillier wrote:
> nadim wrote:
> >Can you tell me why the Inlined code can't be evaluated in the
> >PBS::Runs::xxxx package? Where is it evaluated right now?
>
> It can and is. It's evaluated in the current (the package that calls
> "use Inline ...") package.
> In your case I believe this is PBS::Runs::PBS_1.
>
> The problem you are having is that if you don't know in advance in which
> package
> your code will be, how can you access it?
>
> Remember that Perl packages do not imply a hierarchy, that's why if you
> access
> "PBS::Runs::PBS_1::Pod_alu" as "Pod_alu" (from PBS::Runs::PBS_1) it
> doesn't work.
> IIRC package names must always be absolute.
>
>
> Patrick

Reply via email to