Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Primitives == lowercase letters

19 views
Skip to first unread message

Bruno Le Floch

unread,
May 22, 2011, 3:31:36 PM5/22/11
to
Hello all,

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

Heiko Oberdiek

unread,
May 22, 2011, 3:56:03 PM5/22/11
to
Bruno Le Floch <blfl...@gmail.com> wrote:

> 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

GL

unread,
May 22, 2011, 3:59:13 PM5/22/11
to
Le 22/05/2011 21:31, Bruno Le Floch a écrit :
> Hello all,
>
> I'd just like to confirm that apart from \/, \ and \-, other

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...

GL

unread,
May 22, 2011, 4:08:15 PM5/22/11
to
Le 22/05/2011 21:56, Heiko Oberdiek a écrit :
> Bruno Le Floch<blfl...@gmail.com> wrote:
>
>> 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, ...)

\beginL \TeXXeTstate

Bruno Le Floch

unread,
May 22, 2011, 4:28:38 PM5/22/11
to
On May 22, 3:56 pm, Heiko Oberdiek <heiko.oberd...@googlemail.com>
wrote:

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

Enrico Gregorio

unread,
May 22, 2011, 5:23:05 PM5/22/11
to
Bruno Le Floch <blfl...@gmail.com> wrote:

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

Philipp Stephani

unread,
May 22, 2011, 5:26:38 PM5/22/11
to
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.

--
Change “LookInSig” to “tcalveu” to answer by mail.

Dan

unread,
May 22, 2011, 11:58:34 PM5/22/11
to
On May 22, 4:26 pm, Philipp Stephani <LookIn...@arcor.de> wrote:

> Bruno Le Floch <blfla...@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 <blfla...@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.

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

Bruno Le Floch

unread,
May 23, 2011, 10:33:36 AM5/23/11
to
> > > (1) The exceptions are I think \/, \-, \ , \firstmark, \topmark,
> > > \botmark, and \nullfont.
>
> > Plus \splitfirstmark and \splitbotmark.  But I think that's all.

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

David Kastrup

unread,
May 25, 2011, 7:01:47 AM5/25/11
to
Philipp Stephani <Look...@arcor.de> writes:

> 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>

Bruno Le Floch

unread,
May 25, 2011, 7:17:02 AM5/25/11
to
On May 25, 7:01 am, David Kastrup <d...@gnu.org> wrote:
> Philipp Stephani <LookIn...@arcor.de> writes:

> > Bruno Le Floch <blfla...@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 <blfla...@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}

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

GL

unread,
May 25, 2011, 8:10:10 AM5/25/11
to

\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

David Kastrup

unread,
May 25, 2011, 9:39:45 AM5/25/11
to
GL <goua...@gmail.com> writes:

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.

0 new messages