Reorganize things in l3fp-extras.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4182 de43f980-851b-0410-b2f7-c40aca1f87e0
Make variable declaration more robust in l3fp-extras


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4183 de43f980-851b-0410-b2f7-c40aca1f87e0
Add support for defining functions in l3fp-extras.

For instance,

    \fp_set_function:nnn { sqrt } { x } { x**.5 }

defines sqrt(x) to evaluate to x**.5.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4184 de43f980-851b-0410-b2f7-c40aca1f87e0
Fix issue with \tl_tail:n and associated changes

As shown up by issue #104 and issue #107, the old definition of \tl_tail:n
was problematic as it stripped braces from the output if there was exactly one
braced item in the 'tail'. The fix here means that tail is always left exactly
as-is by \tl_tail:n. The documentation now reflects that.

As a result of the change, xparse can now use \tl_tail:n reliably, allowing
the slightly awkward code we had there to be removed once again. At the
same time, \tl_tail:w is defected and cannot be fixed (more than one expansion
will always be required). It is therefore deprecated: announcement to LaTeX-L
upcoming.

While \tl_head:n always strips braces, the old definition did not always behave
correctly with \q_stop in the input. The new definition here should be robust
against any reasonable input: you only get an issue if you deliberately
use two @ tokens with appropriate catcodes followed by \q_stop, which seems
acceptable.

Some of the documentation has been tightened up a little, so that hopefully
we can ues 'item' clearly to describe the behaviour not only of
\tl_(head|tail):n but also of other functions in l3tl.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4185 de43f980-851b-0410-b2f7-c40aca1f87e0
Add support for comparisons with in l3fp-extras.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4186 de43f980-851b-0410-b2f7-c40aca1f87e0
Remove now irrelevant comment from l3fp-parse.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4187 de43f980-851b-0410-b2f7-c40aca1f87e0
Consolidate l3tl documentation with respect to spaces

I've tried to make the documentation of all functions
as consistent as I could.  All should be 100% precise
about what the function does to explicit spaces; in the
same pass I've also made more precise the description
of what the \tl_if_in-like functions accept.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4188 de43f980-851b-0410-b2f7-c40aca1f87e0
Document three primitives whose argument must be braced

As currently implemented, the arguments of \tl_lowercase:n,
\tl_uppercase:n, and \tl_show:n must be within braces.
Also in this commit, some end-of-line white space is removed.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4189 de43f980-851b-0410-b2f7-c40aca1f87e0
Typo "lead low-level" => "lead to low-level"


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4190 de43f980-851b-0410-b2f7-c40aca1f87e0
Minor documentation change about \c_job_name_tl.

The documentation stated that \c_job_name_tl is the TeX
primitive \tex_jobname:D, but it is in fact a copy,
because the primitive is not a token list.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4191 de43f980-851b-0410-b2f7-c40aca1f87e0
Move definition of \c_empty_tl.

This does not need to be defined until \tl_new:N is used,
so the definition can be moved close to \c_job_name_tl and
\c_space_tl.  Also order the constants alphabetically in
the documentation.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4192 de43f980-851b-0410-b2f7-c40aca1f87e0
Typo in list of variants


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4193 de43f980-851b-0410-b2f7-c40aca1f87e0
Fix \c_job_name_tl in format mode

When creating a format, the jobname needs to be set using \tex_everyjob:D.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4194 de43f980-851b-0410-b2f7-c40aca1f87e0
Move LuaTeX-only jobname rewriting so it's only processed by LuaTeX

As Bruno points out, this code does not need to be in \tex_everyjob:D
unless LuaTeX is in use. The work is done before setting \c_job_name_tl
as LuaTeX allows us to actually alter the primitive itself.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4195 de43f980-851b-0410-b2f7-c40aca1f87e0
Updaet \tl_head:n again

This uses the approach from http://tex.stackexchange.com/a/69968, with some
modification to increase efficiency. This defintion does not forbid any
tokens in the string, and does not rely on any marker at all. It also does
not require a loop to remove the remaining tokens.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4196 de43f980-851b-0410-b2f7-c40aca1f87e0
Update docs to reflect change in \tl_head:n

As it stands, this is only x-type expandable: document this while waiting to
see what rest of team make of this approach.

Drop one auxiliary which did not actually do anything useful.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4197 de43f980-851b-0410-b2f7-c40aca1f87e0
Add f-type expansions tests for \tl_head:n/\tl_tail:n

These tests fail with l3tl.dtx 'as is', as the current defintion is not
f-type expandable. They all pass with a version of \tl_head:n proposed by
Bruno:

    \cs_new:Npn \tl_head:n #1
      {
        \etex_unexpanded:D
          \if_false: { \fi: \__tl_head_aux:nw #1 {} \q_stop }
      }
    \cs_new:Npn \__tl_head_aux:nw #1#2 \q_stop
      {
        \exp_after:wN \__tl_head_auxii:n \exp_after:wN { \if_false: } \fi: {#1}
      }
    \cs_new:Npn \__tl_head_auxii:n #1
      {
        \tl_if_empty:oTF { \use_none:n #1 }
          { #1 }
          { \if_false: { \fi: \__tl_head_aux:nw #1 } }
      }

and all of the f-type tests (but not the \q_stop tests) pass with 

    \cs_new:Npn \tl_head:n #1
      { \etex_unexpanded:D \exp_after:wN { \tl_head:w #1 { } \q_stop } }

(the 'original' version).

(Untested, but they should also pass with David's idea 
http://tex.stackexchange.com/a/69877, which is a loop-based approach and so
rather slow.)


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4198 de43f980-851b-0410-b2f7-c40aca1f87e0
Tighten up documentation for \tl_head:w

By adding a brace group, the need for a test for 'blankness' can be avoided,
so this should be mentioned explicitly.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4199 de43f980-851b-0410-b2f7-c40aca1f87e0
Switch \tl_head:n back to the simple defintion

As suggested by Bruno, use this (unchanged from the last release) so we
can update CTAN. Then decide what is best to do about \tl_head:n.

\tl_tail:w is deprecated and this needs to be notified.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4200 de43f980-851b-0410-b2f7-c40aca1f87e0
Fix a typo in l3tl

Also update the info about how many pages there are in source3.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4201 de43f980-851b-0410-b2f7-c40aca1f87e0