Constants
Language | Example |
---|---|
Schema / Rust | const NAME: T = <literal>; |
Go | const Name T = <literal> |
Kotlin | const val NAME: T = <literal> |
TypeScript | const name: T = <literal>; |
Python | NAME: T = <literal> |
Schema
mabo
const VALUE_BOOL: bool = true;
const VALUE_U8: u8 = 1;
const VALUE_U16: u16 = 2;
const VALUE_U32: u32 = 3;
const VALUE_U64: u64 = 4;
const VALUE_U128: u128 = 5;
const VALUE_I8: i8 = -1;
const VALUE_I16: i16 = -2;
const VALUE_I32: i32 = -3;
const VALUE_I64: i64 = -4;
const VALUE_I128: i128 = -5;
const VALUE_F32: f32 = 1;
const VALUE_F64: f64 = 2;
const VALUE_STR: &string = "abc";
const VALUE_BYTES: &bytes = [1, 2, 3];
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Languages
rs
const VALUE_BOOL: bool = true;
const VALUE_U8: u8 = 1;
const VALUE_U16: u16 = 2;
const VALUE_U32: u32 = 3;
const VALUE_U64: u64 = 4;
const VALUE_U128: u128 = 5;
const VALUE_I8: i8 = -1;
const VALUE_I16: i16 = -2;
const VALUE_I32: i32 = -3;
const VALUE_I64: i64 = -4;
const VALUE_I128: i128 = -5;
const VALUE_F32: f32 = 1.0;
const VALUE_F64: f64 = 2.0;
const VALUE_STR: &str = "abc";
const VALUE_BYTES: &[u8] = &[1, 2, 3];
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
go
const (
ValueBool bool = true
ValueU8 uint8 = 1
ValueU16 uint16 = 2
ValueU32 uint32 = 3
ValueU64 uint64 = 4
ValueI8 int8 = -1
ValueI16 int16 = -2
ValueI32 int32 = -3
ValueI64 int64 = -4
ValueF32 float32 = 1.0
ValueF64 float64 = 2.0
ValueStr string = "abc"
)
var (
ValueU128 *big.Int = big.NewInt(5)
ValueI128 *big.Int = big.NewInt(-5)
ValueBytes []byte = []byte{1, 2, 3}
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
kt
const val VALUE_BOOL: Boolean = true
const val VALUE_U8: UByte = 1u
const val VALUE_U16: UShort = 2u
const val VALUE_U32: UInt = 3u
const val VALUE_U64: ULong = 4u
const val VALUE_I8: Byte = -1
const val VALUE_I16: Short = -2
const val VALUE_I32: Int = -3
const val VALUE_I64: Long = -4
const val VALUE_F32: Float = 1.0f
const val VALUE_F64: Double = 2.0
const val VALUE_STR: String = "abc"
val VALUE_U128: BigInteger = BigInteger.valueOf(5)
val VALUE_I128: BigInteger = BigInteger.valueOf(-5)
val VALUE_BYTES: ByteArray = byteArrayOf(1, 2, 3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ts
const VALUE_BOOL: boolean = true;
const VALUE_U8: number = 1;
const VALUE_U16: number = 2;
const VALUE_U32: number = 3;
const VALUE_U64: bigint = 4n;
const VALUE_U128: bigint = 5n;
const VALUE_I8: number = -1;
const VALUE_I16: number = -2;
const VALUE_I32: number = -3;
const VALUE_I64: bigint = -4n;
const VALUE_I128: bigint = -5n;
const VALUE_F32: number = 1.0;
const VALUE_F64: number = 2.0;
const VALUE_STR: string = "abc";
const VALUE_BYTES: number[] = [1, 2, 3];
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
py
VALUE_BOOL: bool = True
VALUE_U8: int = 1
VALUE_U16: int = 2
VALUE_U32: int = 3
VALUE_U64: int = 4
VALUE_U128: int = 5
VALUE_I8: int = -1
VALUE_I16: int = -2
VALUE_I32: int = -3
VALUE_I64: int = -4
VALUE_I128: int = -5
VALUE_F32: float = 1.0
VALUE_F64: float = 2.0
VALUE_STR: str = "abc"
VALUE_BYTES: bytes = bytes([1, 2, 3])
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19