Re: Bitwise operation problems.

2016-11-27 Thread def_pri_pub
Crap. You're right. I ding-donnged that. Thanks!

Re: Nim in Action is going into production!

2016-11-27 Thread Libman
As always, _PLEASE_ help spread the word by liking and sharing on social media! Ex: [Reddit](https://www.reddit.com/r/nim/comments/5ebn5o/nim_in_action_is_going_into_production/), [Facebook](https://www.facebook.com/software.libman.org/posts/589468044578512), [Twitter](https://twitter.com/libm

Re: Bitwise operation problems.

2016-11-27 Thread LeuGim
Nothing wrong here with `and`. Probably just what you want is `or` (if you want to combine 4 values with disjoint bits into 1).

Bitwise operation problems.

2016-11-27 Thread def_pri_pub
I'm trying to map my "quadruplet" object to an unsigned 32-bit number, that is supposed to represent an RGBA pixel. I'm able to convert my floating point quadruplet values to their respective R, G, B, and A components, but when I try to do an and on all of the components, I'm getting a 0. Here i

Re: Modeling probability distributions

2016-11-27 Thread Krux02
So when I understood you correctly, you want to have a symbolic representation of the distribution, so that you can do symbolic transformations on them, but I am not sure about it. Then you should specify, if your distributions are is something known at compile time, or something that depends on

Re: Exact dependencies to build Nim

2016-11-27 Thread andrea
Well, it is just that apparently installing the release version (the one on the download page) requires less RAM and works there :)

Code generation from AST with annotations in Nim like in C

2016-11-27 Thread komerdoor
I use annotation macros in C to generate new C code from the AST. For example in C, where the X macro uses the GNU annotate attribute, I do the following: // Type definition (can access fields from script) X(script) typedef struct { int value; } something_t; // yes I k

Question about the interaction of Concepts, Generic types, and typedesc

2016-11-27 Thread jdb
So, I started working with concepts, which are awesome, and I ran across a use case that seems like it should work, but fails to compile. Basically, we see concrete types as subtypes of concepts they match in most cases, but it seems like they are not handled the same way when they themselves ar