2

See the LaTeX 3 programming layer doc here: https://mirror.math.princeton.edu/pub/CTAN/macros/latex/contrib/l3kernel/interface3.pdf

seems to indicate whether a macro is expandable; e.g.:

\prop_to_keyval:N ⋆

But what is ?

\prop_map_function:NN ✩
\prop_map_function:cN ✩
  • 1
    Functions with the filled star are fully expandable also with recursive expansion (f), those with the hollow star are fully expandable only for x or e expansion. Now that we have e in all engines, the distinction is less important, but there are cases where f expansion is still useful. – egreg Apr 28 '22 at 21:42
  • 2
    Page 6 of interface3 describes what Fully and Restricted expandable functions are. – Phelype Oleinik Apr 28 '22 at 21:48
  • Thanks both of you. Happy to accept egreg's comment as an answer. (Page 6 indeed contains the explanation; it unfortunately looked like the doc for \cs_to_str:N.) – Douglas Myers-Turnbull Apr 29 '22 at 00:58

1 Answers1

3

There are three types of “full expansion”, corresponding to three argument types:

  • e means “expandable full expansion”, corresponding to the primitive \expanded

  • x means “unexpandable full expansion”, corresponding to the trick

    \begingroup\edef\x{\endgroup <tokens to be expanded>}\x
    
  • f means “recursive expansion“ and is triggered by \romannumeral.

Until 2019, \expanded was only available in LuaTeX, but with the 2019 release of TeX Live, this new primitive is present in all engines, so the l3kernel started to employ it in preference to f. See Does \expanded replace the \romannumeral trick for expansion?

The filled star denotes kernel functions that can be used in all three types of full expansion, the hollow star is for functions that do their job only in e or x expansion, because it's impossible to achieve their final output by recursive f-expansion.

As mentioned in the linked thread, f-expansion is less needed nowadays that e-expansion is available.

egreg
  • 1,121,712
  • 1
    Perhaps worth adding that with \expanded available, it is possible to turn any 'regular' hollow-star function into a filled-star one: it's only now functions searching unbraced input that might not be 'convertible' to filled-star expandable? – Joseph Wright Apr 29 '22 at 08:36
  • 1
    (Once we require \expanded for expl3, that is something for the team to look at, of course, as it would simplify things.) – Joseph Wright Apr 29 '22 at 08:37