• X11.1-1995 TSTART ambiguity

    From chocolatejollis38@gmail.com@21:1/5 to All on Mon Sep 5 11:02:12 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ed de moel@21:1/5 to chocolat...@gmail.com on Mon Sep 5 12:38:19 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ed de moel@21:1/5 to All on Mon Sep 5 14:57:40 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ed de moel@21:1/5 to All on Wed Sep 7 16:43:27 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)