explicitConstant
From OpenTuring
| explicitConstant | literal |
| Syntax | An explicitConstant is one of:
| |||||||||||||||||||||||||||||||||||||||||||||
| Description | An explicitConstant gives its value directly. For example, the value of the explicit constant 25 is twenty-five.
| |||||||||||||||||||||||||||||||||||||||||||||
| Example | In the following, the explicit constants are "Hello world", 3.14159 and 2. Note that pi is a named constant rather than an explicit constant.
put "Hello world"
var diameter : real
const pi := 3.14159
diameter := pi * r ** 2
var x := diameter
| |||||||||||||||||||||||||||||||||||||||||||||
| Details | In some programming languages, explicit constants are called literals or literal values, because they literally (explicitly) give their values.
| |||||||||||||||||||||||||||||||||||||||||||||
| See also | explicitStringConstant, explicitIntegerConstant, explicitRealConstant, explicitTrueFalseConstant and explicitCharConstant. See also enumeratedValue.
| |||||||||||||||||||||||||||||||||||||||||||||