bugfix: 'set' overloadable; further steps for multi threading support
This commit is contained in:
parent
170573a87f
commit
99bcc233cd
34 changed files with 934 additions and 459 deletions
|
|
@ -8,7 +8,26 @@
|
|||
#
|
||||
|
||||
## This module contains procs for serialization and deseralization of
|
||||
## arbitrary Nimrod data structures. The serialization format uses JSON.
|
||||
## arbitrary Nimrod data structures. The serialization format uses JSON.
|
||||
##
|
||||
## **Restriction**: For objects their type is **not** serialized. This means
|
||||
## essentially that it does not work if the object has some other runtime
|
||||
## type than its compiletime type:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
##
|
||||
## type
|
||||
## TA = object
|
||||
## TB = object of TA
|
||||
## f: int
|
||||
##
|
||||
## var
|
||||
## a: ref TA
|
||||
## b: ref TB
|
||||
##
|
||||
## new(b)
|
||||
## a = b
|
||||
## echo($$a[]) # produces "{}", not "{f: 0}"
|
||||
|
||||
import streams, typeinfo, json, intsets, tables
|
||||
|
||||
|
|
@ -286,3 +305,15 @@ when isMainModule:
|
|||
echo($$test7)
|
||||
testit(test7)
|
||||
|
||||
type
|
||||
TA = object
|
||||
TB = object of TA
|
||||
f: int
|
||||
|
||||
var
|
||||
a: ref TA
|
||||
b: ref TB
|
||||
new(b)
|
||||
a = b
|
||||
echo($$a[]) # produces "{}", not "{f: 0}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue