liveBook · Manning

Literal

A literal is a language construct that directly denotes a fixed value or specifies an exact value permitted by a type.

How 6 Manning books explain it

Modern C, Third Edition

A literal is source text that denotes a fixed value directly in a C program.

How it is used
Distinguishes fixed values written directly in C source from entities named by identifiers.
How deep it goes
Explains numerical, character, and string forms, including bases, types, suffixes, and conversion portability.
Examples
Uses integer bases, decimal and hexadecimal floating-point forms, character escapes, string literals, and a strtoul conversion.
What you can do after
Evaluate/understand literal spellings and types, and recognize portability hazards when converting strings to numbers.

Read how Modern C, Third Edition explains literal →

Modern C

A literal is a C source notation that directly represents a fixed value.

How it is used
Introduces literals as fixed values in C programs and uses integer literals in preprocessor conditions.
How deep it goes
Explains literal notation, string concatenation, sign handling, and decimal integer type selection, including a platform-dependent boundary example.
Examples
Uses octal 077, scientific notation, adjacent string literals, and -32768 on a platform with a 32767 signed maximum.
What you can do after
Evaluate literal forms and their types, including why a leading minus is an operator rather than part of a numerical literal.

Read how Modern C explains literal →

Clojure: The Essential Reference

A compile-time literal is a fixed Clojure value recognized by the compiler without evaluating an expression to obtain it.

How it is used
Provides fixed branch tests for fast conditional selection with `case`.
How deep it goes
Defines accepted test forms and explains why expression-shaped tests are not evaluated, including duplicate-test and missing-default errors.
Examples
Uses numeric branches, expression-shaped tests, quoted-symbol collisions, and grouped operator names.
What you can do after
Apply it via `case` to choose valid constant tests and avoid mistaking expressions for evaluated tests.

Read how Clojure: The Essential Reference explains literal →

Rust in Action: Systems programming concepts and techniques

A literal form is Rust syntax that directly initializes or denotes a value according to the type's literal representation.

How it is used
Introduces Rust values through bindings, numeric notation, and direct field initialization.
How deep it goes
Explains literal forms with runnable examples and contrasts field initialization with a conventional static method.
Examples
Uses integer addition, base conversions, complex-number initialization, and one-byte literals as examples.
What you can do after
Understand how to recognize and write illustrated Rust literal forms and distinguish field initialization from a new method.

Read how Rust in Action: Systems programming concepts and techniques explains literal →

Learn SQL in a Month of Lunches

A literal value is a fixed constant written directly in an SQL statement rather than retrieved from a column or calculated dynamically.

How it is used
Uses fixed values to assign variables, label UNION rows, pass procedure arguments, and establish column defaults.
How deep it goes
Defines literals and demonstrates them in SELECT, UNION, defaults, and procedure calls, but does not develop formal expression theory.
Examples
Demonstrates date assignment, customer and author labels, the argument 1049, and a shipment-date default.
What you can do after
Apply it via SELECT, UNION, DEFAULT constraints, and stored-procedure calls when a known value belongs directly in SQL.

Read how Learn SQL in a Month of Lunches explains literal →

Julia as a Second Language

A number literal is a source-code notation that directly represents a numeric value with digits rather than a variable name.

How it is used
Represents numeric values directly in Julia source while selecting or signaling their numeric type.
How deep it goes
Defines numeric notation, demonstrates inferred types and suffixes, and briefly extends literals through macros without teaching macro internals.
Examples
Uses decimal, hexadecimal, rational, Float32, Float16, BigInt, and custom Int8 literal examples inspected in the REPL.
What you can do after
Apply it to write numeric values, inspect their types, choose conversions, and avoid confusing floating-point suffixes with multiplication.

Read how Julia as a Second Language explains literal →

Also covered in

What to know first

Related concepts

Questions about literal

What is literal?

A literal is a language construct that directly denotes a fixed value or specifies an exact value permitted by a type.

Which Manning books explain literal?

Modern C, Third Edition, Modern C, Clojure: The Essential Reference, Rust in Action: Systems programming concepts and techniques, Learn SQL in a Month of Lunches and Julia as a Second Language.

What should I know before learning literal?

Manning books that teach literal usually introduce long, closure, floating-point arithmetic and function first.

What is the difference between literal and variable?

A literal is a language construct that directly denotes a fixed value or specifies an exact value permitted by a type. A variable is a named program binding or entity associated with a value that can be accessed and, when permitted, changed during computation.

What kinds of literal are there?

Kinds of literal include byte string literal, decimal literal and decimal floating-point constant.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.