Developing Applications with Objective Caml by Emmanuel Chailloux, Pascal Manoury, Bruno Pagano

By Emmanuel Chailloux, Pascal Manoury, Bruno Pagano

Show description

Read Online or Download Developing Applications with Objective Caml PDF

Similar programming: programming languages books

The J2EE Tutorial

* mild, self-paced introductions to servlets, JSP, JDBC, EJBs, XML, JMS, JNDI, and lots of different key subject matters. * Follows a similar process and structure that made The JavaTTM instructional a world best-seller! * comprises CD-ROM containing all content material, examples, and either the J2EE and J2SE model 1. three software program structures.

Informatik kompakt: Eine grundlegende Einfuhrung mit Java

Die Autoren geben eine fundierte Einf? hrung in die Informatik, die von Anfang an die Zusammenh? nge zwischen den Teilgebieten des Faches betont. Das Buch ist kompakt, weil der gemeinsame Kern der verschiedenen Informatikgebiete betrachtet wird. In einer integrativen Sichtweise werden Modellierung, abstrakte Datentypen, Algorithmen sowie nebenl?

Durchstarten mit HTML5

HTML5 ist die neueste model der Markup-Sprache, die das net noch einmal gehörig auf den Kopf stellt. Obwohl die Entwicklung noch nicht abgeschlossen ist, werden viele HTML5-Elemente von modernen Browsern schon jetzt unterstützt. Zeit additionally, die Neuerungen zu erkunden und sich healthy für die Zukunft zu machen.

Additional resources for Developing Applications with Objective Caml

Example text

Pattern matching with guards Pattern matching with guards corresponds to the evaluation of a conditional expression immediately after the pattern is matched. If this expression comes back true, then the expression associated with that pattern is evaluated, otherwise pattern matching continues with the following pattern. Syntax : match expr with .. | pi when condi –> expri .. The following example uses two guards to test equality of two rationals.

Function pn –> expr The following declarations of succ and g are equivalent to their previous declaration. # let succ x = x + 1 ; ; Functional core of Objective Caml 25 val succ : int -> int = # let g x y = 2*x + 3*y ; ; val g : int -> int -> int = The completely functional character of Objective Caml is brought out by the following example, in which the function h1 is obtained by the application of g to a single integer. In this case one speaks of partial application: # let h1 = g 1 ; ; val h1 : int -> int = # h1 2 ; ; - : int = 8 One can also, starting from g, define a function h2 by fixing the value of the second parameter, y, of g: # let h2 = function x → g x 2 ; ; val h2 : int -> int = # h2 1 ; ; - : int = 8 Declaration of infix functions Certain functions taking two arguments can be applied in infix form.

This is the case with addition of integers. One writes 3 + 5 for the application of + to 3 and 5. To use the symbol + as a regular function value, this must be syntactically indicated by surrounding the infix symbol with parentheses. The syntax is as follows: Syntax : ( op ) The following example defines the function succ using ( + ). # ( + ) ;; - : int -> int -> int = # let succ = ( + ) 1 ; ; val succ : int -> int = # succ 3 ; ; - : int = 4 It is also possible to define new operators.

Download PDF sample

Rated 4.72 of 5 – based on 24 votes