ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: \jobname and \doifelse
Date: Sun, 6 Nov 2022 14:11:01 +0100	[thread overview]
Message-ID: <a8a40c70-bbae-d94d-1372-6d84acd98cb3@gmx.es> (raw)
In-Reply-To: <2eb6e285-c29d-d1e0-19f6-92bf8a7efce3@gmail.com>

On 11/5/22 16:55, Wolfgang Schuster via ntg-context wrote:
> Pablo Rodriguez via ntg-context schrieb am 05.11.2022 um 16:30:
>>
>>    \doifelse{\jobname}{a}
>>      {yes}{no}
>>
>> I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file.
>>
>> The TeX conditional used to work before.
>>
> Are you sure the check worked in the past?

Many thanks for your reply, Wolfgang.

I thought this used to work before.

Now I realize I have to check the use of \doif{\jobname} and
\doifelse{\jobname} in all my documents.

> The content of \jobname has catcode 12 while you "a" you check against 
> has catcode 11, and even when \jobname result in "a" they are different 
> because the catcodes differ.

I see now. Not that I fully understand what catcodes are, but
\doifsamestringelse should be what I have used here (as suggested in
https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions#.5Cdoifsamestringelse.2C.5Cdoifsamestring.2C.5Cdoifnotsamestring).

Just a final question: \doif compares both strings and catcodes and
\doifsamestring compares only strings. Or am I missing something here too.

Many thanks for your help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-11-06 13:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 15:30 Pablo Rodriguez via ntg-context
2022-11-05 15:55 ` Wolfgang Schuster via ntg-context
2022-11-06 13:11   ` Pablo Rodriguez via ntg-context [this message]
2022-11-06 10:21 ` Hans Hagen via ntg-context
2022-11-06 13:12   ` Pablo Rodriguez via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8a40c70-bbae-d94d-1372-6d84acd98cb3@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).