Commit Graph

1378 Commits (master)

Author SHA1 Message Date
Louis Roché 52954a428d Add missing word in -nostdlib doc 2018-12-10 11:09:13 +00:00
Florian Angeletti 8c5d81f262 manual: document exception A | pat 2018-12-08 20:15:56 +01:00
Alain Frisch d9e8e9da25
Document ocaml.local attribute on functions (#2169) 2018-11-28 17:03:45 +01:00
Leo White 1b04903625 Add a manual entry for let operators 2018-11-27 13:30:56 +00:00
Thomas Refis d877e1af2b manual update 2018-11-26 16:20:37 +00:00
Florian Angeletti ad0d6fea72 manual: examples for extended opens 2018-11-26 16:20:37 +00:00
Alain Frisch 2e5b9d1ef1
"Alerts" as a generalization of "deprecated" (#1804) 2018-11-15 09:51:35 +01:00
Thomas Refis 9145aab78f manual 2018-11-09 16:43:43 +00:00
yallop ee1c2a4d7e Add paths for built-in types (#1876)
* Add an Extension_constructor submodule to Obj.

Deprecate top-level functions extension_constructor / extension_name /
extension_id.

* Add 'true' and 'false' to the definition of Bool.t

* Add aliases for the built-in 'list' and 'array' types.

* Add an alias for 'exn' to Printexc.

* Changes entry: built-in type aliases

* Add a Unit module.

* Add paths for built-in exceptions.
2018-11-08 16:08:17 +01:00
Daniel Bünzli a7afd89003 s/string_of_int/Int.to_string/g 2018-11-07 13:52:02 +01:00
Gabriel Scherer d5e75fb28f
Merge pull request #2133 from yallop/warn-on-literal-full
Warn on literal patterns found anywhere in a constructor's arguments.
2018-11-07 10:09:14 +01:00
Florian Angeletti 9f01a08a2b
Merge pull request #2117 from Octachron/stdlib_precedence_table_3
documentation: precedence table for the standard library.
2018-11-06 22:18:48 +01:00
Damien Doligez 17b64ac2b2
Add caml_alloc_custom_mem (#1738)
* add caml_alloc_custom_mem and corresponding GC parameters
* fix a bug in tests/misc/ephetest2.ml
2018-11-06 13:42:48 +01:00
Florian Angeletti eab2ff3f84 pdf manual:fix refs, compilerlibs/ocaml_operators 2018-11-06 13:29:23 +01:00
Daniel Bünzli 89e48a38e9 Stdlib: add Fun module. (#2129)
* Stdlib: add Fun module.

* Stdlib: rename Bool.negate to Fun.negate.
2018-11-06 10:36:07 +01:00
Jeremy Yallop 894df106a1 Update the manual for the generalized warning 52. 2018-11-05 17:30:03 +00:00
Florian Angeletti cbd4f71a39 documentation: move operator table to a new page 2018-11-04 17:49:22 +01:00
Florian Angeletti c19ba5cab3 review: typo + synchronisation comment 2018-10-26 11:26:07 +02:00
Florian Angeletti 07318a2ffc manual: #... operators are left associative 2018-10-25 18:29:32 +02:00
Daniel Bünzli fdba70136f Stdlib: add Bool module. 2018-10-23 11:35:08 +02:00
Nicolás Ojeda Bär 90d9b2287a
Merge pull request #2011 from dbuenzli/int-support
Improve stdlib support for `int`
2018-10-23 11:23:14 +02:00
yallop 20f4c6ced3 Disallow .~ in extended indexing operators. (#2106)
Disallow .~ in the lexer to preserve MetaOCaml compatibility.
2018-10-22 15:33:00 +02:00
Armaël Guéneau 6b16bcc4fe Add option -error-style and environment variable OCAML_ERROR_STYLE 2018-10-20 17:11:35 +02:00
Armaël Guéneau 2ce52c9e2a unified-options.etex: make check-typo happy 2018-10-20 16:11:27 +02:00
Maxime Flin 74e3b9a215 Change verbatim to caml_example in documentation (#2105)
* Add paragraph in manual's readme about signature option in caml_example env. Change verbatim env to caml_example.
2018-10-15 22:19:46 +02:00
Nicolás Ojeda Bär eab68e78f2 doc: mention feature introduced in 4.08 2018-10-10 14:55:04 +02:00
Nicolás Ojeda Bär 856c0a60c1 Amend doc 2018-10-10 14:55:04 +02:00
Nicolás Ojeda Bär f38b197f90 Specify search order in doc, move to right place 2018-10-10 14:55:04 +02:00
Nicolás Ojeda Bär 0059176658 Doc in manual 2018-10-10 14:54:47 +02:00
Daniel Bünzli 5846aecee6 Stdlib: add Int module. 2018-10-09 10:20:39 +02:00
Florian Angeletti bea374014c manual: fix misplaced end of itemize 2018-09-22 19:10:41 +02:00
Sébastien Hinderer ba6362a07d Move config/Makefile to Makefile.config
In order to prepare the transition to autoconf, this commit moves the
configuration Makefile out of the config directory which will disappear
and gives it the name it will have once intstalled, namely Makefile.config.
2018-09-17 14:23:35 +02:00
Damien Doligez 2fd0186648
Merge pull request #1683 from stedolan/marshal-custom-length
Make marshalled Custom_tag objects store their length.
2018-09-14 10:58:27 +02:00
Jérémie Dimino ee3730f9b2
Deprecate `ocamlc -vmthread` (#2038) 2018-09-13 10:42:26 +01:00
Florian Angeletti 558530a8b4 manual: compiler-libs.mld -> compiler_libs.mld 2018-09-12 16:32:37 +02:00
Florian Angeletti ef135a71ae
MPR7546, manual: preambles and warnings for compiler-libs modules (#2020)
* preambles for compiler-libs modules

* Compilerlibs intro and warning link
2018-09-12 09:51:47 +02:00
Nicolás Ojeda Bär 9c79a08561
Merge pull request #2037 from alainfrisch/doc-ocamllex-ml
Document performance properties of `ocamllex -ml` vs `ocamllex`
2018-09-12 09:05:39 +02:00
Gabriel Scherer 6d7d6c0ec6 manual/exten.etex: cut one page per section for languag extensions 2018-09-10 22:50:54 +02:00
alainfrisch e1b6ea9a6e Document performance properties of ocamllex -ml vs ocamllex 2018-09-10 14:09:04 +02:00
Florian Angeletti 0a05dc8382
Merge pull request #2008 from gasche/manual-examples
Manual examples
2018-09-06 18:54:27 +02:00
Gabriel Scherer 7aeb565fbe
Merge pull request #2021 from pmetzger/fixmanbuild
fix_index.sh: fix a bug, and convert from using "ed" to "sed"
2018-09-06 13:37:29 +02:00
Gabriel Scherer 062e203758 manual: more caml_examples in exten.etex 2018-09-06 12:39:17 +02:00
Gabriel Scherer 14f29e0d65 manual: convert more of exten.etex to {caml_example*} 2018-09-06 12:38:29 +02:00
Perry E. Metzger 6857b9afd8 manual/README.md: remove claim that "ed" is needed for the install 2018-09-05 16:47:07 -04:00
Perry E. Metzger 3b183ff5d4 fix_index.sh: fix a bug, and convert from using "ed" to "sed"
Before, the ed script was only fixing the first instance of the
target lines it encountered, leaving second instances that were not
fixed. Rather than fixing the ed script, I've converted this to sed,
which means one less dependency for the build.

Sadly, although almost every modern sed has the -i flag for in-place
fixes, it isn't in POSIX, so I did a kludgy "sed into a .new file,
move back" hack.
2018-09-05 16:33:00 -04:00
Florian Angeletti 65ab4200d6 html manual: split compilerlibs from stdlib 2018-09-05 18:59:31 +02:00
Florian Angeletti 284c8f8bb8 replace awk by $(AWK) in doc makefiles 2018-09-04 09:16:47 +02:00
octachron 075bf9bed6 doc: remove unprefix trick 2018-09-03 13:59:32 +01:00
Gabriel Scherer 294934299e new -stop-after option: stop after the given compiler pass (parsing, typing) 2018-08-31 22:49:23 +02:00
Gabriel Scherer dcbf1a8fae manual: fix broken build caused by GPR #2007 2018-08-27 18:00:50 +02:00
Gabriel Scherer c578cee935 manual: fix broken build caused by GPR #1605 2018-08-27 17:58:39 +02:00
Gabriel Scherer 6744597090
Merge pull request #2007 from Octachron/nme_integers
documentation: move 32/64/native literals out of the extension chapter
2018-08-27 14:57:11 +02:00
octachron e407ab3829 documentation: promote 32/64/native literals
* Move the description of these literals to refman/const.etex and
refman/lex.etex
* Mention their existence in library/builtins.etex
* Add examples to Int32, Int64 and NativeInt module documentation
2018-08-27 11:08:11 +02:00
Gabriel Scherer 3e588dc964 manual: use the caml_example environments in some of the Extension sections 2018-08-27 09:06:50 +02:00
Gabriel Scherer fffd676d3d [minor] manual: simplify the refman/ build system
I wanted to test a caml_tex issue by creating a smaller .etex file
than exten.etex, and got bitten by the fact that the Makefile hardcode
the knowledge that only exten.etex uses caml_example.
2018-08-27 07:42:31 +02:00
Stephen Dolan e9b04bb0d5 Add CODE_CUSTOM_FIXED for fixed-size custom serializers.
As a space optimisation, custom serializers that always consume
the same number of bytes need not send the lengths explicitly.
2018-08-22 10:33:09 +01:00
Gabriel Scherer 5b2248892e build cross-reference-checker during manual-pregen
Many build errors in cross-reference-checker have gone unnoticed
because this program was only built to build the manual itself, which
is not part of the CI testing. (The test that it implements needs the
.aux files produces by LaTeX, which we don't really want to produce
during CI runs.)

This commit adds cross-reference-checker to the `tools` target of
manual/Makefile, which is in turn built by the `manual-pregen` target
of the main Makefile, which contains the sanity checks for the manual
that do not require building it, and is part of our CI.
2018-08-19 19:07:01 +02:00
Gabriel Scherer 1c082929e3 cross-reference-checker: fix attribute structure after GPR #1953 2018-08-19 19:07:01 +02:00
Gabriel Scherer a6d7e60839 cross-reference-checker: fix Location.report_error after GPR #1952 2018-08-19 19:07:01 +02:00
Jeffrey Tsang 40033ad7fb manual: doc clarification (#1984) 2018-08-16 22:45:52 +02:00
Daniel Bünzli 1798999b65 Stdlib: add Option module. 2018-08-08 11:41:09 +02:00
Daniel Bünzli b7affbb9ef Stdlib: add Result module. 2018-08-08 10:34:03 +02:00
Nicolás Ojeda Bär 7820c10aa4 Include fonts in the manual archives 2018-08-03 09:48:58 +02:00
Nicolás Ojeda Bär 45462a5262 Use relative paths for manual fonts 2018-08-02 23:29:30 +02:00
Florian Angeletti 4be6cafcc3
manual, code example preprocessor : full conversion to compiler-libs (#1863)
* manual tools: use toploop directly in caml_tex2
* manual tool: improved error messages
* manual: always print errors and warnings
* fix nefarious interaction with GPR#1120
* move manual/tools/caml_tex2 to tools/caml_tex
* Basic text for caml-tex
2018-07-25 10:38:08 +02:00
Valentin Gatien-Baron 3d0299a185 Create warning 64, for uses of -unsafe with a -pp that returns a marshalled ast
Instead of the current print to stderr. This way it's treated the same
as other warnings: it has a position, colors, can be made an error,
disabled, goes in the expected formatter, is documented.
2018-07-15 15:08:38 -04:00
whitequark 1ebc9f5a4c Remove the Sort module. (PR7812)
It has been deprecated since 2000, shown a deprecation warning
since 4.02, and Sort.merge is documented to have undefined behavior
when the lists being merged are not sorted in the first place.
2018-07-13 16:04:49 +02:00
Perry E. Metzger a2c2fb7e8e manual: fixes for the .svg arrow files hevea now generates
manual/Makefile: add *.svg to the clean target for htmlman directory
    manual/htmlman/.gitignore: add *.svg
2018-07-09 09:07:07 +01:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Sébastien Hinderer c8343888fa manual/tools/texquote2: reimplement the tool in OCaml 2018-06-26 16:15:23 +02:00
Gabriel Scherer 2fa1dde9d9 manual: rewrite forgotten references to 'pdfmanual' (now 'manual') 2018-06-26 11:17:40 +02:00
Sébastien Hinderer 28c337fecb manual/README.md: stop mentionning the DVI manual
This is a follow-up to commit 2f0d65c7ee
in GPR #1842.
2018-06-26 07:25:22 +02:00
Sébastien Hinderer 85fa27f7e9 Rename C compiler related build variables
This commit renames a few C compiler related build variables so that
they are reserved for the build system. They will then be re-introduced,
but this time as user varialbes whose value can be freely customized
when compiling the package, without risking to conflict with those
command-line flags that are required by the build system itself.

Here are the variables this commit renames:

- CFLAGS -> OC_CFLAGS
- CPPFLAGS -> OC_CPPFLAGS
- LDFLAGS -> OC_LDFLAGS

Note: before this commit the compilation of scheduler.c in
otherlibs/threads was relying on make's implicit rule to compile C files.

Since this commit stops using the standard variables for flags,
it is necessary to introduce an explicit rule to compile C files
and that makes use of the newly introduced variables.
2018-06-20 14:01:42 +02:00
Florian Angeletti 9e67f4e942
Manual: update the exception section in the tutorial (#1831)
* exception cases
* local exceptions
* more exception examples
2018-06-19 20:11:07 +02:00
Xavier Leroy 570fe9f57b Remove old PDF-related macros that are no longer relevant
In the early days of pdflatex, the hyperref package didn't exist
and we used the \pdfchapter, \pdfchapterfold and \pdfsection
custom macros to build the PDF index.

Those macros are now useless, so remove all of their uses.
2018-06-16 10:36:00 +02:00
Xavier Leroy c0a8a2f41e Remove traces of the pre-Hevea plaintext version of the manual
Before Hevea the plaintext version of the manual required a
specific toplevel file "plaintext.tex", some \ifplaintext
conditionals, and a "plaintext.sty" package.
All this is now useless, remove it.
2018-06-16 10:35:21 +02:00
Xavier Leroy 2f0d65c7ee Get rid of the DVI and Postscript versions of the manual
Those formats are now obsolete compared with PDF.

- Merge pdfmanual.tex into manual.tex and remove pdfmanual.tex
- Simplify the Makefile: run with pdflatex only, not latex then pdflatex
- Remove mentions of DVI and Postscript versions on the HTML front page
2018-06-15 15:12:08 +02:00
Xavier Leroy ad5d93af99 Use Type 1 (vector) fonts for Computer Modern Roman, not Type 3 (bitmap)
By default, \usepackage[T1]{fontenc} causes CMR bitmap fonts to be put
in PDF and PS files.  Fix this using the "ae" package
(virtual fonts for T1 encoded CMR-fonts).
2018-06-15 14:56:26 +02:00
octachron a555152a4b manual: explicit subsection for precedence table 2018-06-12 21:25:43 +02:00
Gabriel Scherer 12e9c1d19a match-context-args: have --help refer to the (reworded) manual 2018-06-02 00:02:47 +02:00
Dwight Guth 6a06a1123a add advanced option to tune performance of pattern matching compiler in case of exponential blowup 2018-06-01 23:51:56 +02:00
Perry E. Metzger 262b70d819 Document that -safe-string is the default, -unsafe-string is not
Nearly identical changes to:
   ocaml.m, ocamlc.m, ocamlopt.m, unified-options.etex

"-safe-string" has been the default since 4.06, so the assertion that
it would be the default someday, and that "-unsafe-string" is still
the default, was incorrect.
2018-06-01 14:05:08 +02:00
Mark Shinwell e7d6ceadce Rework of PR1020 2018-05-30 17:32:21 +01:00
Florian Angeletti 1d27ddef10
manual: move quoted string to the main chapters (#1788)
* manual: itemize the list of basic data types
2018-05-25 21:15:35 +02:00
Sébastien Hinderer 73620c1591 Add the -m and -M command-line options to ocamlrun
- -m shows the magic number of the bytecode executable given as argument

- -M shows the magic number this runtime expects
2018-05-25 14:14:25 +02:00
Gabriel Scherer 58c105e7e4
Merge pull request #1789 from Octachron/manual_utf8_encoding
manual: switch to utf-8 encoding
2018-05-20 19:57:01 +02:00
octachron f21f05a6ae Fix forgotten latin1 byte sequences 2018-05-20 16:41:57 +02:00
octachron 5486d3fe27 manual: switch to utf-8 encoding 2018-05-20 14:52:04 +02:00
stdowl bd204c7939
Merge branch 'trunk' into html-manual 2018-05-20 10:49:54 +02:00
steinuil b517e0fff1 manual: cleanup of main Makefiles 2018-05-19 21:48:18 +02:00
steinuil 1717ccd628 manual: improve consistency in the Makefiles 2018-05-19 21:48:18 +02:00
steinuil 478b14ef93 manual: delete old .cvsignore files 2018-05-18 20:27:35 +02:00
steinuil 3b74227b61 manual: fix typo in README 2018-05-18 20:27:35 +02:00
steinuil 2d9d48cd3c manual: add clean target to tests 2018-05-18 20:27:30 +02:00
steinuil eb789250e1 manual: delete unused tools 2018-05-18 20:27:30 +02:00
Charles Chamberlain 25ef453068 Change font size for pre's back to 1rem 2018-05-15 16:24:10 +00:00
Charles Chamberlain 600fea6ce0 Use em, not rem, for inline monospace 2018-05-15 16:24:10 +00:00
Charles Chamberlain b2cefc81a0 Adding comment in manual style 2018-05-15 16:24:10 +00:00
Charles Chamberlain 2a271b4884 Change font size of inline monospace text 2018-05-15 16:24:10 +00:00
Charles Chamberlain f2d36b0486 Improve font size of pre elements in html manual 2018-05-15 16:24:10 +00:00
Charles Chamberlain f5d7c7957f Smaller body size, smaller text size, and wrap pre 2018-05-15 16:24:10 +00:00
Charles Chamberlain 00d1fdd4a7 Change libref headings to relative font size 2018-05-15 16:24:10 +00:00
Charles Chamberlain bb7c1c2c26 Change html manual to use relative font sizes 2018-05-15 16:24:10 +00:00
Gabriel Scherer 83b0ee1b62
Merge pull request #1779 from pmetzger/bigardocfix
Integrate Bigarray documentation
2018-05-14 10:31:38 +02:00
Perry E. Metzger 1a412be026 Integrate Bigarray documentation
1. Add Bigarray lines to library/stdlib.etex
2. Move intro from libbigarray.etex to stdlib/bigarray.mli
3. Note that 0-dimensional arrays are supported.
4. Move C interface description to cmds/intf-c.etex
5. Change wording in libbigarray.etex to reflect legacy status.
6. Add a label to libunix.etex (needed for link from libbigarray.etex)
7. Put the changes in Changes (for 4.07).
2018-05-10 15:13:56 -04:00
Perry E. Metzger 0fad94e80a unix library documentation: move HTML links higher up on the page (#1780) 2018-05-10 11:09:20 +02:00
octachron 3b6236e484 fix indentation 2018-05-07 10:49:48 +02:00
octachron 1edd1e69da partial revert on exten.etex 2018-05-07 09:30:30 +02:00
octachron c7a641d198 manual: use [@@@ellipsis] 2018-05-07 09:27:36 +02:00
octachron 18b5d64df2 manual: check all nested ellipses early 2018-05-07 09:25:31 +02:00
octachron 8d20b53234 manual: ellipis for subset of underline interval 2018-05-06 23:56:21 +02:00
octachron f40d1d1c99 Add ellipsis to caml_example pseudo-env 2018-05-06 20:38:19 +02:00
Florian Angeletti 145bedc2ae
manual: signature option for caml_example (#1702)
* Signature option for caml_example
* convert ocamldoc code example to caml_example
* error message when using caml_example*{signature} without *
2018-05-05 21:50:40 +02:00
Gabriel Scherer eb62d2e90d
Merge pull request #1693 from lpw25/fix-mpr7701
Keep documentation comments in structures with no other items (MPR#7701 cont.)
2018-05-05 15:45:57 +02:00
Charles Chamberlain 5317b717f6 Host fonts in the manual, add line to Changes 2018-05-04 23:41:18 -05:00
Charles Chamberlain c24c911bf6 Select main title better; scroll overflow for tables 2018-05-04 16:20:20 -05:00
Charles Chamberlain 1e32d1614b Format stdlib pages, use font cdn, switch bg color 2018-05-03 21:08:29 -05:00
Charles Chamberlain d9333f9fdc Add backgrounds and move to darker blue links 2018-05-03 20:16:51 -05:00
Charles Chamberlain 9632c889d8 Fix the order of \input{macros.tex} and meta tag 2018-05-03 12:57:33 -05:00
Charles Chamberlain 980afa8f19 Style the html manual, changing type and layout
Add a new font for the headers, change the link colors,
re-center it, and improve support for mobile viewing.
2018-05-03 12:22:44 -05:00
Gabriel Scherer 559206b4e0 ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
  a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
  and exit with a failure return value (non-0)

Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.

The following alternative behaviors were considered:

- We could print a newline after the configuration value, which
  would let users distinguish empty values from non-existing variables
  by counting the lines of output, and would also be more pleasant for
  users invoking the option from the command-line. However, the way
  bash works on Windows means that $(ocamlc -config-var foo) would keep
  a trailing \r in its output, and portable scripts would have to use
  $(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
  (This issue was pointed out by David Allsopp)

- We could print a message on the error output if the configuration
  variable does not exist. This is clearer to a human user, but it is
  annoying for scripts if they forget to silence the error output and
  get their output mixed with our error messages. The main use of this
  new feature is for scripting purposes.
2018-04-27 19:54:08 +02:00
steinuil 49abafc587 html manual: improve typesetting and legibility
Make the pages narrower to avoid overly long lines,
increase line height to improve legibility.
2018-04-27 11:59:58 +02:00
Perry E. Metzger 24a551c0ef Fix a grammar error in the description of inline records. (#1734) 2018-04-23 17:32:29 +01:00
Florian Angeletti c5b3dada13 cleanup stdlib documentation makefiles (#1700) 2018-04-12 11:02:16 +01:00
Gabriel Scherer 482e8a8b52 manual Makefiles: set LD_PATH to protect from stale installs
Trying to build the manual (make -C manual/manual etex-files) when
your current opan switch is stale (for example, 4.05.0 when working on
the current 4.07.0+dev trunk) results in the following error:

    make[1]: Entering directory '/home/gasche/Prog/ocaml/github-trunk/manual/manual/tutorials'
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating coreexamples.tex
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating lablexamples.tex
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating objectexamples.tex
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating moduleexamples.tex
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating advexamples.tex
    Fatal error: cannot load shared library dllunix
    Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup
    Failure when generating polymorphism.tex
    make[1]: Leaving directory '/home/gasche/Prog/ocaml/github-trunk/manual/manual/tutorials'

This PR fixes the issue by using Makefile.tools' SET_LD_PATH variable
to set a LD_PATH containing the required build directory's otherlibs/
libraries, instead of looking in an installed path.

(no change entry needed)
2018-04-09 19:55:40 +02:00
Florian Angeletti 6e927dcdb0
MPR#7663: reword unsafe recursive modules message (#1694) 2018-04-04 21:15:26 +02:00
Leo White 070416d6bb Fix syntax errors in ocamldoc examples 2018-04-03 17:00:02 +01:00
Gabriel Scherer b4a1d2fcc9
Merge pull request #1692 from Octachron/manual_seq
manual: links to Seq in stdlib.etex
2018-04-03 14:02:47 +02:00
octachron ee898e3b98 manual: links to Seq in stdlib.etex 2018-04-03 13:41:09 +02:00
Florian Angeletti aa484302a7
MPR#7613, manual: minor rewording of refutation case (#1677) 2018-04-01 16:01:10 +02:00
Florian Angeletti 6d65f789f0
manual: record and variant disambiguation (#1647)
This commit adds a subsection to the record and variant section of the manual describing the behavior of the type-directed disambiguation of variant constructors and record fields.
2018-03-18 20:50:56 +01:00
Nicolás Ojeda Bär 37541310b4
Merge pull request #1653 from nojb/deprecate_thread_option
Deprecate -thread option
2018-03-16 06:31:37 +01:00
Nicolás Ojeda Bär 6c1bec42c7 Deprecate -thread option, equivalent to -I +threads 2018-03-15 18:37:02 +01:00
Nicolás Ojeda Bär 94dc90d735 Add missing manual entries 2018-03-15 18:26:52 +01:00
Nicolás Ojeda Bär b27733747c Add manual entry 2018-03-15 18:26:52 +01:00
Timothy Bourke ac6c864279 Doc for caml_alloc_final: allocates n + 1 words
The current documentation for caml_calloc_final, fixed by this commit,
contradicts the documentation for caml_calloc_custom:

  Custom blocks must be allocated via the caml_alloc_custom function:
  caml_alloc_custom(ops, size, used, max) returns a fresh custom block,
  with room for size bytes of user data...

The caml_alloc_final function is defined as follows:

CAMLexport value caml_alloc_final (mlsize_t len, final_fun fun,
				   mlsize_t mem, mlsize_t max)
{
  return caml_alloc_custom(caml_final_custom_operations(fun),
			   len * sizeof(value), mem, max);
}

And the caml_alloc_custom function begins as follows:

CAMLexport value caml_alloc_custom(struct custom_operations * ops,
                                   uintnat size,
                                   mlsize_t mem,
                                   mlsize_t max)
{
  mlsize_t wosize;
  value result;

  wosize = 1 + (size + sizeof(value) - 1) / sizeof(value);
  ...

It adds the extra word to store the custom_operations.
2018-03-14 11:52:16 +01:00
Gabe Levi c9d911ec24
Manual: Fix typo in Chapter 8 Language extensions
I believe this change reflects the original author's intent. The example is trying to demonstrate that the `[@bar]` attribute applies to the function definition, not to the extension itself.
2018-03-08 10:53:26 -05:00
objmagic 0993cd9ba9 Support empty variants (#1546)
* Allow empty variants.
* Update manual and ocamldoc.
2018-03-06 10:48:16 +09:00
octachron 8f2a15369f Factorize the build of the unprefixed stdlib
which is used by both ocamldoc and the reference manual.
2018-02-12 08:29:16 +00:00
octachron e95b0c4769 Minimal fix for the manual build pocess 2018-02-12 08:29:16 +00:00
Jeremie Dimino 225d1c65b9 Prefix the compilation unit names of all modules in the stdlib
Except for the Camlinternal* modules and the new Stdlib module, all
modules in the stdlib now compile to Stdlib__<module>.

Pervasives is renamed to Stdlib and now contains a list of aliases
from the long names to the short ones, so that from inside and outside
the stdlib we can refer to the standard modules as just List or
Stdlib.List rather than Stdlib__list.

In order to avoid printing the long names in error messages and in the
toplevel, the following heuristic is added to Printtyp: given a path
Foo__bar, if Foo.Bar exists and is a direct or indirect alias to
Foo__bar, then prefer Foo.Bar.

A bootstrap step was required to replace Pervasives by Stdlib as the
module opened by default.
2018-02-12 08:29:16 +00:00
Yuriy Vostrikov 3899948207 Fix minor typo 2018-02-09 19:46:52 +03:00
Jim 52454d3742 Improve wording in several places in the OCaml manual, mostly in chapter
1.
PR#7698
2018-01-25 10:47:57 -08:00
David Allsopp 617c461bb1 s/an Unicode/a Unicode/ 2018-01-19 13:55:50 +00:00
Gabriel Scherer 39e56ac9c0 manual/README.md: minor rendering bug 2018-01-05 22:36:29 +01:00
octachron 4997f9239a manual: new consistency test for cross-references 2018-01-04 12:46:57 +01:00
Jakub Wilk 040de1f860 Manual: fix obsolete reference to "curses.mli" 2017-12-30 18:03:05 +01:00
Florian Angeletti 17cf59c306
manual examples:decouple verbatim/toplevel styles (#1540) 2017-12-21 16:14:49 +01:00
octachron 929b0adee5 manual, remove dangling reference
This commit removes a dangling reference to the explicitly overriding
method definition that was moved to the tutorial part of the manual.
2017-10-27 18:57:52 +02:00
Nicolás Ojeda Bär daeebabb62 Add C stubs Unicode guidelines to manual (#1450)
Add C stubs Unicode guidelines to manual
2017-10-27 17:52:19 +02:00
Xavier Leroy 94270d6f7e Update section 11.5 (differences between ocamlopt and ocamlc)
Discuss FMA and also the issue from MPR#7271.
2017-10-19 16:13:59 +02:00
Gabriel Scherer d229144189 Merge pull request #1344 from nojb/linscan_flag_manual
Add -linscan doc to manual
2017-10-16 09:27:02 +02:00
Florian Angeletti 2675b1f10b GPR#594, manual: new chapter on polymorphism
This commit adds a new chapter to the tutorial part of the manual, describing potential issues that can appear with polymorphic functions and types, and possible solutions or  workarounds. The issues covered are, section-by-section:
* weakly polymorphic types
* polymorphic recursion
* higher-ranked polymorphic function
2017-10-16 08:36:37 +02:00
Markus Mottl a62e31abf9 Improved documentation of unboxed and noalloc attributes 2017-10-11 12:25:19 -04:00
octachron e30e82a219 PR#7363: start documentation headers at {1 2017-10-04 13:05:05 +02:00
octachron 03e1a93f0b PR#7363, ocamldoc: implicit level 0 for titles
This commit makes the heading hierarchy of ocamldoc start at {0 rather
than {1. This level {0 should be reserved for global titles, freeing
the use of {1 for normal subtitles.
2017-10-03 23:29:50 +02:00
Gabriel Scherer a202aa032b rename the configure-time safe-string options for clarity
-(un)safe-string becomes -(no-)force-safe-string
-(un)safe-string-default becomes -default-unsafe-string

Config.safe_string (and Clflags.unsafe_string) keep their name for
backward-compatibility, as well as the C define CAML_SAFE_STRING
(which corresponds to -force-safe-string).
2017-10-02 14:42:19 +02:00
Fabrice Le Fessant f20a0a042e Allow first character of OCAMLPARAM to specify an alternative separator
The alternative separator must be in ":|; ,".
2017-09-29 13:38:59 +02:00
Leonid Rozenberg efdbb82787 Change factor estimation equation
Currently, the equation is rendered as (1/1 + f)<sup>d</sup>.
I'm not certain if this will correctly render in HTML (apologies, but I don't have the capacity to check at the moment), but hopefully this PR will suffice.
2017-09-18 14:41:15 +02:00
octachron 28e53d1305 Add support for qualified indexing operators
aka `x.Module.Path.!(y)` and friends
2017-09-16 23:05:35 +02:00
Florian Angeletti 201ee17fe0 Extended indexing operators (#1064)
* Extended indexing operators

This commit adds extended indexing operators to the parser.
For instance,

```
let (.%()) p (x,y) = p.( x ).( y )
;; p.%(0,0)

```
Extended indexing operators name starts with a leading
dot "." followed by an operator symbol, except "." or "<"
and a sequence of any operators and must be closes with a
couple of enclosing parentheses ( i.e. "()", "[]", "{}" )
and then an optional assignment operator "<-":

  * '.' dotsymbolchar symbolchar* '(' ')' ['<-']
  * '.' dotsymbolchar symbolchar* '[' ']' ['<-']
  * '.' dotsymbolchar symbolchar* '{' '}' ['<-']

Similarly, expressions of the form

* expr_1 '.' dotsymbolchar symbolchar* '(' expr_2 ')'
* expr_1 '.' dotsymbolchar symbolchar* '[' expr_2 ']'
* expr_1 '.' dotsymbolchar symbolchar* '{' expr_2 '}'

and

* expr_1 '.' dotsymbolchar symbolchar* '(' expr_2 ')' '<-' expr_3
* expr_1 '.' dotsymbolchar symbolchar* '[' expr_2 ']' '<-' expr_3
* expr_1 '.' dotsymbolchar symbolchar* '{' expr_2 '}' '<-' expr_3

are desugared to

* ('.' dotsymbolchar symbolchar* '(' ')' ) expr_1 expr_2
* ('.' dotsymbolchar symbolchar* '[' ']' ) expr_1 expr_2
* ('.' dotsymbolchar symbolchar* '{' '}' ) expr_1 expr_2

and

* ('.' dotsymbolchar symbolchar* '(' ')' '<-' ) expr_1 expr_2 expr_3
* ('.' dotsymbolchar symbolchar* '[' ']' ) expr_1 expr_2 expr_3
* ('.' dotsymbolchar symbolchar* '{' '}' '<-' ) expr_1 expr_2 expr_3
2017-09-15 18:47:05 +02:00
Leo White 20668002bb Turn off warning 40 by default (#1333)
* Turn off warning 40 by default
2017-09-15 18:41:49 +02:00
Nicolas Ojeda Bar 2c371b7104 Add -linscan doc to manual and man page 2017-09-15 18:07:25 +02:00
Leo White 5cb27d8ebb Merge pull request #792 from sliquister/generalize-destr-subst2
Fixing the limitations on destructive substitutions
2017-09-15 09:29:29 +01:00
Florian Angeletti 588c23117b Merge pull request #1231 from Octachron/hello_κόσμος
Toplevel: only escapes bytes and not strings
2017-09-13 23:24:24 +02:00
octachron 2e6a78aa18 toplevel: only escapes bytes and not strings
Escaping strings when printing them in the toplevel has the disadvantage
of mangling unicode text:

```
\# "한글";;
- : string = "\237\149\156\234\184\128"
```

With this commit, strings are not escaped anymore, contrarily to bytes:

```
\# let cosmos = "κόσμος";;
cosmos : string = "κόσμος"
\# Bytes.of_string cosmos;;
- : bytes =
Bytes.of_string "\206\186\207\140\207\131\206\188\206\191\207\130"
```

This new behavior can be disabled dynamically by setting the environment
variable OCAMLTOP_UTF_8 to false

This change is not solely aesthetic: the mangling of unicode string may
contribute to the impression of some OCaml newcomers that Ocaml has no
support for unicode.
2017-09-12 22:28:18 +02:00
alainfrisch 80eeb3af48 Document that some warnings cannot be controlled by ocaml.warning. 2017-09-12 00:36:46 +02:00
alainfrisch 478efb5646 Doc. 2017-09-12 00:36:46 +02:00
alainfrisch b074e5666a Documentation. 2017-09-12 00:36:46 +02:00
Leo White d41c41c172 Add private extensible variants 2017-09-11 13:29:56 +01:00
Xavier Leroy 4d4cf60445 Minor rewording 2017-08-22 20:12:45 +02:00
octachron c183f0cb8e manual: update after the separation of Num 2017-08-21 14:09:22 +02:00
Christophe Troestler 1dffd7dcdf Make clear "toplevel" = "REPL" in the TOC (#1276) 2017-08-04 09:37:50 +01:00
yallop 65c932253b String_val: return 'const char *' when -safe-string is globally enabled (#1274) 2017-08-03 14:19:13 +01:00
Valentin Gatien-Baron 45f21c6d2b Teach Changes, ocamldoc and the manual about deep destructive substitutions 2017-08-01 07:40:14 -04:00
Vincent Jacques 66f2090609 Reference manual: re-add \\
As noted by @Octachron
2017-07-24 15:26:46 +02:00
Vincent Jacques 1f59f2498b Reference manual: fix grammar in Language extensions
No change entry needed
2017-07-21 19:10:06 +02:00
Vincent Jacques 7a14d5b4e7 Reference manual: fix syntax errors in grammar 2017-07-21 18:13:09 +02:00
Alain Frisch d6d1739c0b Merge branch 'trunk' into string-unicode-escapes 2017-07-20 15:23:35 +02:00
Alain Frisch fd47ba9649 Support 'let open' in class and class type expressions (#1249)
* Support 'let open' in class and class type expressions.

* Adapt ocamlprof.

* Adapt ocamldoc.

* Add tests.

* Changelog.

* Manual.
2017-07-20 08:17:30 +02:00
Daniel Bünzli dae520ca12 Add Unicode character escape \u{X+} to OCaml string literals.
The syntax of string literals is changed to add the \u{X+} escape
sequence which replaces the escape by the UTF-8 encoding of the
Unicode scalar value denoted by the hexadecimal number H made of one
to six lower or uppercase hexadecimal digits.

Unfortunately due to OCaml lax policy about escape sequences this
change can break program that trigger warning 14 on compilation. More
precisely programs which have literals with "\u" as a substring will
now either fail or the string literal will be silently compiled to
another representation in case the literal has a subsequence that
respects the \u{X+} syntax.
2017-07-20 01:11:30 +02:00
Damien Doligez f78128a7d7 merge 4.05 into trunk 2017-07-18 13:03:54 +02:00
Ng Zhi An dbbaae9648 Clarify ocamldoc -keep-code behavior 2017-07-12 17:19:58 +08:00
Damien Doligez fee01100fb Some tweaks for MPR#7557 (#1213)
* fall back to __secure_getenv when secure_getenv is not available

* use secure_getenv for instrumented runtimes

* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
2017-06-28 14:08:07 +02:00
Damien Doligez cf100bae04 Some tweaks for MPR#7557 (#1213)
* fall back to __secure_getenv when secure_getenv is not available

* use secure_getenv for instrumented runtimes

* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
2017-06-28 14:02:15 +02:00
Damien Doligez ac6dbd49ac small typo in manual 2017-06-23 17:51:38 +02:00
Florian Angeletti 8b11050021 GPR#1205: manual, remove last remnants of labltk (#1205) 2017-06-16 13:56:32 +01:00
Gabriel Scherer 139e281d20 manual: fix parallel make in manual/library
The rule said:

$(INTF): $(MLIS)
	$(OCAMLDOC) -latex [...] $(MLIS)
        # renaming of files
       	mv -f Arith_status.tex Arithstatus.tex
	mv -f Big_int.tex Bigint.tex
	mv -f Ast_helper.tex Asthelper.tex
	mv -f Ast_mapper.tex Astmapper.tex

If two targets executed at the same time depend on different files in
INTF, this rule would be executed several time in parallel, and in
particular the calls to `mv -f ...` would race with each other,
resulting in a build failure.

Now the $(OCAMLDOC) call is made unique by using a single target:

$(INTF): interfaces
interfaces: $(MLIS)
	$(OCAMLDOC) -latex [...] $(MLIS)
        [...]

Note that parallel build does not improve the build speed on my
machine; but it can still make people more productive by not breaking.
2017-06-15 07:30:58 -04:00
Gabriel Scherer ee1b6e5643 manual: build using ocamldoc.opt when available
On my machine, "make clean; make html" goes from 30s to 11s
2017-06-15 07:22:30 -04:00
octachron 488dbd9fe3 GPR#1194: update Changes and manual/README.md 2017-06-07 18:31:03 +02:00
octachron 41c042c596 GPR#1194: caml_example make mode non-optional 2017-06-07 18:14:16 +02:00
octachron 80b394c6c7 MPR#7551: allow caml_example to omit final ";;"
This commit makes it possible to omit the final ";;" in a caml_example
environment.

By default, this final ";;" is still mandatory. A new command line
option "-implicit-stop" makes it optional globally.

This global setting can be overrided locally by adding an optional
argument to the environment:

* [toplevel] makes the ";;" mandatory
* [verbatim] makes it optional

The tutorial part of the manual is configured to use the mandatory ";;"
mode globally for the sake of consistency whereas the language extension
section uses the new optional ";;" mode.
2017-06-07 16:44:28 +02:00
Gabriel Scherer 2072b5d063 Merge pull request #1187 from Octachron/document_plugins
Manual: minimal documentation for compiler plugins
2017-06-04 10:43:59 -04:00
Sébastien Hinderer 5c268a210e Documentation fix: cmti files
The documentation for the -bin-annot option did only mention .cmt files,
not .cmti ones.
2017-06-02 11:44:10 +02:00
octachron df3f4b9f61 GPR#1187: document command line flags for plugins 2017-06-01 23:24:12 +02:00
octachron 7a2a68a513 GPR#1187: describe lambda plugin hooks 2017-06-01 23:12:10 +02:00
octachron 1a4dc2fa26 GPR#1187: cite typemod and pparse plugin hooks 2017-06-01 22:43:30 +02:00
octachron 019ba2f3f6 GPR1187: Typos 2017-06-01 18:59:21 +02:00
octachron 60ad2d8145 GPR#1187: Minimal documentation for compiler plugins 2017-06-01 18:22:09 +02:00
Fabrice Le Fessant 8daa184d95 New -depend option for ocamlc/ocamlopt 2017-06-01 15:56:30 +02:00