No, they are not, it would work only if seq[YourConcept] is not needed or only
of homogeneous concrete type.
@mratsim Vtptrs are not ready yet, as I've heard? If they were, I guess they
would solve the problem (it is how it would probably be solved in Rust,
actually).
Also could concepts fit your need?
The number of message types is not fixed. I'm trying something else now, using
composition instead of inheritance.
@monster Is the number of different kinds of messages fixed? If it is, you can
use variant types.
> No. It means that the object gains a type header that allows for dynamic
> dispatch, RTTI, and such.
@Jehan Thank you for pointing that out! I thought the {.inheritable.} pragma
was the solution to my question, but if it adds a "dynamic dispatch" pointer to
the object, than I cannot use it. S
> Does the {.inheritable.} pragma convert an object into a pointer or keep it
> as a normal object with copy semantics?
No. It means that the object gains a type header that allows for dynamic
dispatch, RTTI, and such.
> Should the compiler warn that putting an Obj2 into a seq of Obj1 will drop
@coffeepot I _think_ what you pointed out is _by design_. This is also how I
would expect it to work. OTOH, I guess a compiler warning in the first case
would be good.
within the atomics.nim the gcc-api is very different (and better) than the vcc
ones. a consolidation would be nice. AtomicLoad could be replaced by atomicInc
or atomicDec but unfortunately not AtomicStore. And doing cas is not the same
as AtomicStore. If you need two atomics for a specific opera
Can't really remember but it was likely something like "argh this needs to
compile **now** and I know my data is aligned at an 8 byte boundary".
@cdome Great!
@Araq So, is/was (I'm assuming the '8' version is going to be used in the
future), the call safe? I cannot imagine it would have been used at all, if it
caused random memory overwrite. Maybe the 'compare' part of the call makes this
safe? But then, why even bother offering 8/16/32
Thank you, you rock!
Had various issues with the vcc version too. Just made a
[pull-request](https://github.com/nim-lang/Nim/pull/6735)
Actually _InterlockedCompareExchange8 does exist, It was added in VS2012
silently and it is not mentioned in the docs.
Hi,
I'm trying to understand what goes on in "lib\system\atomics.nim". This is in
part because I'm missing atomicLoadN/atomicStoreN on Windows, and I'm trying to
work out how to implement that myself. I've just stumbled upon this declaration
(atomics.nim, line #220):
interlockedC
15 matches
Mail list logo