LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Philipp Stephani <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 15 Feb 2010 01:05:36 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (113 lines)
Hello,

some more mostly arbitrary suggestions that I noticed during programming with expl3:

- the scratch variables have already been mentioned in another thread. I think that a few scratch variables guaranteed not to be touched by the kernel are useful, if combined with a warning like "The kernel defines the following scratch variables: ... They are guaranteed to never be used by the kernel. However, calling other packages' macros might affect them since they are shared by all packages. So you must not rely on these variables being unaltered when calling macros that are not defined by the kernel. In the latter case, use your own private variables. As an example, a package `foo' might define private scratch variables `\l_foo_tmpa_tl' and so on."

- Critical errors: This class of messages lies between errors and fatal errors. They cause the closing of the current input file "at the next moment possible", but don't halt the whole LaTeX run. Errors of this kind (with \endinput) are actually quite common, see the other thread for statistics.

- maybe some wrappers around LaTeX-2 conditionals, but that is syntactic sugar

- a generalized command checking framework similar to \CheckCommand that works with arbitrary parameter texts and prefixes and can issue messages of arbitrary classes

- key-value option processing with l3keys

- a string datatype

- dedicated stack and queue datatypes that hide their implementation

- \exp_arg_unbraced:No === \exp_after:wN

- \c_job_name_tl contains the token \tex_jobname:D, not the job name

- stack pop operations for every possible combination of local/global stack manipulation and assignment

- a local \undefine

- the code from memoir.dtx, l. 16880-16933:
\cs_new:Nn \maybe_noalign:n {
  \intexpr_compare:nNnTF { \etex_currentgrouptype:D } = { \c_six } {
    \mode_if_vertical:TF {
      \tex_noalign:D { #1 }
    } {
      #1
    }
  } {
    #1
  }
}
(to define macros that can be used between \cr and \noalign)

- while I'm reading the code above: perhaps also constants for the \currentgrouptype, \lastnodetype etc., as in etex.sty

%% Declare names for `grouptypes'

\int_const:Nn \c_group_bottomlevel { 0 } % for the outside world
\int_const:Nn \c_group_simple { 1 } % for local structure only
\int_const:Nn \c_group_hbox { 2 } % for `\hbox{}'
\int_const:Nn \c_group_adjustedhbox { 3 } % for `\hbox{}' in vertical mode
\int_const:Nn \c_group_vbox { 4 } % for `\vbox{}'
\int_const:Nn \c_group_vtop { 5 } % for `\vtop{}'
\int_const:Nn \c_group_align { 6 } % for `\halign{}', `\valign{}'
\int_const:Nn \c_group_noalign { 7 } % for `\noalign{}'
\int_const:Nn \c_group_output { 8 } % for output routine
\int_const:Nn \c_group_math { 9 } % for, e.g, `^{}'
\int_const:Nn \c_group_disc { 10 } % for `\discretionary{}{}{}'
\int_const:Nn \c_group_insert { 11 } % for `\insert{}', `\vadjust{}'
\int_const:Nn \c_group_vcenter { 12 } % for `\vcenter{}'
\int_const:Nn \c_group_mathchoice { 13 } % for `\mathchoice{}{}{}{}'
\int_const:Nn \c_group_semisimple { 14 } % for `\begingroup...\endgroup'
\int_const:Nn \c_group_mathshift { 15 } % for `$...$'
\int_const:Nn \c_group_mathleft { 16 } % for `\left...\right'

\int_const:Nn \c_interaction_batch { 0 } % omits all stops and omits terminal output
\int_const:Nn \c_interaction_nonstop { 1 } % omits all stops
\int_const:Nn \c_interaction_scroll { 2 } % omits error stops
\int_const:Nn \c_interaction_errorstop { 3 } % stops at every opportunity to interact

%% Declare names for `nodetypes'

\int_const:Nn \c_node_char { 0 } % character nodes
\int_const:Nn \c_node_hlist { 1 } % hlist nodes
\int_const:Nn \c_node_vlist { 2 } % vlist nodes
\int_const:Nn \c_node_rule { 3 } % rule nodes
\int_const:Nn \c_node_ins { 4 } % insertion nodes
\int_const:Nn \c_node_mark { 5 } % a mark node
\int_const:Nn \c_node_adjust { 6 } % an adjust node
\int_const:Nn \c_node_ligature { 7 } % a ligature node
\int_const:Nn \c_node_disc { 8 } % a discretionary node
\int_const:Nn \c_node_whatsit { 9 } % special extension nodes
\int_const:Nn \c_node_math { 10 } % a math node
\int_const:Nn \c_node_glue { 11 } % node that points to a glue specification
\int_const:Nn \c_node_kern { 12 } % a kern node
\int_const:Nn \c_node_penalty { 13 } % a penalty node
\int_const:Nn \c_node_unset { 14 } % an unset node
\int_const:Nn \c_node_maths { 15 } % nodes that occur only in maths mode

%% Declare names for `iftypes'

\int_const:Nn \c_if_char { 1 } % \if
\int_const:Nn \c_if_cat { 2 } % \ifcat
\int_const:Nn \c_if_num { 3 } % \ifnum
\int_const:Nn \c_if_dim { 4 } % \ifdim
\int_const:Nn \c_if_odd { 5 } % \ifodd
\int_const:Nn \c_if_vmode { 6 } % \ifvmode
\int_const:Nn \c_if_hmode { 7 } % \ifhmode
\int_const:Nn \c_if_mmode { 8 } % \ifmmode
\int_const:Nn \c_if_inner { 9 } % \ifinner
\int_const:Nn \c_if_void { 10 } % \ifvoid
\int_const:Nn \c_if_hbox { 11 } % \ifhbox
\int_const:Nn \c_if_vbox { 12 } % \ifvbox
\int_const:Nn \c_if_x { 13 } % \ifx
\int_const:Nn \c_if_eof { 14 } % \ifeof
\int_const:Nn \c_if_true { 15 } % \iftrue
\int_const:Nn \c_if_false { 16 } % \iffalse
\int_const:Nn \c_if_case { 17 } % \ifcase
\int_const:Nn \c_if_defined { 18 } % \ifdefined
\int_const:Nn \c_if_csname { 19 } % \ifcsname
\int_const:Nn \c_if_fontchar { 20 } % \iffontchar

- \chk_if_free_cs, but with an arbitrary message class

Those are just some random ideas, but perhaps some of them are helpful.

ATOM RSS1 RSS2