Skip to Content
Programming Languages: Concepts and Implementation
book

Programming Languages: Concepts and Implementation

by Saverio Perugini
December 2021
Beginner
840 pages
47h 29m
English
Jones & Bartlett Learning
Content preview from Programming Languages: Concepts and Implementation

B.12 Input and Output

I/O is among the impure features of ML since I/O in ML involves side effect.

B.12.1 Input

The option data type has two values: NONE and SOME. Use isSome (χ) to determine the value of a variable of type option. Use valOf (χ) to extract the value of a variable of type option. A string option list is not the same as a string list.

Standard Input

The standard input stream generally does not need to be opened and closed.

A set of three code lines in M L that is a standard input stream.
Description

File Input

The following example demonstrates file input in ML.

A set of 25 code lines in M L for demonstrating file input.
Description

B.12.2 Parsing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concepts and Semantics of Programming Languages 1

Concepts and Semantics of Programming Languages 1

Therese Hardin, Mathieu Jaume, Francois Pessaux, Veronique Viguie Donzeau-Gouge
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9781284222739