Re: [eclipse-clp-users] Finding the ECLiPSE startup directory

From: Joachim Schimpf <joachim.schimpf_at_...44...>
Date: Wed, 18 Mar 2009 00:14:23 +1100
Paulo Moura wrote:
> 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.

See http://eclipse-clp.org/doc/bips/lib/toplevel/index.html

% eclipse -e "ensure_loaded(library(toplevel)),toplevel:toplevel_init(tty),toplevel:toplevel"


-- Joachim
Received on Tue Mar 17 2009 - 13:14:42 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST