You can do pretty traditional OOP in Nim if you want to (except for proper
abstract methods). Here's an example:
# main.nim
# Free Public License 1.0.0
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is
In other words, the "problem" is that in order for you to be able to stuff a
bunch of items into a "bag", shake the bag, and then pull one out of it - and
**still knowing the type of what you pulled out** \- requires storing type
information together with each item. Nim, as many statically
cdome: but one problem - vtrefs are not implemented yet
vtref of concepts will do that. You can define a union type if you want to.
There are other options, I don't see a problem here
Yes, I'm talking about storing different type values in one container, but in a
safer way than by casting/storing raw pointers to values. In some other
languages you can use interfaces for that, but if that's not possible in nim
that would mean this feature is based on a VM?
Probably you're asking about what here is discussed:
[https://forum.nim-lang.org/t/3150](https://forum.nim-lang.org/t/3150); that
is, on storing different (concrete) type values in one container. You have to
choose between casts, object variants, refs to objects + dynamic dispatch
(methods),
No idea what you're talking about.
Right now it's impossible to use containers based on generic types. Is it going
to change, or is there some alternative?