mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
13 lines
307 B
Nim
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
|
|
|
|
|