LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 17 Jul 2015 15:05:52 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
On 17/07/2015 15:00, Alexander Grahn wrote:
> Joseph,
> 
> On Fri, Jul 17, 2015 at 12:09:27PM +0100, Joseph Wright wrote:
>> by
>>
>>    \bool_if:nTF
>>      {
>>        !\cs_if_exist:cTF {#1}
> really an `!' in front?
> 
>> by
>>
>>    \bool_if:nT
>>      {
>>        ! \cs_if_exist:NTF \fxocg@insert@OC
> same here.
> 
>> which could be redone as for the first case in media9. However,
>> reviewing the code I realise that as you have \use:c here you'll
>> actually get away with it (the second part will evaluate even if the
>> csname is undefined). If you do want a 'safe' change then
>>
>>    \bool_if:nTF
>>      {
>>        ! \cs_if_exist:cTF { OCGpdfobj#3 }
> same here.
> 
> Alexander

Indeed :-)

I've tried to offer a 'minimal change' version of your code. To do that,
I've using the fact that \bool_if:nTF works by expansion. So

    \bool_if:nTF
      {
         !\cs_if_exist:cTF {#1}
           ...
      }

will find the "!" then expand what follows looking ultimately for
\c_true_bool or \c_false_bool. In the usual set up with something like
\cs_if_exist_p:c we have a function that will expand to one of these
outcomes. With \cs_if_exist:cTF that's not automatically the case but we
can put the logical outcomes into the T/F branches (as I did) to force
the same result.
--
Joseph Wright

ATOM RSS1 RSS2