Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing escaped string chars #1

Closed
latex3 opened this issue Mar 13, 2011 · 4 comments
Closed

Missing escaped string chars #1

latex3 opened this issue Mar 13, 2011 · 4 comments
Labels
enhancement New feature or request

Comments

@latex3
Copy link
Collaborator

latex3 commented Mar 13, 2011

I think perhaps we should have a short list of constant escape characters such as LaTeX2e's \@backslashchar. E.g.,

\c_backslash_str
\c_percent_str
\c_lbrace_str
\c_rbrace_str

and so on. (I think ‘str’ is clearer than ‘char’ here but I could be wrong.)

(Issue by Will, written while logged into the wrong account.)

@phst
Copy link

phst commented Mar 14, 2011

Did you change the naming conventions? There is already \c_space_tl and I think this is more appropriate since they are token lists.

@wspr
Copy link
Contributor

wspr commented Mar 14, 2011

@phst: Oops, including space in that list was a mistake. The difference with _tl is that the ‘detokenized’ chars are inside. But _tl would work too; perhaps that'd be better, really.

@josephwright
Copy link
Member

We still are not really clear on what to do about 'strings', are we :-)

@wspr
Copy link
Contributor

wspr commented Mar 14, 2011

Maybe we should just define \% -> %₁₂, \# -> #₁₂, etc. Not entirely joking.

wspr pushed a commit that referenced this issue Apr 14, 2011
git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@2232 de43f980-851b-0410-b2f7-c40aca1f87e0
@wspr wspr closed this as completed in 2165428 Sep 6, 2011
wspr pushed a commit that referenced this issue Oct 23, 2011
Here, I can't find a real use case, but this ought to arise some day:

\dim_set:Nn \l_foo_dim
  { \token_if_dim_register:NTF #1 { #1 } { 0pt } }

and someone might (for some reason hidden in some deeply nested code)
give #1=\par. Far fetched, but better safe than sorry.



git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@2929 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Dec 22, 2011
The idea is similar to list comprehension in other languages:

    \seq_set_filter:NNn \l_A_seq \l_B_seq { \int_compare_p:n { #1 > 0 } }

copies in \l_A_seq all positive items of \l_B_seq. Similarly,

    \seq_set_map:NNn \l_A_seq \l_B_seq { \int_eval:n { #1 * #1 } }

stores in \l_A_seq the sequence of squares of items in \l_B_seq.



git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3085 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Jan 20, 2012
First argument: the file name.
Second argument: inline function receiving the line as #1.


git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3160 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Feb 10, 2012
Now \msg_new:nnnn follows the suit of
    \cs_new:Npn #1 -> \chk_if_free_cs:N #1 \cs_gset:Npn #1



git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3368 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue May 26, 2012
At first I was unsure whether #1 = intexpr, #2 = real
was a good enough syntax, but I think I'm happy with it.

git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3690 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Jun 23, 2012
I was using \dim_strip_pt:n { #1 pt } for all registers "#1".  This of 
course will fail for large integers.  The correct way is to apply 
"\the", then grab everything until the first "pt".

Incidentally, this won't fail with a toks register if it contains 
something sensible, but it will fail when \count, \dimen, etc are used 
with an explicit number.



git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3784 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
we want #1 to be executed at the literal very end

this might need some more analysis, but this is
okay for now

(I'm still undecided whether these mapping functions
should be made expandable. Is there a speed tradeoff?)

git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2187 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
\tl_put_right, etc., all give "#1 not defined"
errors so you don't need to use \_tl_if_exist:N
for them

git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2222 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
wspr pushed a commit that referenced this issue Aug 8, 2012
wspr pushed a commit that referenced this issue Aug 8, 2012
Here, I can't find a real use case, but this ought to arise some day:

\dim_set:Nn \l_foo_dim
  { \token_if_dim_register:NTF #1 { #1 } { 0pt } }

and someone might (for some reason hidden in some deeply nested code)
give #1=\par. Far fetched, but better safe than sorry.



git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2929 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
The idea is similar to list comprehension in other languages:

    \seq_set_filter:NNn \l_A_seq \l_B_seq { \int_compare_p:n { #1 > 0 } }

copies in \l_A_seq all positive items of \l_B_seq. Similarly,

    \seq_set_map:NNn \l_A_seq \l_B_seq { \int_eval:n { #1 * #1 } }

stores in \l_A_seq the sequence of squares of items in \l_B_seq.



git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3085 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
First argument: the file name.
Second argument: inline function receiving the line as #1.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3160 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
Now \msg_new:nnnn follows the suit of
    \cs_new:Npn #1 -> \chk_if_free_cs:N #1 \cs_gset:Npn #1



git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3368 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
At first I was unsure whether #1 = intexpr, #2 = real
was a good enough syntax, but I think I'm happy with it.

git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3690 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
I was using \dim_strip_pt:n { #1 pt } for all registers "#1".  This of 
course will fail for large integers.  The correct way is to apply 
"\the", then grab everything until the first "pt".

Incidentally, this won't fail with a toks register if it contains 
something sensible, but it will fail when \count, \dimen, etc are used 
with an explicit number.



git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3784 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
This will be needed for frames, but seems general enough that it should be
somewhere else. At some stage, a kern interface all seems to be required, perhaps
simply

  \cs_new_protected:Npn \kern:n #1
    { \tex_kern:D \__dim_eval:w #1 \dim_eval_end: }

which migh tgo along with rules and leaders somewhere.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4032 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 22, 2012
This alignment type inserts the filling between the
sign and the main part of the number.  It can be useful
when writing a message with a table of numbers.

    \cs_new:Npn \my_do:n #1
      { | \int_format:nn {#1} { 0 = + 5 } | \\ }
    \msg_new:nnn { my } { do }
      { \clist_map_function:nN {#1} \my_do:n }
    \msg_warning:nnn { my } { do }
      { 1 , 123 , -3263 }        


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4122 de43f980-851b-0410-b2f7-c40aca1f87e0
This was referenced Aug 23, 2012
@blefloch blefloch mentioned this issue Aug 11, 2020
bb010g added a commit to bb010g/latex3 that referenced this issue Oct 31, 2020
With variants \tl_map_function_unbraced:NN and
\tl_map_function_unbraced:cN.

Also implement \tl_map_function_unbraced:Nn.

These are basically the same as the \tl_map_function:Nn family, but
without latex3#1 receiving latex3#2 braced. Careful use of this macro allows for
cleanly mapping multi-argument functions.

TODO: The docs here are sucky, but I wrote this months ago and haven't
been LaTeXing enough to feel out better wording that isn't incorrect.
This is a useful macro, even if a bit awkward & subtle to describe.
@blefloch blefloch mentioned this issue Nov 8, 2021
blefloch added a commit that referenced this issue Oct 3, 2022
Previously, we produced \exp_not:N \token for an expandable \token,
which meant that o-expanding that would give a version of \token
temporarily set to \relax.  Thus, \exp_after:wN \if_meaning:w #1
would not match as expected.  Now we do
\__kernel_exp_not:w \exp_after:wN { \exp_not:N #1 }
to avoid that issue yet still deal with the possibility of outer
macros.
josephwright added a commit that referenced this issue Sep 9, 2023
This completes the set for N/c (#1), n/V/v/x (#2, #3). Additional variants (containing o/e) are provided only as far as they appear in TL'23 at present. This means a few unused variants are removed: they can be re-added if required.

We have never provided f-type variants here,
so none are added.
blefloch added a commit that referenced this issue May 11, 2024
At some point in the code the active character is taken as an argument
after being turned into a string, but a string space is simply skipped
when seeking macro arguments.  Now fixed by a trailing brace group
that gives an empty argument, and a trailing space that replaces the
argument in a followup \int_value:w `#1 ~ construction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants