The rule on u;.0 is that the interval must start at a valid index, OR one past the last valid index IF the length is 0.

I don't think the use of ];.0 as an alternative to {. has ever been considered.

Your suggestion is reasonable and I will think about it.  If you put an entry into https://code.jsoftware.com/wiki/System/Interpreter/Requests that will ensure I don't forget.

(I have recently fixed a couple of sparse errors you reported earlier).

hhr

On 12/29/2018 9:02 PM, Igor Zhuravlov wrote:
A Cut (;.) is a convenient alternative to Take ({.) when there is a need to 
ignore overtake:

    4 {. i. 3
0 1 2 0
    4 ];.0 i. 3
0 1 2

But is Cut's behavior consistent?:

    2 ];.0 i. 2
0 1                 NB. ok
    2 ];.0 i. 1
0                   NB. ok
    2 ];.0 i. 0
|index error
| 2 ];.0 i.0

Shouldn't result be an empty list instead of error? However, the following 
works:

    0 ];.0 i. 0
                     NB. empty list, ok

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


---
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to