Re: Yet Another Spinoza Challenge
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 09 Sep 2009 15:59:14 -0700
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
In <lnr5ufvjrn.fsf@xxxxxxxxxxxxxxx>, Keith Thompson wrote:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:<snip>
Stack-like semantics? Sure. But you don't *have* to use a stack.
It's obviously a very, very sensible choice, but it is not the only
choice. Any searchable dynamic data structure will do. I suspect
the reason some people are defending stacks so valiantly is simply
that that's the only way they've ever seen it done.
In what sense are you using the word "stack" in the above paragraph?
The usual sense - a chain of data structures, each (other than the
last, obviously) linked to the next in the chain, either via a
pointer or by virtue of being adjacent in memory, where new items can
be added only at the top and where only the top item can be removed.
If you allow chaining via a pointer or by being adjacent in memory,
two very different mechanisms, it seems inconsistent not to allow
chaining by other means, such as by information stored in some
outside data structure. (I'm using the word "allow" in the sense
that anything not meeting the definition isn't a stack, not that
it's forbidden).
Wikipedia's definition:
<http://en.wikipedia.org/wiki/Stack_(data_structure)>
seems reasonable to me:
In computer science, a stack is a last in, first out(LIFO)
abstract data type and data structure. A stack can have any
abstract data type as an element, but is characterized by only two
fundamental operations, the push and the pop. The push operation
adds to the top of the list, hiding any items already on the
stack, or initializing the stack if it is empty. The pop operation
removes an item from the top of the list, and returns this value
to the caller. A pop either reveals previously concealed items, or
results in an empty list.
A stack is a restricted data structure, because only a small
number of operations are performed on it. The nature of the pop
and push operations also means that stack elements have a natural
order. Elements are removed from the stack in the reverse order to
the order of their addition: therefore, the lower elements are
typically those that have been in the list the longest.
<snip>
I assert that anything with "stack-like semantics" *is* a stack in
the general LIFO sense of the word.
Then we have a terminology clash, so I think we're done here.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: Yet Another Spinoza Challenge
- From: spinoza1111
- Re: Yet Another Spinoza Challenge
- References:
- Yet Another Spinoza Challenge
- From: spinoza1111
- Re: Yet Another Spinoza Challenge
- From: spinoza1111
- Re: Yet Another Spinoza Challenge
- From: Herbert Rosenau
- Re: Yet Another Spinoza Challenge
- From: spinoza1111
- Re: Yet Another Spinoza Challenge
- From: Richard Heathfield
- Re: Yet Another Spinoza Challenge
- From: spinoza1111
- Re: Yet Another Spinoza Challenge
- From: Richard Heathfield
- Re: Yet Another Spinoza Challenge
- From: Keith Thompson
- Re: Yet Another Spinoza Challenge
- From: Richard Heathfield
- Re: Yet Another Spinoza Challenge
- From: Keith Thompson
- Re: Yet Another Spinoza Challenge
- From: Richard Heathfield
- Yet Another Spinoza Challenge
- Prev by Date: Re: Schildt
- Next by Date: Re: A couple of things from H&S
- Previous by thread: Re: Yet Another Spinoza Challenge
- Next by thread: Re: Yet Another Spinoza Challenge
- Index(es):
Relevant Pages
|