在某些语文中,如果一个功能回归一个阵列,那么相对于将阵列储存在一个变量中,那么就可检索一个单一要素,例如:
var someValues = getSomeValues();
var firstElement = someValues[0];
在职能要求收回返回阵列的成分后,你可以直接使用阵列索引。
var firstElement = getSomeValues()[0];
所谓的这种构造或yn是什么? 它是否有特别的名称?
在某些语文中,如果一个功能回归一个阵列,那么相对于将阵列储存在一个变量中,那么就可检索一个单一要素,例如:
var someValues = getSomeValues();
var firstElement = someValues[0];
在职能要求收回返回阵列的成分后,你可以直接使用阵列索引。
var firstElement = getSomeValues()[0];
所谓的这种构造或yn是什么? 它是否有特别的名称?
您可以直接使用功能要求上的阵列索引,以检索要素
var firstElement = getSomeValues()[0];
你们正在做的是获得该功能所交回的阵列/收集的指数化要素。 您不能直接获得职务指数。
我将称这一“链条”指数器为回报值。
Array dereferencing
我使用Lookup这一术语。
Eh. Dangerous?
如果返回阵列中没有任何内容的话。
在处理阵列时,不按评论而搁置。
除此概念外,还称为method chaining。
我认为,它没有任何特殊名称。 你只是再次获得返回阵列的第一个要素。 在许多语言中,在恢复一阵列的功能中没有任何特殊之处。
您请[]
(indexing)营运人 履行<>职能>。 相反,你将其应用于返回阵列。 它以优先地位看待这一点。
var firstElement = ( getSomeValues() )[0];
因此,它没有任何特殊之处。
然而,在职能方案拟订方面又出现了第一个因素。 例如:
($first_value, @rest_of_list) = getSomeValues(); # Perl
let first::rest = getSomeValues () in ... (* OCaml *)
这节省了列入<代码>的(从技术上说,不是阵列)清单的第一价值,而其余则储存在阵列变量中。 这种阵列变数可能漏掉,然后只有你才有第一个数值。
($first_value) = getSomeValues(); # Perl
let first::_ = getSomeValues () in ... (* OCaml *)
以上只是一个特殊案例,即patternomp(
然而,在你所显示的程序法典中,没有任何东西可以完全视为对应模式。
I was looking at XML-RPC for a project. And correct me if I m wrong, but it seems like XML-RPC has no XML datatype. Are you supposed to pass as a string? or something else? Am I missing something? ...
Does a Polymorphic engine have any other uses besides writing viruses?
I have the following available: last reported lat,lon w/timestamp target lat,lon estimated time to target heading How can I interpolate an estimated position over time? I know that s enough to ...
I am creating a desktop app that will create some reports. I want to export these reports as RSS or ATOM feeds. I can easily create feeds with Rome lib for Java. But I have no idea how to spread them. ...
I am currently using Q-Learning to try to teach a bot how to move in a room filled with walls/obstacles. It must start in any place in the room and get to the goal state(this might be, to the tile ...
If you were planning on building a high-traffic, very secure site what language would you use? For example, if you were planning on say building an authorize.net-scale site, that had to handle tons ...
According to various sources, such as Wikipedia and various .edu websites found by Google, the most common ways for a hash table to resolve collisions are linear or quadratic probing and chaining. ...
Recently, I ve been learning different programming langages, and come across many different names to initalize a function construct. For instance, ruby and python use the def keyword, and php and ...