Wollok only supports range for integer values?
class Range extends AbstractJavaWrapper<IntegerRange>
If i do
var rango =new Range(5,10)
rango.map({x=>x*2}).toString()
i get [10, 12, 14, 16, 18, 20]
but if i do
var rango = new Range(5.0,10.0)
rango.map({x=>x*2.0}).toString()
i get
wollok.lang.Exception: java.math.BigDecimal cannot be cast to java.lang.Integer at wollok.lang.Range.forEach(closure) [/wollok.wlk:602] at wollok.lang.Range.map(closure) [/wollok.wlk:606] at [/test.wtest:5]
Why Wollok allow me to construct a range of doubles if i cannot do anything with it? My point here is being consistent, don't allow me to construct an invalid range of Doubles values or let me make range of nums to play with them.
Wollok only supports range for integer values?
class Range extends AbstractJavaWrapper<IntegerRange>
If i do
i get [10, 12, 14, 16, 18, 20]
but if i do
i get
wollok.lang.Exception: java.math.BigDecimal cannot be cast to java.lang.Integer at wollok.lang.Range.forEach(closure) [/wollok.wlk:602] at wollok.lang.Range.map(closure) [/wollok.wlk:606] at [/test.wtest:5]
Why Wollok allow me to construct a range of doubles if i cannot do anything with it? My point here is being consistent, don't allow me to construct an invalid range of Doubles values or let me make range of nums to play with them.