Spec-Zone.ru › OCaml
☰The OCaml language
  • The OCaml language
  • Language extensions

Chapter 11 The OCaml language

Foreword

This document is intended as a reference manual for the OCaml language. It lists the language constructs, and gives their precise syntax and informal semantics. It is by no means a tutorial introduction to the language. A good working knowledge of OCaml is assumed.

No attempt has been made at mathematical rigor: words are employed with their intuitive meaning, without further definition. As a consequence, the typing rules have been left out, by lack of the mathematical framework required to express them, while they are definitely part of a full formal definition of the language.

Notations

The syntax of the language is given in BNF-like notation. Terminal symbols are set in typewriter font (like this). Non-terminal symbols are set in italic font (like that). Square brackets […] denote optional components. Curly brackets {…} denotes zero, one or several repetitions of the enclosed components. Curly brackets with a trailing plus sign {…}+ denote one or several repetitions of the enclosed components. Parentheses (…) denote grouping.

  • 1 Lexical conventions
  • 2 Values
  • 3 Names
  • 4 Type expressions
  • 5 Constants
  • 6 Patterns
  • 7 Expressions
  • 8 Type and exception definitions
  • 9 Classes
  • 10 Module types (module specifications)
  • 11 Module expressions (module implementations)
  • 12 Compilation units
« Memory model: The hard bitsLanguage extensions »
Copyright © 2026 Institut National de Recherche en Informatique et en Automatique

© 1995-2026 INRIA.
https://ocaml.org/manual/5.5/language.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API