digitalmars.D.learn - modules in other directory trees
- dsmith (20/20) Oct 31 2012 What is your way to import modules from other directory trees?
- Tobias Pankrath (7/27) Nov 02 2012 There is an emerging consensus that a
What is your way to import modules from other directory trees? Here is my (incorrect?) ideal: Given: /home/user/library_directory/ Containing: lib_one.d lib_two.d lib_interface.d lib_interface.d source: module lib_interface; public import lib_one, lib_two; Implementation in program /home/user/programs/main.d: cd /home/user/programs ln -s /home/user/library_directory/lib_interface.d // or include in dmd.conf: -I/path_to/library_directory main.d source: import lib_interface; ... Compile program: dmd main.d lib_interface.d
Oct 31 2012
On Wednesday, 31 October 2012 at 23:01:52 UTC, dsmith wrote:What is your way to import modules from other directory trees? Here is my (incorrect?) ideal: Given: /home/user/library_directory/ Containing: lib_one.d lib_two.d lib_interface.d lib_interface.d source: module lib_interface; public import lib_one, lib_two; Implementation in program /home/user/programs/main.d: cd /home/user/programs ln -s /home/user/library_directory/lib_interface.d // or include in dmd.conf: -I/path_to/library_directory main.d source: import lib_interface; ... Compile program: dmd main.d lib_interface.dThere is an emerging consensus that a import-everything-from-my-lib module should be called "all", see for example here: http://prowiki.org/wiki4d/wiki.cgi?BestPractices#ConventionalModuleNameforImportingAllModulesinaPackage Also, there has been an DIP adressing this: http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP16
Nov 02 2012