diff6-10.chapter2.txt

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

last mod. 2008-08-28 (木) 09:50:44

diff6-10

48c48
<       and 'a queue = Empty | Node of priority * 'a * 'a queue * 'a queue
---
>       type 'a queue = Empty | Node of priority * 'a * 'a queue * 'a queue
56,57c56,57
<    Outside the structure, its components can be referred to using the ``dot
< notation'', that is, identifiers qualified by a structure name. For instance,
---
>    Outside the structure, its components can be referred to using the "dot
> notation", that is, identifiers qualified by a structure name. For instance,
92c92
<       and 'a queue
---
>       type 'a queue
113,114c113
< <<
<   module PrioQueue = (struct ... end : PRIOQUEUE);;
---
> <<module PrioQueue = (struct ... end : PRIOQUEUE);;
117,118c116
< <<
<   module PrioQueue : PRIOQUEUE = struct ... end;;
---
> <<module PrioQueue : PRIOQUEUE = struct ... end;;
127c125
<   Functors are ``functions'' from structures to structures. They are used to
---
>   Functors are "functions" from structures to structures. They are used to
173c171
<         and set = element list
---
>         type set = element list
194c192
<       and set = element list
---
>       type set = element list
228c226
<         and set
---
>         type set
241c239
<       and set = AbstractSet(OrderedString).set
---
>       type set = AbstractSet(OrderedString).set
265c263
<       and set
---
>       type set
278c276
<       and set = WrongSet(OrderedString).set
---
>       type set = WrongSet(OrderedString).set
303c301
<         and set
---
>         type set
312,313c310
< <<
<   module AbstractSet(Elt: ORDERED_TYPE) : (SET with type element = Elt.t) =
---
> <<module AbstractSet(Elt: ORDERED_TYPE) : (SET with type element = Elt.t) =
335c332
<       and set = AbstractSet(NoCaseString).set
---
>       type set = AbstractSet(NoCaseString).set
369c366
< terms of the module system. A compilation unit a comprises two files: 
---
> terms of the module system. A compilation unit A comprises two files: 
371c368
<  - the implementation file a.ml, which contains a sequence of definitions,
---
>  - the implementation file A.ml, which contains a sequence of definitions,
373c370
<  - the interface file a.mli, which contains a sequence of specifications,
---
>  - the interface file A.mli, which contains a sequence of specifications,
375,377c372,373
<    Both files define a structure named A (same name as the base name a of the
< two files, with the first letter capitalized), as if the following definition
< was entered at top-level: 
---
>    Both files define a structure named A as if the following definition was
> entered at top-level: 
379,380c375,376
<   module A: sig (* contents of file a.mli *) end
<           = struct (* contents of file a.ml *) end;;
---
>   module A: sig (* contents of file A.mli *) end
>           = struct (* contents of file A.ml *) end;;
383,394c379,389
< the ocamlc -c command (the -c option means ``compile only, do not try to
< link''); this produces compiled interface files (with extension .cmi) and
< compiled object code files (with extension .cmo). When all units have been
< compiled, their .cmo files are linked together using the ocaml command. For
< instance, the following commands compile and link a program composed of two
< compilation units aux and main: 
< <<
<   $ ocamlc -c aux.mli                     # produces aux.cmi
<   $ ocamlc -c aux.ml                      # produces aux.cmo
<   $ ocamlc -c main.mli                    # produces main.cmi
<   $ ocamlc -c main.ml                     # produces main.cmo
<   $ ocamlc -o theprogram aux.cmo main.cmo
---
> the ocamlc -c command (the -c option means "compile only, do not try to link");
> this produces compiled interface files (with extension .cmi) and compiled
> object code files (with extension .cmo). When all units have been compiled,
> their .cmo files are linked together using the ocaml command. For instance, the
> following commands compile and link a program composed of two compilation units
> Aux and Main: 
> <<$ ocamlc -c Aux.mli                     # produces aux.cmi
>   $ ocamlc -c Aux.ml                      # produces aux.cmo
>   $ ocamlc -c Main.mli                    # produces main.cmi
>   $ ocamlc -c Main.ml                     # produces main.cmo
>   $ ocamlc -o theprogram Aux.cmo Main.cmo
399,402c394,397
<   module Aux: sig (* contents of aux.mli *) end
<             = struct (* contents of aux.ml *) end;;
<   module Main: sig (* contents of main.mli *) end
<              = struct (* contents of main.ml *) end;;
---
>   module Aux: sig (* contents of Aux.mli *) end
>             = struct (* contents of Aux.ml *) end;;
>   module Main: sig (* contents of Main.mli *) end
>              = struct (* contents of Main.ml *) end;;
405,406c400,401
< contained in main.ml and main.mli can refer to definition in aux.ml, using the
< Aux.ident notation, provided these definitions are exported in aux.mli.
---
> contained in Main.ml and Main.mli can refer to definition in Aux.ml, using the
> Aux.ident notation, provided these definitions are exported in Aux.mli.

新規 編集 添付