$ZBOOLEAN function

2004-10-12
2012-12-29
  • Alain Descamps

    Alain Descamps - 2004-10-12

    Is there *Any hope, that there will be a similar function in GT.M ?

    Regards,

    Alain

     
    • K.S. Bhaskar

      K.S. Bhaskar - 2004-10-12

      GT.M has $ZBIT*() functions.  What does $ZBOOLEAN do?

      -- Bhaskar

       
      • Alain Descamps

        Alain Descamps - 2004-10-12

        I could suggest to look into the Cache documentation, but essentially it is similar to $ZBIT*, except, that it works on numbers, while the $ZBIT* function work on bit strings.

         
        • K.S. Bhaskar

          K.S. Bhaskar - 2004-10-12

          Alain --

          We on the GT.M team stay away from competing products and their documentation to make sure that we are clean with respect to intellectual property issues.  We can certainly read specifications for desired new GT.M functionality that are posted in an unrestricted public forum such as a Source Forge forum or comp.lang.mumps.

          By the sound of it, a $ZBOOLEAN sounds from your posting like a straightforward implementation.  Especially since this is open source software, ultimately it gets down to making the business case.

          Regards
          -- Bhaskar

           
          • Alain Descamps

            Alain Descamps - 2004-10-13

            Dear Bhaskar,

            I'll explain my proposition by a simple example :

            s x=1+2+4+8 ;(which is 1111 binary)
            s y=1+4+16 ;(10101)

            w $zboolean(x,y,"AND")
            5   ; this is 101 bin.

            w $zboolean(x,y,"OR")
            31 ;this should be 11111

            I would implement the classical operators "AND" "OR" "XOR" and "NOT", the last one with one parameter less, of course.

            I tried to solve this by converting the numbers to bit maps, and using the $zbit* functions, but this is *really slow and ugly.

            Any comment ? Dear World, speak to me.

            Alain

             
            • K.S. Bhaskar

              K.S. Bhaskar - 2004-10-13

              GT.M integrates C and M very well.  Until such time as $ZBOOLEAN is implemented in GT.M (which depends on being able to make the business case for it), you can do this easily by calling out to a small C routine.

              -- Bhaskar

               

Log in to post a comment.