Add more init procs for tables and macros.genExpr
This commit is contained in:
parent
d196350d22
commit
a3df04d701
|
@ -289,3 +289,7 @@ template genCode*(body: untyped) =
|
|||
|
||||
payload()
|
||||
|
||||
template genExpr*(body: untyped) =
|
||||
macro payload: untyped = body
|
||||
payload()
|
||||
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import std/tables, ../objects
|
||||
|
||||
template init*[A, B](T: type Table[A, B]): auto = initTable[A, B]()
|
||||
template init*[A, B](T: type TableRef[A, B]): auto = newTable[A, B]()
|
||||
|
||||
template init*[A, B](T: type OrderedTable[A, B]): auto = initOrderedTable[A, B]()
|
||||
template init*[A, B](T: type OrderedTableRef[A, B]): auto = newOrderedTable[A, B]()
|
||||
|
||||
template init*[A](T: type CountTable[A]): auto = initCountTable[A]()
|
||||
template init*[A](T: type CountTableRef[A]): auto = newCountTable[A]()
|
||||
|
||||
export tables, objects
|
||||
|
|
Loading…
Reference in New Issue