Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is f# `const` keyword

Tags:

f#

What is the const keyword in f#. It highlights in visual studio and the error message also calls it a keyword as shown below:

enter image description here

However I could not find it in MSDN https://msdn.microsoft.com/en-us/library/dd233249.aspx or the official language spec http://fsharp.org/specs/language-spec/3.0/FSharpSpec-3.0-final.pdf

Question: any docs on this reserved keyword?

like image 876
basarat Avatar asked Sep 29 '15 02:09

basarat


People also ask

What F means?

F or f is a written abbreviation for words beginning with f, such as 'female', 'feminine', 'franc', ' false', and 'Fahrenheit'. Heat the oven to 400 degrees F.

What is meaning of F * * * * * *?

1 usually obscene : to engage in coitus with —sometimes used interjectionally with an object (such as a personal or reflexive pronoun) to express anger, contempt, or disgust. 2 usually vulgar : to deal with unfairly or harshly : cheat, screw. — see also fuck off, fuck up. fuck.

Whats F mean in texting?

On the internet, “F” is a slang term used to “pay respects” or commiserate in a tragic incident.

What does F stand for meme?

Press F to Pay Respects Meaning Even when it may seem obvious, the F meme is just a way to pay respects to the fallen. It is now used to either show sympathy for someone in disgrace or to mock them as they fail.


Video Answer


2 Answers

It's right there in the bottom of the first link you pasted:

https://msdn.microsoft.com/en-us/library/dd233249.aspx

The following tokens are reserved as keywords for future expansion of the F# language:

const

like image 168
eugenioy Avatar answered Oct 23 '22 13:10

eugenioy


[<Literal>]
let something = 2

Values that are intended to be constants can be marked with the Literal attribute. This attribute has the effect of causing a value to be compiled as a constant. see https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/literals

like image 1
David Avatar answered Oct 23 '22 13:10

David