andreaferretti / alea

Define and compose random variables
https://github.com/andreaferretti/alea
Apache License 2.0
44 stars 3 forks source link

Confused about the package imports #4

Open mavavilj opened 2 years ago

mavavilj commented 2 years ago

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?

andreaferretti commented 2 years ago

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