In programming languages, a literal is a way of placing actual (constant) data in source code, as opposed to data stored in some variable, or computed somehow, or otherwise generated during execution. The compiler or interpreter defines certain syntaxes for identifying these places where data is being given or passed "literally".

So, 17, for instance, is an integer literal (in most sane programming languages). a = 17 might assign the literal 17 to the variable a. But 17L could (and does, in C, for instance) signal a long integer literal. "Hello World" is the syntax (in several popular languages) for a string literal. And so on. Obviously, some literals are more complex (and might be nested). In Python, you might have the list [17, "Hello World", {2: (1,2)}] which has three elements: the integer 17, the string "Hello World", and a dictionary with just one entry, the tuple of two integers 1 and 2, under the (integer) key 2...

Literals' syntax is part of the compiler or interpreter's basic parsing. Thus, in most modern mainstream languages, builtin types have their handy syntax for literals, while user-defined types and classes must make do with standardised functional constructor syntax, or whatever else is available.

Lit"er*al (?), a. [F. lit'eral, litt'eral, L. litteralis, literalis, fr. littera, litera, a letter. See Letter.]

1.

According to the letter or verbal expression; real; not figurative or metaphorical; as, the literal meaning of a phrase.

It hath but one simple literal sense whose light the owls can not abide. Tyndale
.

2.

Following the letter or exact words; not free.

A middle course between the rigor of literal translations and the liberty of paraphrasts. Hooker.

3.

Consisting of, or expressed by, letters.

The literal notation of numbers was known to Europeans before the ciphers. Johnson.

4.

Giving a strict or literal construction; unimaginative; matter-of fast; -- applied to persons.

Literal contract Law, contract of which the whole evidence is given in writing. Bouvier. -- Literal equation Math., an equation in which known quantities are expressed either wholly or in part by means of letters; -- distinguished from a numerical equation.

 

© Webster 1913.


Lit"er*al, n.

Literal meaning.

[Obs.] Sir T. Browne.

 

© Webster 1913.

Log in or register to write something here or to contact authors.