LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Andreas Matthias <[log in to unmask]>
Sat, 15 Sep 2007 19:07:29 +0200
text/plain (54 lines)
Frank Mittelbach wrote:

| > > \prop_new:N \g_foo_prop
| > > 
| > > \tlp_set:Nn \l_tmp_tlp {\g_foo_prop}
| > > 
| > > \prop_gput:Ooo \l_tmp_tlp ...
| > 
| > 
| > Hmm... But this could be done with \prop_gput:Noo as well.
| that could only be done if you know that \prop_gput:Noo expand its argument
| internally due to its implementation and you use this fact. so you use a
| feature of the implementation which may not be there tomorrow

I see. 

So I skimmed through my code and realised that I was using implementation
details quite often, e.g. using \my_tlp instead of \tlp_use:N\my_tlp.
And I tried to change that. 

Here is an example that actually does what I want it to, but might not
be considered clean code since it depends on implementation details:


  \tlp_new:Nn \a_tlp {aaa}
  \tlp_new:Nn \b_tlp {bbb\a_tlp}

  \prop_new:N \a_plist
  \prop_gput:Nno \a_plist {key} {\b_tlp}


To get rid of implementation details I changed the put command to

  \prop_gput:Nno \a_plist {key} {\tlp_use:N\b_tlp}

But that's worse. Now \b_tlp doesn't get expanded, because -- in
contrast to \toks_use:N, \int_use:N etc -- \tlp_use:N cannot
expand to a "\the for macros".

So I wonder if \tlp_use:N should be considered harmful. It seems
to be equal to \toks_use:N or \int_use:N, but definitely isn't.

And then: What's the error message in \tlp_use:N for? It looks
so arbitrarily. Probably it's not?