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

From: Paulo Moura <pmoura_at_...16...>
Date: Tue, 17 Mar 2009 14:25:29 +0000
On 2009/03/17, at 13:14, Joachim Schimpf wrote:

>>> 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
> % eclipse -e  
> "ensure_loaded 
> (library(toplevel)),toplevel:toplevel_init(tty),toplevel:toplevel"

Thanks. I only looked at the built-in predicate list, I was not  
expecting a "toplevel" library. Found, however, another problem: the  
getval/2 call fails to retrive the value set by the -e option goal  
when using a -b option:

pmmbp:~ pmoura$ eclipse -e "getcwd(CWD), setval(cwd, CWD),  
(library(toplevel)),toplevel:toplevel_init(tty),toplevel:toplevel, "
ECLiPSe Constraint Logic Programming System [kernel]
Kernel and basic libraries copyright Cisco Systems, Inc.
and subject to the Cisco-style Mozilla Public Licence 1.1
(see legal/cmpl.txt or
Source available at
GMP library copyright Free Software Foundation, see legal/lgpl.txt
For other libraries see their individual copyright notices
Version 6.0 #42 (i386_macosx), Mon Oct  6 16:18 2008
[eclipse 1]: getval(cwd, D).

D = "/Users/pmoura/"
Yes (0.00s cpu)
[eclipse 2]: ^D

pmmbp:~ pmoura$ eclipselgt
array or global variable does not exist in getval(cwd, CWD) in module  
   Query exited (abort): :- getval(cwd, CWD), atom_string(,  
Settings), concat_strings(CWD, Settings, String),  
canonical_path_name(String, File), exists(File) -> compile(File) ;  
atom_string($LOGTALKUSER/, String),  
canonical_path_name(String, File), exists(File) ->  
compile($LOGTALKUSER/ ; true

It seems as loading a boot file using the -b option wipes out any  
(previously) defined global variables. Can you confirm?



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_...16...>

Home page: <>
Research:  <>
Received on Tue Mar 17 2009 - 14:25:44 CET

This archive was generated by hypermail 2.3.0 : Sun Aug 25 2019 - 06:15:50 CEST