[latex3-commits] [l3svn] r6794 - Deprecate \sort_ordered/reversed: for \sort_return_unchanged/reversed:

noreply at latex-project.org noreply at latex-project.org
Thu Dec 15 06:40:58 CET 2016


Author: bruno
Date: 2016-12-15 06:40:58 +0100 (Thu, 15 Dec 2016)
New Revision: 6794

Modified:
   trunk/l3experimental/l3sort/l3sort.dtx
   trunk/l3experimental/l3sort/testfiles/m3sort001.lvt
Log:
Deprecate \sort_ordered/reversed: for \sort_return_unchanged/reversed:

\sort_ordered: => \sort_return_unchanged:
\sort_reversed: => \sort_return_reversed:


Modified: trunk/l3experimental/l3sort/l3sort.dtx
===================================================================
--- trunk/l3experimental/l3sort/l3sort.dtx	2016-12-15 05:28:36 UTC (rev 6793)
+++ trunk/l3experimental/l3sort/l3sort.dtx	2016-12-15 05:40:58 UTC (rev 6794)
@@ -94,24 +94,24 @@
 %   \clist_sort:Nn \l_foo_clist
 %     {
 %       \int_compare:nNnTF { #1 } > { #2 }
-%         { \sort_reversed: }
-%         { \sort_ordered: }
+%         { \sort_return_reversed: }
+%         { \sort_return_unchanged: }
 %     }
 % \end{verbatim}
 % will result in \cs{l_foo_clist} holding the values
 % |{ -2 , 01 , +1 , 3 , 5 }| sorted in non-decreasing order.
 %
 % The code defining the comparison should perform
-% \cs{sort_reversed:} if the two items given as |#1|
+% \cs{sort_return_reversed:} if the two items given as |#1|
 % and |#2| are not in the correct order, and otherwise it
-% should call \cs{sort_ordered:} to indicate that
+% should call \cs{sort_return_unchanged:} to indicate that
 % the order of this pair of items should not be changed.
 %
 % For instance, a \meta{comparison code} consisting only
-% of \cs{sort_ordered:} with no test will yield a trivial
+% of \cs{sort_return_unchanged:} with no test will yield a trivial
 % sort: the final order is identical to the original order.
 % Conversely, using a \meta{comparison code} consisting only
-% of \cs{sort_reversed:} will reverse the list (in a fairly
+% of \cs{sort_return_reversed:} will reverse the list (in a fairly
 % inefficient way).
 %
 % \begin{texnote}
@@ -643,7 +643,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[aux]{\sort_ordered:}
+% \begin{macro}[aux]{\sort_return_unchanged:}
 %   If the comparison function returns \texttt{ordered},
 %   then the second argument fed to \cs{@@_compare:nn}
 %   should remain to the right of the other one. Since
@@ -655,7 +655,7 @@
 %   is already in the correct registers and we are done
 %   with merging those two blocks.
 %    \begin{macrocode}
-\cs_new_protected:Npn \sort_ordered:
+\cs_new_protected:Npn \sort_return_unchanged:
   {
     \tex_toks:D \l_@@_B_int \tex_toks:D \l_@@_C_int
     \tex_advance:D \l_@@_B_int - \c_one
@@ -668,7 +668,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[aux]{\sort_reversed:}
+% \begin{macro}[aux]{\sort_return_reversed:}
 %   If the comparison function returns \texttt{reversed},
 %   then the next item to add to the merger is the first
 %   argument, contents of the \tn{toks} register $A$.
@@ -679,7 +679,7 @@
 %   the second block, indexed by $C$, are copied
 %   to the merger by \cs{@@_merge_blocks_end:}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \sort_reversed:
+\cs_new_protected:Npn \sort_return_reversed:
   {
     \tex_toks:D \l_@@_B_int \tex_toks:D \l_@@_A_int
     \tex_advance:D \l_@@_B_int - \c_one
@@ -1055,7 +1055,17 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{Deprecated}
+%
+% \begin{macro}[deprecated=2017-12-31]{\sort_ordered:, \sort_reversed:}
+%   For removal after 2017-12-31.
 %    \begin{macrocode}
+\cs_new_eq:NN \sort_ordered: \sort_return_unchanged:
+\cs_new_eq:NN \sort_reversed: \sort_return_reversed:
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 %</initex|package>
 %    \end{macrocode}
 %

Modified: trunk/l3experimental/l3sort/testfiles/m3sort001.lvt
===================================================================
--- trunk/l3experimental/l3sort/testfiles/m3sort001.lvt	2016-12-15 05:28:36 UTC (rev 6793)
+++ trunk/l3experimental/l3sort/testfiles/m3sort001.lvt	2016-12-15 05:40:58 UTC (rev 6794)
@@ -23,14 +23,14 @@
   \tl_set:Nn \l_tmpa_tl { 8234610203748 }
   {
     \tl_sort:Nn \l_tmpa_tl
-      { \int_compare:nTF { #1 > #2 } \sort_reversed: \sort_ordered: }
+      { \int_compare:nTF { #1 > #2 } \sort_return_reversed: \sort_return_unchanged: }
     \TYPE { \l_tmpa_tl }
   }
   \TYPE { \l_tmpa_tl }
   \tl_gset:Nx \g_tmpa_tl { \prg_replicate:nn { 10 } { 8234610203748 } }
   {
     \tl_gsort:Nn \g_tmpa_tl
-      { \int_compare:nTF { #1 > #2 } \sort_reversed: \sort_ordered: }
+      { \int_compare:nTF { #1 > #2 } \sort_return_reversed: \sort_return_unchanged: }
   }
   \TYPE { \g_tmpa_tl }
 }
@@ -46,7 +46,7 @@
   \clist_set:Nn \l_tmpa_clist { 8,23,4,61,02,--3,03,7,3,48, }
   {
     \clist_sort:Nn \l_tmpa_clist
-      { \int_compare:nTF { #1 > #2 } \sort_reversed: \sort_ordered: }
+      { \int_compare:nTF { #1 > #2 } \sort_return_reversed: \sort_return_unchanged: }
     \TYPE { \l_tmpa_clist }
   }
   \TYPE { \l_tmpa_clist }
@@ -54,7 +54,7 @@
     { \prg_replicate:nn { 10 } { 8,23,4,61,02,--3,03,7,3,48, } }
   {
     \clist_gsort:Nn \g_tmpa_clist
-      { \int_compare:nTF { #1 > #2 } \sort_reversed: \sort_ordered: }
+      { \int_compare:nTF { #1 > #2 } \sort_return_reversed: \sort_return_unchanged: }
   }
   \TYPE { \g_tmpa_clist }
 }
@@ -74,7 +74,7 @@
   \seq_gset_split:Nnn \g_tmpa_seq { , } { 8,23,4,61,02,--3,03,7,3,48 }
   {
     \seq_gsort:Nn \g_tmpa_seq
-      { \int_compare:nTF { #1 > #2 } \sort_reversed: \sort_ordered: }
+      { \int_compare:nTF { #1 > #2 } \sort_return_reversed: \sort_return_unchanged: }
   }
   \TYPE { \tl_to_str:N \g_tmpa_seq }
 }
@@ -104,21 +104,21 @@
 
 \TEST { sort~too~long }
   {
-    \tl_sort:Nn \l_tmpa_tl { \sort_ordered: }
+    \tl_sort:Nn \l_tmpa_tl { \sort_return_unchanged: }
     \int_compare:nF
       { \tl_count:N \l_tmpa_tl = \l_test_expected_count_int }
       { \ERROR }
     \OMIT
     \use:c { newtoks } \l_test_toks
     \TIMO
-    \clist_sort:Nn \l_tmpa_clist { \sort_ordered: }
+    \clist_sort:Nn \l_tmpa_clist { \sort_return_unchanged: }
     \int_compare:nF
       { \clist_count:N \l_tmpa_clist = \l_test_expected_count_int - 1 }
       { \ERROR }
     \OMIT
     \use:c { newtoks } \l_test_toks
     \TIMO
-    \seq_sort:Nn \l_tmpa_seq { \sort_ordered: }
+    \seq_sort:Nn \l_tmpa_seq { \sort_return_unchanged: }
     \int_compare:nF
       { \seq_count:N \l_tmpa_seq = \l_test_expected_count_int - 2 }
       { \ERROR }



More information about the latex3-commits mailing list