Issue #17195 has been updated by Eregon (Benoit Daloze).

Status changed from Open to Rejected

Right, that makes sense, thanks for the reply.

Interestingly it seems `Enumerator#next` is still allowed even if the Enumerator is frozen, even though it is a kind of mutation.
I think that's a bug.

Given `ArithmeticSequence` has state through being an Enumerator, I think it's not reasonable to freeze, so I'll reject this issue.

----------------------------------------
Feature #17195: Freeze Enumerator::ArithmeticSequence objects
https://bugs.ruby-lang.org/issues/17195#change-87962

* Author: Eregon (Benoit Daloze)
* Status: Rejected
* Priority: Normal
----------------------------------------
Now, all Ranges are frozen (#15504).

Enumerator::ArithmeticSequence is very similar to Range, just with an extra `step`.
They're essentially already immutable, except that one could use set instance variables, but it seems of little use.

So, should we make Enumerator::ArithmeticSequence frozen too?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>