Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
gerds
· 14y ago · 0 comments
Is there an equivalent in Ruby?
Comments
[–]
irahul
14y ago
Not as high level as Python's generator expressions, but you can use Ruby's fibers to implement generators.
[–]
rue
14y ago
Enumerator solves typical generator scenarios reasonably well, and are easy to implement for your own classes. They use Fibers internally, and include Enumerable. Enumerator supports both internal and external iteration.