many packages in one file

A

Amir Kadic

Hi!

I'd like to put 2 (or more) packages in one file, the code
each of which is using functionality from the other ones.

And I'd like to make the whole thing compile :)

Something like:

package a;
use b;
package b;
use a;

(The reason is simple: stuff the whole app into one file
for distribution.)

Thanks for any hints.

Amir
 
M

Malcolm Dew-Jones

Amir Kadic ([email protected]) wrote:

: Hi!

: I'd like to put 2 (or more) packages in one file, the code
: each of which is using functionality from the other ones.

: And I'd like to make the whole thing compile :)

: Something like:

: package a;
: use b;
: package b;
: use a;

: (The reason is simple: stuff the whole app into one file
: for distribution.)

: Thanks for any hints.

Did you try it? What error did you have?

The only issue should be the "use module" lines, since there is no longer
a file to load. The easiest solution is to comment out the line. It's
possible that you will need to call the import functions later yourself in
that case (assuming the module has an import function).


so
use module1;
use modeul2;

becomes

insert module1 code here
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top