Re: Nimble cannot find latest version of package
Thanks! It's all clear now.
Re: nim and AngelScript
Maybe you can compile Nim code to C++ and add a postprocessing step to turn the C++ into AngelScript code.
Begginer's question - pointers and refs
I'm still new to Nim (got it a couple of days ago). Both versions work. Which one is better? (It is not clear, or I have missed something in docs.) The first: var sdl_rect : Rect sdl_rect = ( (cint)0, (cint)0, (cint)10, (cint)10 ) # usage: (addr sdl_rect), when ptr Rect is required Run The second: var sdl_rect : ref Rect new(sdl_rect) sdl_rect.x = 0 sdl_rect.y = 0 sdl_rect.w = 10 sdl_rect.h = 10 # usage: sdl_rect, when ptr Rect is required Run
Re: Begginer's question - pointers and refs
That is not an easy topic for a beginner, you may start with [https://peterme.net/nim-types-originally-a-reddit-reply.html](https://peterme.net/nim-types-originally-a-reddit-reply.html)
Re: Begginer's question - pointers and refs
`var sdl_rect : Rect` is better.
Re: Begginer's question - pointers and refs
I disagree, at least regarding the question in the title. A ref is always preferable unless one _needs_ a pointer. And the heap vs. stack is not Nim specific.