前置到

前置到[x个,元素]

预置(prepends)元素价值x个、和重置x个结果。

细节

示例

全部打开全部关闭

基本示例  (1)

分配添加到列表:

在列表开头包含一个新值:

分配给的值已更改:

范围  (5)

使用任意头部:

前缀为协会:

分配给稀疏矩阵:

在矩阵顶部添加一行:

为具有不一致维度的元素添加前缀需要转换为普通列表:

的第一个参数前置到不需要是一个符号:

并行附加到共享列表:

应用  (1)

分配成为2×2矩阵:

在前面加一行:

在列前面加上:

现在是3×3矩阵:

可能的问题  (4)

第一个参数必须具有值:

第一个参数必须指定给可以附加到以下内容之前的内容:

为了什么原子Q真的通常不能添加到:

使用前置到在大循环中累积值可能很慢:

有很多选择,例如使用收割母猪:

并行处理共享列表时,前置到是原子的:

看似等价的表达式使用追加不是原子的:

Wolfram Research(1988),PrependTo,Wolfram语言函数,https://reference.wolfram.com/language/ref/PrependTo.html(2014年更新)。

文本

Wolfram Research(1988),PrependTo,Wolfram语言函数,https://reference.wolfram.com/language/ref/PrependTo.html(2014年更新)。

CMS公司

沃尔夫拉姆语言。1988年,“PrependTo”,Wolfram语言与系统文档中心。Wolfram研究。2014年最后修改。https://reference.wolfram.com/language/ref/PrependTo.html。

亚太地区

沃尔夫拉姆语言。(1988). PrependTo(前缀)。Wolfram语言与系统文档中心。检索自https://reference.wolfram.com/language/ref/PrependTo.html

BibTeX公司

@misc{reference.wolfram_2024_prependto,author=“wolfram Research”,title=“{prependto}”,year=“2014”,howpublished=“\url{https://reference.wolfram.com/language/ref/prependto.html}”]}

BibLaTeX公司

@online{reference.wolfram_2024_prependto,organization={wolfram Research},title={prependto},year={2014},url={https://reference.jolfram.com/language/ref/prependto.html},note=[访问时间:2024年9月21日]}