Re: [crit] Fallen



On 27 May 2009 23:58:48 GMT, "John F. Eldredge" <john@xxxxxxxxxxxxxx>
wrote:

On Wed, 27 May 2009 15:31:34 +0000, Jonathan L Cunningham wrote:

On Wed, 27 May 2009 16:01:33 +0300, Antti-Juhani Kaijanaho
<antti-juhani@xxxxxxxxxxxx> wrote:

John F. Eldredge kirjoitti:
On Wed, 27 May 2009 13:47:00 +0300, Antti-Juhani Kaijanaho wrote:
In these languages, persistent data structures (like various search
trees) are preferred over array-based techniques.

I personally would class an array as a persistent data structure,
assuming that it doesn't have local scope. Admittedly, it isn't a
particularly sophisticated data structure.

A persistent array requires making a copy of the whole array each time
any element is changed. Thus, making an array persistent destroys one
of the main attractions of the data structure, namely in-place updates.

I think that's an implementation detail. In one of my favourite
languages, arrays are just functions[*]. (Modifying the array means that
you are changing the function.)

In that language it is trivial to put a wrapper around any function to
filter the arguments/results.

Of course after assiging to array elements a few hundred times, you'd
end up with a chain of a few hundred wrappers... so you might want to
copy the array every so often. But, as I said, an implementation detail.
:-)

(I'm using persistence here in the sense of Driscoll & Sleator & Tarjan
JACM 41 (5).)

I have to guess what you mean by persistence, since I haven't read it.

Jonathan
[*] Not lisp, obviously. It's a language called pop11.

I hadn't encountered that definition of "persistent" before, and I have
worked as a programmer/analyst since 1986. The definition of
"persistent" that I have encountered is "not local", i.e., the data has
module-level or global-level scope, and so doesn't go away when a
particular subroutine or function exits. I have also seen this term used
to mean data that is stored externally to the program, such as on disk,
so that it continues to exist once the program terminates.

In the contexts I'm familiar with, the concept you are describing is
referred to as "dynamic scope", i.e. instead of "X is persistent" I'd
say "X has dynamic scope" (as opposed to lexical scope).

Actually, it's not quite that simple... since dynamic scope is not quite
the same thing as module-level scope etc.

IME, in every field[*] there are "cliques" or "communities" and they all
use slightly different jargon. Sometimes there is a superstar or guru,
and (some of) his terminology becomes accepted as standard, and
sometimes a market leading company, e.g. IBM first, later Microsoft,
impose new terminology by getting the old terminology wrong, misusing it
in other ways, or reinventing wheels and given them new names. No doubt
the marketing department is relevant too. :-)

Jonathan
(My first paid programming work was in 1974 -- and I've seen a *lot* of
terminology come and go, and change meaning.)

[*] We see it here, too, with writing terminology.

--
"If I let everyone I thought was an idiot die - there
wouldn't be many people left." - Gilgamesh Wulfenbach
.



Relevant Pages

  • Re: Is it possible to use the value of the PROGRAM ID within the source code?
    ... Until the universal availability of scope terminators there were ... But 'reusability' is not a unique feature of OO design. ... remain and some are now garbage. ... A tree can be made faster by increasing its width; an array ...
    (comp.lang.cobol)
  • Re: Packages and returning errors
    ... > array intact. ... sub is_a_instance_method { ... my $class = shift; ... You need to fix the scope of $error by moving its declaration outside ...
    (comp.lang.perl.misc)
  • Re: Solar power questions....
    ... Set the array up facing the sun, but put a sheet of cardboard ... And good DMMs have two fuses -- one for low ... I could use an inexpensive scope. ...
    (rec.crafts.metalworking)
  • Re: Solar power questions....
    ... Set the array up facing the sun, but put a sheet of cardboard ... And good DMMs have two fuses -- one for low ... I could use an inexpensive scope. ... They are inside the power supply module, and are six 'C' size NiCads. ...
    (rec.crafts.metalworking)
  • Re: Postscript questions
    ... It looks as if you believe the curly braces are defining a scope. ... Curly braces are behaving much more like the square brackets, the array "delimiters". ... The difference is deferred execution, ... Evaluating an executable name means that the interpreter searchs the name through the dictionnary stack and when found, evaluate the value associated with the name. ...
    (comp.lang.postscript)