- Page 1: The Objective Caml system release 3
- Page 5 and 6: 3 9 The toplevel system (ocaml) 145
- Page 7 and 8: 5 20.9 Module Format : Pretty print
- Page 9 and 10: Foreword This manual documents the
- Page 11: Part I An introduction to Objective
- Page 14 and 15: 12 Recursive functions are defined
- Page 16 and 17: 14 # List.map (function n -> n * 2
- Page 18 and 19: 16 1.5 Imperative features Though a
- Page 20 and 21: 18 1.6 Exceptions Caml provides exc
- Page 22 and 23: 20 # | Prod(f, g) -> eval env f *.
- Page 24 and 25: 22 a list of keywords and returns a
- Page 26 and 27: 24 $ ocamlc -o fib fib.ml $ ./fib 1
- Page 28 and 29: 26 # else Node(rprio, relt, left, r
- Page 30 and 31: 28 # type element = Elt.t # type se
- Page 32 and 33: 30 # module type SET = # sig # type
- Page 34 and 35: 32 cal necessity to split the sourc
- Page 36 and 37: 34 The evaluation of the body of a
- Page 38 and 39: 36 However, the former pattern is g
- Page 40 and 41: 38 # end;; class point : int -> obj
- Page 42 and 43: 40 3.6 Class interfaces Class inter
- Page 44 and 45: 42 3.8 Multiple inheritance Multipl
- Page 46 and 47: 44 # end;; class [’a] ref_succ :
- Page 48 and 49: 46 # let l = new intlist [1; 2; 3];
- Page 50 and 51: 48 int -> object val mutable x : in
- Page 52 and 53:
50 # class type c2 = object (’a)
- Page 54 and 55:
52 # class virtual c’ = object me
- Page 56 and 57:
54 # let p = new point 5;; val p :
- Page 58 and 59:
56 method clear : unit method get :
- Page 60 and 61:
58 # let min (x : #comparable) y =
- Page 62 and 63:
60 representation, while their repr
- Page 64 and 65:
62 Labels obey the same rules as ot
- Page 66 and 67:
64 Here (test () ()) is already (0,
- Page 68 and 69:
66 of functions through functionals
- Page 70 and 71:
68 Advanced use Type-checking polym
- Page 72 and 73:
70 they also check that you use onl
- Page 74 and 75:
72 val mutable balance : Euro.c met
- Page 76 and 77:
74 val mutable history : Euro.c ope
- Page 78 and 79:
76 a single unit. This unit would b
- Page 80 and 81:
78 method copy : ostring method get
- Page 82 and 83:
80 # method pop = match l with [] -
- Page 84 and 85:
82 5.2.3 Sets Implementing sets lea
- Page 86 and 87:
84 # let count = ref 0;; val count
- Page 88 and 89:
86 constraint ’a = < identity : i
- Page 91 and 92:
Chapter 6 The Objective Caml langua
- Page 93 and 94:
Chapter 6. The Objective Caml langu
- Page 95 and 96:
Chapter 6. The Objective Caml langu
- Page 97 and 98:
Chapter 6. The Objective Caml langu
- Page 99 and 100:
Chapter 6. The Objective Caml langu
- Page 101 and 102:
Chapter 6. The Objective Caml langu
- Page 103 and 104:
Chapter 6. The Objective Caml langu
- Page 105 and 106:
Chapter 6. The Objective Caml langu
- Page 107 and 108:
Chapter 6. The Objective Caml langu
- Page 109 and 110:
Chapter 6. The Objective Caml langu
- Page 111 and 112:
Chapter 6. The Objective Caml langu
- Page 113 and 114:
Chapter 6. The Objective Caml langu
- Page 115 and 116:
Chapter 6. The Objective Caml langu
- Page 117 and 118:
Chapter 6. The Objective Caml langu
- Page 119 and 120:
Chapter 6. The Objective Caml langu
- Page 121 and 122:
Chapter 6. The Objective Caml langu
- Page 123 and 124:
Chapter 6. The Objective Caml langu
- Page 125 and 126:
Chapter 6. The Objective Caml langu
- Page 127 and 128:
Chapter 6. The Objective Caml langu
- Page 129 and 130:
Chapter 6. The Objective Caml langu
- Page 131 and 132:
Chapter 6. The Objective Caml langu
- Page 133 and 134:
Chapter 7 Language extensions This
- Page 135:
Part III The Objective Caml tools 1
- Page 138 and 139:
136 • Arguments ending in .cma ar
- Page 140 and 141:
138 -I directory Add the given dire
- Page 142 and 143:
140 runtime-name, built earlier wit
- Page 144 and 145:
142 This error can also appear if a
- Page 146 and 147:
144 linked in “custom runtime”
- Page 148 and 149:
146 Finally, a phrase can also cons
- Page 150 and 151:
148 therefore slightly faster, but
- Page 152 and 153:
150 9.4 Common errors This section
- Page 154 and 155:
152
- Page 156 and 157:
154 10.2 Options The following comm
- Page 158 and 159:
156 3. Directories specified at lin
- Page 160 and 161:
158
- Page 162 and 163:
160 • Arguments ending in .cmx ar
- Page 164 and 165:
162 -nolabels Ignore non-optional l
- Page 166 and 167:
164 L/l enable/disable warnings for
- Page 168 and 169:
166
- Page 170 and 171:
168 12.2 Syntax of lexer definition
- Page 172 and 173:
170 Lexing.lexeme lexbuf Return the
- Page 174 and 175:
172 %right symbol . . . symbol %non
- Page 176 and 177:
174 ; | expr TIMES expr { $1 * $3 }
- Page 178 and 179:
176
- Page 180 and 181:
178 13.2 A typical Makefile Here is
- Page 182 and 183:
180
- Page 184 and 185:
182 Most options can also be modifi
- Page 186 and 187:
184
- Page 188 and 189:
186 ocamldoc.sty included in the OC
- Page 190 and 191:
188 Type-checking options OCamldoc
- Page 192 and 193:
190 Options for generating man file
- Page 194 and 195:
192 (******************************
- Page 196 and 197:
194 end module M = struct (** The c
- Page 198 and 199:
196 class type foo = object (** com
- Page 200 and 201:
198 {- item 2} {- item 3}} The list
- Page 202 and 203:
200 Note: The new class can inherit
- Page 204 and 205:
202
- Page 206 and 207:
204 -I directory Add directory to t
- Page 208 and 209:
206 function pat1 -> bowtie expr1 |
- Page 210 and 211:
208 16.4.5 Killing the program kill
- Page 212 and 213:
210 application), and is valid only
- Page 214 and 215:
212 16.8.6 Communication between th
- Page 216 and 217:
214 In addition, Emacs displays the
- Page 218 and 219:
216
- Page 220 and 221:
218 For instance, compiling with oc
- Page 222 and 223:
220
- Page 224 and 225:
222 external input2 : in_channel *
- Page 226 and 227:
224 18.1.3 Statically linking C cod
- Page 228 and 229:
226 ocamlc -a -o mylib.cma a.cmo b.
- Page 230 and 231:
228 18.2.2 Blocks Blocks in the hea
- Page 232 and 233:
230 Constructed term Representation
- Page 234 and 235:
232 18.4.4 Allocating blocks Simple
- Page 236 and 237:
234 Note: some C compilers give bog
- Page 238 and 239:
236 initialize(&Field(v, n), w); Ot
- Page 240 and 241:
238 value curses_initscr(value unit
- Page 242 and 243:
240 If the C code wishes to catch e
- Page 244 and 245:
242 the name of the executable file
- Page 246 and 247:
244 ocamlc -custom -output-obj -o m
- Page 248 and 249:
246 functions input_value or Marsha
- Page 250 and 251:
248 deserialization begins! Thus, t
- Page 252 and 253:
250 Example Consider a Caml interfa
- Page 255 and 256:
Chapter 19 The core library This ch
- Page 257 and 258:
Chapter 19. The core library 255 Ex
- Page 259 and 260:
Chapter 19. The core library 257 va
- Page 261 and 262:
Chapter 19. The core library 259 n
- Page 263 and 264:
Chapter 19. The core library 261 va
- Page 265 and 266:
Chapter 19. The core library 263 Un
- Page 267 and 268:
Chapter 19. The core library 265 Ou
- Page 269 and 270:
Chapter 19. The core library 267 va
- Page 271 and 272:
Chapter 19. The core library 269 va
- Page 273 and 274:
Chapter 19. The core library 271 19
- Page 275 and 276:
Chapter 20 The standard library Thi
- Page 277 and 278:
Chapter 20. The standard library 27
- Page 279 and 280:
Chapter 20. The standard library 27
- Page 281 and 282:
Chapter 20. The standard library 27
- Page 283 and 284:
Chapter 20. The standard library 28
- Page 285 and 286:
Chapter 20. The standard library 28
- Page 287 and 288:
Chapter 20. The standard library 28
- Page 289 and 290:
Chapter 20. The standard library 28
- Page 291 and 292:
Chapter 20. The standard library 28
- Page 293 and 294:
Chapter 20. The standard library 29
- Page 295 and 296:
Chapter 20. The standard library 29
- Page 297 and 298:
Chapter 20. The standard library 29
- Page 299 and 300:
Chapter 20. The standard library 29
- Page 301 and 302:
Chapter 20. The standard library 29
- Page 303 and 304:
Chapter 20. The standard library 30
- Page 305 and 306:
Chapter 20. The standard library 30
- Page 307 and 308:
Chapter 20. The standard library 30
- Page 309 and 310:
Chapter 20. The standard library 30
- Page 311 and 312:
Chapter 20. The standard library 30
- Page 313 and 314:
Chapter 20. The standard library 31
- Page 315 and 316:
Chapter 20. The standard library 31
- Page 317 and 318:
Chapter 20. The standard library 31
- Page 319 and 320:
Chapter 20. The standard library 31
- Page 321 and 322:
Chapter 20. The standard library 31
- Page 323 and 324:
Chapter 20. The standard library 32
- Page 325 and 326:
Chapter 20. The standard library 32
- Page 327 and 328:
Chapter 20. The standard library 32
- Page 329 and 330:
Chapter 20. The standard library 32
- Page 331 and 332:
Chapter 20. The standard library 32
- Page 333 and 334:
Chapter 20. The standard library 33
- Page 335 and 336:
Chapter 20. The standard library 33
- Page 337 and 338:
Chapter 20. The standard library 33
- Page 339 and 340:
Chapter 20. The standard library 33
- Page 341 and 342:
Chapter 20. The standard library 33
- Page 343 and 344:
Chapter 20. The standard library 34
- Page 345 and 346:
Chapter 20. The standard library 34
- Page 347 and 348:
Chapter 20. The standard library 34
- Page 349 and 350:
Chapter 20. The standard library 34
- Page 351 and 352:
Chapter 20. The standard library 34
- Page 353 and 354:
Chapter 20. The standard library 35
- Page 355 and 356:
Chapter 20. The standard library 35
- Page 357 and 358:
Chapter 21 The unix library: Unix s
- Page 359 and 360:
Chapter 21. The unix library: Unix
- Page 361 and 362:
Chapter 21. The unix library: Unix
- Page 363 and 364:
Chapter 21. The unix library: Unix
- Page 365 and 366:
Chapter 21. The unix library: Unix
- Page 367 and 368:
Chapter 21. The unix library: Unix
- Page 369 and 370:
Chapter 21. The unix library: Unix
- Page 371 and 372:
Chapter 21. The unix library: Unix
- Page 373 and 374:
Chapter 21. The unix library: Unix
- Page 375 and 376:
Chapter 21. The unix library: Unix
- Page 377 and 378:
Chapter 21. The unix library: Unix
- Page 379 and 380:
Chapter 21. The unix library: Unix
- Page 381 and 382:
Chapter 21. The unix library: Unix
- Page 383 and 384:
Chapter 21. The unix library: Unix
- Page 385 and 386:
Chapter 21. The unix library: Unix
- Page 387 and 388:
Chapter 21. The unix library: Unix
- Page 389 and 390:
Chapter 21. The unix library: Unix
- Page 391 and 392:
Chapter 22 The num library: arbitra
- Page 393 and 394:
Chapter 22. The num library: arbitr
- Page 395 and 396:
Chapter 22. The num library: arbitr
- Page 397 and 398:
Chapter 22. The num library: arbitr
- Page 399 and 400:
Chapter 23 The str library: regular
- Page 401 and 402:
Chapter 23. The str library: regula
- Page 403 and 404:
Chapter 23. The str library: regula
- Page 405 and 406:
Chapter 24 The threads library The
- Page 407 and 408:
Chapter 24. The threads library 405
- Page 409 and 410:
Chapter 24. The threads library 407
- Page 411 and 412:
Chapter 24. The threads library 409
- Page 413 and 414:
Chapter 25 The graphics library The
- Page 415 and 416:
Chapter 25. The graphics library 41
- Page 417 and 418:
Chapter 25. The graphics library 41
- Page 419 and 420:
Chapter 25. The graphics library 41
- Page 421 and 422:
Chapter 25. The graphics library 41
- Page 423 and 424:
Chapter 26 The dbm library: access
- Page 425 and 426:
Chapter 27 The dynlink library: dyn
- Page 427 and 428:
Chapter 28 The LablTk library: Tcl/
- Page 429 and 430:
Chapter 28. The LablTk library: Tcl
- Page 431 and 432:
Chapter 28. The LablTk library: Tcl
- Page 433 and 434:
Chapter 28. The LablTk library: Tcl
- Page 435 and 436:
Chapter 29 The bigarray library The
- Page 437 and 438:
Chapter 29. The bigarray library 43
- Page 439 and 440:
Chapter 29. The bigarray library 43
- Page 441 and 442:
Chapter 29. The bigarray library 43
- Page 443 and 444:
Chapter 29. The bigarray library 44
- Page 445 and 446:
Chapter 29. The bigarray library 44
- Page 447 and 448:
Chapter 29. The bigarray library 44
- Page 449 and 450:
Chapter 29. The bigarray library 44
- Page 451 and 452:
Chapter 29. The bigarray library 44
- Page 453:
Part V Appendix 451
- Page 456 and 457:
454 atan, 260 atan2, 260 at_exit, 2
- Page 458 and 459:
456 exp, 259, 283 Failure, 254, 342
- Page 460 and 461:
458 int_of_num, 392 int_of_string,
- Page 462 and 463:
460 open_out, 266 open_out_bin, 266
- Page 464 and 465:
462 rev_map, 316, 340 rev_map2, 316
- Page 466 and 467:
464 tcgetattr, 383 tcsendbreak, 384
- Page 468:
466 Index of keywords and, see let,