8000 improve the definition of `\__cdhh_parse_code:nN` by atxy-blip · Pull Request #26 · lvjr/codehigh · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

improve the definition of \__cdhh_parse_code:nN #26

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

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

atxy-blip
Copy link
Contributor

Many thanks for your kind reminder in #12 (comment)! I can't help but notice that the definition of \__cdhh_parse_code:nN which you mentioned is not efficient enough. With \cs_set_protected:Npn, the conditional is executed every time the function is called

> \__cdhh_parse_code:nN=\protected\long macro:#1#2->\legacy_if:nTF
{LuaTeX}{\__cdhh_parse_code_luatex:nN {#1}#2}{\__cdhh_parse_code_normal:nN
{#1}#2}.

However, after a single expansion by the o specifier, the result of the conditional is stored in the definition. For example, when I am using xelatex

> \__cdhh_parse_code:nN=\protected\long macro:->\__cdhh_parse_code_normal:nN .

By the way, I have also unified the \Legacy_ifs with L3 API ^^

8000
@lvjr lvjr merged commit 47377d4 into lvjr:main Mar 1, 2025
2 checks passed
@lvjr
Copy link
Owner
lvjr commented Mar 1, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0