Interval Index Domain Error

General APL language issues

Interval Index Domain Error

Postby paulmansour on Mon Jul 23, 2018 2:19 pm

So interval index gives a domain error when there are duplicates in the left argument:

      1 2 3 3 4 5⍸2.5 3.5 4.5
DOMAIN ERROR
1 2 3 3 4 5⍸2.5 3.5 4.5

We can write a little idiom for domain error free ( in case of dupes) interval index:
      1 2 3 3 4 5{u←∪⍺ ⋄ ⍺⍳u[u⍸⍵]}2.5 3.5 4.5
1 2 4

Which I had to do while writing a percentile ranking function.

Obviously it is no big deal to use this snippet when needed, but is there perhaps a case to eliminate the domain error in this case?
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm

Re: Interval Index Domain Error

Postby Jay|Dyalog on Mon Jul 30, 2018 8:04 am

Paul,

We've been discussing this recently and came to the same conclusion as you: Interval Index should work with empty intervals. This change will be implemented in version 18.0.

Jay.
Jay|Dyalog
 


Return to Language

Who is online

Users browsing this forum: hbarkhof and 1 guest