Cloverleaf 19.1 namespaces

Clovertech Forums Cloverleaf Cloverleaf 19.1 namespaces

  • Creator
    Topic
  • #119135
    Paul Bishop
    Participant

      We just upgraded to 19.1.2.1 from 6.1 and ran across this “feature” and am wondering what others did to get around it.

      I have two different tps procs, one named proc_1 and another named proc_2 (not their real names ;-)).   Both procs have a namespace called “workSubs” (namespace eval workSubs), the namespaces in each have a proc called “parseHL7” (proc parseHL7 {msg}).  When you save a tcl proc in version 6.1 there are no warnings and the parseHL7 procs are not in the tclIndex file.  When you save a tcl proc in version 19.1, you receive a warning about a duplicate process name “::workSubs::parseHL7”.  Each one does a completely different function (pulls different fields).

      So is the best option here to rename either the namespace or the procs within each tps script?

      Thanks!

      Paul Bishop
      Carle Foundation Hospital
      Urbana, IL

    Viewing 2 reply threads
    • Author
      Replies
      • #119136
        Jeff Dinsmore
        Participant

          I would expect them to cause problems in 6.1 too.

          Do the two namespaces exist in different sites in 6.1 and in a master or other common site in 19.1?

          Ultimately, they’ll have to be unique.

          I usually use unique namespaces.  That way, even if you have procs with the same local name, they won’t conflict.

          Something like:

          ::proc1WorkSubs::parseHL7

          ::proc2WorkSubs::parseHL7

           

           

           

          Jeff Dinsmore
          Chesapeake Regional Healthcare

        • #119137
          Paul Bishop
          Participant

            in our 6.1 (production) environment, the procs are in the same site.  When I looked at the tclIndex file, the namespace procs weren’t listed which is why it wasn’t an issue there.  In the 19.1 (test) environment, the namespace procs are listed in the tclIndex.

            Paul Bishop
            Carle Foundation Hospital
            Urbana, IL

          • #119138
            Charlie Bursell
            Participant

              Make a package with different proc names.   Tcl will look for packages one level deeper than the search path so I usually create a directory under site/tclprocs called library or similar or in root/tclprocs/library if I want to use across sites.  I usually provide a suffix like .pkg, i.e., mypack.pkg to discern from regular Tcl procs.  These will not show up in your tclIndex but will create a pkgIndex in the library site.  Once created call it like any namespace.

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.