4

According to the xint packages source code, the definition of \xint_bye is

\long\def\xint_bye #1\xint_bye {}%.

Somehow it invokes itself, but I do not understand it. What does \xint_bye do?

Chilote
  • 189

1 Answers1

4

That definition doesn't mean that \xint_bye calls itself. The definition is of a macro with a delimited argument. According to it, \xint_bye must be followed by (almost1) arbitrary tokens and by \xint_bye at the same brace level. Everything up to and including that token is then discarded, because the replacement text is empty.

Actually, \xint_bye is mostly used as a “sentinel” for other delimited argument macros. I believe that the definition is done for corner cases when \xint_bye gets to be expanded (usually it's discarded, being an argument delimiter).


1 Almost, because outer tokens cannot ever appear in arguments. Any other token can, including \par, because of the prefix \long.

egreg
  • 1,121,712
  • Thanks for the answer. Could you please add an explicit (code) use? or where can I learn how/when to use it? – Chilote Dec 29 '21 at 22:45
  • @Chilote You don't use it. It's an internal token of the xint bundle. – egreg Dec 29 '21 at 22:47
  • I am trying to understand the code of the section ROW REDUCTION (INITIAL) ANSWER of this post where \xint_bye is explicitly used in lines 48, 51, etc: https://tex.stackexchange.com/a/360116/81269 – Chilote Dec 29 '21 at 22:51
  • @Chilote That's by the author of xint, who left this site. Clever code, poor documentation, I'm afraid. – egreg Dec 29 '21 at 23:09
  • @Chilote That answer mostly uses plain TeX, so you can read the books to learn the language; on the other hand it may be easier to learn Lua and reimplement the thing from scratch. – user202729 Dec 30 '21 at 01:03