Re: Shift operation for array elements

2016-09-24 Thread OderWat
I was thinking about refs too and I kinda doubt that just moving the refs in memory works. Sequtils usually uses `shallowCopy()` for manipulation of elements in the seq. Which imho avoids (deep) copying a string or seq inside the seq and copies the "pointer" (reference). I guess OP shift() proc

Re: Shift operation for array elements

2016-09-24 Thread stisa
@OderWat: do you mean something like this? proc shift[T](a: var openarray[T]; d: int) = if d == 0: discard # do nothing elif abs(d) >= a.len: # reset all zeroMem(addr a[0], a.len*sizeof(T)) elif d > 0: # right shift moveMem(addr a[d], addr a[0], (a.le

Re: nim-chipmunk7 demos

2016-09-24 Thread matkuki
It took some time but here it is: [https://github.com/matkuki/chipmunk7_demos](https://github.com/matkuki/chipmunk7_demos) Also available on nimble: nimble install chipmunk7_demos Have fun! Matic

Re: GTK 3.20 Nim wrapper

2016-09-24 Thread vonH
Hi Simon, can you share how you managed to get GTK3 working on Windows 7? I am trying to quote from your earlier response but I have finding difficult.

Re: Shift operation for array elements

2016-09-24 Thread Stefan_Salewski
@OderWat Sorry, can not really understand... Somethink like memCopy or memMove? That was my first idea, but I was very unsure what would happen when array elements are not somethink like plain ints, but objects with refs. Would that confuse the GC? And of course one may ask if array shifting is

Re: Shift operation for array elements

2016-09-24 Thread OderWat
Would "shifting" a seq or even an array not just be one operation operation for all elements at once and then initialisation of the remaining fields with 0 because an array/seq has continuous memory layout and the default init is "zeroing memory" afaik.

Re: Shift operation for array elements

2016-09-24 Thread Stefan_Salewski
Yes, for some languages shift may mean returning an element. But in Nim we have shl and shr operators. scroll may be confused with rotation? I will look at your code in more detail tonigth -- you are using magic reset proc from system module. I tried also a year ago, then I asked Araq in IRC ab

Re: How do you install the gtk 3 development libraries and toolchain on Windows 64bit?

2016-09-24 Thread Stefan_Salewski
> Which directory are your GNOME development libraries themselves installed, I am not using Windows. For gentoo linux, command is just "emerge -av gnome". I can search for directory paths, but I guess that will not really help you for Windows. Personally I would be very interested how well GTK3

Re: Shift operation for array elements

2016-09-24 Thread stisa
Nice, though I'm used to shift meaning "remove the first value of the (resizable) array and return the value", I think your proc feels more like it's "scrolling" the array? Anyway, naming aside, what do you think of this version? proc scroll[T](a: var openarray[T]; d: int) =

Re: How do you install the gtk 3 development libraries and toolchain on Windows 64bit?

2016-09-24 Thread vonH
It is about installing the development libraries themselves. I am doing a test installation using the guide here [http://wiki.geany.org/howtos/win32/msys2](http://forum.nim-lang.org///wiki.geany.org/howtos/win32/msys2) to see if I can get an GTK 3 project working and if I succeeds I will see if