Guidance on mixing Object Script with legacy MUMPS in the same .INT and/ or .MAC
Looking for official guidance concerning the pitfalls of mixing Object Script with legacy MUMPS in the same .INT and/ or .MAC. Thanks, R
Comments
It starts with the basic definition:
What is LEGACY for you? any MUMPS dialect (DTM. DSM, ISM, ...) ?
From the language elements, there is all included and possible. what was available in MUMPS.
Except that System variables may have some differences that need to be checked.
In general, you have enhancements at all levels: Commands, Functions, Variables
One of the significant differences is variable scoping.
In legacy MUMPS you had your partition and all variables were visible everywhere.
In COS this visibility is managed at various levels and you have to take control over the variable scope.
see this articles:
Variable scope in .mac routine?
Summary on Local Variable Scoping
Of course, interaction with external devices and peripheral is different.
But this doesn't affect programming style.
I assume you have some special techniques in mind.
For questionable cases, this forum is the place to get help at almost any level.
And often it's more than a single unique solution but a choice of variants the members offer.
I personally have seen code written on DSM-11 in 1978, copied to Caché and running without change.
This was core logic. Communication with peripherals needed adaption. No surprise.
To clarify: I once read that "dotted syntax" and curly braces should not be used in the same routine; doing so, would produce unpredictable results. I can't remember where I found the guidance. I was hoping to read more about it.
Hi, RF! We have coding guidelines on ObjectScript. It's not about mixing, but how to code better with InterSystems Objectscript. HTH
the dotted syntax works in the same routine as curly braces.
There was a different question recently with such code.
The confusion comes up when you use curly braces INSIDE a dotted section.
as the nesting is calculated by the dots at the start of the line this causes confusion.
So cascading and intermixing is a NoNo.
on the other hand
. line1
. line2
. line3
is an equivalent to
line1
line2
line3
}
-
As dots are always in sequence a move to { } shouldn't be that hard.
Though I admit: It's additional effort