0xE111 / cat-400

Game framework for nim programming language. Modular and extensible
Mozilla Public License 2.0
88 stars 5 forks source link

Get rid of messages.register() #14

Open 0xE111 opened 4 years ago

0xE111 commented 4 years ago

Per https://forum.nim-lang.org/t/3199

0xE111 commented 4 years ago

May be helpful: https://forum.nim-lang.org/t/4545

0xE111 commented 4 years ago
template typedef(name: untyped, typ: typedesc) =
  type
    `T name`* {.inject.} = typ
    `P name`* {.inject.} = ref `T name`

typedef(myint, int)
var x: PMyInt

In the example name is instantiated with myint, so T name becomes Tmyint.

0xE111 commented 4 years ago

https://forum.nim-lang.org/t/5710