Re: Nimble cannot find latest version of package

2019-03-19 Thread c0ntribut0r
Thanks! It's all clear now.


Re: nim and AngelScript

2019-03-19 Thread Araq
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

2019-03-19 Thread Tomek
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

2019-03-19 Thread Stefan_Salewski
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

2019-03-19 Thread Araq
`var sdl_rect : Rect` is better.


Re: Begginer's question - pointers and refs

2019-03-19 Thread moerm
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.