Re: [stack] Advantages of cat, joy ..?

Don Groves <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Feb 18, 2009, at 3:50 PM, William Tanksley wrote:

> ...
>
> The stack might possibly be the simplest concatenative datatype. It's
> easy to add more complexity: A second stack, or a dictionary, or a
> readable/writable terminal, or a queue to handle continuations, etc.
> I've seen nothing that provides similar power to a stack, although I'd
> like to.

I really wish we could come up with a different name for the "stack"
in these languages. The canonical stack only has two methods,
push and pop, and they only operate on the top item in the stack.
All other items are invisible. This data structure has several uses as
it stands and shouldn't be corrupted, in my view.

Maybe we could call ours a "reorderable stack" (rstack) or a
"shufflestack" (s-stack) or something that differentiates it from what
is taught in Comp Sci 101.

Granted, the additional stack operators we define can be defined
in terms of push and pop, but that isn't the way we usually implement
them and would be inefficient if we did (on register machines anyway).

Maybe I'm too picky but I've seen too many other previously-defined
names reused in ways that only cause confusion (mostly mine).
--
don


> -Wm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.