Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

X11.1-1995 TSTART ambiguity

88 views
Skip to first unread message

chocolat...@gmail.com

unread,
Sep 5, 2022, 2:02:14 PM9/5/22
to
The 1995 standard around TSTART says restartarguments can be one of the following:

lname
(L lname)
*
()

This implies you can have:
1) a single local name
2) a list of local names in parens
3) an asterisk, meaning to save off all local variables
4) an empty set of parens, to save no local variables

As I see it, this implies one of:

1: the first option should have been "L lname", for inclusive operation, and the omission of the preceding "L" is an error

2: inclusive operation is limited to a single variable, but you can have a list for exclusive operation

3: there is no exclusive form of restartarguments, and parens are just there to encapsulate a list of inclusive variables

Another part of the standard has this text, explaining the operation of a restart:

The frame at the top of the PROCESS-STACK is examined. If the frame's linked list of CONTEXT-STRUCTUREs contains entries, they are processed in last-in-first-out order from their creation. If the CONTEXT-STRUCTURE is exclusive, all entries in the currently active local variable NAME-TABLE are pointed to empty DATA-CELLs. In all cases, the CONTEXT-STRUCTURE NAME-TABLEs are copied to the currently active NAME-TABLEs.

This implies that scenario 1 is the case.

However, the 1995 Standard MUMPS Pocket Guide from VistA Expertise Network, in its section on TSTART, seems to reinforce either scenario 2 or scenario 3, but makes no mention of any exclusive form.

GT.M and YottaDB seem to support both "L lname" and "(L lname)", but both appear to behave identically to each other.

Also, I find it amusing that the standard discusses a "linked list of CONTEXT-STRUCTURES", but also says it doesn't imply an implementation method, when linked lists are incontrovertibly an implementation method.

Can any former MDC-ers shed some light?

ed de moel

unread,
Sep 5, 2022, 3:38:20 PM9/5/22
to
On Monday, September 5, 2022 at 2:02:14 PM UTC-4, chocolat...@gmail.com wrote:
> The 1995 standard around TSTART says restartarguments can be one of the following:
>
> lname
> (L lname)
> *
> ()
>
> This implies you can have:
> 1) a single local name
> 2) a list of local names in parens
> 3) an asterisk, meaning to save off all local variables
> 4) an empty set of parens, to save no local variables
>

As with all other commands in the language, the comma separates command-arguments.
Thus, if the first would have been allowed to be a list (also separated by commas), that would work quite differently:
TSTART A,B,C
would be equivalent to
TSTART A TSTART B TSTART C

Hope this helps
Ed

ed de moel

unread,
Sep 5, 2022, 5:57:41 PM9/5/22
to
I didn't quite say that right...
The general format of commands would imply that TSTART A,B,C is equivalent to three TSTART commands, and thus would require three TCOMMITs to complete the "nested" transactions.

ed de moel

unread,
Sep 7, 2022, 7:43:29 PM9/7/22
to
Come to think of it, there are differences between
TSTART A,B,C
and
TSTART (A,B,C)

Consider the sequence of commands:
TSTART A,B,C
--- some code that modifies local variables A, B and C
TRESTART

Remember that TSTART A,B,C is the same as TSTART A TSTART B TSTART C:
The TRESTART command will restart the part of the transaction that was initiated with TSTART C,
which means that local variables A and B will not be reset, but local variable C will...

Hope this clarifies,
Ed


0 new messages