On Tue, Jul 16, 2013 at 7:56 PM, Bruno Le Floch <[log in to unmask]> wrote:

> Actually, this slight issue hints at a memory leak waiting to happen:
> TeX will never be able to know when all mentions of the unique name
> are gone, hence that name (and the associated contents) will need to
> remain forever.  This does not seem very safe.

Well, it's "safe", but it leaks memory, as you say. I do wonder how
much this matters in practice, given that LaTeX runs short batch-jobs
rather than continuous processes. But it is a valid concern.

> or one could write a package providing \pointer_arg:Nn (or something similar)
>      \pointer_arg:Nn \foo:n { ab\cd }

Indeed! A family of `\exp_args` like commands is probably the best way to go.

One of the arguments is, as you say, that the same library can provide
facilities for garbage-collection. Another argument, which just
occurred to me, is that I'll now have the full set of expl3 argument
specifiers at my disposal for expanding the value before putting it in
the pointer.

I will write this library at some point. I'm currently quite busy, though.