mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
14 lines
245 B
Nim
14 lines
245 B
Nim
type
|
|
MyRefObject* = ref object
|
|
s: string
|
|
|
|
BaseObj* = ref object of RootObj
|
|
ChildObj* = ref object of BaseObj
|
|
|
|
proc newMyRefObject*(s: string): MyRefObject =
|
|
new(result)
|
|
result.s = s
|
|
|
|
proc `$`*(o: MyRefObject): string =
|
|
o.s
|
|
|