No, not perse, since InterSystems calls this process 'Compiling'. I just wanted to point out that the first two steps are not a compilation such as C++ or Rust.
A good thing to know is, that there isn't actually a thing as 'during compile time' in ObjectScript.
Compiling a class is a three step process:
- transform the class definition (including any superclasses) to a (set of) .MAC files
- the Macro 'compiler' resolves the $$$macros and #xxx statements and create a (set of) .INT routines
- which in turn are pre-compiled into byte code .OBJ routines
#dim x,y,x as Data.Product = ##class(Data.Product).%New()
in a .MAC routine becomes:
Set x=##class(Data.Product).%New(),y=##class(Data.Product).%New(),x=##class(Data.Product).%New()
in a .INT routine





Can't you set ^myClassD once? Set ^myClassD=$Order(^myClassD(""),-1)
And from then use $Increment(^myClassD). The advantage of using this is that the operation is atomic, even in a mirror.