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

From: Paulo Moura <pmoura_at_di.ubi.pt>
Date: Tue, 17 Mar 2009 15:15:58 +0000
On 2009/03/17, at 14:25, Paulo Moura wrote:

> 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 http://eclipse-clp.org/doc/bips/lib/toplevel/index.html
>>
>> % 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),
> ensure_loaded
> (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 www.eclipse-clp.org/licence)
> Source available at www.sourceforge.org/projects/eclipse-clp
> 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
> eclipse
> ERROR: logtalk_eclipse6.pl:15:
>   Query exited (abort): :- getval(cwd, CWD), atom_string(settings.pl,
> Settings), concat_strings(CWD, Settings, String),
> canonical_path_name(String, File), exists(File) -> compile(File) ;
> atom_string($LOGTALKUSER/settings.pl, String),
> canonical_path_name(String, File), exists(File) ->
> compile($LOGTALKUSER/settings.pl) ; true
> ...
>
> It seems as loading a boot file using the -b option wipes out any
> (previously) defined global variables. Can you confirm?


Found the answer in the docs:

"The -e option can be used together with the -b option and is executed  
afterwards."

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 - 15:16:18 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET