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

\quark_if_recursion_tail_stop:n has edge cases #2

Closed
wspr opened this issue Mar 13, 2011 · 2 comments
Closed

\quark_if_recursion_tail_stop:n has edge cases #2

wspr opened this issue Mar 13, 2011 · 2 comments
Labels
bug Something isn't working

Comments

@wspr
Copy link
Contributor

wspr commented Mar 13, 2011

Bruno has submitted the following re-implementation of \quark_if_recursion_tail_stop:n for edge cases noted below.

% The `:n` quark tests are currently broken: both lines below crash.
%
%   \quark_if_recursion_tail_stop:n {{{{a}}}}
%   \quark_if_recursion_tail_stop:n {{ab\iffalse}\fi}
%
% Here is the proposed fix (changing of course `Mquark` to `quark`). FYI,
%     `\if_catcode:w A \tl_to_str:n {...} A` 
% tests whether {...} is empty. It is a variant of 
%     `\exp_after:wN \if_meaning:w \exp_after:wN A \tl_to_str:n {...} A`
% which is the version used for `\tl_if_empty:n(TF)`.

\cs_new:Npn \Mquark_if_recursion_tail_stop:n #1 {
  \if_catcode:w A \tl_to_str:n \exp_after:wN {
    \Mquark_if_recursion_tail_aux:w #1 \q_recursion_stop
                     \q_recursion_tail \q_recursion_stop \q_stop
  } A
  \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
  \fi:
}
\cs_new:Npn \Mquark_if_recursion_tail_stop_do:nn #1#2 {
  \if_catcode:w A \tl_to_str:n \exp_after:wN {
    \Mquark_if_recursion_tail_aux:w #1 \q_recursion_stop 
                     \q_recursion_tail \q_recursion_stop \q_stop
  } A
  \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw
  \else:
  \exp_after:wN\use_none:n
  \fi:
  {#2}
}
\cs_new:Npn \Mquark_if_recursion_tail_aux:w #1 \q_recursion_tail #2
     \q_recursion_stop #3 \q_stop { #1 #2 }
@blefloch
Copy link
Member

This issue should probably be closed now that the code is in the svn. For completeness, the quark tests proposed here do not differentiate between \q_recursion_tail, {}\q_recursion_tail, \q_recursion_tail{}, and {}\q_recursion_tail{}. In practical applications, this should not matter.

@wspr
Copy link
Contributor Author

wspr commented Apr 15, 2011

Thanks; I agree.

@wspr wspr closed this as completed Apr 15, 2011
wspr pushed a commit that referenced this issue May 15, 2011
(definition allows #2 to be "n" rather than "N")


git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@2372 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Feb 8, 2012
We are actually OK, as #2 is a tracking number which will be an explicit
integer, but 'good style' says we should keep the code clear. 


git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3346 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 Aug 8, 2012
  {{{a}}}
  {ab\iffalse}\fi

properly (fixes #2)


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2234 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
(definition allows #2 to be "n" rather than "N")


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2372 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Aug 8, 2012
We are actually OK, as #2 is a tracking number which will be an explicit
integer, but 'good style' says we should keep the code clear. 


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3346 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
This was referenced Aug 23, 2012
wspr pushed a commit that referenced this issue Jan 9, 2013
The T and F branches of \__prop_split:NnTF now receive
the various pieces of the prop as #1, #2, #3, rather than
as three brace groups.  This turns out to require less
auxiliaries, but more importantly, arguments are read one
time less, which leads to speed ups for large props (but
a slight slow down for small props).


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4423 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Jun 1, 2014
The documentation of \int_mod:nn didn't describe how the remainder
is found (in particular its sign for negative inputs).  Now it should
be clearer: the following invariant holds:
\int_mod:nn {#1} {#2} + \int_div_truncate:nn {#1} {#2} * (#2) == (#1)


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4966 de43f980-851b-0410-b2f7-c40aca1f87e0
@blefloch blefloch added the bug label Jul 25, 2014
wspr pushed a commit that referenced this issue Sep 6, 2014
…. spec.

Try for example

     \def\foo#1->#2{#1#2}
     \edef\foo{\token_get_prefix_spec:N \foo}
     \show\foo

This is probably not easily avoided, the same as for \token_get_arg_spec:N,
so just note that it can happen.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@5397 de43f980-851b-0410-b2f7-c40aca1f87e0
wspr pushed a commit that referenced this issue Feb 18, 2015
josephwright added a commit that referenced this issue Nov 8, 2015
For example

    \DeclareExpandableDocumentCommand\foo{d||m}
      {\showtokens{#1::#2}}

otherwise fails with

    \foo||{A}
josephwright pushed a commit that referenced this issue Feb 12, 2017
1. (luc: path/to/font.luc) -> (luc: [..]/font.luc)
2. when -H is used, print the diff directly.

The idea of #2 is that you're asking it to stop when coming to a problem, so it kind of makes sense to display that problem immediately. More pragmatically, I needed that to debug problems in remove installations where only l3build output was able to be queried (Travis CI in this case).

Happy to switch this behaviour to be optional if people prefer.
wspr referenced this issue Nov 17, 2017
an attempt to address #255 — more eyes needed, please :)
blefloch pushed a commit that referenced this issue Mar 30, 2018
In most drivers, the angle in \driver_box_use_rotate:Nn is allowed to
be an expression (because one needs its cosd and sind), so doing -#2
is unsafe; I changed to -(#2).  Perhaps l3fp could provide a function
that checks something is a decimal number and not an expression?
@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
josephwright added a commit that referenced this issue Oct 13, 2022
As the 'source' codepoint could be out of the ASCII range even
if the 'target' is not.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants