There is a bug in assert. when placed inside a control structure
without an argument, it does not signal a control error as expected
but instead segfaults.

   9!:14''
j701/beta/2010-11-24/22:45

   3 : 'assert.'
|control error
|   [0]assert.
|       3 :'assert.'

   3 : 'if. 1 do. assert. end.'
Segmentation fault

   3 : 'if. assert. do. 2 end.'
Segmentation fault

-

The definition of 5!:7 differs from the dictionary's documented
version. Compare it with the output from
http://www.jsoftware.com/help/dictionary/dx005.htm

    perm=: 3 : 0
z=. i.1 0
for. i.y do. z=.,/(0,.1+z){"2 1\:"1=i.>:{:$z end.
)

+-+---------+-------------------------------+
|0|1 65535 0|z=.i.1 0                       |
+-+---------+-------------------------------+
|1|17 2 1   |for.                           |
+-+---------+-------------------------------+
|2|2 65535 1|i.y                            |
+-+---------+-------------------------------+
|3|18 6 1   |do.                            |
+-+---------+-------------------------------+
|4|1 65535 1|z=.,/(0,.1+z){"2 1\:"1=i.>:{:$z|
+-+---------+-------------------------------+
|5|6 3 1    |end.                           |
+-+---------+-------------------------------+

System information:

$ uname -srvm
Linux 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC 2010 x86_64
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to