[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Aug 23 02:29:46 2002 
Subject:Re: pop11 on a PC : does HELP work? 
From:Aaron Sloman 
Volume-ID:1020823.01 


jeffb@jtbest.demon.co.uk wrote about poplog on:

> Date: Thu, 22 Aug 2002 23:43:35 +0000 (UTC)

Thanks for the tips on getting windows poplog V15.53 to work with ved,
invoked from a shortcut.

If anyone can tell me how to create a directory containing the short cut
I'll add that to the zip file for V15.53 on the poplog website, and
phase out windows poplog V15.5.

> By the way, I have encountered some problems with Poplog's use of
> environment variables. The scripts usually define lower case versions of
> the names, ...

There are some upper case ones, though most users will never need them.

You can find out all the environment variables poplog knows about
(including those inherited from the shell or whatever invoked it)
via the identifier: popenvlist.

The value of this is a list of strings of the form 'N=V'
where N is a variable name and V its value.

E.g. if I give the commands

    true -> pop_pr_quotes;  ;;; make it print string quotes

    applist(popenvlist, npr);

this prints out about 96 strings including all sorts of things that
have nothing to do with poplog, e.g.

'SHELL=/bham/bin/tcsh'
'TERM=xterm'
'DISPLAY=acws-0051:10.0'
'NNTPSERVER=news.cs.bham.ac.uk'
'DOMAINNAME=cs.bham.ac.uk'
etc., etc.

and several (too many) that are set up in poplog scripts, e.g

'usepop=/bham/common/com/packages/poplog/linux.current'
'popcom=/bham/common/com/packages/poplog/linux.current/pop/com'
'popsrc=/bham/common/com/packages/poplog/linux.current/pop/src'
'popsys=/bham/common/com/packages/poplog/linux.current/pop/pop'
'popexternlib=/bham/common/com/packages/poplog/linux.current/pop/extern/lib'
'popautolib=/bham/common/com/packages/poplog/linux.current/pop/lib/auto'
'poplocal=/bham/common/com/packages/poplog'
'local=/bham/common/com/packages/poplog/local'

etc.

and some that use upper case, set up in
    $usepop/pop/com/popenv
or
    $usepop/pop/com/popenv.sh

e.g.
'POP_XM_EXLIBS=x=motif/2002: -L/usr/X11R6/lib -lXm -lXt -lXext -lX11'
'POP_XOL_EXLIBS=x=openlook/3000:  -lXol -lXt -lX11'
'POP_XT_EXLIBS=x=mit/11005: -L/usr/X11R6/lib -lXt -lX11'
'POP_XLINK_EXLIBS===POP_XT_EXLIBS'
'POP_X_INCLUDE=/usr/include'

> ....but some of the tools in the unholy mixtures I am trying
> expect upper-case versions and others, lower-case. In particular, one of
> the Bourne-shell tools I was working with - momentarily, I forget which
> - - insisted on requiring all environment variables to be in upper-case
> with shell variables in lower-case. Has anyone else encountered and/or
> surmounted this problem? (I.e. Do you have any scripts I can filch to
> save me rewriting them!)

It depends whether you want to have lower case environment variables
used by poplog translated to uppercase before poplog invokes a shell, or
whether you want poplog to translate inherited upper case variables
(e.g. POPAUTOLIB to lower case).

CASE 1.
For the former, you can rebuild popenvlist temporarily before spawning
a sub-process. E.g. run process foo, with environment variable 'evar'
replaced by 'EVAR' with the same value.

define run_foo();
    ;;; use dlocal to ensure that popenvlist is restored on exit
    dlocal popenvlist;

    ;;; make a copy of popenvlist so that original is not mangled
    ;;; by updater of systranslate.
    copylist(popenvlist) -> popenvlist;

    ;;; using systranslate is easier than editing popenvlist
    systranslate('evar') -> sysstranslate('EVAR');

    ;;; remove original (if necessary)
    false -> systranslate('evar');

    foo();

enddefine;

The temporary popenvlist will eventually be garbage collected.

If you don't know which environment variables will need to be replaced,
as some of them are created at run time then you can do things like this
to replace the environment variables in var_list with upper case ones:

    lvars string;
    for string in var_list do

        systranslate(string) -> sysstranslate(lowertoupper(string));
        false -> systranslate(string);

    endfor;


CASE 2:
If you want poplog when it starts up to replace $POPAUTOLIB with
$popautolib then include in your startup procedure:

    systranslate('POPOAUTOLIB') -> systranslate('popoautolib');
    ;;; and possibly also
    false -> systranslate('POPOAUTOLIB');

(or use uppertolower on strings)

However, there are environment variables like pop_pop11 that are used
before any user code can start running, e.g. to invoke a saved image.
(See REF system). So you'll have to get your shell script to invoke
pop11 with the full command, i.e.

    basepop11 +startup

not just

    pop11

I hope that helps.

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk   (ReadATas@please !)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/ (And free book on Philosophy of AI)
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html