Files
Nim/tests/generics/tgenericprop.nim
2014-01-13 02:10:03 +01:00

13 lines
307 B
Nim

type
TProperty[T] = object of TObject
getProc: proc(property: TProperty[T]): T {.nimcall.}
setProc: proc(property: TProperty[T], value: T) {.nimcall.}
value: T
proc newProperty[T](value: TObject): TProperty[T] =
result.getProc = proc (property: TProperty[T]) =
return property.value