* Expandable \doifelse tests
@ 2017-05-21 8:14 Henri Menke
2017-05-21 8:21 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Henri Menke @ 2017-05-21 8:14 UTC (permalink / raw)
To: mailing list for ConTeXt users
Dear list,
Motivated by this question on TeX.SX https://tex.stackexchange.com/questions/370868 I was fiddling around with the \doifelse conditionals. I noticed that most of them are not expandable, which makes it very difficult to concatenate them. Here a simple example
\starttext
\doifelse{a}{%
\doifelse{x}{x}{a}{b}% <- evaluates to "a" but not expandable
}{yes}{no}
\stoptext
This outputs "no" even though "a" is equal to "a".
Would it be possible to substitute these conditionals by expandable ones? I would volunteer to help make them expandable.
Cheers, Henri
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Expandable \doifelse tests
2017-05-21 8:14 Expandable \doifelse tests Henri Menke
@ 2017-05-21 8:21 ` Wolfgang Schuster
2017-09-08 14:33 ` Meer, Hans van der
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2017-05-21 8:21 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1286 bytes --]
\starttext
\expdoifelse{a}{\expdoifelse{x}{x}{a}{b}}
{yes}
{no}
\stoptext
Wolfgang
> Henri Menke <mailto:henrimenke@gmail.com>
> 21. Mai 2017 um 10:14
> Dear list,
>
> Motivated by this question on TeX.SX
> https://tex.stackexchange.com/questions/370868 I was fiddling around
> with the \doifelse conditionals. I noticed that most of them are not
> expandable, which makes it very difficult to concatenate them. Here a
> simple example
>
> \starttext
>
> \doifelse{a}{%
> \doifelse{x}{x}{a}{b}% <- evaluates to "a" but not expandable
> }{yes}{no}
>
> \stoptext
>
> This outputs "no" even though "a" is equal to "a".
>
> Would it be possible to substitute these conditionals by expandable
> ones? I would volunteer to help make them expandable.
>
> Cheers, Henri
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry
> to the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 2906 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Expandable \doifelse tests
2017-05-21 8:21 ` Wolfgang Schuster
@ 2017-09-08 14:33 ` Meer, Hans van der
0 siblings, 0 replies; 3+ messages in thread
From: Meer, Hans van der @ 2017-09-08 14:33 UTC (permalink / raw)
To: NTG ConTeXt
[-- Attachment #1.1: Type: text/plain, Size: 2485 bytes --]
While going through the posts I had stowed away because I found them interesting, I came along this one.
There is not a problem here, just a tiny observation.
In order to work
\doifelse{a}{\doifelse{x}{x}{a}{b}}{yes}{no}
properly it is sufficient that the inner \doifelse is of the expandable kind.
Thus
\doifelse{a}{\expdoifelse{x}{x}{a}{b}}{yes}{no}
yields the same as
\expdoifelse{a}{\expdoifelse{x}{x}{a}{b}}{yes}{no}
Hans van der Meer
On 21 May 2017, at 10:21, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>> wrote:
\starttext
\expdoifelse{a}{\expdoifelse{x}{x}{a}{b}}
{yes}
{no}
\stoptext
Wolfgang
Henri Menke<mailto:henrimenke@gmail.com>
21. Mai 2017 um 10:14
Dear list,
Motivated by this question on TeX.SX https://tex.stackexchange.com/questions/370868 I was fiddling around with the \doifelse conditionals. I noticed that most of them are not expandable, which makes it very difficult to concatenate them. Here a simple example
\starttext
\doifelse{a}{%
\doifelse{x}{x}{a}{b}% <- evaluates to "a" but not expandable
}{yes}{no}
\stoptext
This outputs "no" even though "a" is equal to "a".
Would it be possible to substitute these conditionals by expandable ones? I would volunteer to help make them expandable.
Cheers, Henri
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://context.aanhet.net<http://context.aanhet.net/>
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 5677 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-08 14:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-21 8:14 Expandable \doifelse tests Henri Menke
2017-05-21 8:21 ` Wolfgang Schuster
2017-09-08 14:33 ` Meer, Hans van der
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).