% \iffalse
%% File: l3names.dtx Copyright (C) 1990-1997 LaTeX3 project
%
%<*dtx>
          \ProvidesFile{l3names.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{l3names}
%<driver> \ProvidesFile{l3names.drv}
% \fi
%         \ProvidesFile{l3names.dtx}
     [1998/04/20 v2.0b L3 Experimental Naming Scheme for TeX Primitives]
%
% \iffalse
%<*driver>
\documentclass{l3doc}

\begin{document}
\DocInput{l3names.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{l3names.dtx}
% \title{The \textsf{l3names} package\thanks{This file
%         has version number \fileversion, last
%         revised \filedate.}\\
% A systematic naming scheme for \TeX}
% \author{\Team}
% \date{\filedate}
% \maketitle
%
% \changes{v2.0a}{1997/08/04}
%      {new consistent tex module name for \TeX\ primitives}
%
% \begin{abstract}
% This package sets up an experimental naming scheme for
% \LaTeX\ commands. It allows the \LaTeX\ programmer to systematically
% name functions and variables, and specify the argument types of
% functions.
%
% The \TeX\ primitives are all given a new name according to these
% conventions.
%
% \begin{bfseries}
% Warning: This package, and all packages using it should be regarded as
% \emph{expermiental}!
%
% The names of these packages, and the names and syntax of any commands
% defined in them might change at any time.
%
% These conventions are being distributed in this form to encourage
% discussion and experimentation. It is \emph{not} intentended that
% these packages be used in `real' documents at this stage.
% \end{bfseries}
% \end{abstract}
%
%
% \section{Conventions}
%
% This section gives an overview of the syntax for \LaTeX\ commands
% that is set up for use in these `experimental' pacages.
%
% Commands in \LaTeX3 are either functions or parameters. All
% primitive commands of \TeX{} have private names.
%
% \subsection{Functions}
%
% Functions have the following general syntax:
% \begin{quote}
%   |\|\m{module}|_|\m{description}|:|\m{arg-spec}
% \end{quote}
% where \m{module} is one of the (to be) chosen module names and
% \m{description} is a verbal description of the functionality.
% \m{arg-spec} finally describes the type of arguments that the
% function takes and is left empty if it is a function without
% arguments.
%
% All three parts consists of letters only \m{description} is allowed
% to take further |_| characters to separate words is necessary.
%
% Currently there exists some functions which don't have a proper
% \m{module} name.
%
% As a semi-formalized concept the letter |g| is sometimes used to
% prefix the \m{module} name and certain parts of the \m{description}
% to mark the function as ``globally acting''.
%
% The \m{arg-spec} currently supports the following types of
% arguments:
% \begin{description}
%
% \item[n] Unexpanded token (or token-list if in braces) braces.
%
% \item[o] One time expanded token or token-list. In the latter case,
% effectively only the first token in the list gets expanded. Since
% the expansion might result in more than one token, the result is
% surrounded for further processing with braces.
%
% \item[x] Fully expanded token or token-list. Like |o| but the
% argument is expanded using |\def:Npx| before it is passed on.
%
% \item[c] A character string or a token-list that expands to
% characters of catcode 11 or 12. This string (after expansion) is
% used to construct a command name that is eventually passed on.
%
% \item[N,O,X] Like |n|, |o|, |x| but the argument must be a single
% token without any braces around it.
%
% \item[w] One or more arguments with ``weird'' syntax that one has
% to know by hard or better leave it alone.
%
% \item[p] Denotes parameter text specification part, e.g.\^^M
% |#1#2\q_stop#3|.
%
% \item[T,F] denotes the ``true'' or the ``false'' case in a
% functional predicate.
%
% \end{description}
%
% Especially for the new names of \TeX{} primitives there are is one
% more character to denote arguments. It implies that these
% functions should not be used outside this bootstrapping file.
% \begin{description}
%
% \item[D] Zero or more arguments with  ``weird'' syntax. Uppercase
% ``D''  means (DON'T USE IT), i.e.,
% that this is a primitive \TeX{} command that should
% not show up in code except in the very basic functions of \LaTeX3
% that provide a more sensible interface.
%
% \end{description}
%
% One could perhaps envisage an extended system which allocated
% lettters to denote the various primitive argument types available in
% \TeX, however it seems that this just complicates the system
% withoutadding any real benefit, as these primitives would never be
% used in production code, as higher level packages should offer a
% better interface. Thus the following letters, although they were
% considered have not been used. ``D'' is used in most cases in
% preference.
% \begin{description}
% \item[i] Denotes an integer in \TeX{} notation (which might be a
% register or \dots).
%
% \item[d] Denotes a dimension in \TeX{} notation.
%
% \item[g] Denotes a glue in \TeX{} notation.
%
% \item[m] Denotes an muglue or mukern in \TeX{} notation.
%
% \item[b] Denotes a box specification in \TeX{} notation (again
% something pretty arbitrary).
%
% \item[r] Denotes a rule specification in \TeX{} notation.
%
% \end{description}
%
% Some of the primitive functions below are flagged ``D'' even if
% they actually might be useful in average code. So certainly there
% are some adjustments necessary. It all depends whether or not we
% provide some safer interface or leave them alone.
%
% \subsection{Parameters}
%
% Parameter names have the following general syntax:
% \begin{quote}
%   |\|\m{access}|_|\m{module}|_|\m{description}|_|\m{type}
% \end{quote}
%
% \m{module} and \m{description} is as above. \m{type} should denote
% the type of parameter if this helps in using it. The currently used
% types are:
% \begin{description}
%
% \item[int] Integer valued.
%
% \item[factor] Another integer value type. Used for things where the
% parameter is used as a factor for something else.
%
% \item[status] The sort of boolean stuff \TeX{} provides. Essentially
% an integer with the meaning |0| = `off' and other values may or may
% not have sensible meanings.
%
% \item[pen] Another integer describing penalties.
%
% \item[dem] The demerits.
%
% \item[dim] A dimension.
%
% \item[skip] A glue value.
%
% \item[toks] A toks register (sort of).
%
% \item[char] An integer denoting a character.
%
% \item[muskip] A math unit.
%
% \end{description}
%
% \m{access} describes how the parameter can be accessed. The
% following characters are possible:
% \begin{description}
%
% \item[c] A constant. Should not be set in the code except with
% special functions to define the value for the whole processing.
%
% \item[C] A constant according to \TeX's rules. Can not be changed at
% all.
%
% \item[l] A local variable which therefore should not be changed
% globally.
%
% \item[L] A local variable that is usually set (and/or reset) by
% \TeX{} itself.
%
% \item[g] A global variable.
%
% \item[G] A global variable that is usually set (and/or reset by \TeX.
%
% \item[R] A  variable that is set (and changed) by \TeX{} and can not
% be changed by in the code (read-only).
%
% \end{description}
%
% 
%
% \section{Modules}
% 
% Nearly all operations of \LaTeX3 are carried out by calling control
% sequences. For better programming concepts many types of functions are
% identified and gathered in modules. Functions in such modules starts
% with special prefixes, for example "\tlp_" is the prefix for functions
% dealing with token list pointers.
% 
% 
%
% \StopEventually{}
%
% \section{Starters}
%
%    This is the base part of \LaTeX3 defining things like |catcode|s
%    and redefining the \TeX{} primitives.
%
%    We start by setting up |\catcode|s that we need to define new
%    commands. These are the ones for begin-group and end-group
%    characters.\footnote{Well not needed while this file is running
%    as a package on top of \LaTeXe, so omitted from the package code}
%    \begin{macrocode}
%<*initex>
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 %
\catcode`\^^I=10 % ascii tab is a blank space
%</initex>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*initex|package>
\catcode`\ =9\relax
\catcode`\^^I=9\relax
\catcode`\^^M=9\relax
\catcode`\~=10\relax
\catcode`\_=11\relax\catcode`\:=11\relax
\catcode`\@=11\relax                 % as long as we use old LaTeX stuff.
%    \end{macrocode}
%
%
% \section{Setting up primitive names}
%
%    Here is the function that renames \TeX{}'s primitives.
%
% Normally the old name is left untouched, but the possibility of
% undefining the original names is made available by docstrip and
% package options.
% If nothing else, this gives a way of checking what `old code' a
% package depends on\ldots\
%
% If the package option `removeoldnames' is used then some trick code
% is run after the end of this file, to skip past the code which has
% been inserted by \LaTeXe\ to manage the file name stack, this code
% would break if run once the \TeX\ primitives have been undefined.
% (What a surprise!)
%
% To get things started, give a new name for |\let|.
%    \begin{macrocode}
\let\tex_let:D\let
%</initex|package>
%    \end{macrocode}
%
% and now an internal function to  possibly
% remove the old name.
%
%    \begin{macrocode}
%<*initex>
\long\def\name_undefine:N#1{
    \tex_let:D#1\tex_undefined:}
%</initex>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*package>
\DeclareOption{removeoldnames}{
  \long\def\name_undefine:N#1{
    \tex_let:D#1\tex_undefined:}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{keepoldnames}{
  \long\def\name_undefine:N#1{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\ExecuteOptions{keepoldnames}
%    \end{macrocode}
%
%    \begin{macrocode}
\ProcessOptions
%</package>
%    \end{macrocode}
%
% The internal function to give the new name and possibly undefine
% the old name.
%    \begin{macrocode}
%<*initex|package>
\long\def\name_primitive:NN#1#2{
  \tex_let:D #2 #1
  \name_undefine:N #1
      }
%    \end{macrocode}
%
% \subsection{Assignments}
%
% In the current incarnation of this package, all \TeX\ primitives
% are given a new name of the form |\tex_|\emph{oldname}|:D|.
% But first three special cases which have symbolic original names.
% These are given modified new names, so that they may be entered
% without catcode tricks.
%    \begin{macrocode}
\name_primitive:NN \                      \tex_space:D
\name_primitive:NN \/                     \tex_italiccor:D
\name_primitive:NN \-                     \tex_hyphen:D
%    \end{macrocode}
%  
% Now all the other primitives.
%    \begin{macrocode}
\name_primitive:NN \let                   \tex_let:D
\name_primitive:NN \def                   \tex_def:D
\name_primitive:NN \edef                  \tex_edef:D
\name_primitive:NN \gdef                  \tex_gdef:D
\name_primitive:NN \xdef                  \tex_xdef:D
\name_primitive:NN \chardef               \tex_chardef:D
\name_primitive:NN \countdef              \tex_countdef:D
\name_primitive:NN \dimendef              \tex_dimendef:D
\name_primitive:NN \skipdef               \tex_skipdef:D
\name_primitive:NN \muskipdef             \tex_muskipdef:D
\name_primitive:NN \mathchardef           \tex_mathchardef:D
\name_primitive:NN \toksdef               \tex_toksdef:D
\name_primitive:NN \futurelet             \tex_futurelet:D
\name_primitive:NN \advance               \tex_advance:D
\name_primitive:NN \divide                \tex_divide:D
\name_primitive:NN \multiply              \tex_multiply:D
\name_primitive:NN \font                  \tex_font:D
\name_primitive:NN \fam                   \tex_fam:D
\name_primitive:NN \global                \tex_global:D
\name_primitive:NN \long                  \tex_long:D
\name_primitive:NN \outer                 \tex_outer:D
\name_primitive:NN \setlanguage           \tex_setlanguage:D
\name_primitive:NN \globaldefs            \tex_globaldefs:D
\name_primitive:NN \afterassignment       \tex_afterassignment:D
\name_primitive:NN \aftergroup            \tex_aftergroup:D
\name_primitive:NN \expandafter           \tex_expandafter:D
\name_primitive:NN \noexpand              \tex_noexpand:D
\name_primitive:NN \begingroup            \tex_begingroup:D
\name_primitive:NN \endgroup              \tex_endgroup:D
\name_primitive:NN \halign                \tex_halign:D
\name_primitive:NN \valign                \tex_valign:D
\name_primitive:NN \cr                    \tex_cr:D
\name_primitive:NN \crcr                  \tex_crcr:D
\name_primitive:NN \noalign               \tex_noalign:D
\name_primitive:NN \omit                  \tex_omit:D
\name_primitive:NN \span                  \tex_span:D
\name_primitive:NN \tabskip               \tex_tabskip:D
\name_primitive:NN \everycr               \tex_everycr:D
\name_primitive:NN \if                    \tex_if:D
\name_primitive:NN \ifcase                \tex_ifcase:D
\name_primitive:NN \ifcat                 \tex_ifcat:D
\name_primitive:NN \ifnum                 \tex_ifnum:D
\name_primitive:NN \ifodd                 \tex_ifodd:D
\name_primitive:NN \ifdim                 \tex_ifdim:D
\name_primitive:NN \ifeof                 \tex_ifeof:D
\name_primitive:NN \ifhbox                \tex_ifhbox:D
\name_primitive:NN \ifvbox                \tex_ifvbox:D
\name_primitive:NN \ifvoid                \tex_ifvoid:D
\name_primitive:NN \ifx                   \tex_ifx:D
\name_primitive:NN \iffalse               \tex_iffalse:D
\name_primitive:NN \iftrue                \tex_iftrue:D
\name_primitive:NN \ifhmode               \tex_ifhmode:D
\name_primitive:NN \ifmmode               \tex_ifmmode:D
\name_primitive:NN \ifvmode               \tex_ifvmode:D
\name_primitive:NN \ifinner               \tex_ifinner:D
\name_primitive:NN \else                  \tex_else:D
\name_primitive:NN \fi                    \tex_fi:D
\name_primitive:NN \or                    \tex_or:D
\name_primitive:NN \immediate             \tex_immediate:D
\name_primitive:NN \closeout              \tex_closeout:D
\name_primitive:NN \openin                \tex_openin:D
\name_primitive:NN \openout               \tex_openout:D
\name_primitive:NN \read                  \tex_read:D
\name_primitive:NN \write                 \tex_write:D
\name_primitive:NN \closein               \tex_closein:D
\name_primitive:NN \newlinechar           \tex_newlinechar:D
\name_primitive:NN \input                 \tex_input:D
\name_primitive:NN \endinput              \tex_endinput:D
\name_primitive:NN \inputlineno           \tex_inputlineno:D
\name_primitive:NN \errmessage            \tex_errmessage:D
\name_primitive:NN \message               \tex_message:D
\name_primitive:NN \show                  \tex_show:D
\name_primitive:NN \showthe               \tex_showthe:D
\name_primitive:NN \showbox               \tex_showbox:D
\name_primitive:NN \showlists             \tex_showlists:D
\name_primitive:NN \errhelp               \tex_errhelp:D
\name_primitive:NN \errorcontextlines     \tex_errorcontextlines:D
\name_primitive:NN \tracingcommands       \tex_tracingcommands:D
\name_primitive:NN \tracinglostchars      \tex_tracinglostchars:D
\name_primitive:NN \tracingmacros         \tex_tracingmacros:D
\name_primitive:NN \tracingonline         \tex_tracingonline:D
\name_primitive:NN \tracingoutput         \tex_tracingoutput:D
\name_primitive:NN \tracingpages          \tex_tracingpages:D
\name_primitive:NN \tracingparagraphs     \tex_tracingparagraphs:D
\name_primitive:NN \tracingrestores       \tex_tracingrestores:D
\name_primitive:NN \tracingstats          \tex_tracingstats:D
\name_primitive:NN \pausing               \tex_pausing:D
\name_primitive:NN \showboxbreadth        \tex_showboxbreadth:D
\name_primitive:NN \showboxdepth          \tex_showboxdepth:D
\name_primitive:NN \batchmode             \tex_batchmode:D
\name_primitive:NN \errorstopmode         \tex_errorstopmode:D
\name_primitive:NN \nonstopmode           \tex_nonstopmode:D
\name_primitive:NN \scrollmode            \tex_scrollmode:D
\name_primitive:NN \end                   \tex_end:D
\name_primitive:NN \csname                \tex_csname:D
\name_primitive:NN \endcsname             \tex_endcsname:D
\name_primitive:NN \ignorespaces          \tex_ignorespaces:D
\name_primitive:NN \relax                 \tex_relax:D
\name_primitive:NN \the                   \tex_the:D
\name_primitive:NN \mag                   \tex_mag:D
\name_primitive:NN \language              \tex_language:D
\name_primitive:NN \mark                  \tex_mark:D
\name_primitive:NN \topmark               \tex_topmark:D
\name_primitive:NN \firstmark             \tex_firstmark:D
\name_primitive:NN \botmark               \tex_botmark:D
\name_primitive:NN \splitfirstmark        \tex_splitfirstmark:D
\name_primitive:NN \splitbotmark          \tex_splitbotmark:D
\name_primitive:NN \fontname              \tex_fontname:D
\name_primitive:NN \escapechar            \tex_escapechar:D
\name_primitive:NN \endlinechar           \tex_endlinechar:D
\name_primitive:NN \mathchoice            \tex_mathchoice:D
\name_primitive:NN \delimiter             \tex_delimiter:D
\name_primitive:NN \mathaccent            \tex_mathaccent:D
\name_primitive:NN \mathchar              \tex_mathchar:D
\name_primitive:NN \mskip                 \tex_mskip:D
\name_primitive:NN \radical               \tex_radical:D
\name_primitive:NN \vcenter               \tex_vcenter:D
\name_primitive:NN \mkern                 \tex_mkern:D
\name_primitive:NN \above                 \tex_above:D
\name_primitive:NN \abovewithdelims       \tex_abovewithdelims:D
\name_primitive:NN \atop                  \tex_atop:D
\name_primitive:NN \atopwithdelims        \tex_atopwithdelims:D
\name_primitive:NN \over                  \tex_over:D
\name_primitive:NN \overwithdelims        \tex_overwithdelims:D
\name_primitive:NN \displaystyle          \tex_displaystyle:D
\name_primitive:NN \textstyle             \tex_textstyle:D
\name_primitive:NN \scriptstyle           \tex_scriptstyle:D
\name_primitive:NN \scriptscriptstyle     \tex_scriptscriptstyle:D
\name_primitive:NN \eqno                  \tex_eqno:D
\name_primitive:NN \leqno                 \tex_leqno:D
\name_primitive:NN \abovedisplayshortskip \tex_abovedisplayshortskip:D
\name_primitive:NN \abovedisplayskip      \tex_abovedisplayskip:D
\name_primitive:NN \belowdisplayshortskip \tex_belowdisplayshortskip:D
\name_primitive:NN \belowdisplayskip      \tex_belowdisplayskip:D
\name_primitive:NN \displaywidowpenalty   \tex_displaywidowpenalty:D
\name_primitive:NN \displayindent         \tex_displayindent:D
\name_primitive:NN \displaywidth          \tex_displaywidth:D
\name_primitive:NN \everydisplay          \tex_everydisplay:D
\name_primitive:NN \predisplaysize        \tex_predisplaysize:D
\name_primitive:NN \predisplaypenalty     \tex_predisplaypenalty:D
\name_primitive:NN \postdisplaypenalty    \tex_postdisplaypenalty:D
\name_primitive:NN \mathbin               \tex_mathbin:D
\name_primitive:NN \mathclose             \tex_mathclose:D
\name_primitive:NN \mathinner             \tex_mathinner:D
\name_primitive:NN \mathop                \tex_mathop:D
\name_primitive:NN \displaylimits         \tex_displaylimits:D
\name_primitive:NN \limits                \tex_limits:D
\name_primitive:NN \nolimits              \tex_nolimits:D
\name_primitive:NN \mathopen              \tex_mathopen:D
\name_primitive:NN \mathord               \tex_mathord:D
\name_primitive:NN \mathpunct             \tex_mathpunct:D
\name_primitive:NN \mathrel               \tex_mathrel:D
\name_primitive:NN \overline              \tex_overline:D
\name_primitive:NN \underline             \tex_underline:D
\name_primitive:NN \left                  \tex_left:D
\name_primitive:NN \right                 \tex_right:D
\name_primitive:NN \binoppenalty          \tex_binoppenalty:D
\name_primitive:NN \relpenalty            \tex_relpenalty:D
\name_primitive:NN \delimitershortfall    \tex_delimitershortfall:D
\name_primitive:NN \delimiterfactor       \tex_delimiterfactor:D
\name_primitive:NN \nulldelimiterspace    \tex_nulldelimiterspace:D
\name_primitive:NN \everymath             \tex_everymath:D
\name_primitive:NN \mathsurround          \tex_mathsurround:D
\name_primitive:NN \medmuskip             \tex_medmuskip:D
\name_primitive:NN \thinmuskip            \tex_thinmuskip:D
\name_primitive:NN \thickmuskip           \tex_thickmuskip:D
\name_primitive:NN \scriptspace           \tex_scriptspace:D
\name_primitive:NN \noboundary            \tex_noboundary:D
\name_primitive:NN \accent                \tex_accent:D
\name_primitive:NN \char                  \tex_char:D
\name_primitive:NN \discretionary         \tex_discretionary:D
\name_primitive:NN \hfil                  \tex_hfil:D
\name_primitive:NN \hfilneg               \tex_hfilneg:D
\name_primitive:NN \hfill                 \tex_hfill:D
\name_primitive:NN \hskip                 \tex_hskip:D
\name_primitive:NN \hss                   \tex_hss:D
\name_primitive:NN \vfil                  \tex_vfil:D
\name_primitive:NN \vfilneg               \tex_vfilneg:D
\name_primitive:NN \vfill                 \tex_vfill:D
\name_primitive:NN \vskip                 \tex_vskip:D
\name_primitive:NN \vss                   \tex_vss:D
\name_primitive:NN \unskip                \tex_unskip:D
\name_primitive:NN \kern                  \tex_kern:D
\name_primitive:NN \unkern                \tex_unkern:D
\name_primitive:NN \hrule                 \tex_hrule:D
\name_primitive:NN \vrule                 \tex_vrule:D
\name_primitive:NN \leaders               \tex_leaders:D
\name_primitive:NN \cleaders              \tex_cleaders:D
\name_primitive:NN \xleaders              \tex_xleaders:D
\name_primitive:NN \lastkern              \tex_lastkern:D
\name_primitive:NN \lastskip              \tex_lastskip:D
\name_primitive:NN \indent                \tex_indent:D
\name_primitive:NN \par                   \tex_par:D
\name_primitive:NN \noindent              \tex_noindent:D
\name_primitive:NN \vadjust               \tex_vadjust:D
\name_primitive:NN \baselineskip          \tex_baselineskip:D
\name_primitive:NN \lineskip              \tex_lineskip:D
\name_primitive:NN \lineskiplimit         \tex_lineskiplimit:D
\name_primitive:NN \clubpenalty           \tex_clubpenalty:D
\name_primitive:NN \widowpenalty          \tex_widowpenalty:D
\name_primitive:NN \exhyphenpenalty       \tex_exhyphenpenalty:D
\name_primitive:NN \hyphenpenalty         \tex_hyphenpenalty:D
\name_primitive:NN \linepenalty           \tex_linepenalty:D
\name_primitive:NN \doublehyphendemerits  \tex_doublehyphendemerits:D
\name_primitive:NN \finalhyphendemerits   \tex_finalhyphendemerits:D
\name_primitive:NN \adjdemerits           \tex_adjdemerits:D
\name_primitive:NN \hangafter             \tex_hangafter:D
\name_primitive:NN \hangindent            \tex_hangindent:D
\name_primitive:NN \parshape              \tex_parshape:D
\name_primitive:NN \hsize                 \tex_hsize:D
\name_primitive:NN \lefthyphenmin         \tex_lefthyphenmin:D
\name_primitive:NN \righthyphenmin        \tex_righthyphenmin:D
\name_primitive:NN \leftskip              \tex_leftskip:D
\name_primitive:NN \rightskip             \tex_rightskip:D
\name_primitive:NN \looseness             \tex_looseness:D
\name_primitive:NN \parskip               \tex_parskip:D
\name_primitive:NN \parindent             \tex_parindent:D
\name_primitive:NN \uchyph                \tex_uchyph:D
\name_primitive:NN \emergencystretch      \tex_emergencystretch:D
\name_primitive:NN \pretolerance          \tex_pretolerance:D
\name_primitive:NN \tolerance             \tex_tolerance:D
\name_primitive:NN \spaceskip             \tex_spaceskip:D
\name_primitive:NN \xspaceskip            \tex_xspaceskip:D
\name_primitive:NN \everypar              \tex_everypar:D
\name_primitive:NN \prevgraf              \tex_prevgraf:D
\name_primitive:NN \spacefactor           \tex_spacefactor:D
\name_primitive:NN \shipout               \tex_shipout:D
\name_primitive:NN \vsize                 \tex_vsize:D
\name_primitive:NN \interlinepenalty      \tex_interlinepenalty:D
\name_primitive:NN \brokenpenalty         \tex_brokenpenalty:D
\name_primitive:NN \topskip               \tex_topskip:D
\name_primitive:NN \maxdeadcycles         \tex_maxdeadcycles:D
\name_primitive:NN \maxdepth              \tex_maxdepth:D
\name_primitive:NN \output                \tex_output:D
\name_primitive:NN \deadcycles            \tex_deadcycles:D
\name_primitive:NN \pagedepth             \tex_pagedepth:D
\name_primitive:NN \pagestretch           \tex_pagestretch:D
\name_primitive:NN \pagefilstretch        \tex_pagefilstretch:D
\name_primitive:NN \pagefillstretch       \tex_pagefillstretch:D
\name_primitive:NN \pagefilllstretch      \tex_pagefilllstretch:D
\name_primitive:NN \pageshrink            \tex_pageshrink:D
\name_primitive:NN \pagegoal              \tex_pagegoal:D
\name_primitive:NN \pagetotal             \tex_pagetotal:D
\name_primitive:NN \outputpenalty         \tex_outputpenalty:D
\name_primitive:NN \hoffset               \tex_hoffset:D
\name_primitive:NN \voffset               \tex_voffset:D
\name_primitive:NN \insert                \tex_insert:D
\name_primitive:NN \holdinginserts        \tex_holdinginserts:D
\name_primitive:NN \floatingpenalty       \tex_floatingpenalty:D
\name_primitive:NN \insertpenalties       \tex_insertpenalties:D
\name_primitive:NN \lower                 \tex_lower:D
\name_primitive:NN \moveleft              \tex_moveleft:D
\name_primitive:NN \moveright             \tex_moveright:D
\name_primitive:NN \raise                 \tex_raise:D
\name_primitive:NN \copy                  \tex_copy:D
\name_primitive:NN \lastbox               \tex_lastbox:D
\name_primitive:NN \vsplit                \tex_vsplit:D
\name_primitive:NN \unhbox                \tex_unhbox:D
\name_primitive:NN \unhcopy               \tex_unhcopy:D
\name_primitive:NN \unvbox                \tex_unvbox:D
\name_primitive:NN \unvcopy               \tex_unvcopy:D
\name_primitive:NN \setbox                \tex_setbox:D
\name_primitive:NN \hbox                  \tex_hbox:D
\name_primitive:NN \vbox                  \tex_vbox:D
\name_primitive:NN \vtop                  \tex_vtop:D
\name_primitive:NN \prevdepth             \tex_prevdepth:D
\name_primitive:NN \badness               \tex_badness:D
\name_primitive:NN \hbadness              \tex_hbadness:D
\name_primitive:NN \vbadness              \tex_vbadness:D
\name_primitive:NN \hfuzz                 \tex_hfuzz:D
\name_primitive:NN \vfuzz                 \tex_vfuzz:D
\name_primitive:NN \overfullrule          \tex_overfullrule:D
\name_primitive:NN \boxmaxdepth           \tex_boxmaxdepth:D
\name_primitive:NN \splitmaxdepth         \tex_splitmaxdepth:D
\name_primitive:NN \splittopskip          \tex_splittopskip:D
\name_primitive:NN \everyhbox             \tex_everyhbox:D
\name_primitive:NN \everyvbox             \tex_everyvbox:D
\name_primitive:NN \nullfont              \tex_nullfont:D
\name_primitive:NN \textfont              \tex_textfont:D
\name_primitive:NN \scriptfont            \tex_scriptfont:D
\name_primitive:NN \scriptscriptfont      \tex_scriptscriptfont:D
\name_primitive:NN \fontdimen             \tex_fontdimen:D
\name_primitive:NN \hyphenchar            \tex_hyphenchar:D
\name_primitive:NN \skewchar              \tex_skewchar:D
\name_primitive:NN \defaulthyphenchar     \tex_defaulthyphenchar:D
\name_primitive:NN \defaultskewchar       \tex_defaultskewchar:D
\name_primitive:NN \number                \tex_number:D
\name_primitive:NN \romannumeral          \tex_romannumeral:D
\name_primitive:NN \string                \tex_string:D
\name_primitive:NN \lowercase             \tex_lowercase:D
\name_primitive:NN \uppercase             \tex_uppercase:D
\name_primitive:NN \meaning               \tex_meaning:D
\name_primitive:NN \penalty               \tex_penalty:D
\name_primitive:NN \unpenalty             \tex_unpenalty:D
\name_primitive:NN \lastpenalty           \tex_lastpenalty:D
\name_primitive:NN \special               \tex_special:D
\name_primitive:NN \dump                  \tex_dump:D
\name_primitive:NN \patterns              \tex_patterns:D
\name_primitive:NN \hyphenation           \tex_hyphenation:D
\name_primitive:NN \time                  \tex_time:D
\name_primitive:NN \day                   \tex_day:D
\name_primitive:NN \month                 \tex_month:D
\name_primitive:NN \year                  \tex_year:D
\name_primitive:NN \jobname               \tex_jobname:D
\name_primitive:NN \everyjob              \tex_everyjob:D
\name_primitive:NN \count                 \tex_count:D
\name_primitive:NN \dimen                 \tex_dimen:D
\name_primitive:NN \skip                  \tex_skip:D
\name_primitive:NN \toks                  \tex_toks:D
\name_primitive:NN \muskip                \tex_muskip:D
\name_primitive:NN \box                   \tex_box:D
\name_primitive:NN \wd                    \tex_wd:D
\name_primitive:NN \ht                    \tex_ht:D
\name_primitive:NN \dp                    \tex_dp:D
\name_primitive:NN \catcode               \tex_catcode:D
\name_primitive:NN \delcode               \tex_delcode:D
\name_primitive:NN \sfcode                \tex_sfcode:D
\name_primitive:NN \lccode                \tex_lccode:D
\name_primitive:NN \uccode                \tex_uccode:D
\name_primitive:NN \mathcode              \tex_mathcode:D
%    \end{macrocode}
%
%  \begin{macro}{\CodeStart}
%  \begin{macro}{\CodeStop}
%    Here we define functions that are used to turn on and off the
%    special conventions used in the kernel of \LaTeX3. 
%
%    First of all, the space, tab and the return characters will all be
%    ignored inside \LaTeX3 code. When space characters are needed in 
%    \LaTeX3 code the |~| character will be used for that purpose.
%
%    \begin{macrocode}
\tex_def:D\CodeStart{%
    \tex_catcode:D `\ =9\tex_relax:D
    \tex_catcode:D `\^^M=9\tex_relax:D
    \tex_catcode:D `\^^I=9\tex_relax:D
    \tex_catcode:D `\~=10\tex_relax:D
%<!initex>    \tex_catcode:D `\@=11\tex_relax:D % For LaTeX2e
    \tex_catcode:D `\_=11\tex_relax:D
    \tex_catcode:D `\:=11\tex_relax:D}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\CodeStop{
    \tex_catcode:D `\ =10\tex_relax:D
    \tex_catcode:D `\^^M=5\tex_relax:D
    \tex_catcode:D `\^^I=10\tex_relax:D
    \tex_catcode:D `\~=13\tex_relax:D
%<!initex>    \tex_catcode:D `\@=12\tex_relax:D  % For LaTeX2e
    \tex_catcode:D `\_=8\tex_relax:D
    \tex_catcode:D `\:=12\tex_relax:D}
%</initex|package>
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  
% Finally some corrections in the case we are running over \LaTeXe.
%
% A few of the `primitives' assigned above have already been stolen
% by \LaTeX, so assign them by hand to the saved real primitive.
%    \begin{macrocode}
%<*package>
\tex_let:D\tex_input:D        \@@input
\tex_let:D\tex_underline:D    \@@underline
\tex_let:D\tex_end:D          \@@end
\tex_let:D\tex_everymath:D    \frozen@everymath
\tex_let:D\tex_everydisplay:D \frozen@everydisplay
\tex_let:D\tex_italiccor:D    \@@italiccorr
\tex_let:D\tex_hyphen:D       \@@hyph
%    \end{macrocode}
%
% \TeX\ has a nasty habit of inserting a command with the name |\par|
% so we had better make sure that that command at least has a definition.
%    \begin{macrocode}
\tex_let:D\par          \tex_par:D
%    \end{macrocode}
%
% As mentioned above, The \LaTeXe\ package mechanism will insert some code
% to handle the filename stack, and reset the package options, this
% code will die if the \TeX\ primitives have gone, so skip past it
% and insert some equivalent code that will work.
%
% First a version of |\ProvidesPackage| that can cope.
%    \begin{macrocode}
\tex_def:D\ProvidesPackage{
  \tex_begingroup:D
  \CodeStop
  \package_provides:w}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\package_provides:w#1#2[#3]{
  \tex_endgroup:D
  \tex_immediate:D\tex_write:D-1{Package: #1#2 #3}
  \tex_expandafter:D\tex_xdef:D
    \tex_csname:D ver@#1.sty\tex_endcsname:D{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_ifx:D\name_undefine:N\@gobble
%    \end{macrocode}
%
% Normally just set the catcodes, and let \LaTeXe\ handle the
% package stack. If \LaTeXe\ resets @ reset the white space as well. 
%    \begin{macrocode}
  \tex_def:D\name_pop_stack:w{}
  \g@addto@macro\@popfilename{%
    \tex_ifnum:D12=\tex_the:D\tex_catcode:D`@
      \CodeStop
    \tex_fi:D}
  \g@addto@macro\@pushfilename{\CodeStart}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_else:D
%    \end{macrocode}
%
% But if traditional \TeX\ code is disabled, do this\ldots
%
% In this case the catcode preserving stack is not maintained and 
% |\CodeStart| conventions stay in force once on. You'll need
% to turn then off explicitky with |\CodeStop| (although as currently
% built on 2e, nothing except very experimental code will run in
% this mode!) Also note that |\RequirePackage| is a simple definition, just for
% one file, with no options.
%    \begin{macrocode}
\tex_def:D\name_pop_stack:w#1\relax{%
  \CodeStop
  \tex_expandafter:D\@p@pfilename\@currnamestack\@nil
  \tex_let:D\default@ds\@unknownoptionerror
  \tex_global:D\tex_let:D\ds@\@empty
  \tex_global:D\tex_let:D\@declaredoptions\@empty}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\@p@pfilename#1#2#3#4\@nil{%
  \tex_gdef:D\@currname{#1}%
  \tex_gdef:D\@currext{#2}%
  \tex_catcode:D`\@#3%
  \tex_gdef:D\@currnamestack{#4}}
%    \end{macrocode}
%
%    \begin{macrocode}
  \tex_def:D\NeedsTeXFormat#1{}
  \tex_def:D\RequirePackage#1{
      \tex_expandafter:D\tex_ifx:D
        \tex_csname:D ver@#1.sty\tex_endcsname:D\tex_relax:D
          \CodeStart
          \tex_input:D#1.sty\tex_relax:D
       \tex_fi:D}
\tex_fi:D
%    \end{macrocode}
%
% The |\futurelet| just forces the special end of file marker to vanish,
% so the argument of |\name_pop_stack:w| does not cause an end-of-file
% error. (Normally I use |\expandafter| for this trick, but here the next
% token is in fact |\let| and that may be undefined.)
%    \begin{macrocode}
\tex_futurelet:D\name_tmp:\name_pop_stack:w
%</package>
%    \end{macrocode}
%
