Mumpster
http://mumpster.org/

2. X11/1993-39, $REFERENCE
http://mumpster.org/viewtopic.php?f=20&t=1763
Page 2 of 2

Author:  gwoodhouse [ Sat Feb 01, 2014 5:05 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

I do not see any language here for the $REFERENCE extension, just an icon suggesting there is an attachment. Where can I find the proposed language?

Author:  toad [ Sat Feb 01, 2014 5:11 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

Greg, go to the bottom of the original post, hover over the name of the file, click on it, and it should download. Depending on your browser, you might have to control-click.

Author:  gwoodhouse [ Sat Feb 01, 2014 9:16 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

I don't see a problem with this language, but I'm not thrilled with the idea of setting $REFERENCE, it seems like a more cryptic version of subscript indirection, and I'm not sure what problem it solves. Caché has an interesting compromise solution. As far as reading goes , $ZEEFERENCE works just like $REFERENCE, but you can only set $ZREFERENCE to. "", and that has the effect of clearing the naked indicator (which can be useful). Otherwise, I don't see a reason to set $REFERENCE, unless you like to use lots of naked references in your code.

Author:  toad [ Sat Feb 01, 2014 10:11 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

X11/1993-39 $REFERENCE is half of a pair of MDC Type A Extensions aimed at getting the naked indicator under better control in light of the module programming extensions added as part of MUMPS 1990. If the naked indicator is changing within subroutines, then that is a side effect that they are leaving behind, violating encapsulation. The solution is twofold. First, this extension lets your subroutine save off $REFERENCE at the start by setting some other variable equal to it, and then restore it at the end by setting $REFERENCE to that saved-off value. Second, X11/1998-30 NEW $REFERENCE gives you a simpler way to so just that, by newing it at the start of your subroutine; that will leave the setting of $REFERENCE just for special cases, probably involving infrastructure packages.

I'll post the NEW $REFERENCE extension soon, to help complete the picture they paint together.

Does that make sense?

Author:  gwoodhouse [ Sun Feb 02, 2014 12:42 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

If that is the goal, NEW $REFERENCE would seem safer and clearer if it is supported. Will the new language support this paradigm? I'm all in favor of avoiding side effects.

Author:  toad [ Sun Feb 02, 2014 12:50 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

Greg, yes X11/1998-30 NEW $REFERENCE was accepted by the MDC as a Type A Extension to the language on 1 May 1998, and it is listed in the MUMPS 2015 map for inclusion in the next standard. I'll post it soon.

Author:  toad [ Sat Mar 29, 2014 3:54 pm ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

For certain values of "soon."

Author:  raynewman [ Sun Apr 06, 2014 4:36 am ]
Post subject:  Re: 2. X11/1993-39, $REFERENCE

toad wrote:
Greg, yes X11/1998-30 NEW $REFERENCE was accepted by the MDC as a Type A Extension to the language on 1 May 1998, and it is listed in the MUMPS 2015 map for inclusion in the next standard. I'll post it soon.


Toad et al, NEW $REFERENCE and SET $REFERENCE="" are reasonable all other SET $REFERENCE=krap are neither reasonable nor useful.

I STRONGLY suggest that the proposed standard reads that $REFERENCE may be NEWed and may be SET to the null string and that's it.

Ray Newman
(with 35 years MUMPS programming experience)

Page 2 of 2 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/