Download PDF by Hickey J.: Introduction to the Objective Caml programming language

By Hickey J.

Show description

Read or Download Introduction to the Objective Caml programming language PDF

Similar programming books

Read e-book online Microsoft SQL Server 7.0 System Administration Training Kit PDF

The objective viewers of this identify is SQL Server directors who set up, configure, and help SQL server in an firm community. enterprise proprietors, contractors, and database directors also will locate all they should find out about Microsoft SQL Server.

Joshua Noble's Programming Interactivity, 2nd Edition PDF

Able to create wealthy interactive stories together with your paintings, designs, or prototypes? this can be the proper position to begin. With this hands-on consultant, you’ll discover numerous issues in interactive artwork and design—including 3D snap shots, sound, actual interplay, laptop imaginative and prescient, and geolocation—and examine the elemental programming and electronics strategies you want to enforce them.

Download PDF by Marco Buttu: Programmare con Python: Guida completa

Python è un linguaggio di programmazione multipiattaforma, robusto e maturo, a cui si affidano le più prestigiose aziende e organizzazioni a livello mondiale, come Google, los angeles NASA, YouTube, Intel e Yahoo! Il suo successo è legato sia al fatto che favorisce l. a. produttività, rendendo semplice lo sviluppo di sistemi software program anche molto complessi, sia al fatto che ha molteplici ambiti di utilizzo: applicazioni net, giochi e multimedia, interfacce grafiche, networking, applicazioni scientifiche, intelligenza artificiale, programmazione di sistema e tanto altro ancora.

Additional info for Introduction to the Objective Caml programming language

Example text

For example, Ocaml analyzes the format string to tell that the following fprintf function should take a float, int, and string argument. 4. PRINTF 65 The format specification corresponds roughly to the C specification. Each format argument takes a width and length specifier that corresponds to the C specification. d or i convert an integer argument to signed decimal u convert an integer argument to unsigned decimal x convert an integer argument to unsigned hexadecimal, using lowercase letters. ddd e+-dd (mantissa and exponent) g or G convert a floating-point argument to decimal notation, in style f or e, E (whichever is more compact) b convert a Boolean argument to the string true or false a user-defined printer.

A function application is not a value, and a record with mutable fields is not a value. By this definition, the x and one shot variables cannot be polymorphic, as the type constants ’_a indicate. 3 Arrays and strings Arrays are fixed-size vectors of values. All of the values must have the same type. The fields in the array can be accessed and modified in constant time. Arrays can be created with the [ |e1 ; . . ; en | ] syntax, which creates an array of length n initialized with the values computed from the expressions e1 , .

7 # let fst3 (x, _, _) = x;; val fst3 : ’a * ’b * ’c -> ’a = # fst3 t;; - : int = 1 Note also that the pattern assignment is simultaneous. The following expression swaps the values of x and y. # let val x # let val y # let val x val y x = 1;; : int = 1 y = "Hello";; : string = "Hello" x, y = y, x;; : string = "Hello" : int = 1 36 CHAPTER 5. TUPLES, LISTS, AND POLYMORPHISM Since the components of a tuple are unnamed, tuples are most appropriate if they have a small number of well-defined components.

Download PDF sample

Introduction to the Objective Caml programming language by Hickey J.

by George

Rated 4.73 of 5 – based on 24 votes