opened
eksperimental
username_0
Private function Enum.random_index/2 has been replaced with Enum.random_integer/2
and the deterministic examples had to be updated.
Optimize Enum.random/1, Enum.take_random/2 for ranges
issue
created
josevalim
username_1
@username_0 beautiful, thank you!
comment
created
eksperimental
username_0
changes updated
comment
created
eksperimental
username_0
does anybody know how can I represent a typespec for
`@spec random_integer(integer, integer) :: integer`
that the return value would be within `lower_limit..upper_limit`

/cc @username_2
comment
created
ericmj
username_2
@spec random_integer(integer, integer) :: integer
that the return value would be within lower_limit..upper_limit

```elixir
@spec random_integer(lower, upper) :: lower..upper
when lower: integer, upper: integer
```

But we usually don't typespec private functions.
comment
created
eksperimental
username_0
@username_2 that's exactly what I was looking for! thank you
comment
created
eksperimental
username_0
@username_1 we are for a final review.
the only issue left to be addressed is the one about traversing the enumerable twice https://github.com/elixir-lang/elixir/pull/4927/files#r69396589
comment
created
josevalim
username_1
:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart:
comment
created
eksperimental
username_0
@username_1 should we backport by removing these changes realted to ranges with count =1, that changed the semantics?
https://github.com/elixir-lang/elixir/commit/b6245074614b241f0df2c0eedaf981412f67f71c#diff-6881431a92cd4e3ea0de82bf2338f8eaL2262

initially introduced in 095321451743ea000201b5f0ff3456a061ed62ba
comment
created
josevalim
username_1
I won't backport because I believe we should not change the random result for a given seed in a tiny release.
comment
created
eksperimental
username_0
great then. just wanted to make sure we are not missing anything.
comment