Skip to content

Instantly share code, notes, and snippets.

@wtsnjp
Created August 9, 2018 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtsnjp/202052b6c4680d2a819fa0b02279aea7 to your computer and use it in GitHub Desktop.
Save wtsnjp/202052b6c4680d2a819fa0b02279aea7 to your computer and use it in GitHub Desktop.
%#!lualatex
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_generate_variant:Nn \seq_set_split:Nnn { Nnx }
\cs_new:Npn \my_test:n #1 {
\int_eval:n { #1 * 3 } |
}
\seq_new:N \l_number_seq
\seq_new:N \l_res_seq
\seq_set_split:Nnn \l_number_seq { | } {
1 | 2 | 3
}
\seq_set_split:Nnx \l_res_seq { | } {
\seq_map_function:NN \l_number_seq \my_test:n
}
\seq_pop_right:NN \l_res_seq \l_tmpa_tl
\seq_show:N \l_res_seq
\ExplSyntaxOff
\end{document}
% vim: ft=expl3 nospell:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment