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

Change name of supertype AbstractRNG? #35

Open
GregPlowman opened this issue Apr 5, 2018 · 2 comments
Open

Change name of supertype AbstractRNG? #35

GregPlowman opened this issue Apr 5, 2018 · 2 comments

Comments

@GregPlowman
Copy link
Contributor

I think "re-using" the name AbstractRNG is not ideal:
abstract type AbstractRNG{T<:Number} <: Base.Random.AbstractRNG end

AbstractRNG is defined and exported by Base and RandomNumbers

using RandomNumbers
AbstractRNG

results in following:

WARNING: both RandomNumbers and Base export "AbstractRNG"; uses of it in module Main must be qualified
ERROR: UndefVarError: AbstractRNG not defined

Thus code that uses AbstractRNG without RandomNumbers, will no longer work when using RandomNumbers, without explicitly qualifying. i.e. that code will need modifying.

This can be problematic when one doesn't have access to the modules containing references to AbstractRNG.

Maybe this is some form of type piracy?

@ChrisRackauckas
Copy link
Contributor

It's not type piracy but it is a form of shadowing which seems unnecessary. I agree this should be changed.

@sunoru
Copy link
Member

sunoru commented Apr 6, 2018

Yes it makes sense that it is better to change the name. Originally I wanted to merge this package to the Base library of Julia, so I kept this name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants