Changes between Version 1 and Version 2 of League


Ignore:
Timestamp:
Mar 23, 2010, 5:26:10 PM (12 years ago)
Author:
vadim.godunko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • League

    v1 v2  
    5959}}}
    6060
    61 === Equivalence and comparison ===
     61=== Equivalence and compare ===
    6262
    63 There are several kinds of important equivalence for strings, and it is a reason why there is no "=" operator for Universal_String. Instead you can use Is_Binary_Equal function for binary equivalence detection. For the same reason there are no other predefined comparison operators for Universal_String. The function Binary_Compare can be used to compare two string in binary order.
     63There are several kinds of important equivalence for strings. "Default" equivalence and compare are based on binary order of code points.
    6464
    6565=== Collation ===
     
    7979
    8080begin
    81    case Binary_Compare (S1, S2) is
    82       when Less =>
    83          Put_Line ("Binary comparison: less");
     81   if S1 < S2 then
     82      Put_Line ("Binary comparison: less");
    8483
    85       when Equal =>
    86          Put_Line ("Binary comparison: equal");
     84   elsif S1 = S2 then
     85      Put_Line ("Binary comparison: equal");
    8786
    88       when Greater =>
    89          Put_Line ("Binary comparison: greater");
     87   else
     88      Put_Line ("Binary comparison: greater");
    9089   end case;
    9190