* bug in \doifinset
@ 2020-05-27 20:31 Pablo Rodriguez
2020-05-27 20:39 ` Wolfgang Schuster
0 siblings, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2020-05-27 20:31 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Hans,
the following sample:
\starttext
\startTEXpage[offset=1em]
\doifinsetelse{i7}{i4, i5, i7}
{yes}{no}
\stopTEXpage
\stoptext
outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest
from 2020.05.25 23:39.
I think this may be a bug, since the sample above would only get "yes"
with { i7}.
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 20:31 bug in \doifinset Pablo Rodriguez
@ 2020-05-27 20:39 ` Wolfgang Schuster
2020-05-27 21:28 ` Pablo Rodriguez
2020-05-27 22:23 ` Hans Hagen
0 siblings, 2 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2020-05-27 20:39 UTC (permalink / raw)
To: mailing list for ConTeXt users, Pablo Rodriguez
Pablo Rodriguez schrieb am 27.05.2020 um 22:31:
> Hi Hans,
>
> the following sample:
>
> \starttext
> \startTEXpage[offset=1em]
> \doifinsetelse{i7}{i4, i5, i7}
> {yes}{no}
> \stopTEXpage
> \stoptext
>
> outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest
> from 2020.05.25 23:39.
>
> I think this may be a bug, since the sample above would only get "yes"
> with { i7}.
No spaces are allowed in these lists. Older versions of the command
removed the spaces before the entries but the current version is stricter.
Wolfgang
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 20:39 ` Wolfgang Schuster
@ 2020-05-27 21:28 ` Pablo Rodriguez
2020-05-27 21:58 ` luigi scarso
2020-05-27 22:17 ` Wolfgang Schuster
2020-05-27 22:23 ` Hans Hagen
1 sibling, 2 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2020-05-27 21:28 UTC (permalink / raw)
To: ntg-context
On 5/27/20 10:39 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 27.05.2020 um 22:31:
>> [...]
>> I think this may be a bug, since the sample above would only get "yes"
>> with { i7}.
> No spaces are allowed in these lists. Older versions of the command
> removed the spaces before the entries but the current version is stricter.
Many thanks for your reply, Wolfgang.
Without commas, lists are harder both to read and to write (at least, to
me).
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 21:28 ` Pablo Rodriguez
@ 2020-05-27 21:58 ` luigi scarso
2020-05-28 19:08 ` Pablo Rodriguez
2020-05-27 22:17 ` Wolfgang Schuster
1 sibling, 1 reply; 8+ messages in thread
From: luigi scarso @ 2020-05-27 21:58 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 320 bytes --]
On Wed, May 27, 2020 at 11:28 PM Pablo Rodriguez <oinos@gmx.es> wrote:
>
> Without commas, lists are harder both to read and to write (at least, to
> me).
>
>
what about
\starttext
\startTEXpage[offset=1em]
\doifinsetelse{i7}{%
i4,%
i5,%
i7,%
}
{yes}{no}
\stopTEXpage
\stoptext
here seems to work.
--
luigi
[-- Attachment #1.2: Type: text/html, Size: 801 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 21:28 ` Pablo Rodriguez
2020-05-27 21:58 ` luigi scarso
@ 2020-05-27 22:17 ` Wolfgang Schuster
1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2020-05-27 22:17 UTC (permalink / raw)
To: mailing list for ConTeXt users
Pablo Rodriguez schrieb am 27.05.2020 um 23:28:
> On 5/27/20 10:39 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez schrieb am 27.05.2020 um 22:31:
>>> [...]
>>> I think this may be a bug, since the sample above would only get "yes"
>>> with { i7}.
>> No spaces are allowed in these lists. Older versions of the command
>> removed the spaces before the entries but the current version is stricter.
>
> Many thanks for your reply, Wolfgang.
>
> Without commas, lists are harder both to read and to write (at least, to
> me).
The \doifinset etc. commands are used for internal checks when a key
accepts multiple values with the same result and none of the existing
mechanism has a space after the comma. As a result of this I saw no
problem with this limitation and without a more detailed example from
you there is no reason to change this.
As Luigi already has shown there are ways to format your code in a way
to create readable lists, below is another one but in the end it depends
on your use case.
%%%% begin example
\starttext
\startsetups [check]
\doifelseinset
{
i7
}
{
i4,
i5,
i7,
}
{yes}
{no}
\stopsetups
\directsetup{check}
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 20:39 ` Wolfgang Schuster
2020-05-27 21:28 ` Pablo Rodriguez
@ 2020-05-27 22:23 ` Hans Hagen
2020-05-28 19:12 ` Pablo Rodriguez
1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2020-05-27 22:23 UTC (permalink / raw)
To: mailing list for ConTeXt users, Wolfgang Schuster
On 5/27/2020 10:39 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 27.05.2020 um 22:31:
>> Hi Hans,
>>
>> the following sample:
>>
>> \starttext
>> \startTEXpage[offset=1em]
>> \doifinsetelse{i7}{i4, i5, i7}
>> {yes}{no}
>> \stopTEXpage
>> \stoptext
>>
>> outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest
>> from 2020.05.25 23:39.
>>
>> I think this may be a bug, since the sample above would only get "yes"
>> with { i7}.
> No spaces are allowed in these lists. Older versions of the command
> removed the spaces before the entries but the current version is stricter.
we can use the old one, so only the raw variants then ignore the space;
best to be downward compatible, even if this was never the formal spec
(more a side effect)
it's only 20% slower and internally we we often use the raw one
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 21:58 ` luigi scarso
@ 2020-05-28 19:08 ` Pablo Rodriguez
0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2020-05-28 19:08 UTC (permalink / raw)
To: ntg-context
On 5/27/20 11:58 PM, luigi scarso wrote:
>> On Wed, May 27, 2020 at 11:28 PM Pablo Rodriguez wrote:
>> Without commas, lists are harder both to read and to write (at least, to me).
>
> what about
>
> \starttext
> \startTEXpage[offset=1em]
> \doifinsetelse{i7}{%
> i4,%
> i5,%
> i7,%
> }
> {yes}{no}
> \stopTEXpage
> \stoptext
>
> here seems to work.
Many thanks for your reply, Luigi.
This is a better approach for me.
Many thanks for help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 8+ messages in thread
* Re: bug in \doifinset
2020-05-27 22:23 ` Hans Hagen
@ 2020-05-28 19:12 ` Pablo Rodriguez
0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2020-05-28 19:12 UTC (permalink / raw)
To: ntg-context
On 5/28/20 12:23 AM, Hans Hagen wrote:
> On 5/27/2020 10:39 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez schrieb am 27.05.2020 um 22:31:
>>> [...]
>>> I think this may be a bug, since the sample above would only get "yes"
>>> with { i7}.
>>
>> No spaces are allowed in these lists. Older versions of the command
>> removed the spaces before the entries but the current version is stricter.
>
> we can use the old one, so only the raw variants then ignore the space;
> best to be downward compatible, even if this was never the formal spec
> (more a side effect)
Just in case it might be relevant.
I have been using \doifinsetelse for two months now.
Backwards compatibility is not an issue for me (after Luigi provided a
better approach to the issue)
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 8+ messages in thread
end of thread, other threads:[~2020-05-28 19:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 20:31 bug in \doifinset Pablo Rodriguez
2020-05-27 20:39 ` Wolfgang Schuster
2020-05-27 21:28 ` Pablo Rodriguez
2020-05-27 21:58 ` luigi scarso
2020-05-28 19:08 ` Pablo Rodriguez
2020-05-27 22:17 ` Wolfgang Schuster
2020-05-27 22:23 ` Hans Hagen
2020-05-28 19:12 ` Pablo Rodriguez
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).