Re: Default param values & type classes

2018-03-08 Thread polypus74
Ok cool. Thanks. Good to know because I'd probably consider that a design bug, and bad to know because I'm nowhere near capable of fixing it myself

Re: How to rewrite this C++ code to Nim properly

2018-03-08 Thread maxcroud
cdome, I slightly simplified the code and missed end of buffer checking, yes. Now it's updated.

"multiple definition" Problem

2018-03-08 Thread DTxplorer
Hello I try to use the [stb_image](https://github.com/define-private-public/stb_image-Nim) lib. I made this minimal test for my question. import stb_image/read as stbi var width, height, nrChannels:int var test = stbi.load("some_image.jpg", width, height, nrChannels, s

Re: Default param values & type classes

2018-03-08 Thread Araq
It's ... a bug, I think.

Re: How to rewrite this C++ code to Nim properly

2018-03-08 Thread cdome
Code above does never check when end of buffer is hit, it is kind of important for design. Does it always ints in the buffer or something else as well?

How to rewrite this C++ code to Nim properly

2018-03-08 Thread maxcroud
Hello, I have some C++ code which context I want to re-create in Nim. Briefly, there is buffer of bytes. As it's just a pointer, I can easily designate an offset (current). Do not care about unpack_int, it's just a function combining some bytes from the buffer into an integer. **The questions

Re: Default param values & type classes

2018-03-08 Thread twetzel59
Welcome! I'm glad you chose Nim for games, I've been interested in that possibility as well. Hmm, I'm curious if @Araq will reply to this. I'm guessing that the second example really takes a float because the default parameter is more specific/derived than Some Number. Honestly I don't know if

Re: Default param values & type classes

2018-03-08 Thread polypus74
p.s. I should have said, I'm only a couple of days in and don't know the whole language yet.

Default param values & type classes

2018-03-08 Thread polypus74
Hi guys, Learning Nim as a game programming language. Been following along from a distance for a while, but decided to dive in. Really loving it. I am a bit puzzled by the following behavior: proc f(x: SomeNumber) = discard f(1.1) # OK f(1) # OK proc g(x: So

Re: Big integer litterals

2018-03-08 Thread lightness1024
It was even worse before [https://github.com/nim-lang/Nim/issues/936](https://github.com/nim-lang/Nim/issues/936)

Re: Full nimble support for gintro package (high level GTK3 GUI) available

2018-03-08 Thread Stefan_Salewski
Currently libvte is not included -- I never heard about it before. For what do you use it, and have you used GTK3 seriously already? Of course we can try to add it, which may be a trivial task, or may be some work, we have to investigate it.

How do I read BMP file header directly to type?

2018-03-08 Thread HonzsSedlomn
Hello, I'm trying to load BMP file header to type using FileStream readData, but it doesn't work. I have to read every single variable separately. If I try to load it with readData, there is some weird result, missing data, etc. type BitmapFileHeader* = object si

Re: Full nimble support for gintro package (high level GTK3 GUI) available

2018-03-08 Thread aedt
Does gintro wrap libvte as well?

Re: c2nim fails for struct with function pointer containing reference argument, how to convert manually?

2018-03-08 Thread guibar
The struct is not defined in the generated file when you use the `header` pragma. It only includes the header at the top of the file.

Re: Big integer litterals

2018-03-08 Thread lscrd
You have not convinced me either. I have shown that on 32 bits platform, when a variable is initialized without explicit type, the current rule will cause problems as the variable size will vary according to the initialization value. I think it's really a bigger problem that which seems a proble

Re: Is it possible to run Python code from Nim?

2018-03-08 Thread qqtop
Another one for python2 not stated above is this one [https://github.com/marcoapintoo/nim-pythonize](https://github.com/marcoapintoo/nim-pythonize) You easily can move data from nim to python call your 3rd party lib python function and move the result back to nim for further processing. You ca

Re: Big integer litterals

2018-03-08 Thread StasB
@Iscrd: > But this is already what is done when you use when conditions The entire point of when is to make sure that your code doesn't arbitrarily break on other platforms, but again, we're not talking about that. We're talking about the language itself being consistent across platforms, so yo

link broken from standard library documentation page

2018-03-08 Thread mitai
fs monitor: [https://nim-lang.org/docs/fsmonitor.html](https://nim-lang.org/docs/fsmonitor.html)