mymodule.nim 245 B

1234567891011121314
  1. type
  2. MyRefObject* = ref object
  3. s: string
  4. BaseObj* = ref object of RootObj
  5. ChildObj* = ref object of BaseObj
  6. proc newMyRefObject*(s: string): MyRefObject =
  7. new(result)
  8. result.s = s
  9. proc `$`*(o: MyRefObject): string =
  10. o.s