www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Module Paths

reply "Matt" <webwraith fastmail.fm> writes:
Is it possible to retrieve the file path to a module from within 
the module itself? Or, if not, are there any methods to retrieve 
the import location list (the argument -I that is passed to the 
compiler) from within code?
Aug 09 2012
next sibling parent reply "Tobias Pankrath" <tobias pankrath.net> writes:
On Friday, 10 August 2012 at 02:20:18 UTC, Matt wrote:
 Is it possible to retrieve the file path to a module from 
 within the module itself? Or, if not, are there any methods to 
 retrieve the import location list (the argument -I that is 
 passed to the compiler) from within code?

I don't know of any possibility. What do you want to achieve?
Aug 10 2012
parent Jacob Carlborg <doob me.com> writes:
On 2012-08-10 14:06, Matt wrote:
 I'd like to try to track the source files, to watch for editing. The
 goal is for Run-time compiling, akin to runtime compiled C++, which
 allows the programmer to edit their modules, save them, then the program
 notices the change of file and recompiles, all while the program is
 still running. The final goal would be to allow the programmer to edit
 code, and see the changes in realtime, without having to stop the
 program and restart.

Tomasz Stachowiak did that way back in the D1 days. He used a modified version of the DDL linker. It might be this code: https://bitbucket.org/h3r3tic/boxen/src/76f3fab1b889/src/ddl/ddl -- /Jacob Carlborg
Aug 10 2012
prev sibling next sibling parent "Matt" <webwraith fastmail.fm> writes:
I'd like to try to track the source files, to watch for editing. 
The goal is for Run-time compiling, akin to runtime compiled C++, 
which allows the programmer to edit their modules, save them, 
then the program notices the change of file and recompiles, all 
while the program is still running. The final goal would be to 
allow the programmer to edit code, and see the changes in 
realtime, without having to stop the program and restart.
Aug 10 2012
prev sibling parent "Matt" <webwraith fastmail.fm> writes:
On Friday, 10 August 2012 at 13:44:13 UTC, Jacob Carlborg wrote:
 On 2012-08-10 14:06, Matt wrote:
 I'd like to try to track the source files, to watch for 
 editing. The
 goal is for Run-time compiling, akin to runtime compiled C++, 
 which
 allows the programmer to edit their modules, save them, then 
 the program
 notices the change of file and recompiles, all while the 
 program is
 still running. The final goal would be to allow the programmer 
 to edit
 code, and see the changes in realtime, without having to stop 
 the
 program and restart.

Tomasz Stachowiak did that way back in the D1 days. He used a modified version of the DDL linker. It might be this code: https://bitbucket.org/h3r3tic/boxen/src/76f3fab1b889/src/ddl/ddl

Cool, that seems to be a good example. I'll have a look and see what I can do with it.
Aug 10 2012