diff6-10.chapter8.txt

このページは最後に更新されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

last mod. 2008-08-28 (木) 10:00:54

diff6-10

15c15,16
< compilers. It accepts several types of arguments:
---
> compilers. It accepts several types of arguments and processes them
> sequentially:
92a94
>  
95,96c97
<    of the library can be set with the -o option. The default name is
<    library.cma. 
---
>    of the library must be set with the -o option.
111c112
<    ``custom runtime'' mode (see the -custom option). This causes the given C
---
>    "custom runtime" mode (see the -custom option). This causes the given C
115c116
<    linking in ``custom runtime'' mode (see the -custom option). For instance,
---
>    linking in "custom runtime" mode (see the -custom option). For instance,
118c119
<  -custom  Link in ``custom runtime'' mode. In the default linking mode, the
---
>  -custom  Link in "custom runtime" mode. In the default linking mode, the
123c124
<    if the ocamlrun command is not installed. Moreover, the ``custom runtime''
---
>    if the ocamlrun command is not installed. Moreover, the "custom runtime"
126,128c127,128
<                    Never use the strip command on executables produced by
<                   ocamlc -custom. This would remove the bytecode part of the
<                   executable. 
---
>        Never use the strip command on executables produced by ocamlc -custom.
>       This would remove the bytecode part of the executable. 
140a141,146
>  -dtypes  Dump detailed type information. The information for file x.ml is put
>    into file x.annot. In case of a type error, dump all the information
>    inferred by the type-checker before the error. The x.annot file can be used
>    with the emacs commands given in emacs/caml-types.el to display types
>    interactively.
>  
143c149,150
<    chapter 16).
---
>    chapter 16), and to produce stack backtraces when the program terminates on
>    an uncaught exception (see section 10.2).
146,151c153,159
<    or their definitions) when compiling an implementation (.ml file). This can
<    be useful to check the types inferred by the compiler. Also, since the
<    output follows the syntax of interfaces, it can help in writing an explicit
<    interface (.mli file) for a file: just redirect the standard output of the
<    compiler to a .mli file, and edit that file to remove all declarations of
<    unexported names.
---
>    or their definitions) when compiling an implementation (.ml file). No
>    compiled files (.cmo and .cmi files) are produced. This can be useful to
>    check the types inferred by the compiler. Also, since the output follows the
>    syntax of interfaces, it can help in writing an explicit interface (.mli
>    file) for a file: just redirect the standard output of the compiler to a
>    .mli file, and edit that file to remove all declarations of unexported
>    names.
196,198c204,208
<    default output name is a.out, in keeping with the Unix tradition. If the -a
<    option is given, specify the name of the library produced. If the
<    -output-obj option is given, specify the name of the output file produced.
---
>    default output name is a.out under Unix and camlprog.exe under Windows. If
>    the -a option is given, specify the name of the library produced. If the
>    -pack option is given, specify the name of the packed object file produced.
>    If the -output-obj option is given, specify the name of the output file
>    produced.
209,210c219
<    <<
<              ocamlc -pack -o p.cmo a.cmo b.cmo c.cmo
---
>    <<        ocamlc -pack -o p.cmo a.cmo b.cmo c.cmo
235c244,245
<    supported.
---
>    supported. Note that once you have created an interface using this flag, you
>    must use it again for all dependencies.
238,239c248
<    threads library described in chapter 24. What this option actually does is
<    select a special, thread-safe version of the standard library.
---
>    system threads library described in chapter 24.
259a269,271
>  -vmthread  Compile or link multithreaded programs, in combination with the
>    VM-level threads library described in chapter 24.
>  
266a279,281
>     E/e  enable/disable warnings for fragile pattern matchings (matchings that
>       would remain complete if additional constructors are added to a variant
>       type involved). 
274c289,290
<       (e.g. expr1; expr2 when expr1 does not have type unit). 
---
>       (e.g. expr1; expr2 when expr1 does not have type unit), and that are not
>       functions (covered by warning F). 
277,278c293,301
<     X/x  enable/disable all other warnings. 
<   The default setting is -w Al (all warnings but labels enabled).
---
>     Y/y  enable/disable warnings for unused variables bound with the let or as
>       keywords and that don't start with an underscore. 
>     Z/z  enable/disable warnings for all other unused variables that don't
>       start with an underscore. 
>     X/x  enable/disable warnings that don't fit in the above categories. 
>   The default setting is -w Aelz (all warnings enabled except fragile
>    matchings, omitted labels, non-suspicious unused variables). Warnings F and
>    S rely on the type system, thus they are not triggered when the type of the
>    statement is unknown.
281,286c304,309
<    warning-list into errors. The compiler will stop on an error as soon as one
<    of these warnings is emitted, instead of going on. The warning-list is a
<    string of one or several characters, with the same meaning as for the -w
<    option: an uppercase character turns the corresponding warning into an
<    error, a lowercase character leaves it as a warning. The default setting is
<    -warn-error a (all warnings are not treated as errors).
---
>    warning-list into errors. The compiler will stop with an error when one of
>    these warnings is emitted. The warning-list is a string of one or several
>    characters, with the same meaning as for the -w option: an uppercase
>    character turns the corresponding warning into an error, a lowercase
>    character leaves it as a warning. The default setting is -warn-error a (none
>    of the warnings is treated as an error).
312,318c335,341
< looks in the search path for a file mod.cmi (note lowercasing of first letter)
< and loads the compiled interface contained in that file. As a consequence,
< renaming .cmi files is not advised: the name of a .cmi file must always
< correspond to the name of the compilation unit it implements. It is admissible
< to move them to another directory, if their base name is preserved, and the
< correct -I options are given to the compiler. The compiler will flag an error
< if it loads a .cmi file that has been renamed.
---
> looks in the search path for a file named Mod.cmi or mod.cmi and loads the
> compiled interface contained in that file. As a consequence, renaming .cmi
> files is not advised: the name of a .cmi file must always correspond to the
> name of the compilation unit it implements. It is admissible to move them to
> another directory, if their base name is preserved, and the correct -I options
> are given to the compiler. The compiler will flag an error if it loads a .cmi
> file that has been renamed.
332a356
>  
362,368c386,391
<    incompatible. For instance, the compiler can report that ``expression of
<    type foo cannot be used with type foo'', and it really seems that the two
<    types foo are compatible. This is not always true. Two type constructors can
<    have the same name, but actually represent different types. This can happen
<    if a type constructor is redefined. Example: 
<    <<
<              type foo = A | B
---
>    incompatible. For instance, the compiler can report that "expression of type
>    foo cannot be used with type foo", and it really seems that the two types
>    foo are compatible. This is not always true. Two type constructors can have
>    the same name, but actually represent different types. This can happen if a
>    type constructor is redefined. Example: 
>    <<        type foo = A | B
373,374c396,397
<  This result in the error message ``expression C of type foo cannot be used
<    with type foo''. 
---
>  This result in the error message "expression C of type foo cannot be used with
>    type foo". 
386,387c409,410
<    ``syntactic values'', which includes constants, identifiers, functions,
<    tuples of syntactic values, etc. In all other cases (for instance, expr is a
---
>    "syntactic values", which includes constants, identifiers, functions, tuples
>    of syntactic values, etc. In all other cases (for instance, expr is a
389c412,416
<    generalization is therefore turned off.
---
>    generalization is therefore turned off for all variables occuring in
>    contravariant or non-variant branches of the type. For instance, if the type
>    of a non-value is 'a list the variable is generalizable (list is a covariant
>    type constructor), but not in 'a list -> 'a list (the left branch of -> is
>    contravariant) or 'a ref (ref is non-variant).
400,401c427
<       <<
<             let sort_int_list = Sort.list (<)
---
>       <<    let sort_int_list = Sort.list (<)
405,406c431
<       <<
<             let sort_int_list = (Sort.list (<) : int list -> int list);;
---
>       <<    let sort_int_list = (Sort.list (<) : int list -> int list);;
412,413c437
<       <<
<             let map_length = List.map Array.length
---
>       <<    let map_length = List.map Array.length
418,419c442
<       <<
<             let map_length lv = List.map Array.length lv
---
>       <<    let map_length lv = List.map Array.length lv
440,441c463
<       <<
<         mod1.ml:    let f x = ... Mod2.g ...
---
>       <<mod1.ml:    let f x = ... Mod2.g ...
445,446c467
<       <<
<         mod1.ml:    let f g x = ... g ...
---
>       <<mod1.ml:    let f g x = ... g ...
451,452c472
<       <<
<         mod1.ml:    let forward_g =
---
>       <<mod1.ml:    let forward_g =
458d477
<     This will not work if g is a polymorphic function, however. 
465,466c484,485
<    libraries (DLLs), the code must be linked in ``custom runtime'' mode. Fix:
<    add the required C libraries to the command line, and possibly the -custom
---
>    libraries (DLLs), the code must be linked in "custom runtime" mode. Fix: add
>    the required C libraries to the command line, and possibly the -custom

新規 編集 添付