Tcl "lcompare" command…

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Tcl "lcompare" command…

  • Creator
    Topic
  • #50752
    Tom Rioux
    Participant

      Has anyone used this command?   I don’t see a man page for it anywhere.  I have it some code I am testing but I am getting mixed results.   It is returning either a -1, 0, or 1 and I’m sometimes I’m seeing a 1 or 0 when I expect a -1.

      Any information would be helpful.

      Thanks….

    Viewing 0 reply threads
    • Author
      Replies
      • #67379
        Charlie Bursell
        Participant

          It comes from an old extended Tcl library.  From a hcitcl/tcl prompt

               

             tcl> help hci/lists/lcompare

             lcompare list1 list2

                 This   command compares two lists   and returns thier relation

                 (like strcmp 0).   Corresponding elements of each list

                 are compared.  The result is the value of the first difference

                 encountered or equality.  A list that is a prefix of the other

                 list   is   considered   to  be  less  than  the  other  list.

                 By default, items are compared lexicographically. The -numeric

                 flag (or some unique fraction thereof),  however,  causes  the

                 items  to  be  compared  as  double-precision   floating-point

                 numbers.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.