<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">                                                      \input plainpkg
\ProvidesPackage{domore}[2015/09/17 v0.32 dowith extended (UL)]
%% Copyright (C) 2012 2013 2015 Uwe Lueck,
%% http://www.contact-ednotes.sty.de.vu
%% -- author-maintained in the sense of LPPL below --
%%
%% This file can be redistributed and/or modified under
%% the terms of the LaTeX Project Public License; either
%% version 1.3c of the License, or any later version.
%% The latest version of this license is in
%%     http://www.latex-project.org/lppl.txt
%% We did our best to help you, but there is NO WARRANTY.
%%
%% Please report bugs, problems, and suggestions via
%%
%%   http://www.contact-ednotes.sty.de.vu
%%
\PushCatMakeLetterAt                                %% 2015/09/17
%% == With \LaTeX, extend 'dowith''s \cs{setdo} ==
%% %% mod. 2012/11/06: 
%% The original 'dowith' offers |\setdo{&lt;do&gt;}|
%% for defining a one-parameter macro `\do' expanding to &lt;do&gt;.
%% The present package allows applying a &lt;digit&gt;-parameter macro 
%% (maybe `\do', &lt;digit&gt; being 2, 3, or ...)
%% to a list of "brace groups" where each brace group 
%% contains &lt;digit&gt; arguments. If \LaTeX\ is present ...
\ifltx
%% ... the following extension 
%% \[|\setdo[&lt;digit&gt;]{&lt;do&gt;}]|\]
%% of the basic 'dowith' version 
%% can be used to define a &lt;digit&gt;-parameter macro `\do'.
%% You also can equip `\do' with an initial optional argument by
%% \[|\setdo[&lt;digit&gt;][&lt;default&gt;]{&lt;do&gt;}]|\]
%% The next two moves allow loading the package 
%% independently of 'dowith' (overriding its definition of `\setdo')
%% as well as using the package 
%% with a format that has not defined `\do' before.
%% The first parameter of `\do' may even be \emph{optional.}
  \let\setdo\relax \let\do\empty
  \newcommand*{\setdo}[1][1]{\renewcommand\do[#1]}
\fi
%% 
%% == Auxiliaries ==
%% |\@firstsecondoftwo{&lt;balanced-1&gt;}{&lt;balanced-2&gt;}| \ 
%% is a variant of \LaTeX's `\@firstofone{&lt;balanced&gt;}' for 
%% \emph{two} arguments. It just removes outer braces
%% from each of the two arguments (provided it has outer braces), 
%% resulting in \[&lt;balanced-1&gt;&lt;balanced-2&gt;\]
\long\def\@firstsecondoftwo#1#2{#1#2}
%% % |\@secondfirstoftwo&lt;arg-1&gt;&lt;arg-2&gt;| results in &lt;ark-2&gt;&lt;ark-1&gt; 
%% % where &lt;ark-1&gt; is ... 
%% % [TODO declare "meta-function removing braces"---in 'dowith' documentation]
%% % (&lt;arg-1&gt;, &lt;arg-2&gt; must not contain `\par' tokens so far---TODO):
%% |\@secondfirstoftwo{&lt;balanced-1&gt;}{&lt;balanced-2&gt;}| 
%% \emph{additionally} interchanges the two arguments 
%% (after removing braces):
\long\def\@secondfirstoftwo#1#2{#2#1}
%% Our main application is using it as an extended `\expandafter'
%% before `\fi':
%% \[`\@secondfirstoftwo{&lt;do&gt;}\fi'\]
%% will expand to
%% \[`\fi&lt;do&gt;'\]
%% This won't work with `\else' in place of `\fi'.
%% 
%% == Enhanced \cs{DoWith} ==
%% Here comes a more powerful variant of 'dowith''s `\DoWith'. 
%% Instead of iterating a single "command" &lt;cmd&gt;
%% on an arglist &lt;args&gt; by 
%% \[`\DoWith{&lt;cmd&gt;}&lt;args&gt;\StopDoing'\]
%% (cf. `dowith.pdf'), the present `\DoWith' can have a 
%% more complex first argument. If &lt;args&gt; consists 
%% of some brace groups the first of which is {&lt;farg&gt;} 
%% so that &lt;args&gt; is 
%% \[`{&lt;farg&gt;}&lt;rgs&gt;'\]
%% ---&lt;rgs&gt; being the remaining arglist---
%% \[|\DoWith{&lt;repeat&gt;}&lt;args&gt;\StopDoing|\]
%% works like 
%% \[`&lt;repeat&gt;{&lt;farg&gt;}\DoWith{&lt;repeat&gt;}&lt;rgs&gt;\StopDoing'\]
%% and so on---a recursive explanation. Or if &lt;args&gt; is
%% \[`{&lt;arg-1&gt;}{&lt;arg-2&gt;}'\dots`{&lt;arg-n&gt;}'\]
%% ($n$ items), the result is like 
%% \[`&lt;repeat&gt;{&lt;arg-1&gt;}&lt;repeat&gt;{&lt;arg-2&gt;}'\dots`&lt;repeat&gt;{&lt;arg-n&gt;}'\]
%% The actual definition is:
\def\DoWith#1#2{%
    \ifx\StopDoing#2\empty      %% not \@empty for Plain 2012/11/05
        \else\@secondfirstoftwo{#1{#2}\DoWith{#1}}\fi}
%% In order to \strong{use} the remaining definitions from \strong{'dowith' 
%% together with the present package},          %% \strong 2012/11/06
%% load `dowith.sty' before `domore.sty'.
%%
%% (v0.32:) |\StopDoing| must be provided in case 'dowith'
%% is not loaded at all. Being "undefined" is very 
%% bad when `\DoWithMore' is used for a list of \emph{assignments.}
%% As in 'dowith', we assume that no argument starts with something 
%% that has the same meaning as `\DoWith' itself:
\let\StopDoing\DoWith
%%
%% == Applications of \cs{DoWith} ==
%% `\DoWith' still is somewhat auxiliary. What I have used in practice, 
%% are the following definitions.
%%
%% |\DoWithMore{&lt;repeat&gt;}&lt;args&gt;\StopDoing| %% was \DoMore 2015/05/22
%% with &lt;args&gt; as above 
%% "unpacks" each arglist item so that &lt;repeat&gt; may be a macro 
%% with more than one argument---say, &lt;digit&gt; arguments.
%% Then &lt;f-arg&gt; or &lt;arg-1&gt;, as well as &lt;arg-2&gt; $\dots$ &lt;arg-n&gt;,
%% should provide an arglist consisting of &lt;digit&gt; items.
\def\DoWithMore#1{\DoWith{\@firstsecondoftwo{#1}}}
%% Now I use metavariable &lt;do&gt; instead of &lt;repeat&gt;. 
%% We consider some "separator" material &lt;sep&gt; to be inserted
%% between instances of applying &lt;do&gt; to an item of &lt;args&gt;.
%% We want to get
%% \[`&lt;do&gt;{&lt;arg-1&gt;}&lt;sep&gt;&lt;do&gt;{&lt;arg-2&gt;}&lt;sep&gt;'\dots`&lt;sep&gt;&lt;do&gt;{&lt;arg-n&gt;}'\]
%% This is achieved simply by starting with
%% \[`&lt;do&gt;{&lt;farg&gt;}'\]
%% and then proceeding as with 
%% \[`\DoWith{&lt;sep&gt;&lt;do&gt;}&lt;rgs&gt;\StopDoing'\]
%% And that's what |\DoSeparateWith{&lt;do&gt;}{&lt;sep&gt;}&lt;args&gt;\StopDoing| does:
\def\DoSeparateWith#1#2#3{#1{#3}\DoWith{#2#1}}
%% |\DoSeparateWithMore{&lt;do&gt;}{&lt;sep&gt;}&lt;args&gt;\StopDoing| combines
%% the two previous things, inserting separator material &lt;sep&gt;
%% and unpacking the nested arg\-lists:
\def\DoSeparateWithMore#1#2{%              %% wieder 2012/06/05
    \DoSeparateWith{\@firstsecondoftwo{#1}}{#2}}
%% My main application is that &lt;do&gt; is a link macro with arguments
%% &lt;target&gt; and &lt;text&gt; and that &lt;sep&gt; is \qtdcode{~\string|~}
%% (or some tie variant) to get a horizontal list of links like
%% \[\def|{$\vert$}\mbox{&lt;text-1&gt; | &lt;text-2&gt; | \dots | &lt;text-n&gt;}\]
%% 
%% == Without \cs{StopDoing} == %% 2013/03/20, mv. 2013/03/22
%% The following enhancements of 'dowith' are provided by %% 2013/03/22
%% v0.31.
%%
%% |\DoWithAllOf{&lt;repeat&gt;}{&lt;list&gt;}| works like 
%% \[`\DoWith{&lt;repeat&gt;}&lt;list&gt;\StopDoing'\]
%% as in 'dowith', but now with a more general first argument:
\def\DoWithAllOf#1#2{\DoWith{#1}#2\StopDoing}
%% |\DoWithAllIn{&lt;repeat&gt;}{&lt;list-macro&gt;}| works as in 'dowith' too
%% and needs the &lt;repeat&gt; enhancement too:                %% 2013/03/21
\def\DoWithAllIn#1#2{%
    \expandafter \@secondfirstoftwo \expandafter {#2}{\DoWith{#1}}%
    \StopDoing}
%%
%% == Leaving and History ==
\PopLetterCatAt
\endinput

VERSION HISTORY 
v0.1    2012/01/17  developed in `texblog.fdf' 
                    (using \[re]newcommand*)
v0.2    2012/08/07  own file `domore.sty', \def's only
        2012/08/08  dealing with "more" \setdo
v0.3    2012/11/05  using `plainpkg'; removing old % code
                    (see stored v0.2); auxiliaries \long
        2012/11/06  doc.: more on \setdo (&lt;digit&gt;, opt. arg.), 
                    usage with `dowith' \strong
        2012/11/18  doc.: adjusted for `catchdq'; reworking for 
                    \DoWith; \DoWithMore, \DoSeparateWith
        2012/11/19  doc.: \DoSeparateWithMore
v0.31   2013/03/20  \DoWithAllOf
        2013/03/21  \DoWithAllIn
        2013/03/22  moving down new section, mod. doc.
v0.32   2015/05/22  doc. fix \DoWithMore; providing \StopDoing
        2015/09/17  \PushCatMakeLetterAt!
</pre></body></html>