"Duke Normandin" <dukeofperl@[EMAIL PROTECTED]
> wrote in message
news:0OzNj.681$n63.637@[EMAIL PROTECTED]
>
> Then how does one differentiate between a local and global variables;
> and local and global variable arrays? I see that global arrays have the
> ^ prefix. Do global (scalar) variables have the ^ prefix as well. If
> yes, how can I tell what I'm dealing with -- a global variable or a
> global array?
> --
> Duke Normandin
Here is a definition from The Annotated M[UMPS] Standard
(http://71.174.62.16/Demo/AnnoStd)
4.2 array: M arrays, unlike those of most other computer languages, are
trees of unlimited depth and breadth. Every node may optionally contain a
value and may also have zero or more descendant nodes. The name of a
subscripted variable refers to the root, and the nth subscript refers to a
node on the nth level. Arrays vary in size as their nodes are set and
killed. See scalar, subscript.
Since there are no variable declarations, one could simply say that an
array
is a variable with subscripts. Note that the definition says that arrays
are
trees. So, which are they -- arrays or trees? Well, they are actually
trees
which are referenced as if they were arrays, but since they are trees,
they
behave differently than arrays.
You can tell if a variable is subscripted by using the $DEFINE
(abbreviated
$D) function. For example, if $D(X) returns 1, then variable X has a
defined
value but no pointer to a descendant.node -- ie, it is currently a scalar.
You asked about MUMPS versions. If you want to climb inside and play with
the source code, MUMPS V1 is fine, and it is pretty close to standard
Mumps.
GT.M is much closer to a full standard Mumps and is an industrial strength
commercial product and is sup****ted. It just happens to be open source on
certain platforms. Kevin OKane's Mumps is far from standard but has many
interesting features not found in generic Mumps. Cache
(www.intersystems.com) is a commercial product which is not open source
but
does have free downloads for Windows and Linux, but the free versions are
limited to single user and no networking. Like GT.M, it is a serious
product that is nearly a full standard Mumps, and it includes many
enhancements such as built in OO features, an integrated SQL interface,
and
extended syntax for scoping code and local variables (ie curly braces.)
Have fun.


|