[Jprogramming] Selection question

John Randall randall at andromeda.rutgers.edu
Mon Jan 22 07:44:21 HKT 2007


David Vincent-Jones wrote:
> I had expected that m3 from the Phrases would have targeted '8' in the
> series based on the description rather than going to the data end.
>
>    m3=: i.<./ NB. IO first occurrence of minimum of y
>    [dat=:2*i.10
> 0 2 4 6 8 10 12 14 16 18
>    dat m3 6
> 3
>    dat m3 7
> 10
>
> Am I missing something?

m3 is intended to be used as a monad (that's what the m means).  If you
use it as a dyad, you are getting

x (i.<./) y ---> x i. (<./ y)

which is the index of the minimum of y in x.

Best wishes,

John



More information about the Programming mailing list