简体   繁体   English

数组x的索引n处的项目值的惯用J

[英]Idiomatic J for value of item at index n of array x

In the J language, what is the idiomatic word or phrase to return the value of the item at index n of array x? 在J语言中,返回数组x的索引n处的项目值的惯用词或短语是什么? The documentation for {:: seems concerned with boxed values, mentioning normal arrays as an afterthought. {::的文档似乎与装箱的值有关,将普通数组作为事后的想法。

    nth =: {:: NB. This is what I have found, but is there a better word?
    2 nth 5 12 73 23 89
73
    1 nth 3 3 $ i.9
3 4 5

You are looking for from ( { ). 您正在{ )寻找。 It returns item(s) from an array 它从数组中返回项目

   2 { 5 12 73 23 89
73
   2 4 { 5 12 73 23 89
73 89
   2 { i. 4 5
10 11 12 13 14

Some references for from : 来自的一些参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM