Mumpster
http://mumpster.org/

$TEXT Enhancements to Mumps V1...
http://mumpster.org/viewtopic.php?f=22&t=1683
Page 1 of 1

Author:  shabiel [ Mon Jan 30, 2012 6:06 pm ]
Post subject:  $TEXT Enhancements to Mumps V1...

I won't call them fixes because I think the standard does not specify these behaviors for $Text.

I fixed the following:
@tag+offset from within a routine now works correctly.
@tag[+offset]^@rtn now works correctly

Here's the code I used to test this:
Code:
%UT       ; SMH - Unit Test Suite for MV1
         ;;
AEQ      (C1,C2) ; Assert that C1 and C2 are equal
         I C1'=C2 S $EC=",U1,"
         Q
ANE      (C1) ; Assert that C1 is not empty
         I '$L(C1) S $EC=",U2,"
         Q
DTEXT      ; $Text
         W $T(+2^%UT),!         ; Routine Name
         W $T(+0),!             ; ditto
         W $T(^%UT),!           ; Routine Identity
         W $T(+1),!             ; First Line
         W $T(AEQ),!            ; Label Test
         W $T(AEQ^%UT),!        ; ditto
         W $T(AEQ+1),!          ; next line
         W $T(AEQ+1^%UT),!      ; ditto
         W $T(AEQ+2^%UT),!      ; next line
         W $T(AEQ+3^%UT),!      ; next line yet
         ;
         ; Indirection Tests - Part 1
         S X="+0^%UT" W $T(@X),!    ; Normal indirection
         S X="+0" W $T(@X),!    ; Ditto
         S X="^%UT" W $T(@X),!      ; More
         S X="+1" W $T(@X),!        ; More
         S X="AEQ" W $T(@X),!       ; More
         S X="AEQ+1" W $T(@X),!     ; More
         S X="AEQ+1^%UT" W $T(@X),! ; More
         S X="AEQ+2^%UT" W $T(@X),! ; More
         S X="AEQ+3^%UT" W $T(@X),! ; More
         ;
         ; Indirection Tests - Part 2 - most fail
         W $T(@""),!                    ; Not supposed to work!!
         S X="ANE" W $T(@X+1),!         ; Sam fixed this one
         S X="ANE" W $T(@X+2),!         ; Sam fixed this one
         S X="+0",Y="%UT" W $T(@X^@Y),! ; Works
         S X="AEQ",Y="%UT" W $T(@X^@Y),! ; Sam fixed this one
         S X="AEQ+1",Y="%UT" W $T(@X^@Y),! ; ditto
         W "---",!
         S X="AEQ" W $T(@X^%UT),!         ; Sam fixed this one
         S X="AEQ+1" W $T(@X^%UT),!       ; Sam fixed this one
         S Y="%UT" w $T(AEQ^@Y),!       ; Works
         S Y="%UT" w $T(AEQ+1^@Y),!     ; Works
         QUIT


Here's the output:
Code:
MCL> D DTEXT^%UT
 ;;
%UT
%UT ; SMH - Unit Test Suite for MV1
%UT ; SMH - Unit Test Suite for MV1
AEQ(C1,C2) ; Assert that C1 and C2 are equal
AEQ(C1,C2) ; Assert that C1 and C2 are equal
 I C1'=C2 S $EC=",U1,"
 I C1'=C2 S $EC=",U1,"
 Q
ANE(C1) ; Assert that C1 is not empty
%UT
%UT
%UT ; SMH - Unit Test Suite for MV1
%UT ; SMH - Unit Test Suite for MV1
AEQ(C1,C2) ; Assert that C1 and C2 are equal
 I C1'=C2 S $EC=",U1,"
 I C1'=C2 S $EC=",U1,"
 Q
ANE(C1) ; Assert that C1 is not empty
%UT
 I '$L(C1) S $EC=",U2,"
 Q
%UT
AEQ(C1,C2) ; Assert that C1 and C2 are equal
 I C1'=C2 S $EC=",U1,"
---
AEQ(C1,C2) ; Assert that C1 and C2 are equal
 I C1'=C2 S $EC=",U1,"
AEQ(C1,C2) ; Assert that C1 and C2 are equal
 I C1'=C2 S $EC=",U1,"


How do I contribute back the source code? I modified just routine.c.

Sam

Author:  tlwiechmann [ Mon Feb 06, 2012 8:57 am ]
Post subject:  Re: $TEXT Enhancements to Mumps V1...

These are not arbitrary constructs but, in fact, part of the 95 standard. If your have the ANSI/MDC X11.1-1995 manual, follow the entryref option for the $TEXT function (pages 40 and 47).

You will find them used extensively in File Manager as well as EsiObjects.

Author:  raynewman [ Wed Feb 08, 2012 8:24 pm ]
Post subject:  Re: $TEXT Enhancements to Mumps V1...

Version 1.54 of MV1 incorporating Sam's fixes has been uploaded to source forge.
see https://sourceforge.net/projects/mumps/files/
Files loaded are:
mumps-1.54-FreeBSD.9.0-RELEASE.tar.gz
mumps-1.54-linux.2.6.32-33.Ubuntu.tar.gz
mumps-1.54-osx-10.7.3.tar.gz
mumps-1.54-src.tar.gz

Ray

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