Re: Best 2D game engine for nim?

2016-07-31 Thread Arrrrrrrrr
One hasn't received an updated for one year, and the other since 2012, probably they won't work out of the box (The downside of move fast, break things).

Re: Concept[T] design question

2016-07-31 Thread mora
Hi, Let me write some comments and suggestions. I added numbers, so you can refer to them easier. I understand that some of these requests are actually making the `concept` body a little bit longer. However, I believe that these will make Nim cleaner. **1.** _Suggestion:_ I think that the

Re: Best 2D game engine for nim?

2016-07-31 Thread Stefan_Salewski
There is a fine tutorial by Dennis: [https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2](https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2)/

Best 2D game engine for nim?

2016-07-31 Thread hcorion
LOL, I can't beleive it, now we can have nim game engine wars :P. So which one is better? [https://github.com/rnentjes/nim-ludens](https://github.com/rnentjes/nim-ludens) or [https://github.com/Vladar4/nimgame](https://github.com/Vladar4/nimgame) ? Do they basically function the same? Which

Macro question

2016-07-31 Thread Stefan_Salewski
I have this macro, which works fine. macro gDefineTypeExtended*(tn, t, tp, f, c: static[string]): stmt = var cc = indent("\n" & c, 4) s = """ proc $2Init(self: $1) {.cdecl.} proc $2ClassInit(klass: $1Class) {.cdecl.} var $2ParentClass: Gpointer

Identifier construction

2016-07-31 Thread Stefan_Salewski
Based on [http://nim-lang.org/docs/manual.html#templates-identifier-construction](http://forum.nim-lang.org///nim-lang.org/docs/manual.html#templates-identifier-construction) I had from

Re: Go-lang like interface

2016-07-31 Thread OderWat
@Krux02: "Ok, I will search for examples" ... I still wait for them.

Re: Go-lang like interface

2016-07-31 Thread Krux02
@_tulayang It would be nice to know, where you lost my explanation, or where you started to skip reading it, because the point was to create a single type that can be used to implement `foobar`, and both `MyImplementationA` and `MyImplementationB` can be casted to this single type. Of course

Re: Is it possible to import C #define constants without knowing their values?

2016-07-31 Thread endragor
This is a similar issue: [https://github.com/nim-lang/Nim/issues/4441](https://github.com/nim-lang/Nim/issues/4441) There is a workaround offered in comments that is to import the constant as a procedure instead of a variable: proc foo(): cint {.importcpp: "FOO@".}

Is it possible to import C #define constants without knowing their values?

2016-07-31 Thread cjxgm
Well, importing itself can be done easily like this: {.emit: """ #define HELLO_WORLD 10 """.} var x {.importc: "HELLO_WORLD", nodecl.}: cint echo x This will generate `LOC1 = nimIntToStr(((NI) (HELLO_WORLD)));`, which directly uses the name. Good. But

Nimsuggest wrong

2016-07-31 Thread VKlayd
Hello. Trying some simple code: type sometype1 = object a: int sometype1_ref = ref sometype1 proc get_a(s: sometype1_ref): int = s.a proc create(): sometype1_ref = new sometype1_ref let k = create() echo

Re: Concept[T] design question

2016-07-31 Thread mora
@zahary I read your code (which is in extremely good shape) and examples. I have some comments, change suggestions (in the code and in the syntax) and no computer to write a longer post. I'll come back tonight.

Re: Go-lang like interface

2016-07-31 Thread _tulayang
How about: type MyImplementationA = object MyImplementationB = object m_foo,m_bar: int proc foo(this: MyImplementationA): int = return 17 proc bar(this: MyImplementationA): int = return 4 proc foo(this:

Re: Go-lang like interface

2016-07-31 Thread Dippo
+1 Awesome!

AsyncSocket delimeter

2016-07-31 Thread everlast
Is there a way to set the delimeter from rL to something else (perhaps without editting the asyncnet library itself).