[latex3-commits] [latex3/latex2e] develop: Add \socket_use_expandable:n (0dc785e70)

github at latex-project.org github at latex-project.org
Sun Oct 27 18:13:47 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/0dc785e7095f2f5e9a74b2e7c06be93ab52a2734

>---------------------------------------------------------------

commit 0dc785e7095f2f5e9a74b2e7c06be93ab52a2734
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun Oct 27 11:57:02 2024 +0100

    Add \socket_use_expandable:n


>---------------------------------------------------------------

0dc785e7095f2f5e9a74b2e7c06be93ab52a2734
 base/changes.txt   |  4 +++-
 base/ltsockets.dtx | 29 ++++++++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index e35bcb333..c8434e2b0 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,10 +6,12 @@ to completeness or accuracy and it contains some references to files that are
 not part of the distribution.
 ================================================================================
 
-2024-10-21  Marcel Krüger  <Marcel.Krueger at latex-project.org>
+2024-10-27  Marcel Krüger  <Marcel.Krueger at latex-project.org>
 	* lttagging.dtx
 	Adapt two argument tagging sockets to preserve second argument when the socket is disabled.
 	Add expandable versions of tagging socket use commands.
+	* ltsocket.dtx
+	Add expandable versions of \socket_use_expandable:n
 
 2024-10-26  Yukai Chou <muzimuzhi at gmail.com>
 	* ltcounts.dtx (subsection{Environment Counter Macros}):
diff --git a/base/ltsockets.dtx b/base/ltsockets.dtx
index c77c74b57..ccedec867 100644
--- a/base/ltsockets.dtx
+++ b/base/ltsockets.dtx
@@ -33,7 +33,7 @@
 %<*driver> 
 % \fi
 \ProvidesFile{ltsockets.dtx}
-             [2024/06/29 v0.9a LaTeX Kernel (Sockets)]
+             [2024/10/27 v0.9b LaTeX Kernel (Sockets)]
 % \iffalse
 %
 \documentclass{l3doc}
@@ -617,6 +617,22 @@
 % \end{function}
 %
 % 
+% \begin{function}[EXP]{\socket_use_expandable:nw,\socket_use_expandable:n}
+% \begin{syntax}
+% \cs{socket_use_expandable:n} \Arg{socket-name}
+% \end{syntax}
+%   Fully expandable variant of \cs{socket_use:n}. This can be used in macro code
+%   to retrieve code from sockets which need to appear in an expandable context.
+%
+%   This usually requires the plug to only contain expandable code and should therefore
+%   only be used for sockets which are clearly documented to be used in an expandable context.
+%   This command does not print any debugging info when \cs{DebugSocketsOn} is active
+%   and should therefore be avoided whenever possible.
+%
+%   For performance reasons there is no explicit check that the socket was declared!
+% \end{function}
+%
+%
 % \begin{function}{\ShowSocket,\LogSocket,\socket_show:n,\socket_log:n}
 % \begin{syntax}
 % \cs{ShowSocket}    \Arg{socket-name}
@@ -942,6 +958,17 @@
 %    \fmi{Implement?} 
 %  \end{macro}
 %
+%  \begin{macro}{\socket_use_expandable:nw,\socket_use_expandable:n}
+%    \changes{v0.9b}{2024/10/27}{Added \cs{socket_use_expandable:n}}
+%    The same as the non-expandable code, except for the missing debug output.
+%    \begin{macrocode}
+\cs_new:Npn \socket_use_expandable:nw #1 {
+  \use:c { @@_#1_plug_ \str_use:c { l_@@_#1_plug_str } :w }
+}
+\cs_new_eq:NN  \socket_use_expandable:n \socket_use_expandable:nw     % socket with no inputs
+%    \end{macrocode}
+%  \end{macro}
+%
 %
 %
 %





More information about the latex3-commits mailing list.