You are not supposed to use `not nil` types as Option generic parameters,
Options check if a type is ref or ptr or proc then assume their nil values to
be `None` instead of using an extra bool discriminator, so `some(nil)` is also
disallowed. You used `Option[Foo]` where `Foo` is not nil. There
> So, I'll ask now.
I think the primary reason is different API design.
these 2 cmd line tools are relevant
* nimfind
* nimsuggest
* this PR
[https://github.com/nim-lang/Nim/pull/12076](https://github.com/nim-lang/Nim/pull/12076)
allows a library solution to find declarations:
allows showing where a symbol is defined (works with all symbols) eg:
@Araq I appreciate all of the work done by you and others, and I think a cycle
collector is useful even without async. That said, you know that some will ask
"Why does Nim async need a cycle collector when Rust/C++ async does not?". So,
I'll ask now.
Still looking forward to the day when I can
See
[http://ssalewski.de/nimprogramming.html#_casts_and_type_conversion](http://ssalewski.de/nimprogramming.html#_casts_and_type_conversion)
first. Then it should be easy to cast a float to an array of 8 bytes and back.
And when you have a seq containing exactly 8 bytes, then you can copy the 8
How do I cast float64 to sequence of byte`s and cast sequence of `byte`s to
`float64? float64 is just an example it could be any basic type. I already did
it for an array, but don't know how to do it for a sequence.
Thanks
I'm just getting started with Nim, and really loving it. (My background is
mostly C++ and Objective-C, but I've spent time in Java, Swift, Python, Ruby,
Smalltalk-80, and I'm currently also learning Rust.)
I'd like to use a more Rust/Swift/etc. style where `nil` is not allowed. It
looks like th
@bpr Given that I spent months on the problem, then gave up and worked on
`--gc:orc` (with much better progress), it's anything but a "temporary
implementation detail". But one can write new async implementations that work
with pure ARC. Whether that's important or not remains unclear, I _might_
Is the need for a cycle collector with async a temporary implementation detail,
or is it something that will be fixed in a future async?
FWIW, I found the talk about ARC during FOSDEM to be a nice resource as well:
[https://fosdem.org/2020/schedule/event/nimmovesemantics](https://fosdem.org/2020/schedule/event/nimmovesemantics)/
I really liked the write up. Thank you for this!
I think I soved this issue(?)
# winconsole.nim
when system.hostOS == "windows":
import std/winlean
import std/unicode
proc readConsoleW(hConsoleInput: Handle, lpBuffer: pointer,
nNumberOfCharsToRead: int, lpNumberOfCharsRead: pointer, pInputControl:
> "Compile your code with --gc:arc". That's it, the rest are details, the
> document describes how --gc:arc is implemented.
Don't you need to at least mention `--gc:orc` as well? The difference between
them at least is useful knowledge, since as soon as someone compiles async code
with `--gc:ar
This document is the spec we follow in our implementation and it served us well
for this purpose. It's not for end users (but then it's also not meant to be
incomprehensible either :-/ ), we'll have an ARC tutorial soon, I hope.
Here is the summary: "Compile your code with --gc:arc". That's it,
I am trying to understand ARC, which seems to be promised as the future for
Nim. That, in turn, redirects to [this
document](https://nim-lang.org/docs/destructors.html), so I am reading that,
but I cannot make head or tails of the whole document.
It starts with a motivating example, which I can
Well we use the Win API directly for `copyFile` so every inconsistency is
Microsoft's fault. :-)
my understanding is that this Builtin optional type is dead code and should be
removed, which matters a lot because TTypeKind.high == 63 I'd like to add a new
TTypeKind without making set operations on types slower (although this should
be benchmarked to see if it matters or not)
It's not used, feel free to remove/replace it.
18 matches
Mail list logo