[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guarded commands [Re: Scriptometer...]





> Has anyone run across a system which
> used guarded commands, but with atomic
> transactions instead of the guards?

Two systems which come closer:

1. Prograph - a visual dataflow language;
it defines functions as several cases of
dataflow graphs, executing the one which
succeeds.  It seems that the debugger can
back up the computation and recalculate
if one rewrites the code, presumably by
using the same mechanism as case failure.

I'm not sure how all of this interacts
with side effects, nor whether success
and failure propagate beyond the cases
of an individual function.

<http://www.pictorius.com/prograph.html>

2. Sed - as in "sed is turing complete";
at the pattern substitution level, we can
express IF...FI as:

    tc;:c
    s/.../.../;tf
    s/.../.../;tf
    s/.../.../;tf
    :f

and DO...OD as:

    :b
    s/.../.../
    s/.../.../
    s/.../.../
    tb

in both of these cases the individual
substitions will be either completely
applied, or not at all, no matter how
complex.

On the other hand, atomic sequencing
of substitutions (A;B) is not easily
expressed.

I'm guessing the lack of subroutines in
sed-like tools (card processors?) led to
expression success and failure in META,
Snobol, and eventually, Icon.

-Dave