_. also does weird things as the x value for ".


NB. the following work as expected:

    _". '25'

25

     _". 'Haoussa'

_

     _". 'Gisir'

_

    _.".'Haoussa'

_.

   _.". 'GISIR'

_.

NB. but somehow this fails on some magic values:

   _.".'Gisir'

|NaN error

|  _.    ".'Gisir'
    _. ". 'gisir'

|NaN error

| _. ".'gisir'





(The original purpose is to find whether choices in a questionnaire pick-list 
should be construed as numbers or as strings. I prefer to use _. as the default 
value because I could vaguely consider using _ and __ as authorized values some 
day. But I will stick with __ this time round.)







De : Elijah Stone <elro...@elronnd.net>
À : programm...@jsoftware.com
Sujet : Re: [Jprogramming] bug: _. and logical operations
Date : 06/05/2022 13:15:01 Europe/Paris

_. may give garbage results. It shouldn't hang.

On Fri, 6 May 2022, Razetime wrote:

> Although this does not seem like intended behaviour, it is worth mentioning
> that NuVoc <https://code.jsoftware.com/wiki/Vocabulary/underdot> explicitly
> states that _. is not recommended for use in J computations.
>
> On Fri, May 6, 2022 at 4:30 PM <jph.but...@mailoo.org> wrote:
>
>> Hello,
>>
>>
>>
>> _. does not mix well with logical operators. The following hang and use a
>> lot of CPU on J 9.03 (Windows and Linux):
>>
>>
>>
>> 1 +. _.
>>
>> 1 *. _.
>>
>> +. / 8 0 _.
>>
>>
>>
>> Note, that I have no particular use for these sentences, I just stumbled
>> across them due to a bug in my program.
>>
>>
>>
>> Philip
>>
>>
>>
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to