我读到了有关list使用一些快速操作的信息as a reference,如此处所解释的。
从列表中删除第一项的最快方法是什么(也许使用as a reference和rest of list)?
例如:
{3,5,6,2,8}
变成
{5,6,2,8}
这将从列表中删除第一项
set theList to rest of {3, 5, 6, 2, 8}
Run Code Online (Sandbox Code Playgroud)
返回 {5, 6, 2, 8}
或者,这将从列表中删除最后一项
set theList to reverse of rest of reverse of {3, 5, 6, 2, 8}
Run Code Online (Sandbox Code Playgroud)
返回 {3, 5, 6, 2}
| 归档时间: |
|
| 查看次数: |
1067 次 |
| 最近记录: |