I'd just like to confirm that apart from \/, \ and \-, other
primitives (in all engines) are exactly characterized by the fact that
their \meaning is only made from lowercase letters (plus the escape
character): e.g., registers, chars and such have at least a digit or
an uppercase letter in their meaning; characters have at least one
space; macros have at least ":"; etc.
Also, what is the shortest meaning a non-primitive can have?
"\toks0" (or "toks0" when \escapechar is non-printable) ?
Regards,
Bruno
> I'd just like to confirm that apart from \/, \ and \-, other
> primitives (in all engines) are exactly characterized by the fact that
> their \meaning is only made from lowercase letters
The documenation of LuaTeX contains large lists of primitives in
section "4.13.12.2 tex.extraprimitives".
e-TeX: \eTeX... (\eTeXversion, ...)
Aleph: \Aleph..., \Omega...
LuaTeX: \U...
--
Heiko Oberdiek
Actually \- is defined in latex.ltx :
\def\-{\discretionary{-}{}{}}
> primitives (in all engines) are exactly characterized by the fact that
> their \meaning is only made from lowercase letters (plus the escape
> character): e.g., registers, chars and such have at least a digit or
> an uppercase letter in their meaning; characters have at least one
> space; macros have at least ":"; etc.
>
> Also, what is the shortest meaning a non-primitive can have?
> "\toks0" (or "toks0" when \escapechar is non-printable) ?
>
> Regards,
> Bruno
I don't know if one must consider ($,3) (&,4) etc. to be primitive...
There is also \skip0...
\beginL \TeXXeTstate
Right... I realized that after testing with the contents of
l3names.dtx (which renames primitives to LaTeX3 names).
So let me propose something else: apart from seven exceptions (1), the
meaning of any other primitive consists in an escape character (2),
and only lowercase and uppercase letters. Also, any other token has
either a space, or a digit, or the double quote character (for
\char"A), or a dash (for ...macro:...->...) in its meaning.
(1) The exceptions are I think \/, \-, \ , \firstmark, \topmark,
\botmark, and \nullfont.
(2) No escape character if \escapechar is unprintable (and a word of
caution when \escapechar=32).
If what's above is true, then it gives a reasonable test of whether a
given token is a primitive. I'm a little bit confused by what the
meaning of \firstmark etc. is in general.
@GL: LaTeX redefines \-, but it is initially a primitive (I think that
LaTeX remaps it to \@@hyph).
I don't consider ($,3) etc. to be primitives. Although perhaps I
should.
Regards,
Bruno
As far as I know, LuaTeX and XeTeX have primitives with uppercase
letters in their name. And also e-TeX, so also pdftex.
\eTeXversion
\Umathquad
\XeTeXmathchar
Ciao
Enrico
> (1) The exceptions are I think \/, \-, \ , \firstmark, \topmark,
> \botmark, and \nullfont.
Plus \splitfirstmark and \splitbotmark. But I think that's all.
Bruno Le Floch <blfl...@gmail.com> writes:
> I'm a little bit confused by what the
> meaning of \firstmark etc. is in general.
The name of the primitive, plus a colon, plus the contents of the mark.
These two classes (macros and marks) are indeed the only special cases.
--
Change “LookInSig” to “tcalveu” to answer by mail.
Is an undefined token an exception? Its meaning is "undefined",
which is all lowercase letters (but has no escape character even
when printable). It hardly qualifies as a primitive (or does it?).
If you save a primitive with \let, does the new token qualify as
a primitive? For example latex has \let\@@hyph\-. Then the meaning
of \@@hyph is "\-", which is about as short as a \meaning can get.
Dan
I spotted those when testing with everything that I could find in
l3names.dtx. Thanks for confirming, it's now in l3token, until I find
a less messy test.
> Is an undefined token an exception? Its meaning is "undefined",
> which is all lowercase letters (but has no escape character even
> when printable). It hardly qualifies as a primitive (or does it?).
I missed that exception indeed. I'll have to add a test for that.
> If you save a primitive with \let, does the new token qualify as
> a primitive? For example latex has \let\@@hyph\-. Then the meaning
> of \@@hyph is "\-", which is about as short as a \meaning can get.
Yes, \@@hyph is a primitive, as well as \@@input and many others. What
matters is not the name of the control sequence, but its meaning. In
fact, the meaning of a primitive can go down to a single space ("\ "
when the escapechar is unprintable).
Regards,
Bruno
> Bruno Le Floch <blfl...@gmail.com> writes:
>
>> (1) The exceptions are I think \/, \-, \ , \firstmark, \topmark,
>> \botmark, and \nullfont.
>
> Plus \splitfirstmark and \splitbotmark. But I think that's all.
>
> Bruno Le Floch <blfl...@gmail.com> writes:
>
>> I'm a little bit confused by what the
>> meaning of \firstmark etc. is in general.
>
> The name of the primitive, plus a colon, plus the contents of the
> mark. These two classes (macros and marks) are indeed the only
> special cases.
What about the following:
\halign{#\global\futurelet\zapx\relax\cr test\cr}
\message{\meaning\zapx}
--
David Kastrup
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Yet another case I didn't think of (although I had toyed around with
that at some point). The problem is that any \outer command will break
any test you can try to put it through. If somehow you could sneak
this as an argument of the \token_if_macro and \token_if_primitive
tests currently in l3token, these tests would yield that it is not a
macro, but think that it is not a primitive.
Regards,
Bruno
\outer endtemplate: cannot be anything but a primitive.
However, I can't imagine an example where this primitive can
be of any use... It's the cell - boundary.
>
> Regards,
> Bruno
Well, the letter x seems also a primitive in that regard. The question
is what kind of things are supposed to be sorted in what bin.