On 2009/03/17, at 09:48, Joachim Schimpf wrote: > Paulo Moura wrote: > ... >> >> Allow me to briefly describe the problem I'm trying to solve. When >> starting up Logtalk (using ECLiPSE as the back-end Prolog compiler), >> the startup (Prolog) script looks into the current directory for a >> settings file. > > If Logtalk were an ECLiPSe library module it could contain a directive > :- export initialization(load_settings_file). > When a user imports/use_module/libs this module, load_settings_file/0 > gets executed in the original current directory, which is what you > want. > > But I think you can't use this trick because logtalk is not a module. > Please don't use :- local initialization() instead - it currently > works as above (as long as the file isn't pre-compiled), but I'd > consider this a bug, so don't rely on it please. > > I suppose we could introduce a global setting analogous to > get_flag(cwd,D) > that returns the startup directory. But, as Kish said, you can start > eclipse (via script or shortcut) with a -e option to save the startup > directory yourself: eclipse -e "getcwd(D),setval(startup_cwd,D),..." Using the -e option could work if it's possible to call a predicate that will start an interactive toplevel session (the -e option would be used with a -b option that loads Logtalk). However, I cannot find such a predicate in the documentation. Cheers, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura, PhD Assistant Professor Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura_at_di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------Received on Tue Mar 17 2009 - 10:55:06 CET
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET