Currently, there is only a way to define long and double literals in configuration.
This imposes limitation on several things:
1.Other types cannot be used for primitive values
a: 23
b: 234.13
a can only be of type long, but sometimes it is useful to have int, short or byte as a type.
b can only be of type double, but sometimes it is useful to have float type as well.
Other types cannot be used in functions
x: circular(1..250, 1)
y: random(1.0..100.0)
There is no way to define those ranges to be of type byte, short, int or float.
Problem
Currently, there is only a way to define
long
anddouble
literals in configuration. This imposes limitation on several things: 1.Other types cannot be used for primitive valuesa
can only be of typelong
, but sometimes it is useful to haveint
,short
orbyte
as a type.b
can only be of typedouble
, but sometimes it is useful to havefloat
type as well.There is no way to define those ranges to be of type
byte
,short
,int
orfloat
.Proposed solution
Proposed solution is to use:
Some unanswered questions:
int
type be default when using implicit value or should we uselong
for that?double
type be default when using implicit value or should we usefloat
for that?My votes go to:
Any other syntax proposal is welcome.