%%
%% This is file `l3seq.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3seq.dtx  (with options: `package')
%% 
%% EXPERIMENTAL CODE
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute a modified version of this file.
%% 
%% File: l3seq.dtx Copyright (C) 1990-2012 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%%    http://www.latex-project.org/svnroot/experimental/trunk/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%%   Snapshots taken from the repository represent work in progress and may
%%   not work or may contain conflicting material!  We therefore ask
%%   people _not_ to put them into distributions, archives, etc. without
%%   prior consultation with the LaTeX3 Project.
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
\GetIdInfo$Id: l3seq.dtx 3490 2012-03-04 01:00:53Z bruno $
  {L3 Experimental sequences and stacks}
\ProvidesExplPackage
  {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\package_check_loaded_expl:
\cs_new:Npn \seq_item:n
  {
    \msg_expandable_kernel_error:nn { seq } { misused }
    \use_none:n
  }
\tl_new:N \l_seq_internal_a_tl
\tl_new:N \l_seq_internal_b_tl
\cs_new_eq:NN \seq_new:N \tl_new:N
\cs_new_eq:NN \seq_new:c \tl_new:c
\cs_new_eq:NN \seq_clear:N  \tl_clear:N
\cs_new_eq:NN \seq_clear:c  \tl_clear:c
\cs_new_eq:NN \seq_gclear:N \tl_gclear:N
\cs_new_eq:NN \seq_gclear:c \tl_gclear:c
\cs_new_eq:NN \seq_clear_new:N  \tl_clear_new:N
\cs_new_eq:NN \seq_clear_new:c  \tl_clear_new:c
\cs_new_eq:NN \seq_gclear_new:N \tl_gclear_new:N
\cs_new_eq:NN \seq_gclear_new:c \tl_gclear_new:c
\cs_new_eq:NN \seq_set_eq:NN  \tl_set_eq:NN
\cs_new_eq:NN \seq_set_eq:Nc  \tl_set_eq:Nc
\cs_new_eq:NN \seq_set_eq:cN  \tl_set_eq:cN
\cs_new_eq:NN \seq_set_eq:cc  \tl_set_eq:cc
\cs_new_eq:NN \seq_gset_eq:NN \tl_gset_eq:NN
\cs_new_eq:NN \seq_gset_eq:Nc \tl_gset_eq:Nc
\cs_new_eq:NN \seq_gset_eq:cN \tl_gset_eq:cN
\cs_new_eq:NN \seq_gset_eq:cc \tl_gset_eq:cc
\cs_new_protected_nopar:Npn \seq_set_split:Nnn
  { \seq_set_split_aux:NNnn \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gset_split:Nnn
  { \seq_set_split_aux:NNnn \tl_gset:Nx }
\cs_new_protected:Npn \seq_set_split_aux:NNnn #1 #2 #3 #4
  {
    \tl_if_empty:nTF {#3}
      { #1 #2 { \tl_map_function:nN {#4} \seq_wrap_item:n } }
      {
        \tl_set:Nn \l_seq_internal_a_tl
          {
            \seq_set_split_aux_i:w \prg_do_nothing:
            #4
            \seq_set_split_aux_end:
          }
        \tl_replace_all:Nnn \l_seq_internal_a_tl { #3 }
          {
            \seq_set_split_aux_end:
            \seq_set_split_aux_i:w \prg_do_nothing:
          }
        \tl_set:Nx \l_seq_internal_a_tl { \l_seq_internal_a_tl }
        #1 #2 { \l_seq_internal_a_tl }
      }
  }
\cs_new:Npn \seq_set_split_aux_i:w #1 \seq_set_split_aux_end:
  {
    \exp_not:N \seq_set_split_aux_ii:w
    \exp_args:No \tl_trim_spaces:n {#1}
    \exp_not:N \seq_set_split_aux_end:
  }
\cs_new:Npn \seq_set_split_aux_ii:w #1 \seq_set_split_aux_end:
  { \seq_wrap_item:n {#1} }
\cs_new_protected:Npn \seq_concat:NNN #1#2#3
  { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
\cs_new_protected:Npn \seq_gconcat:NNN #1#2#3
  { \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
\cs_generate_variant:Nn \seq_concat:NNN  { ccc }
\cs_generate_variant:Nn \seq_gconcat:NNN { ccc }
\cs_new_eq:NN \seq_if_exist:NTF \cs_if_exist:NTF
\cs_new_eq:NN \seq_if_exist:NT  \cs_if_exist:NT
\cs_new_eq:NN \seq_if_exist:NF  \cs_if_exist:NF
\cs_new_eq:NN \seq_if_exist_p:N \cs_if_exist_p:N
\cs_new_eq:NN \seq_if_exist:cTF \cs_if_exist:cTF
\cs_new_eq:NN \seq_if_exist:cT  \cs_if_exist:cT
\cs_new_eq:NN \seq_if_exist:cF  \cs_if_exist:cF
\cs_new_eq:NN \seq_if_exist_p:c \cs_if_exist_p:c
\cs_new_protected:Npn \seq_put_left:Nn #1#2
  { \tl_put_left:Nn #1 { \seq_item:n {#2} } }
\cs_new_protected:Npn \seq_put_right:Nn #1#2
  { \tl_put_right:Nn #1 { \seq_item:n {#2} } }
\cs_generate_variant:Nn \seq_put_left:Nn  {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_put_left:Nn  { c , cV , cv , co , cx }
\cs_generate_variant:Nn \seq_put_right:Nn {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_put_right:Nn { c , cV , cv , co , cx }
\cs_new_protected:Npn \seq_gput_left:Nn #1#2
  { \tl_gput_left:Nn #1 { \seq_item:n {#2} } }
\cs_new_protected:Npn \seq_gput_right:Nn #1#2
  { \tl_gput_right:Nn #1 { \seq_item:n {#2} } }
\cs_generate_variant:Nn \seq_gput_left:Nn  {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_gput_left:Nn  { c , cV , cv , co , cx }
\cs_generate_variant:Nn \seq_gput_right:Nn {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_gput_right:Nn { c , cV , cv , co , cx }
\cs_new:Npn \seq_wrap_item:n #1 { \exp_not:n { \seq_item:n {#1} } }
\seq_new:N \l_seq_internal_remove_seq
\cs_new_protected:Npn \seq_remove_duplicates:N
  { \seq_remove_duplicates_aux:NN \seq_set_eq:NN }
\cs_new_protected:Npn \seq_gremove_duplicates:N
  { \seq_remove_duplicates_aux:NN \seq_gset_eq:NN }
\cs_new_protected:Npn \seq_remove_duplicates_aux:NN #1#2
  {
    \seq_clear:N \l_seq_internal_remove_seq
    \seq_map_inline:Nn #2
      {
        \seq_if_in:NnF \l_seq_internal_remove_seq {##1}
          { \seq_put_right:Nn \l_seq_internal_remove_seq {##1} }
      }
    #1 #2 \l_seq_internal_remove_seq
  }
\cs_generate_variant:Nn \seq_remove_duplicates:N  { c }
\cs_generate_variant:Nn \seq_gremove_duplicates:N { c }
\cs_new_protected:Npn \seq_remove_all:Nn
  { \seq_remove_all_aux:NNn \tl_set:Nx }
\cs_new_protected:Npn \seq_gremove_all:Nn
  { \seq_remove_all_aux:NNn \tl_gset:Nx }
\cs_new_protected:Npn \seq_remove_all_aux:NNn #1#2#3
  {
    \seq_push_item_def:n
      {
        \str_if_eq:nnT {##1} {#3}
          {
            \if_false: { \fi: }
            \tl_set:Nn \l_seq_internal_b_tl {##1}
            #1 #2
               { \if_false: } \fi:
                 \exp_not:o {#2}
                 \tl_if_eq:NNT \l_seq_internal_a_tl \l_seq_internal_b_tl
                   { \use_none:nn }
          }
        \seq_wrap_item:n {##1}
      }
    \tl_set:Nn \l_seq_internal_a_tl {#3}
    #1 #2 {#2}
    \seq_pop_item_def:
  }
\cs_generate_variant:Nn \seq_remove_all:Nn  { c }
\cs_generate_variant:Nn \seq_gremove_all:Nn { c }
\prg_new_eq_conditional:NNn \seq_if_empty:N \tl_if_empty:N
  { p , T , F , TF }
\prg_new_eq_conditional:NNn \seq_if_empty:c \tl_if_empty:c
  { p , T , F , TF }
\prg_new_protected_conditional:Npnn \seq_if_in:Nn #1#2
  { T , F , TF }
  {
    \group_begin:
      \tl_set:Nn \l_seq_internal_a_tl {#2}
      \cs_set_protected:Npn \seq_item:n ##1
        {
          \tl_set:Nn \l_seq_internal_b_tl {##1}
          \if_meaning:w \l_seq_internal_a_tl \l_seq_internal_b_tl
            \exp_after:wN \seq_if_in_aux:
          \fi:
        }
      #1
      \seq_break:n { \prg_return_false: }
    \prg_break_point:n { \group_end: }
  }
\cs_new_nopar:Npn \seq_if_in_aux: { \seq_break:n { \prg_return_true: } }
\cs_generate_variant:Nn \seq_if_in:NnT  {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_if_in:NnT  { c , cV , cv , co , cx }
\cs_generate_variant:Nn \seq_if_in:NnF  {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_if_in:NnF  { c , cV , cv , co , cx }
\cs_generate_variant:Nn \seq_if_in:NnTF {     NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_if_in:NnTF { c , cV , cv , co , cx }
\cs_new_protected:Npn \seq_get_left:NN #1#2
  {
    \seq_if_empty_err_break:N #1
    \exp_after:wN \seq_get_left_aux:NnwN #1 \q_stop #2
    \prg_break_point:n { }
  }
\cs_new_protected:Npn \seq_get_left_aux:NnwN \seq_item:n #1#2 \q_stop #3
  { \tl_set:Nn #3 {#1} }
\cs_generate_variant:Nn \seq_get_left:NN { c }
\cs_new_protected_nopar:Npn \seq_pop_left:NN
  { \seq_pop_left_aux:NNN \tl_set:Nn }
\cs_new_protected_nopar:Npn \seq_gpop_left:NN
  { \seq_pop_left_aux:NNN \tl_gset:Nn }
\cs_new_protected:Npn \seq_pop_left_aux:NNN #1#2#3
  {
    \seq_if_empty_err_break:N #2
    \exp_after:wN \seq_pop_left_aux:NnwNNN #2 \q_stop #1#2#3
    \prg_break_point:n { }
  }
\cs_new_protected:Npn \seq_pop_left_aux:NnwNNN \seq_item:n #1#2 \q_stop #3#4#5
  {
    #3 #4 {#2}
    \tl_set:Nn #5 {#1}
  }
\cs_generate_variant:Nn \seq_pop_left:NN  { c }
\cs_generate_variant:Nn \seq_gpop_left:NN { c }
\cs_new_protected:Npn \seq_get_right:NN #1#2
  {
    \seq_if_empty_err_break:N #1
    \seq_get_right_aux:NN #1#2
    \prg_break_point:n { }
  }
\cs_new_protected:Npn \seq_get_right_aux:NN #1#2
  {
    \seq_push_item_def:n { }
    \exp_after:wN \exp_after:wN \exp_after:wN \seq_get_right_loop:nn
      \exp_after:wN \use_none:n #1
      { \tl_set:Nn #2 }
      { }
      {
        \seq_pop_item_def:
        \seq_break:
      }
}
\cs_new:Npn \seq_get_right_loop:nn #1#2
  {
    #2 {#1}
    \seq_get_right_loop:nn
  }
\cs_generate_variant:Nn \seq_get_right:NN { c }
\cs_new_protected_nopar:Npn \seq_pop_right:NN
  { \seq_pop_right_aux:NNN \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gpop_right:NN
  { \seq_pop_right_aux:NNN \tl_gset:Nx }
\cs_new_protected:Npn \seq_pop_right_aux:NNN #1#2#3
  {
    \seq_if_empty_err_break:N #2
    \seq_pop_right_aux_ii:NNN #1 #2 #3
    \prg_break_point:n { }
  }
\cs_new_protected:Npn \seq_pop_right_aux_ii:NNN #1#2#3
  {
    \seq_push_item_def:n { \seq_wrap_item:n {##1} }
    #1 #2 { \if_false: } \fi:
      \exp_after:wN \exp_after:wN \exp_after:wN \seq_get_right_loop:nn
         \exp_after:wN \use_none:n #2
        {
          \if_false: { \fi: }
          \tl_set:Nn #3
        }
        { }
        {
          \seq_pop_item_def:
          \seq_break:
        }
  }
\cs_generate_variant:Nn \seq_pop_right:NN  { c }
\cs_generate_variant:Nn \seq_gpop_right:NN { c }
\cs_new_eq:NN \seq_break:      \prg_map_break:
\cs_new_eq:NN \seq_break:n     \prg_map_break:n
\cs_new_eq:NN \seq_map_break:  \prg_map_break:
\cs_new_eq:NN \seq_map_break:n \prg_map_break:n
\cs_new_protected:Npn \seq_if_empty_err_break:N #1
  {
    \if_meaning:w #1 \c_empty_tl
      \msg_kernel_error:nnx { seq } { empty-sequence } { \token_to_str:N #1 }
      \exp_after:wN \seq_break:
    \fi:
  }
\cs_new:Npn \seq_map_function:NN #1#2
  {
    \exp_after:wN \seq_map_function_aux:NNn \exp_after:wN #2 #1
      { ? \seq_map_break: } { }
    \prg_break_point:n { }
  }
\cs_new:Npn \seq_map_function_aux:NNn #1#2#3
  {
    \use_none:n #2
    #1 {#3}
    \seq_map_function_aux:NNn #1
  }
\cs_generate_variant:Nn \seq_map_function:NN { c }
\cs_new_protected:Npn \seq_push_item_def:n
  {
    \seq_push_item_def_aux:
    \cs_gset:Npn \seq_item:n ##1
  }
\cs_new_protected:Npn \seq_push_item_def:x
  {
    \seq_push_item_def_aux:
    \cs_gset:Npx \seq_item:n ##1
  }
\cs_new_protected:Npn \seq_push_item_def_aux:
  {
    \cs_gset_eq:cN { seq_item_ \int_use:N \g_prg_map_int :n }
      \seq_item:n
    \int_gincr:N \g_prg_map_int
  }
\cs_new_protected_nopar:Npn \seq_pop_item_def:
  {
    \int_gdecr:N \g_prg_map_int
    \cs_gset_eq:Nc \seq_item:n
      { seq_item_ \int_use:N \g_prg_map_int :n }
  }
\cs_new_protected:Npn \seq_map_inline:Nn #1#2
  {
    \seq_push_item_def:n {#2}
    #1
    \prg_break_point:n { \seq_pop_item_def: }
  }
\cs_generate_variant:Nn \seq_map_inline:Nn { c }
\cs_new_protected:Npn \seq_map_variable:NNn #1#2#3
  {
    \seq_push_item_def:x
      {
        \tl_set:Nn \exp_not:N #2 {##1}
        \exp_not:n {#3}
      }
    #1
    \prg_break_point:n { \seq_pop_item_def: }
  }
\cs_generate_variant:Nn \seq_map_variable:NNn {     Nc }
\cs_generate_variant:Nn \seq_map_variable:NNn { c , cc }
\cs_new_eq:NN \seq_push:Nn  \seq_put_left:Nn
\cs_new_eq:NN \seq_push:NV  \seq_put_left:NV
\cs_new_eq:NN \seq_push:Nv  \seq_put_left:Nv
\cs_new_eq:NN \seq_push:No  \seq_put_left:No
\cs_new_eq:NN \seq_push:Nx  \seq_put_left:Nx
\cs_new_eq:NN \seq_push:cn  \seq_put_left:cn
\cs_new_eq:NN \seq_push:cV  \seq_put_left:cV
\cs_new_eq:NN \seq_push:cv  \seq_put_left:cv
\cs_new_eq:NN \seq_push:co  \seq_put_left:co
\cs_new_eq:NN \seq_push:cx  \seq_put_left:cx
\cs_new_eq:NN \seq_gpush:Nn \seq_gput_left:Nn
\cs_new_eq:NN \seq_gpush:NV \seq_gput_left:NV
\cs_new_eq:NN \seq_gpush:Nv \seq_gput_left:Nv
\cs_new_eq:NN \seq_gpush:No \seq_gput_left:No
\cs_new_eq:NN \seq_gpush:Nx \seq_gput_left:Nx
\cs_new_eq:NN \seq_gpush:cn \seq_gput_left:cn
\cs_new_eq:NN \seq_gpush:cV \seq_gput_left:cV
\cs_new_eq:NN \seq_gpush:cv \seq_gput_left:cv
\cs_new_eq:NN \seq_gpush:co \seq_gput_left:co
\cs_new_eq:NN \seq_gpush:cx \seq_gput_left:cx
\cs_new_eq:NN \seq_get:NN \seq_get_left:NN
\cs_new_eq:NN \seq_get:cN \seq_get_left:cN
\cs_new_eq:NN \seq_pop:NN \seq_pop_left:NN
\cs_new_eq:NN \seq_pop:cN \seq_pop_left:cN
\cs_new_eq:NN \seq_gpop:NN \seq_gpop_left:NN
\cs_new_eq:NN \seq_gpop:cN \seq_gpop_left:cN
\cs_new_protected:Npn \seq_show:N #1
  {
    \msg_aux_show:Nnx
      #1
      { seq }
      { \seq_map_function:NN #1 \msg_aux_show:n }
  }
\cs_generate_variant:Nn \seq_show:N { c }
\cs_new:Npn \seq_if_empty_break_return_false:N #1
  {
    \if_meaning:w #1 \c_empty_tl
      \prg_return_false:
      \exp_after:wN \seq_break:
    \fi:
  }
\prg_new_protected_conditional:Npnn \seq_get_left:NN #1 #2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \exp_after:wN \seq_get_left_aux:Nw #1 \q_stop #2
    \prg_return_true:
    \seq_break:
    \prg_break_point:n { }
  }
\prg_new_protected_conditional:Npnn \seq_get_right:NN #1#2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \seq_get_right_aux:NN #1#2
    \prg_return_true: \seq_break:
    \prg_break_point:n { }
  }
\cs_generate_variant:Nn \seq_get_left:NNT   { c }
\cs_generate_variant:Nn \seq_get_left:NNF   { c }
\cs_generate_variant:Nn \seq_get_left:NNTF  { c }
\cs_generate_variant:Nn \seq_get_right:NNT  { c }
\cs_generate_variant:Nn \seq_get_right:NNF  { c }
\cs_generate_variant:Nn \seq_get_right:NNTF { c }
\prg_new_protected_conditional:Npnn \seq_pop_left:NN #1#2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \exp_after:wN \seq_pop_left_aux:NnwNNN #1 \q_stop \tl_set:Nn #1#2
    \prg_return_true: \seq_break:
    \prg_break_point:n { }
  }
\prg_new_protected_conditional:Npnn \seq_gpop_left:NN #1#2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \exp_after:wN \seq_pop_left_aux:NnwNNN #1 \q_stop \tl_gset:Nn #1#2
    \prg_return_true: \seq_break:
    \prg_break_point:n { }
  }
\prg_new_protected_conditional:Npnn \seq_pop_right:NN #1#2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \seq_pop_right_aux_ii:NNN \tl_set:Nx #1 #2
    \prg_return_true: \seq_break:
    \prg_break_point:n { }
  }
\prg_new_protected_conditional:Npnn \seq_gpop_right:NN #1#2 { T , F , TF }
  {
    \seq_if_empty_break_return_false:N #1
    \seq_pop_right_aux_ii:NNN \tl_gset:Nx #1 #2
    \prg_return_true: \seq_break:
    \prg_break_point:n { }
  }
\cs_generate_variant:Nn \seq_pop_left:NNT    { c }
\cs_generate_variant:Nn \seq_pop_left:NNF    { c }
\cs_generate_variant:Nn \seq_pop_left:NNTF   { c }
\cs_generate_variant:Nn \seq_gpop_left:NNT   { c }
\cs_generate_variant:Nn \seq_gpop_left:NNF   { c }
\cs_generate_variant:Nn \seq_gpop_left:NNTF  { c }
\cs_generate_variant:Nn \seq_pop_right:NNT   { c }
\cs_generate_variant:Nn \seq_pop_right:NNF   { c }
\cs_generate_variant:Nn \seq_pop_right:NNTF  { c }
\cs_generate_variant:Nn \seq_gpop_right:NNT  { c }
\cs_generate_variant:Nn \seq_gpop_right:NNF  { c }
\cs_generate_variant:Nn \seq_gpop_right:NNTF { c }
\cs_new:Npn \seq_length:N #1
  {
    \int_eval:n
      {
        0
        \seq_map_function:NN #1 \seq_length_aux:n
      }
  }
\cs_new:Npn \seq_length_aux:n #1 { +1 }
\cs_generate_variant:Nn \seq_length:N { c }
\cs_new:Npn \seq_item:Nn #1#2
  {
    \exp_last_unbraced:Nfo \seq_item_aux:nnn
      {
        \int_eval:n
          {
            \int_compare:nNnT {#2} < \c_zero
              { \seq_length:N #1 + }
            #2
          }
      }
    #1
    { ? \seq_break: }
    { }
    \prg_break_point:n { }
  }
\cs_new:Npn \seq_item_aux:nnn #1#2#3
  {
    \use_none:n #2
    \int_compare:nNnTF {#1} = \c_zero
      { \seq_break:n { \exp_not:n {#3} } }
      { \exp_args:Nf \seq_item_aux:nnn { \int_eval:n { #1 - 1 } } }
  }
\cs_generate_variant:Nn \seq_item:Nn { c }
\cs_new:Npn \seq_use:N #1 { \seq_map_function:NN #1 \use:n }
\cs_generate_variant:Nn \seq_use:N { c }
\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
  {
    \exp_after:wN \seq_mapthread_function_aux:NN
      \exp_after:wN #3
      \exp_after:wN #1
      #2
      { ? \seq_break: } { }
    \prg_break_point:n { }
  }
\cs_new:Npn \seq_mapthread_function_aux:NN #1#2
  {
    \exp_after:wN \seq_mapthread_function_aux:Nnnwnn
      \exp_after:wN #1
      #2
      { ? \seq_break: } { }
      \q_stop
  }
\cs_new:Npn \seq_mapthread_function_aux:Nnnwnn #1#2#3#4 \q_stop #5#6
  {
    \use_none:n #2
    \use_none:n #5
    #1 {#3} {#6}
    \seq_mapthread_function_aux:Nnnwnn #1 #4 \q_stop
  }
\cs_generate_variant:Nn \seq_mapthread_function:NNN {     Nc }
\cs_generate_variant:Nn \seq_mapthread_function:NNN { c , cc }
\cs_new_protected:Npn \seq_set_from_clist:NN #1#2
  {
    \tl_set:Nx #1
      { \clist_map_function:NN #2 \seq_wrap_item:n }
  }
\cs_new_protected:Npn \seq_set_from_clist:Nn #1#2
  {
    \tl_set:Nx #1
      { \clist_map_function:nN {#2} \seq_wrap_item:n }
  }
\cs_new_protected:Npn \seq_gset_from_clist:NN #1#2
  {
    \tl_gset:Nx #1
      { \clist_map_function:NN #2 \seq_wrap_item:n }
  }
\cs_new_protected:Npn \seq_gset_from_clist:Nn #1#2
  {
    \tl_gset:Nx #1
      { \clist_map_function:nN {#2} \seq_wrap_item:n }
  }
\cs_generate_variant:Nn \seq_set_from_clist:NN  {     Nc }
\cs_generate_variant:Nn \seq_set_from_clist:NN  { c , cc }
\cs_generate_variant:Nn \seq_set_from_clist:Nn  { c      }
\cs_generate_variant:Nn \seq_gset_from_clist:NN {     Nc }
\cs_generate_variant:Nn \seq_gset_from_clist:NN { c , cc }
\cs_generate_variant:Nn \seq_gset_from_clist:Nn { c      }
\cs_new_protected_nopar:Npn \seq_tmp:w { }
\cs_new_protected_nopar:Npn \seq_reverse:N
  { \seq_reverse_aux:NN \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_greverse:N
  { \seq_reverse_aux:NN \tl_gset:Nx }
\cs_new_protected:Npn \seq_reverse_aux:NN #1 #2
  {
    \cs_set_eq:NN \seq_tmp:w \seq_item:n
    \cs_set_eq:NN \seq_item:n \seq_reverse_aux_item:nwn
    #1 #2 { #2 \exp_not:n { } }
    \cs_set_eq:NN \seq_item:n \seq_tmp:w
  }
\cs_new:Npn \seq_reverse_aux_item:nwn #1 #2 \exp_not:n #3
  {
    #2
    \exp_not:n { \seq_item:n {#1} #3 }
  }
\cs_generate_variant:Nn \seq_reverse:N  { c }
\cs_generate_variant:Nn \seq_greverse:N { c }
\cs_new_protected_nopar:Npn \seq_set_filter:NNn
  { \seq_set_filter_aux:NNNn \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gset_filter:NNn
  { \seq_set_filter_aux:NNNn \tl_gset:Nx }
\cs_new_protected:Npn \seq_set_filter_aux:NNNn #1#2#3#4
  {
    \seq_push_item_def:n { \bool_if:nT {#4} { \seq_wrap_item:n {##1} } }
    #1 #2 { #3 \prg_break_point:n { } }
    \seq_pop_item_def:
  }
\cs_new_protected_nopar:Npn \seq_set_map:NNn
  { \seq_set_map_aux:NNNn \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gset_map:NNn
  { \seq_set_map_aux:NNNn \tl_gset:Nx }
\cs_new_protected:Npn \seq_set_map_aux:NNNn #1#2#3#4
  {
    \seq_push_item_def:n { \exp_not:N \seq_item:n {#4} }
    #1 #2 { #3 }
    \seq_pop_item_def:
  }
%% 
%%
%% End of file `l3seq.sty'.
