Running Pop-11 
Author Message
 Running Pop-11

Those of you that are keeping count have probably noticed my posts tend to
be about putting Pop-11 on Linux, so this one won't come as a surprise to
you...

a) The latest problem I've found is that if a user existed before Pop-11
was put on their system, then the $HOME/.Poplib directory won't exist for
them.  The standard solution to this is to copy the directory across at
load time if it doesn't exist.

Is there an easy way to do this in Pop-11 (I don't know of one, and I'd
rather not do it in the shell scripts if possible), and can anyone think
of a reason not to do it?

b) The large number of environment variables needed by Pop-11 is an old
problem, but is it possible to do something like this:

vars temppopenvlist = [ pop-specific environment variables ];
file temppopenvlist in $poplib/popenvlist.p;

then towards the top of init.p:

load $poplib/popenvlist.p;
[ ^^popenvlist ^^temppopenvlist ] -> popenvlist;

This would at least reduce the number of sitting variables to a handful.

        - Andrew



Sun, 01 Sep 2002 03:00:00 GMT  
 Running Pop-11
Steve Leach posted the following reply to Andrew. However our mail->news
gateway caused it not to get posted to comp.lang.pop, so I am
re-posting.

Apologies to those who have already seen it.

Aaron
=======================================================================

Date: Wed, 15 Mar 2000 14:11:58 +0000


Subject: Re: Running Pop-11

Hi Andrew (& other popforum readers),

Quote:
>a) The latest problem I've found is that if a user existed before Pop-11
>was put on their system, then the $HOME/.Poplib directory won't exist for
>them.  The standard solution to this is to copy the directory across at
>load time if it doesn't exist.

>Is there an easy way to do this in Pop-11 (I don't know of one, and I'd
>rather not do it in the shell scripts if possible), and can anyone think
>of a reason not to do it?

The main problem is there is no way to create a directory in Pop11.
You either need to get a shell to do it or to externally load mkdir and
write a suitable wrapper.  This omission is a bad one.

[To be honest, the blame lies fairly and squarely with UNIX.  The UNIX
world has never had a properly thought-out policy for making applications
visible on a per user basis (the $PATH is a joke), giving apps working areas
on a per user basis, installing and removing apps is still painful, and
even basic issues like finding out the installation directories has no
overall solution.  Worst of all, these are all easy problems to solve.]

Quote:
>b) The large number of environment variables needed by Pop-11 is an old
>problem, but is it possible to do something like this:

>vars temppopenvlist = [ pop-specific environment variables ];
>file temppopenvlist in $poplib/popenvlist.p;

>then towards the top of init.p:

>load $poplib/popenvlist.p;
>[ ^^popenvlist ^^temppopenvlist ] -> popenvlist;

>This would at least reduce the number of sitting variables to a handful.

I think this is a rather clever suggestion.

Steve
======================END of STEVE's REPLY======================
--
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   (NB: Anti Spam address)
TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html



Thu, 05 Sep 2002 03:00:00 GMT  
 Running Pop-11
[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]

Quote:

> Date: 15 Mar 2000 13:35:53 GMT

> Those of you that are keeping count have probably noticed my posts tend to
> be about putting Pop-11 on Linux, so this one won't come as a surprise to
> you...

> a) The latest problem I've found is that if a user existed before Pop-11
> was put on their system, then the $HOME/.Poplib directory won't exist for
> them.

That is a special case. The problem is more general. E.g. here at
Birming if a user is created who is not set up as a poplog user
initially (and not all are) then the $poplib directory will not exist
for that user either, even though poplog was there all the time.

Quote:
> The standard solution to this is to copy the directory across at
> load time if it doesn't exist.

Or to use my poplog startup script 'poplog' which is a shell script put
in one of the bin directories. Then all these work:

    poplog pop11
    poplog eliza
    poplog xved

etc. The script sets up all the environment variables before running
Pop11 and sets up one's $poplib directory to be a shared Poplib
directory. This assumes you don't want to alter vedinit.p etc.

Such a script is included with the Birmingham poplog CD, but in
an obscure location and is not automatically put in /usr/local/bin as
it probably should be when poplog is installed. It can be found in

    http://www.cs.bham.ac.uk/research/poplog/man/bin/poplog

It uses /bin/csh, and should be re-written to use /bin/sh, which will be
smaller and faster.

Quote:
> Is there an easy way to do this in Pop-11 (I don't know of one, and I'd
> rather not do it in the shell scripts if possible), and can anyone think
> of a reason not to do it?

Steve Leach gave an answer.

A third answer is as follows. If you wish you can put something like
this in $popsys/init.p though it will slightly slow down starting up
pop11:

;;; $popsys/init.p

;;; If the $poplib environment variable has not yet been set up
;;; define it to be ~/Poplib
unless systranslate('poplib') then
    ;;; using the updater of systranslate is an alternative to
    ;;; manipulating popenvlist.
    sysfileok('~/Poplib') -> systranslate('poplib');
endunless;

;;; Check whether the $poplib directory exists
unless sysisdirectory('$poplib') then

    ;;; If there's no $poplib directory then copy one from the
    ;;; local library (assumed to exist).
    sysobey('/bin/cp -rp /usr/local/poplog/local/Poplib/* $poplib')

endunless;

;;; End $popsys/init.p

NB I have not tested all that. There may be bugs in it.
It won't be a nice thing to do if $poplib is set to be your login
directory, which is the Poplog default set in
    $popcom/popenv

The first conditional above could test for that and change $poplib in
that case.

Quote:
> b) The large number of environment variables needed by Pop-11 is an old
> problem, but is it possible to do something like this:

> vars temppopenvlist = [ pop-specific environment variables ];
> file temppopenvlist in $poplib/popenvlist.p;

> then towards the top of init.p:

> load $poplib/popenvlist.p;
> [ ^^popenvlist ^^temppopenvlist ] -> popenvlist;

> This would at least reduce the number of sitting variables to a handful.

As Steve commented, that's an ingenious solution which will work.
temppopenvlist will have to be a list of strings of the form

    ['n1=v1' 'n2=v2' 'n3=v3' ...]

where each of ni is the name of an environment variable, and each of
vi is the corresponding value, e.g.

    'poplocalauto=/usr/local/poplog/local/auto'

That could be done in $popsys/init.p if the same environment
variables are to be used for all users. I may experiment with that
mechanism at Birmingham, which will reduce the number of variables
setup at login time in

    $poplocal/local/com/popenv

which has to be done separately for bash users in:
    $poplocal/local/com/popenv.sh

That won't work for the environment variables used to decide how to
start up poplog, i.e.

    $pop_pop11 $pop_prolog $pop_xved $pop_clisp $pop_pml

etc. These are used at an earlier stage than the reading of init.p

Using those to determine which saved image to run is described in
section 4 of REF SYSTEM.

That convention was adopted to allow poplog to run in a shell that
does not support aliases or functions, like early versions of
/bin/sh

As Steve often points out, this is an area of poplog/pop-11 that
needs to be re-designed.

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   (NB: Anti Spam address)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/



Thu, 05 Sep 2002 03:00:00 GMT  
 Running Pop-11

Quote:
> > The standard solution to this is to copy the directory across at
> > load time if it doesn't exist.

> Or to use my poplog startup script 'poplog' which is a shell script put
> in one of the bin directories. Then all these work:

I should've said that it's the Linux-way of doing things.  I've been
defaulting to Linux standards rather than Poplog standards because I know
them better and because my goal is to get Poplog to blend in better with
Linux.

I've been using the poplog script with a lot of success, and have made
some minor modifications (i.e. getting it to handle being called with an
arbitrary name - e.g. running xved if it's called as xved)

That said, I'd like to get rid completely of the need for load-time shell
scripts - they cause problems for people who don't have/don't use the
shell a script is written for, and we have a perfectly good language to do
all this stuff with anyway :)

To that end, is there anything other than environment variables that is
currently set-up by scripts?

Quote:
> A third answer is as follows. If you wish you can put something like
> this in $popsys/init.p though it will slightly slow down starting up
> pop11:

<snip - answer>

This seems the best solution since I need to copy a directory and its
contents across.

While we're on the subject, though...

I've been putting the default user Poplib directory in /etc/skel, because
Red Hat Linux copies the contents of that directory into the home
directory of each new user.  Since RH is the only distribution I use, I'm
not sure how common that is - does anyone know what the equivalent is
under other distributions?

Also, this is obviously a Linux rather than Poplog standard.  As I said,
I've been defaulting to the Linux standard, but would it be better to try
and conform to Poplog?  Or both? (e.g. create a link in /etc/skel to
/usr/local/poplog/local/Poplib)

<snip - environment variables>

Thanks - my next question was going to be about the minimal set needed :)

        - Andrew



Sat, 07 Sep 2002 03:00:00 GMT  
 Running Pop-11
I am slowly catching up with comp.lang.pop, having previously been
too busy with work on the How to Design a Functioning Mind Symposium
coming up in a few weeks:
    http://www.cs.bham.ac.uk/~axs/aisb/
(Advert for poplog users interested in cognitive science!)


Quote:
> Date: 21 Mar 2000 22:13:28 GMT
> I've been putting the default user Poplib directory in /etc/skel, because
> Red Hat Linux copies the contents of that directory into the home
> directory of each new user.  Since RH is the only distribution I use, I'm
> not sure how common that is - does anyone know what the equivalent is
> under other distributions?

> Also, this is obviously a Linux rather than Poplog standard.  As I said,
> I've been defaulting to the Linux standard, but would it be better to try
> and conform to Poplog?  Or both? (e.g. create a link in /etc/skel to
> /usr/local/poplog/local/Poplib)

I think using a link to the poplog local directory is better, since
then people with different kinds of knowledge and backgrounds will
find it where they expect.

More on this when I've finished checking out my new versions of
    $popsys/init.p
    $popsys/popenv.p

requiring only ONE environment variable to be set, $popsys, and
later on not even that.

Quote:
> <snip - environment variables>

> Thanks - my next question was going to be about the minimal set needed :)

The comments in $popcom/popenv (or, if you prefer $popcom/popenv.sh)

should help you answer that.

Unfortunately the $popcom/popenv* scripts define $poplocal/local
as $usespop/local by default.

Assuming the local directory is a subdirectory of $usepop is surely
a mistake, since local directories should survive deletion of a
version of poplog. So I am inclined to make $usepop/local a symbolic
link to ../local by default in all the distributions.

I've done this at one university where I helped them install poplog
on suns, and it seemed to work fine, with usepop as
/usr/local/poplog/v15.53 and $poplocal/local equivalent to
/usr/local/poplog/local

I also set the poplogin script so that if ~/Poplib did not exist,
and $poplib was not defined, then it defined $poplib as
    $poplocal/local/Poplib

That meant copying Poplib was not needed for the majority of
users (students who would not have been able to edit their init.p
and vedinit.p files sensibly anyway).

It also meant that it was very easy to modify pop11 or ved startup
behaviour for users by editing files in $local/Poplib

I think that in future I should do that for students here.

Anyone who learns enough to want to edit their startup files can
then copy the Poplib directory over and edit. Most students never do
edit them. (Is that good or bad???)

If you follow that policy then maybe there should be nothing in
/etc/skel ???

A compromise would be to put Poplib in /etc/skel with symbolic links
to $poplocal/local/Poplib/*

Neither strategy works if people try to use ved_dk to produce
permanent changes to key-bindings. so that would have to be changed
to copy files over if necessary.

There's a trade-off between the default of giving people something
they will look at and learn from, and making things simple and easy
to administer centrally. A compromise might be simply to copy over a
    ~/.Poplog-help
file to each new user, telling users where default startup files are
and where to look for information on tailoring the environment?

No doubt there are other, possibly better, options...

Aaron



Thu, 12 Sep 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. forwarding message from Steve Leach re Running Pop-11

2. Modula II for PDP-11 running RT-11

3. A POP-11 Book Available via FTP

4. calling prolog from pop-11

5. Pop-11 Procedures for encoding and decoding BASE64 files (mimencode)

6. Development of Pop-11 for Windows

7. GSL interface: another Pop-11 development task?

8. vectors in pop-11

9. Pop-11 XML tools by Steve Leach

10. Email list for discussion of poplog/pop-11 developments

11. Regular expression string pattern matching: Embedding pop-11 procedures, and more

12. popsh-0.1 : For Scripting in Poplog and Pop-11

 

 
Powered by phpBB® Forum Software