On Mon, 12 Mar 2018, Sven Schreiber wrote:
Am 12.03.2018 um 16:44 schrieb Allin Cottrell:
> On Mon, 12 Mar 2018, Sven Schreiber wrote:
>>> Yes, I think that s the conclusion we’ve reached as well. And because
>>> it was undocumented “if foo” will also be banned after the respective
>>> function packages (mine, perhaps Oleh’s?) have been adjusted. At
>>> least that’s my interpretation of the discussion.
>
> Hmm, I've just added a compile-time switch in genmain.c, STR_AS_BOOL,
> whereby one can turn off interpretation of strings as boolean values. In
> my working copy I've flipped this switch and run all my tests (all
> addons, all function packages, numerous test scripts gathered over the
> years), and I'm not seeing any failures.
>
> Are we sure that strings are used as booleans in any packages? If so,
> could you give me an example? (It may be that there's some "backdoor"
> way a string could get taken as a boolean that has escaped my notice and
> has not really been turned off.)
As it happens, I checked earlier today and (only) found a usage in
Artur's and my FEP 2.1 in the function GUI_FEP. This is likely not
triggered by the example script (due to being the GUI function).
Ah, good, getting rid of strings-as-booleans shouldn't be too
painful then. I've found lots of tests involving strstr in
StrucBreak, cointARDL, PTconf, ADMBP, johansensmall, a_eff,
margeff_el, FEP, waldTest and lagreg. But in almost all cases the
usage is one or other of
if strstr(s1, s2) != ""
if strlen(strstr(s1, s2))
(which can now be accomplished in git via instring(s1, s2)). As you
say the FEP GUI seems to be the only exception.
Allin