% \iffalse meta-comment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% memoize-ext.dtx
% Additions and changes Copyright (C) 2024-2026 Clea F. Rees.
% Code from skeleton.dtx Copyright (C) 2015-2024 Scott Pakin (see below).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008-05-04 or later.
%
% This work has the LPPL maintenance status 'muaintained'.
%
% The Current Maintainer of this work is Clea F. Rees.
%
% This work consists of all files listed in manifest.txt.
%
% The file memoize-ext.dtx is a derived work under the terms of the
% LPPL. It is based on version 2.4 of skeleton.dtx which is part of
% dtxtut by Scott Pakin. A copy of dtxtut, including the
% unmodified version of skeleton.dtx is available from
% https://www.ctan.org/pkg/dtxtut and released under the LPPL.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \fi
%
% \iffalse
%<*driver>
\GetIdInfo $Id: memoize-ext-l3draw.dtx 11731 2026-03-06 05:47:08Z cfrees $ {Extensions for Memoize}
\ProvidesExplFile{\ExplFileName}{\ExplFileDate}{v0.3 \ExplFileVersion}{\ExplFileDescription}
\begin{document}
\let\MakePrivateLetters\MyMakePrivateLetters
\DocInput{\filename}
\end{document}
%</driver>
% \fi
%
% \title{\ExplFileName}
% \date{\ExplFileVersion~\ExplFileDate}
% \maketitle
%
% \begin{abstract}
%   \noindent Support for auto-memoization of content created with \pkg{l3draw} \autocite{latex-project-l3draw}.
%   \pkg{memoize-ext-l3draw} is part of \pkg{memoize-ext}.
% \end{abstract}
%
% \tableofcontents
% 
% 
% \MaybeStop{%
% \PrintChanges
% \PrintIndex
% }
% 
% ^^A \section{Implementation}
%
%<*sty>
%<@@=mmzx>
%    \begin{macrocode}
\GetIdInfo $Id: memoize-ext-l3draw.dtx 11731 2026-03-06 05:47:08Z cfrees $ {Extensions for Memoize}
%<!debug>    \ProvidesExplPackage{\ExplFileName}{\ExplFileDate}
%<!debug>     {v0.3 \ExplFileVersion}{\ExplFileDescription}
%<debug>    \ProvidesExplPackage{\ExplFileName-debug}{\ExplFileDate}
%<debug>      {v0.3 \ExplFileVersion}{\ExplFileDescription}
%
%<!debug>    \disable@package@load {memoize-ext-l3draw-debug}
%<debug>    \disable@package@load {memoize-ext-l3draw}
{ Only~one~of~memoize-ext-l3draw~and~memoize-ext-l3draw-debug~
  should~be~loaded.
  Since~
%<!debug>    memoize-ext-l3draw
%<debug>    memoize-ext-l3draw-debug
  ~has~been~loaded,~I~will~ignore~your~request~for~
%<debug>    memoize-ext-l3draw
%<!debug>    memoize-ext-l3draw-debug
.}
% 
%<!debug>    \RequirePackage{memoize-ext}
%<debug>    \RequirePackage{memoize-ext-debug}
%<!debug>    \RequirePackage{memoize-ext-expl3}
%<debug>    \RequirePackage{memoize-ext-expl3-debug}
%    \end{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% l3draw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \begin{fn}{\@@_advice_collect_draw_args:w}
%   The \pkg{l3draw} picture environment is essentially a function with a weird argument specification, so we use a custom collector.
%    \begin{macrocode}
\cs_new:Npn \@@_advice_collect_draw_args:w #1 \draw_end:
{
  \toks0={ #1 \draw_end: }
  \exp_args:No \AdviceInnerHandler {\the\toks0}
}
%    \end{macrocode}
% \end{fn}
% \begin{macro}{\AdviceCollectDrawArguments}
%   Public wrapper.
%    \begin{macrocode}
\cs_new:Npn \AdviceCollectDrawArguments{
  \toks0 = {}
  \@@_advice_collect_draw_args:w
}
%    \end{macrocode}
% \end{macro}
% Default configuration.
% ^^A   l3draw~auto~memoize/.default=true,
%    \begin{macrocode}
\mmzset{%
  auto~csname={draw_begin:}{memoize,collector=\AdviceCollectDrawArguments,},
  auto~csname={__draw_record_origin:}{run~if~memoizing,replicate~expl~fn,},
}
%    \end{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%</sty>
% 
%\Finale
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%^^A vim: et:tw=0:sw=2:ts=2:foldmethod=marker:fmr=<<<,>>>:
