JuliaRandom / JuliaRandom/RandomNumbers.jl

Change name of supertype AbstractRNG?

未关闭
#35 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Julia
星标
100
派生
23
PR 合并指标
30 天内没有已合并 PR

描述

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?

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reviewing the exported AbstractRNG definition shown in the issue and comparing it with Base.Random.AbstractRNG. Determine an unambiguous replacement and assess the impact on code that imports RandomNumbers; done means the export collision is resolved with compatibility implications documented.

由索引模型根据 Issue 内容生成。

评估

技术栈
julia
领域
developer-experience
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。