Hmm... If import is namespace operation, why (then) code is executed during this operation? Or it is executed only for .pmod files?
Code is executed when the corresponding directory module is resolved.
The question, actually, is - which files (.pmod and/or .pike) import "." will use... And - where. And which location inherit uses to search
import "." creates a directory module of the directory the current source file is in, and imports that module. See handle_import() for details.
for programs/modules...
The default implementation of handle_inherit() uses cast_to_program(), which in turn searches the directory the current file is in, and then the program path as specified by ${PIKE_PROGRAM_PATH} and -P.
Regards, /Al
/ Henrik Grubbström (Lysator)
Previous text:
2004-02-02 13:39: Subject: Re: Pike module initialization at compile time
On Mon, Feb 02, 2004 at 01:15:02PM +0100, Henrik Grubbström (Lysator) @ Pike (-) developers forum wrote:
What would be the difference? import is a namespace operation.
Hmm... If import is namespace operation, why (then) code is executed during this operation? Or it is executed only for .pmod files?
The question, actually, is - which files (.pmod and/or .pike) import "." will use... And - where. And which location inherit uses to search for programs/modules...
Regards, /Al
/ Brevbäraren