Trouble with or'ed type and var return type.

2021-10-29 Thread Araq
c2nim has an `#isarray` directive for that. It's rather new.

Trouble with or'ed type and var return type.

2021-10-29 Thread geekrelief
I guess the real problem is that I'm interop'ing with C via nimterop, and it's hard to tell the difference between a pointer and array. This is an attempt to put a band-aid over the C API to make things cleaner. Thanks for the clarification!

Trouble with or'ed type and var return type.

2021-10-28 Thread Araq
The `|` operator for types doesn't "lift" the properties of the or'ed types: If A and B are mutable, `A|B` still isn't. That said, array indexing for `ptr T` is just wrong anyway, it's indexing into `ptr UncheckedArray[T]` and type systems and compilers work better when you're precise.

Trouble with or'ed type and var return type.

2021-10-28 Thread geekrelief
I'm wondering why the iterator `mitems` with an or'ed type doesn't compile. The error originates from line 32 when using an `UncheckedArray`: expression has no address. If you comment out the last `mitems` and uncomment the two above, it works fine. I'm try