Deutsch English Français Italiano |
<0f492a94-b10c-4658-8d3f-303a785b1b76n@googlegroups.com> View for Bookmarking (what is this?) Look up another Usenet article |
X-Received: by 2002:a0c:f807:0:b0:66d:a22c:1dab with SMTP id r7-20020a0cf807000000b0066da22c1dabmr113888qvn.2.1698526795987; Sat, 28 Oct 2023 13:59:55 -0700 (PDT) X-Received: by 2002:a05:6870:4d02:b0:1dc:7909:91fa with SMTP id pn2-20020a0568704d0200b001dc790991famr4212191oab.2.1698526795726; Sat, 28 Oct 2023 13:59:55 -0700 (PDT) Path: ...!3.us.feeder.erje.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: fr.comp.text.tex Date: Sat, 28 Oct 2023 13:59:55 -0700 (PDT) In-Reply-To: <ugej1s$3v7g2$1@dont-email.me> Injection-Info: google-groups.googlegroups.com; posting-host=89.149.22.17; posting-account=dtL1OgoAAAABPdH-AXByPRqcqzbeD8au NNTP-Posting-Host: 89.149.22.17 References: <564ae975-a378-42f5-8048-691605fdeea5n@googlegroups.com> <ufs001$2dann$1@dont-email.me> <dca2cab4-21f2-4003-bccf-5da7a33dbc81n@googlegroups.com> <a9880a47-f6ea-4097-ad43-5044b830f49fn@googlegroups.com> <9b7345d6-74ba-4cad-9ca4-260737d96c3bn@googlegroups.com> <ugej1s$3v7g2$1@dont-email.me> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0f492a94-b10c-4658-8d3f-303a785b1b76n@googlegroups.com> Subject: Re: \advance\toks 41{...} From: Florent CHERVET <florestan.chervet@gmail.com> Injection-Date: Sat, 28 Oct 2023 20:59:55 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3754 Bytes: 4008 Lines: 58 Le samedi 14 octobre 2023 =C3=A0 19:27:28 UTC+2, Texboy a =C3=A9crit=C2=A0: > Le 13/10/2023 =C3=A0 15:13, G=C3=A9rard Lemenn a =C3=A9crit :=20 >=20 > >> Pour =C3=AAtre plus pr=C3=A9cis :=20 > >> \toks 0=3D\toks 10=20 > >>=20 > >> est ultra rapide, car alors \toks 0 pointe sur la m=C3=AAme chaine que= \toks 10=20 > >> Il n'y a pas de copie du contenu de \toks 10 dans \toks 0. > Ah ?=20 >=20 > \toks0=3D{A} \toks10=3D{B}=20 > \toks0=3D\toks10=20 > \toks10=3D{C}=20 > \showthe\toks0 % donne B et non pas C > > Et on a besoin d'un token auxilliaire pour stocker la chaine =C3=A0 ajo= uter.=20 > > % ------------------------------------------=20 > > \def\toks@advance {\expandafter \toks@adva \romannumeral-`\q }%=20 > > \def\toks@adva {\afterassignment \toks@advb \let\@let@token =3D}%=20 > > \def\toks@advb {\ifx \toks\@let@token \begingroup=20 > > \afterassignment\toks@advc \count@ =3D%=20 > > \else \afterassignment\toks@advd \toks@advtok \fi=20 > > }% \toks@advb=20 > > \def\toks@advc {\expandafter \endgroup \expandafter \toksdef \expandaft= er \@let@token \the\count@=20 > > \afterassignment\toks@advd \toks@advtok=20 > > }% \toks@advc=20 > > \def\toks@advd {\@let@token =3D\expandafter {\the\expandafter\@let@toke= n \the\toks@advtok }}%=20 > > % ------------------------------------------- > Oui. Pour le sucre syntaxique et faire la distinction entre=20 > \toks<nombre> et \<toksname>, on peut aussi utiliser \meaning et all=C3= =A9ger=20 > un peu le code. Ce qui, =C3=A0 mon avis, ne doit pas modifier de fa=C3=A7= on=20 > significative la vitesse d'ex=C3=A9cution (pas test=C3=A9)...=20 >=20 > \newtoks\tmptoks \newcount\tmpcount=20 > \def\toksadd{\expandafter\toksaddA\meaning}=20 > \expandafter\def\expandafter\toksaddA\string\toks{\afterassignment\toksad= dB\tmpcount}=20 > \def\toksaddB{\afterassignment\toksaddC\tmptoks=3D }=20 > \def\toksaddC{\toks\tmpcount\expandafter{\the\toks\expandafter\tmpcount\t= he\tmptoks}} Mon code marcherait m=C3=AAme si on =C3=A9crit : \toks@advance \macro o=C3=B9 \macro commence par : \toks@ Alors que votre code non. Mais on peut bien s=C3=BBr passer par \meaning si on veut, mais il faut le \romannumeral-`\q avant de s'occuper du \meaning. Donc en fait, hormis \global impossible, mon code s'approche le plus de la = syntaxe de TeX. Bref, bon weekend !