julia - 如何在 Julia 中初始化摘要?
问题描述
Julia> abstract Shape
ERROR: syntax: extra token "Shape" after end of expression
Stacktrace:
[1] top-level scope at REPL[64]:0
只是想创建一个摘要,但即使我使用帮助它也会说跟随?> 有什么替代方法吗?
help?> abstract
search: AbstractSet abstract type AbstractChar AbstractDict AbstractFloat
Couldn't find abstract
Perhaps you meant struct or AbstractSet
No documentation found.
Binding abstract does not exist.
解决方案
正确的语法是abstract type Shape end
.
您可以使用 full 关键字在 REPL 帮助模式中找到文档:
help?> abstract type
有关于关键字的在线文档和关于类型的更一般的文档。
推荐阅读
- android - autoSize TextView 不起作用(使用 androidx 定位 v.24)
- javascript - 当我已经将数组(参数)值传递给另一个进行修改时,为什么它会更改函数中的数组(参数)值?
- mongodb - 如何使用 go mongo-driver 在 MongoDB 中将 []byte 存储为二进制文件
- swift - Xcode 生成的 swiftinterface 文件的兼容性问题
- javascript - 从 Shopify Webhook 验证 HMAC(使用 Hapijs)
- flutter - 如何在 Flutter 和 Dart 中使用后期绑定和摇树使图标加载工作
- android - 如何将文本框一一填充?安卓
- c - 创建指向给定地址的指针时出现问题
- email - 带有 sendgrid SMTP 中继“回复电子邮件”的 Postfix
- c# - 为 asp.net 核心 web api 中的方法编写测试