Use of noexpand in the implementation of TextOrMath for eTeXWhen to use edef, noexpand, and expandafter?Does noexpand have to be a primitive?Problem with nested noexpand and edefReplacement for unexpanded without eTeX extensionWhy do some arguments in a macro need to be preceded by noexpand?How to use noexpand in an edef?Why six noexpand in a row?How can I use noexpand and unexpanded without appending a space to the unexpanded tokens?How should I /protect this command for use in csname?ifx doesn't treat noexpand as relax

Why were 5.25" floppy drives cheaper than 8"?

Sums of two squares in arithmetic progressions

What Exploit Are These User Agents Trying to Use?

Why do I get negative height?

Unlock My Phone! February 2018

In the UK, is it possible to get a referendum by a court decision?

Which ISO should I use for the cleanest image?

Finitely generated matrix groups whose eigenvalues are all algebraic

Is this draw by repetition?

Did 'Cinema Songs' exist during Hiranyakshipu's time?

Do Iron Man suits sport waste management systems?

Can I hook these wires up to find the connection to a dead outlet?

Use of noexpand in the implementation of TextOrMath for eTeX

How can I prove that a state of equilibrium is unstable?

How can saying a song's name be a copyright violation?

Bullying boss launched a smear campaign and made me unemployable

How do conventional missiles fly?

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

Why is the sentence "Das ist eine Nase" correct?

What exactly is ineptocracy?

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Why are UK visa biometrics appointments suspended at USCIS Application Support Centers?

files created then deleted at every second in tmp directory



Use of noexpand in the implementation of TextOrMath for eTeX


When to use edef, noexpand, and expandafter?Does noexpand have to be a primitive?Problem with nested noexpand and edefReplacement for unexpanded without eTeX extensionWhy do some arguments in a macro need to be preceded by noexpand?How to use noexpand in an edef?Why six noexpand in a row?How can I use noexpand and unexpanded without appending a space to the unexpanded tokens?How should I /protect this command for use in csname?ifx doesn't treat noexpand as relax













4















In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question






















  • thanks I suppose we could change that:-)

    – David Carlisle
    2 hours ago











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    2 hours ago















4















In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question






















  • thanks I suppose we could change that:-)

    – David Carlisle
    2 hours ago











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    2 hours ago













4












4








4








In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question














In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!







macros expansion definition protected-macro






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









frougonfrougon

641611




641611












  • thanks I suppose we could change that:-)

    – David Carlisle
    2 hours ago











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    2 hours ago

















  • thanks I suppose we could change that:-)

    – David Carlisle
    2 hours ago











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    2 hours ago
















thanks I suppose we could change that:-)

– David Carlisle
2 hours ago





thanks I suppose we could change that:-)

– David Carlisle
2 hours ago













Many thanks for your insight into this, I was really puzzled!

– frougon
2 hours ago





Many thanks for your insight into this, I was really puzzled!

– frougon
2 hours ago










1 Answer
1






active

oldest

votes


















3














No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482829%2fuse-of-noexpand-in-the-implementation-of-textormath-for-etex%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






    share|improve this answer



























      3














      No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






      share|improve this answer

























        3












        3








        3







        No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






        share|improve this answer













        No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        David CarlisleDavid Carlisle

        497k4111441891




        497k4111441891



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482829%2fuse-of-noexpand-in-the-implementation-of-textormath-for-etex%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2