Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kstrauser
on Aug 29, 2024
|
parent
|
context
|
favorite
| on:
From Julia to Rust (2021)
That's nearly identical to Python's approach, too. It doesn't have C-style loops, just ones that consumer iterators.
for i in range(10): print(i)
consumes 1 value at a time from the `range(10)` generator. `for` has no special knowledge of numbers or ranges or any of that.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: