alea icon indicating copy to clipboard operation
alea copied to clipboard

Confused about the package imports

Open mavavilj opened this issue 2 years ago • 1 comments

I am confused about the package imports.

Coming from Python, I am finding it a bit messy to have to do a plethora of imports, whose purposes are not clear to me.

Like in the complete example:

https://github.com/andreaferretti/alea#a-complete-example

As a Nim newbie, I'm not sure why we need the packages future, random/urandom, and random/mersenne. And particularly, why these aren't "baked into" import alea?

mavavilj avatar May 05 '22 14:05 mavavilj

Because Alea does not contain any Random Number Generator, and it is designed to interoperate with any RNG that you might want to provide. Import future should now be import sugar: it is just the syntactic sugar for the short form of lambda functions

andreaferretti avatar May 05 '22 16:05 andreaferretti