Fix what I assume to be a typo.
This commit is contained in:
parent
f7ff2fc454
commit
fcc73afa84
|
@ -118,7 +118,7 @@ var heterogeneousArray: seq[ParentObjectType] = @[]
|
||||||
# TODO: Add an object inheriting from ParentObjectType to the seq
|
# TODO: Add an object inheriting from ParentObjectType to the seq
|
||||||
```
|
```
|
||||||
|
|
||||||
That will return a compilation error, because the objects have different sizes. Like in C, you can't make an array of structs with disparate types and sizes. What one can do is an array of references to the objects, all references having the same size put pointing to heterogeneous objects. This is what Python does by default.
|
That will return a compilation error, because the objects have different sizes. Like in C, you can't make an array of structs with disparate types and sizes. What one can do is an array of references to the objects, all references having the same size but pointing to heterogeneous objects. This is what Python does by default.
|
||||||
|
|
||||||
``` Nim
|
``` Nim
|
||||||
# TODO: Show the proper way to do things, with emphasis on what changed
|
# TODO: Show the proper way to do things, with emphasis on what changed
|
||||||
|
|
Loading…
Reference in New Issue