Statefulness = "Processness"...?
Thu Mar 13 15:33:27 CET 2003
On Wed, 12 Mar 2003 20:27:21 -0800
Jay Nelson <> wrote:
> Chris Pressey wrote:
> > I'd just use a stack for undo. A stack being a 'naturally
> > backwards' list.
> A stack of strings? Or a stack of character stacks?
Depends on whether you want to undo character-by-character or
entry-by-entry, I guess.
> > My idea of the implicit 'undo' in a functional language
> > results from the recursion itself, and doesn't require a list
> This is non-obvious to the style of programming I do.
If you would like an obvious example, compare simple maze-solving programs
(the kind you find in programming textbooks in the chapter on recursion)
written in C and Erlang.
> Typing in the data is not a recursive
> or inductive act, it is an unpredictable serialized sequence.
....which is almost exactly why I don't think a functional language offers
a significant advantange over an imperative one here - because this
problem is different enough from the simple undoing used in solving a maze
to require a list, no matter what language you use.
If Erlang has an advantage here, it's because it has pattern matching,
incremental GC, etc - not because it's single-assignment.
> > The thing is, you can't do it this way with a textbox,
> > essentially because the textbox is shared.
> Unless your definition of textbox is radically different than
> a standard one, it is by nature a single-state device. If two
> processes want to change it, there are either two instances,
> two closures with two views, or last changed view only. So
> I don't understand this statement.
See my previous message re liveness and locking.
More information about the erlang-questions