F# 特殊引号? (##)
我刚刚跑过 http://frankniemeyer.blogspot.com/2010/ 04/minimalistic-native-64-bit-array.html 其中包含一行
(# "sizeof !0" type('T) : nativeint #)
我相信技术短语是“到底是什么?”在我(大约 8 个月)的 F# 编程中,我从未遇到过类似的情况...
FSI 告诉我一些有关已弃用的构造的信息,仅用于 F# 库...
谷歌搜索 (# 呃...嗯,不多
这方面有什么方向吗?
I just ran across
http://frankniemeyer.blogspot.com/2010/04/minimalistic-native-64-bit-array.html
Which contains the line
(# "sizeof !0" type('T) : nativeint #)
I believe the technical phrase is "what the heck?" I have never in my (~8 months) of F# programming run across something even resembling that...
FSI tells me something about deprecated constructs, used only for F# libs...
And google with (# does uh...well, not much
Any direction in this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是内联 IL 发射的符号。它曾经是 F# 早期的一个更突出的功能,但已被弃用。 F# 团队中一位名叫 Brian 的先生表示,它目前主要用于引导 F# 编译器,并且该团队打算将此构造标记为错误,而不仅仅是警告。
请参阅此处了解完整故事。
This is the notation for inline IL emission. It used to be a more prominent feature during F#'s earlier years, but has been deprecated. A gentleman named Brian from the F# team has indicated that it is currently used mainly to bootstrap the F# compiler, and that the team had intended to mark this construct as an error, not merely a warning.
See his post here for the full story.
它是内联 IL(中间语言)代码。此构造由 F# 团队在内部使用,以实现您无法通过任何其他方式执行的 F# 核心库的某些部分。此代码将接受一个警告,表明它不应在 F# 核心库以外的任何地方使用,因此您可能不必太担心它,因为它永远不会出现在生产代码中。
It's inline IL (intermediate language) code. This construct is used internally by the F# team to implement bits of the F# core library you just can't do any other way. This code will admit a warning saying it shouldn't be used any where other than the F# core libraries, so you probably don't have to worry about it too much as it should never appear in production code.
迷人。但我认为 F# 已经为我们提供了所需的转换操作(对于此特定操作!),而无需诉诸 IL。
Fascinating. But I think F# already gives us the conversion operations (for this particular operation!) you need without resorting to IL.