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).
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
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)/
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
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
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
@Krux02: "Ok, I will search for examples" ... I still wait for them.
@_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
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@".}
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
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
@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.
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:
+1 Awesome!
Is there a way to set the delimeter from rL to something else (perhaps without
editting the asyncnet library itself).
15 matches
Mail list logo