3 ms·
If you don't mind me asking, what in particular were you searching for? I agree that Nim's documentation needs a lot of love but would like suggestions on what
by dom96 10y ago
If you don't mind me asking, what in particular were you searching for? I agree that Nim's documentation needs a lot of love but would like suggestions on what specifically you had trouble with so that I can at least improve that (for now) :)
- mikebenfield 10y agoUnfortunately I can't remember the details at this point. There was something I couldn't figure out with the `new` function and heap allocation in general, and I also got frustrated trying to understand some things about the type system. I do know one thing about `new` was that it took me forever to figure out how to allocate anything on the heap at all, only to find a couple lines about `new` in the API docs. At least, I think that's what happened. Sorry I can't be more specific.
- dom96 10y agoNo worries, thank you for replying :)
- arc776 10y agoCurious as to when you had this problem, I thought the manual was fairly descriptive: https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types https://nim-lang.org/docs/manual.html#types-reference-and-po... I'm sure your original question was more nuanced, but for anyone wondering about this basically any ref type is heap allocated, and you do this by calling new, so: type MyType = ref object var myHeapObject: MyType new myHeapObject Pretty much anything else is stack allocated and doesn't need the GC if I remember right.