Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

references to Random module in the Julia manual #26853

Closed
bkamins opened this issue Apr 19, 2018 · 3 comments
Closed

references to Random module in the Julia manual #26853

bkamins opened this issue Apr 19, 2018 · 3 comments
Labels
docs This change adds or pertains to documentation

Comments

@bkamins
Copy link
Member

bkamins commented Apr 19, 2018

Currently in several places of the Julia Manual random number generation is used in examples. We require explicit using Random for those examples to work (now it will throw deprecation warning but in Julia 1.0 those examples will throw an error).

This means that novice Julia users when trying to copy-paste an example will not understand why it fails.

There are three possible solutions:

  1. in the introduction to the manual explicitly discuss this issue and leave the manual as-is;
  2. add using Random in the examples where needed to make them work stand alone;
  3. do nothing (I would not recommend this).

My personal preference would be option 2 (adding using Random where needed to the examples - the downside is adds a bit of noise to the examples), but maybe there are other opinions.

I will make a PR with the appropriate changes when I we have an opinion.

@ararslan
Copy link
Member

+1 for option 2, using Random. We did that recently for an example that required Sockets.

@ararslan ararslan added the docs This change adds or pertains to documentation label Apr 19, 2018
@fredrikekre
Copy link
Member

Currently in several places of the Julia Manual random number generation is used in examples.

Hmm... I didn't find any of those, only calls to rand(...) which works without using Random.

@bkamins
Copy link
Member Author

bkamins commented Apr 20, 2018

@fredrikekre I thought that only rand(...) is exported. Now I have checked that also randn(...) can be used without using Random which I did not know (and it is used in several places). So this leaves us with only one line

julia> r = randjump(MersenneTwister(1), big(10)^20, nthreads());

in parallel-computing.md which uses non-exported methods. I will add using Random to this example then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

3 participants