ringabout
ringabout
Perhaps we should allow empty tuple types constructed in parentheses: ```nim var x: () ``` After all ```nim var x: tuple[] ``` compiles
It's really annoying for `range` types though, I would expect tons of **mis**usages of `ranges` ```nim let z: seq[range['a'..'z']] = @['c'] ``` Otherwise stdlibs need a `requireInit` typetraits for using...
```nim proc arrayWithDefault*[T](size: static int): array[size, T] {.noinit, nodestroy, raises: [].} = ## Creates a new array filled with `default(T)`. for i in 0..size-1: result[i] = default(T) proc setLen[T](s: var...
It seems that It can make do by making the low bound value the default value of range types, e.g., simple range types only, like `default(range[3..4])` The annoying cases are...
!nim c ```nim type MyType = tuple[] | int ```
It seems that this doesn't work anymore See also https://github.com/nim-lang/Nim/pull/20994#discussion_r1139029958 ```nim type MyType = (tuple[] | int) ``` This should be used instead
> Literals must match the datatype, for example, 333'i8 is an invalid literal. Non-base-10 literals are used mainly for flags and bit pattern representations, therefore the checking is done on...
> but, 0b10000000'i8 == 0x80'i8 == -1 instead of causing an overflow error. In the manual, it says it returns `-1` instead of causing an overflow error. Though we can...
It seems that an extra VM opcode needs to be introduced for `rangecheck`
> tupleConstr = '(' optInd (exprColonEqExpr comma?)* optPar ')' I think this intended to mean in the position of the last element or when there is no value in the...