Greg --

That is indeed how GT.M works.  There is an environment variable 
$ZROutines (which is initialized at process startup from the environment 
variable $gtmroutines), which defines a search path when a routine ^XYZ 
needs to be linked.

Consider a search path such as: "/home/bhaskar/myVistA 
/usr/local/FOIAVistA20060615/o(/usr/local/FOIAVistA20060615/r) 
/usr/local/gtm_V5.1-000".  When attempting to link ^XYZ, GT.M does the 
following:

1. Look for a file /home/bbhaskar/myVistA/XYZ.o.

   1a. If /home/bbhaskar/myVistA/XYZ.o exists, look for a file 
/home/bhaskar/myVistA/XYZ.m.

     1a(i) If /home/bhaskar/myVistA/XYZ.m exists and it is newer than 
/home/bhaskar/myVistA/XYZ.o, compile /home/bhaskar/myVistA/XYZ.m to 
generate a new /home/bhaskar/myVistA/XYZ.o and link the (new or old) 
file /home/bhaskar/myVistA/XYZ.o.  An error is generated if 
recompilation is necessary, and GT.M does not have appropriate 
permissions to create a new /home/bhaskar/myVistA/XYZ.o.

     1a(ii) If /home/bhaskar/myVistA/XYZ.m does not exist 
/home/bhaskar/myVistA/XYZ.o is linked.

   1b If /home/bbhaskar/myVistA/XYZ.o does not exist, look for a file 
/home/bhaskar/myVistA/XYZ.m.

     1b(i) If /home/bhaskar/myVistA/XYZ.m exists, compile 
/home/bhaskar/myVistA/XYZ.m to generate /home/bhaskar/myVistA/XYZ.o and 
link the new file /home/bhaskar/myVistA/XYZ.o.  An error is generated if 
GT.M does not have appropriate permissions to create 
/home/bhaskar/myVistA/XYZ.o.

     1b(ii) If /home/bhaskar/myVistA/XYZ.m does not exist, go to Step 2 
and seek XYZ.o in the next "chunk" of $ZROutines - 
"/usr/local/FOIAVistA20060615/o(/usr/local/FOIAVistA20060615/r)".

2. The logic here is the same as for Step 1, except that the object file 
sought is /usr/local/FOIAVistA20060615/o/XYZ.o and the source file 
sought is /usr/local/FOIAVistA20060615/r/XYZ.m.  If it is not found 
here, it is sought in the next chunk, /usr/local/gtm_V5.1-000.

3. The logic here is the same as for Step 1.  If it is not found in the 
last chunk of $ZROutines, an error is generated.

Note that $ZROutines can be set within the mumps process.  So, a complex 
name space scheme could treat each name space as a search path rather 
than just a directory in the current search path, trapping the error if 
there is a link failure to change search paths for a new name space.

A slightly more complex chunk than 
"/usr/local/FOIAVistA20060615/o(/usr/local/FOIAVistA20060615/r)" might 
be a chunk such as 
"/usr/local/FOIAVistA20060615/o(/usr/local/FOIAVistA20060615/p 
/usr/local/FOIAVistA20060615/r)" which means to match a file 
/usr/local/FOIAVistA20060615/o/XYZ.o by seeking for XYZ.m first in 
/usr/local/FOIAVistA20060615/p and then in /usr/local/FOIAVistA20060615/r.

Hope this helps to explain things.

Regards
-- Bhaskar

Greg Woodhouse wrote, on 08/29/2006 12:02 PM:
> Caché, of course, has namespaces, but GT.M seems to provide analogous
> functionality though the use of "private" global and routine
> directories. Not being a GT.M expert by any stretch, I wonder if it is
> feasible to treat a routien directory as a namespace that can be
> imported or used dynamically (i.e., code could be written so that if
> you zlink "XYZ" it will first look in directory abc then, say, the
> system directory and finally the user's home directory).
> 
> I ask because the mehtod of assigning namespaces that are implemented
> as the first 2-4 charachters as routine and variable names is, well,
> archaic. If better namespaces were available in both Caché and GT.M it
> might be reasonable to consider implementing them -- at least for
> future work.
> 
> ===
> Gregory Woodhouse  <[EMAIL PROTECTED]>
> 
> "Judge a man by his questions not his answers."
> --Voltaire
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
> _______________________________________________
> Hardhats-members mailing list
> Hardhats-members@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hardhats-members
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to