toad wrote:
4: 1990-1995 (MUMPS 1990).
The New command, parameter passing, and functions (extrinsic calls and argumented Quit) introduced outstanding new power for controlling the scope of variables. Since variables are the greatest common source of spaghetti logic in MUMPS, these improvements were much needed, much used, and began a dramatic change in the look and feel of MUMPS code that is still playing out, since some packages introduced these new features more quickly and thoroughly than others.
Likewise, argumentless Do did the same for the scope of execution by (1) breaking free of the line-oriented length limitations of For, If, and Else that used to cause us to add named subroutines for no better reason than to extend the amount of logic within their scope, and (2) creating anonymous subroutines whenever we wanted to, for example to create variable-scoping boundaries for the New command to work with. Stacking $Test within do-blocks was crucial to making the former work.
Getting control of these two kinds of scope - variables and execution - extended our ability to reduce unnecessary complications (like labels we didn't need) and to increase needed system complexity (like more sophisticated package interactions). This was the standard that made MUMPS able to handle the open-ended development needed for enterprise-level systems.
This fourth generation also included some nice syntactic sugar - argumentless For got rid of the need for throw-away loop variables, Set $Extract simplified our handling of fixed-length fields, merge simplified our ability to move whole trees of data about, $Query made traversing trees easier, and $Get helped get rid of some ugly $Select/$Data constructs for handling potentially undefined variables - even aside from the usual collection of minor extensions and corrections. Routines and symbol-table sizes were only raised another thousand characters, but that still felt like plenty considering all the ways this standard gave us to reduce the size of our code by using the new, more concise language constructs. Likewise, the maximum variable-name length was doubled again to one hundred twenty-seven characters, to give us more room to name our increasingly complex data structures.
I felt that the scoping within extrinsic functions (and DO) was the most 'growed up' improvement here. I could finally write that library without bothering with variable names.
Each library module looked like:
FUNCT(ARG1,ARG2,%,VAR1,VAR2,...) ; Entry for function FUNCT
I $D(%) DIE ; Only permitted 2 arguments the rest are for local use (note the DIE cmd)
And yes, the syntactic sugar was nice. We used to use F %W=0:0 where %W meant WHILE.
After I got the sources to DSM-11, I found the interpreter would in this case laboriously add zero to zero for each itteration.
I will re-read your post again (I don't know why I missed it when it first came up).
I have been using MUMPS for a bloody long time and really just saw it as incremental improvements from the initial introduction of the standard (did you know that version 1 of DSM didn't allow type ahead on the terminal and did not have string subscripts). Some improvements I introduced myself once I purloined the sources of DSM-11. We even ported DSM-11 to the Digital PC-350 (if you know what that was).
Ray