Defining new keywords in F#'s computation expression

眉间皱痕 提交于 2019-12-03 15:08:09

问题


The F# 3.0 beta contains a query {} computation expression with tons of new keywords.

How can I define my own keywords in a computation builder?


回答1:


In F# 3.0, you can use CustomOperationAttribute for this purpose.

The new attribute is not very well-documented, the only examples I find are this great answer by @Tomas and this interesting blog post.



来源:https://stackoverflow.com/questions/9565986/defining-new-keywords-in-fs-computation-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!