Catálogo de publicaciones - libros

Compartir en
redes sociales


Practical OCaml

Joshua B. Smith

Resumen/Descripción – provisto por la editorial

No disponible.

Palabras clave – provistas por la editorial

Software Engineering/Programming and Operating Systems

Disponibilidad
Institución detectada Año de publicación Navegá Descargá Solicitá
No detectada 2007 SpringerLink

Información

Tipo de recurso:

libros

ISBN impreso

978-1-59059-620-3

ISBN electrónico

978-1-4302-0244-8

Editor responsable

Springer Nature

País de edición

Reino Unido

Fecha de publicación

Información sobre derechos de publicación

© Apress 2007

Tabla de contenidos

Practical: A URI Library

OCaml provides a module for dealing with paths and filenames in an operating system (OS)-independent manner (this applies only to files, not to Uniform Resource Identifiers [URIs]). I have had to convert programs from using files to using other sources of input; during one of those conversions, I wondered how nice it would be if OCaml had functions that worked with URIs such as Java. There is a very comprehensive URI module included in the Netstring library. It is a third-party library that is part of the Ocamlnet package. Written by Gerd Stoplmann, this library can be found at http://www.ocaml-programming.de.

Palabras clave: Regular Expression; Error Code; Uniform Resource Identifier; Temporary File; Translation Function.

Pp. 135-144

Using Ocamldoc

Almost everyone can agree that writing proper documentation is very important for programmers, but that this task is often overlooked or done poorly.

Palabras clave: Dependency Graph; Style Sheet; Style File; Transitive Dependency; Verbatim Text.

Pp. 145-154

Modules and Functors

OCaml provides a very advanced module system. It is based on the meta-language (ML) module system, and it is similar to systems provided in Modula-3 and Ada as well. The module system is basically a small typed language on top of OCaml that enables a programmer to group values, functions, types, classes, and other modules together.

Pp. 155-168

Practical: A Spam Filter

Everyone knows what spam is, even if they don’t know that it refers to unwanted (and usually advertisement-ridden) email instead of the venerable meat product made by the Hormel Corporation.

Palabras clave: Bayesian Classifier; Email Message; Training Function; Automatic Learning; Code Reuse.

Pp. 169-178

Practical: A Network-Aware Scoring Function

In the last Chapter, you built a simple spam detector (well, a simple text classifier that can be used for spam detection). It used an on-disk storage mechanism, which works fine for one person on one machine. However, what if that person uses multiple machines? What if you want to have many people or processes contributing information to the text storage?

Pp. 179-191

Ocamllex and Ocamlyacc

You might have heard of Lex and Yacc. Lex, the Lexical Analyzer Generator, is a tool that helps you build programs that are built around regular expressions. Yacc, Yet Another Compiler Compiler, is a program for building interpreters and compilers from grammars that you define. Although you do not have to use these tools together (people often use just Lex or Yacc with a custom lexer), but they are often used together.

Pp. 193-211

Practical: Complex Log File Parsing

Ocamllex and ocamlyacc can be used to build compilers for languages. They also can be used to handle any kind of text file that you might want to parse. Complex log files are places in which ocamllex and ocamlyacc can be used that are not often talked about in the literature.

Pp. 213-223

The Objective Part of Caml

Objective Caml includes very powerful object-oriented features. Although that might seem somewhat obvious given that “objective” is in the language name, the extent and focus of the object system in OCaml is different from many other object-oriented languages currently in use.

Palabras clave: Edit Distance; Virtual Object; Direct Object; Objective Part; Multiple Inheritance.

Pp. 225-248

Digression: OCaml Is Not Pure

Apurely functional function has no side effects. A purely functional programming language would not allow functions with side effects to be defined. But wait, there’s more! Because functions and algorithms cannot have side effects, variables are immutable and persistent. This persistence is not the same as disk storage or serialization; it means that previous versions of a given value can be retained by the language.

Palabras clave: Object Oriented Programming; Functional Programming; Functional Language; Imperative Language; Functional Programming Language.

Pp. 249-260

Digression: Functional Programming

At various points in this book, I noted that OCaml is a functional programming language. Chapter 19 told you that OCaml is not a purely functional programming language and what that lack of purity is about.

Palabras clave: Functional Programming; Functional Language; Normal File; Capability Maturity Model; Programming Style.

Pp. 261-272