What does a double exclamation mark (!!) in Fsharp / FAKE?

心不动则不痛 提交于 2019-12-01 16:45:48
Tomas Petricek

The !! operator takes a file pattern and returns a collection of files matching the pattern.

For example, if you want to print all text files in the current folder, you can write:

for file in !! "*.txt" do
  printfn "%s" file

If you look at the operator definition in the source code, you can see that it is just an alias for creating a IGlobbingPattern value (see the type definition) that includes files given by the specified pattern. The IGlobbingPattern type implements IEnumerable, so you can iterate over the files, but you can do a couple of other things with IGlobbingPattern such as combining two file sets using ++ or removing some files from a file set using --.

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