Stephen Drake wrote:
> > Lee Goddard <leego@cogs.susx.ac.uk> wrote:
> > Is it possible to have an automatically-enlarging structure
> > in which to store objects/object references?
>
> Well, you could have a look at using dynamic lists. There are a couple of HELP
> files, HELP PDTOLIST which is quite helpful and HELP LISTS which isn't that
> helpful at all! Essentially you would create a dynamic list of objects by
> calling 'pdtolist' which takes a procedure as an argument. That procedure -
> call it, say, build_bot - would generate (and return) an object, so you'd
> have something like:
>
> vars bot_list;
> pdtolist(build_bot) -> bot_list;
>
> At first bot_list will be empty, but as soon as you attempt to index an
> element of the list (e.g. bot_list(n) =>) it will create n objects in the
> list. The list is essentially infinitely big. There's a better explanation in
> the book 'Programming in POP-11' by Jonathan Lavanthol, page 107. Any
> problems, find or mail me.
Having problems finding the one copy the library has of this out of print boot,
so hope you don't mind me asking a further question regarding pdtolist: I'm
getting an error when I supply pdtolist with a procedure that has an argument:
;;; MISHAP - enp: EXECUTING NON-PROCEDURE (AS UPDATER)
;;; INVOLVING: <undef this_line>
I'm hoping this is nothing to do with an unmentioned attribute of pdtolist -
but even if it does take a procedure with args, could you please let me know
how those arguments are processed dynamically? Like, does pdtolist retain in
their place the value they held at the initial assignment of pdtolist(p(a,b))->x,
or on calling x, will p(a,b) by accessed with the current values of a,b ?
Or -- do you know of a POP detailed reference book that's still in print?
Although I've been programming for some years, I'm finding some of the HELP files
are less than they claim to be.... maybe there's a gap in the market?
TIA,
Lee
______________________________________________________________________
Lee Goddard on IS MSc at Sussex: <leego@cogs.susx.ac.uk>
Home: <lee.goddard@bigfoot.com> <http://www.webslave.u-net.com>
______________________________________________________________________
"Post-modernism...the Grande Narrative that denies Grande Narrative."
- Cedric Watts (personal correspondence, 1997)
|