Previous Up Next

6.5  Constants

constant::= integer-literal  
  float-literal  
  char-literal  
  string-literal  
  constr  
  false  
  true  
  ()  
  begin end  
  []  
  [||]  
  `tag-name

See also the following language extensions: integer literals for types int32, int64 and nativeint, quoted strings and extension literals.

The syntactic class of constants comprises literals from the four base types (integers, floating-point numbers, characters, character strings), and constant constructors from both normal and polymorphic variants, as well as the special constants false, true, (), [], and [||], which behave like constant constructors, and begin end, which is equivalent to ().


Previous Up Next