Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

f#

f#-fake

I've come across the following code and can not understand what operation the double exclamation marks provide. This code-snipet is from a FAKE script used in a CICD system. Microsoft's Symbol and Operator Reference does not list this operator, nor can I find it in FAKE's API Reference.

  !! (projectPackagePath + "/*.zip")
    |> Seq.iter(fun path ->
      trace ("Removing " + path)
      ShellExec tfCommand ("delete " + path + " /noprompt")

Another example of usage

let buildLabelFiles = 
    !!(labelPath @@ "*.txt")
like image 858
munchrall Avatar asked Oct 25 '17 12:10

munchrall


People also ask

What does double exclamation mark mean in text?

‼ Double Exclamation Mark. Table of Contents. Double Exclamation Mark emoji is two exclamation points next to each other. Exclamation points are used to express shock or surprise, but two exclamation points show an even more extreme form of shock that one exclamation point is just not enough to express.

When to use multiple exclamations?

In Punctuation for Now, John McDermott observes that multiple exclamation points "are best left to schoolchildren and those in love for the first time.". (Brand New Images/Getty Images) An exclamation point (!) is a mark of punctuation used after a word, phrase, or sentence that expresses a strong emotion.

What does the exclamation mark mean in Bash shell?

The exclamation mark serves a different purpose, depending on where it’s being used. It’s one of the powerful features of the Bash shell and can help to improve productivity. In this tutorial, we’ll see the various uses of the exclamation mark in Bash. 2. Specifying the Interpreter Path

What is an exclamation point called in writing?

And "Merriam-Webster's Guide to Punctuation and Style" notes that the exclamation point is used "to mark a forceful comment or exclamation." It is also called an exclamation mark or tellingly, in newspaper jargon, a shriek .


1 Answers

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 --.

like image 187
Tomas Petricek Avatar answered Oct 25 '22 20:10

Tomas Petricek