scala - 查找 Scala Array 深层文档?
问题描述
杰里的回答包括以下用途deep
:
println(k.deep)
按描述工作:
scala> println(Array(10, 20, 30, 40).deep)
Array(10, 20, 30, 40)
我正在寻找deep
有关Array
. 我转到Scala Standard Library 2.13.0 Array并搜索页面deep
并没有匹配项。
这是错误的顺序怎么办?
解决方案
根据https://github.com/scala/bug/issues/10985,它似乎已从 Scala 2.13 中删除:
这是一个在(嵌套)数组中打印值的 hacky 丑陋测试实用程序。如果您对此感觉强烈,我们可以将其添加为已弃用。
/** Creates a possible nested `IndexedSeq` which consists of all the elements
* of this array. If the elements are arrays themselves, the `deep` transformation
* is applied recursively to them. The `stringPrefix` of the `IndexedSeq` is
* "Array", hence the `IndexedSeq` prints like an array with all its
* elements shown, and the same recursively for any subarrays.
*
* Example:
* {{{
* Array(Array(1, 2), Array(3, 4)).deep.toString
* }}}
* prints: `Array(Array(1, 2), Array(3, 4))`
*
* @return An possibly nested indexed sequence of consisting of all the elements of the array.
*/
def deep: scala.collection.IndexedSeq[Any]
推荐阅读
- angular - 如何在 recaptcha 中获取最终用户的 IP
- selenium - 在 BrowserStack 中运行多个自动化测试时,第一个测试成功运行,但不会为剩余的会话创建会话
- c - 为什么单链表打印“NULL”?
- java - com.sun.jdi.invocationexception 方法 getOne(id) Hibernate + Spring MVC + JPA Repository
- vba - 如何访问和切换两个非默认联系人文件夹?
- azure-ad-b2c - Azure AD B2C 单点注销
- python - webjobs json数据到熊猫数据框
- powershell - 在戴尔上使用 Microsoft 更新作为源安装音频驱动程序脚本失败
- python-3.x - 按 ID 分组并按每个 ID 计算唯一开始日期。转换回数据框。熊猫
- firebase - 如何使用 Flutter 在 Firebase AUTH 中创建 2 个不同的用户组