-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add \tl_lowercase:nn
and deprecate (non-expandable) \tl_to_lowercase:n
#141
Comments
I'm reasonably happy with this, provided we feel that requiring understanding of TeX's case-changing stuff is OK. I suspect that this is the realistic position: Will's earlier attempt as I'm also keen we do provide some form of expandable case-change, even if we know it's very slow, as this is something that people want to be able to do and we do have the code. |
I don't think that we can abstract away TeX's case changing, unless we set all lccodes or all uccodes to 0, except those requested by users. What are lc and uc codes used for in TeX, apart from On naming, would you be happier with |
I'd sort of forgotten the exact syntax for I don't know about "did not really work" — it was an abstraction but the question would be whether it was useful. Can probably argue this style of programming doesn't much belong in expl3, but to me it falls into the same grey zone as
|
To be clear, by 'did not really work' I meant in terms of a fit with I'd like to move on @blefloch's suggestion if we are all agreed: |
I've added some code: see the comments there. May be worth raising on LaTeX-L. |
I wonder if we might actually be better if the first argument is a mapping \tl_lowercase:nn { { `\A } { `\A } { `\B } { `\c } } { <stuff> } but then this has the issue that there are different ways of giving a charcode and if you go with the above you can only accept one (presumably as I've done above by number). Longer-term, the above might suggest we don't need `\char_set_lccode:n`, etc., at all, but I'm wary of that as there is an interaction between lccode/uccode and for example end-of-sentence spacing. Thoughts on all of this most welcome! git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4478 de43f980-851b-0410-b2f7-c40aca1f87e0
(Oops, wall of text ahead.) I think we need to think about why we need analogs of
I might be reducing the questions of uppercasing and lowercasing to very small special cases, and if so, correct me. My current impression, though, is that we need two functions: one to lowercase in a controlled way a string of characters, and one to produce weird tokens. It does not make sense to me to define such a function to define weird tokens with On the question of how to implement it, I've asked on TeX.sx to know when TeX uses each code. It may be possible to set uccodes to 0 during the whole TeX run, so that the function only has to apply the setup requested by the user. From Joseph's commit,
I am not sure whether to go with Will's version of
or with
or with one argument for character code changes and one for other setups,
or perhaps in such cases one should mix
None there, but with hyphenation, at least. See the TeX.sx question linked above for details if anyone answers. |
I like the thought process behind the different syntaxes here, and I agree with you that we're basically talking about two different things and we should design the syntax for these to be either appropriate to both or have two separate commands for the two separate ideas. I still lean towards a generic "setup" argument, since you never know what else you'll want to do in there, such as redefine macros or provide "local-only" definitions. If you wanted a shorthand for input char mapping, instead of
etc, a wrapper would be fairly tidy I guess:
|
My concern with a generic 'set up' is that you are then mixing stuff up. I can see an argument for this, as some effects are otherwise tricky to achieve, but do want to be sure that's what we are after. I'd agree with Bruno's analysis that there are distinct cases. Suggests to me that we shouldn't add anything new with 'lower/uppercase' in the name at the moment, so I'm going to back-out the additions. |
As discussed in issue #141, there are separate use cases for the primitives here, and it's likely we want to cover the 'odd category code' case with a name which reflects this. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4481 de43f980-851b-0410-b2f7-c40aca1f87e0
As agreed at TUG2015, do the deprecation and ask for real use cases looking forward. Talk to Ulrike Fischer. |
Progress update: most of the use cases will be removed from |
This was done a while ago. |
Contrarily to all
\<type>_to_<thing>
functions,\tl_to_lowercase:n
and\tl_to_uppercase:n
, wrappers around the corresponding TeX primitives, are not expandable. It would be better to provide\tl_lowercase:nn
, analogous to\tl_rescan:nn
, with a first argument to hold the setup.Later, we can deprecate
\tl_to_lowercase:n
, and even later, rename\tl_expandable_lowercase:n
to\tl_to_lowercase:n
. Similarly for upper case.The text was updated successfully, but these errors were encountered: