Previous Up Next
Chapter 6 The Revised syntax
The revised syntax is an alternative syntax for OCaml. Its purpose is to be simpler, more regular, more logical than the normal syntax, and fix some problems which sometimes result in bugs not always easy to find. This syntax was named ``righteous'' instead of ``revised'' in previous versions.

This chapter presents the changes from OCaml to this syntax.

6.1 Phrases
6.2 Imperative constructions
6.3 Tuples and lists
6.4 Irrefutable patterns

There is a notion of ``irrefutable patterns'' used by some syntactic constructions. Matching against these patterns never fails. An ``irrefutable pattern'' is either: Note that the term ``irrefutable'' does not apply to all patterns which never fail: constructors alone in their type declarations, except ``()'', are not said ``irrefutable''.

6.5 Constructions with matching
6.6 Mutables and assignment
6.7 Types
6.8 Modules

Modules application uses curryfication:
OCamlRevised
type t = Set.Make(M).t;;type t = (Set.Make M).t;


6.9 Objects

The objects also have a revised syntax. To see it, the simplest way is to write examples in normal syntax and to convert them into revised syntax using the command:
     camlp4o pr_r.cmo file.ml
6.10 Miscellaneous
6.11 Streams and parsers


Previous Up Next