Skip to content

Commit

Permalink
manual: review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Octachron committed May 20, 2018
1 parent 3af01f5 commit bd85939
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -43,6 +43,9 @@ Working version

### Manual and documentation:

- GPR#1788: move the quoted string description to the main chapters
(Florian Angeletti, review by Perry E. Metzger)

### Compiler distribution build system:

- GPR#1776: add -no-install-bytecode-programs and related configure options to
Expand Down
8 changes: 5 additions & 3 deletions manual/manual/refman/exten.etex
Expand Up @@ -1799,11 +1799,13 @@ quotes. For instance, you can use "[%sql {|...|}]" to
represent arbitrary SQL statements -- assuming you have a ppx-rewriter
that recognizes the "%sql" extension.

Note that the non-extension form, for example "{sql|...|sql}", should
not be used for this purpose. Indeed, the user cannot see in the code that
Note that the word-delimited form, for example "{sql|...|sql}", should
not be used for signaling an extension is in use.
Indeed, the user cannot see in the code that
this string literal has a different semantics than they expect. Moreover,
giving a semantics to a specific delimiter limits the freedom to
change the delimiter to avoid escaping issues.
change the delimiter to avoid escaping issues
(e.g. "{|hello|}", "{ext|hello {|world|}|ext}", ...).

\subsection{Built-in extension nodes}

Expand Down
17 changes: 14 additions & 3 deletions manual/manual/tutorials/coreexamples.etex
Expand Up @@ -54,12 +54,23 @@ fib 10;;
\pdfsection{Data types}

In addition to integers and floating-point numbers, OCaml offers the
usual basic data types: booleans, characters, and immutable character strings.
usual basic data types: booleans,
\begin{caml_example}{toplevel}
(1 < 2) = false;;
'a';;
let one = if true then 1 else 2;;
\end{caml_example}
characters,
\begin{caml_example}{toplevel}
'a';;
int_of_char '\n';;
\end{caml_example}
and immutable character strings:
\begin{caml_example}{toplevel}
"Hello" ^ " " ^ "world";;
{|This is a quoted string where \n is not a newline|};;
{|This is a quoted string, here, neither \ nor " are special characters|};;
{|"\\"|}="\"\\\\\"";;
{delimiter|the end of this|}quoted string is here|delimiter}
= "the end of this|}quoted string is here";;
\end{caml_example}

Predefined data structures include tuples, arrays, and lists. There are also
Expand Down

0 comments on commit bd85939

Please sign in to comment.