%%
%% This is file `lambdax.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lambdax.dtx  (with options: `package')
%% ----------------------------------------------------------------
%% lambdax --- lambda expression
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
 \NeedsTeXFormat{LaTeX2e}[2021-06-01]
 \RequirePackage{expl3, xparse, xtemplate, l3keys2e}[2021-06-01]
 \RequirePackage{keyparse}[2021-08-18]
 \ProvidesExplPackage
 {lambdax}                                                  % Package name
 {2021-08-18}                                               % Release date
 {1.1}                                                      % Release version
 {lambdax --- Lambda expression                         }   % Description
\ExplSyntaxOn
\cs_generate_variant:Nn\tl_count:n{e}
\cs_generate_variant:Nn\int_eval:n{e}
\cs_generate_variant:Nn\bool_if:nT{o, e}
\cs_new:Nn
\__lambdax_str_case_empty:n
{{#1}
  {\c_empty_tl}}
\msg_new:nnn{__lambdax}
{not-xparse}
{Expecting~an~xparse~command,~got~#2}
\tl_const:Nn
\c__lambdax_xcmdname_tl
{  {NewDocumentCommand}
  {RenewDocumentCommand}
  {ProvideDocumentCommand}
  {DeclareDocumentCommand}
  {NewExpandableDocumentCommand}
  {RenewExpandableDocumentCommand}
  {ProvideExpandableDocumentCommand}
  {DeclareExpandableDocumentCommand} }
\prg_new_conditional:Nnn
\__lambdax_xcmd_if:n{TF}
{\exp_args:Nnx
  \str_case:nnTF{#1}
  {  \tl_map_function:NN
    \c__lambdax_xcmdname_tl
    \__lambdax_str_case_empty:n}
  {\prg_return_true:}
  {\prg_return_false:}}
\cs_generate_variant:Nn\__lambdax_xcmd_if:nTF{e}
\cs_new:Nn
\lambdax_xcmd_if:NTF
{\__lambdax_xcmd_if:eTF
  {\cs_to_str:N#1}{#2}{#3}}
\cs_new:Nn
\__lambdax_xcmd_else_error:Nn
{  \lambdax_xcmd_if:NTF#1
  { #2 }
  { \msg_error:nne{__lambdax}
    {not-xparse}
    {\token_to_str:N#1} } }
\tl_const:Nn
\c__lambdax_xenv_tl
{ {NewDocumentEnvironment}
  {RenewDocumentEnvironment}
  {ProvideDocumentEnvironment}
  {DeclareDocumentEnvironment} }
\cs_new:Nn
\__lambdax_msg_name:n{msg_\g__lambdax_opt_msg_tl{}:#1}
\cs_new:Nn\__lambdax_placeholder:n{#### #1}
\cs_generate_variant:Nn\__lambdax_placeholder:n{o,e}
\cs_new:Nn\__lambdax_argspec:n{\keyparse_eval:nn{argspec}{#1}}
\cs_new:Nn\__lambdax_argspec_count:n{\tl_count:e{\__lambdax_argspec:n{#1}}}
\cs_new:Nn\__lambdax_chain_position:n{\int_eval:e{\__lambdax_argspec_count:n{#1}+1}}
\cs_new:Nn\__lambdax_chain_placeholder:n
{\__lambdax_placeholder:e
  {\__lambdax_chain_position:n{#1}}}
\cs_new_protected:Nn \__lambdax_lambda:Nnn
{\exp_args:NNx
  #1 \__lambdax_lambda
  {#2}
  {#3}
  \__lambdax_lambda}
\cs_generate_variant:Nn\__lambdax_lambda:N{c}
\cs_new_protected:Nn
\__lambdax_lambda_chain:Nnnn
{ \tl_set:Nn
  \l__lambdax_head_tl
  {\exp_args:NNx#1 \__lambdax_lambda_chain
    {#2#3} }
  \exp_args:Nx
  \l__lambdax_head_tl
  {\exp_not:n{#4} \exp_not:N
    \bool_if:oT
    {\__lambdax_chain_placeholder:n{#2}}
    {\exp_not:N\__lambdax_lambda_chain}}
  \__lambdax_lambda_chain}
\cs_set_protected:Nn
\__lambdax_lambda_dev:N
{ \cs_new_protected:Nn
  \lambdax:nn
  {  \__lambdax_lambda:Nnn #1
    {##1}{##2} }
  \cs_new_protected:Nn
  \lambdax:nnn
  {  \__lambdax_lambda_chain:Nnnn #1
    {##1}{##2}{##3} } }
\cs_set_protected:Nn
\__lambdax_lambda_doc:N
{ \NewDocumentCommand
  #1 { O{m} d<>  m }
  {\IfValueTF{##2}
    { \lambdax:nnn { ##1 } { ##2 } { ##3 } }
    { \lambdax:nn { ##1 } { ##3 } } } }
\cs_generate_variant:Nn\__lambdax_lambda_doc:N{c}
\keys_define:nn{ __lambdax }
{ dev.code:n = {
    \__lambdax_xcmd_else_error:Nn#1
    {\__lambdax_lambda_dev:N#1 }
  },
  internal / document-command-name.code:n = { \__lambdax_lambda_doc:c{#1} },
  internal / document-command-name.initial:n = { LambdaX },
  xparse-command.code:n =
  { \__lambdax_xcmd_else_error:Nn #1
    { \keys_set:nn{ __lambdax }{ dev = #1 } } },
  xparse-command .initial:n = { \DeclareDocumentCommand }
}
\ProcessKeysOptions{__lambdax}
\ExplSyntaxOff
%% 
%% Copyright (C) 2021 by Erwann Rogard
%% 
%% This work 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 work is "maintained" (as per LPPL maintenance status) by
%% Erwann Rogard.
%% 
%% This work consists of the file lambdax.dtx and the derived files:
%% lambdax.sty, and lambdax.pdf.
%% 
%%
%% End of file `lambdax.sty'.
