K
Ken Sprague
Was reading the new Microsoft C# 2.0 specification and was interested to see
that they are adding something they call iterators to the language. These
seem very similar to Python generators in that they are methods that save
their state between invocations and return to the exact point where they
left off when called again (that was a brief and not altogether complete
description).
These constructs can be used to create lightweight coroutines ("cooperative"
multi-threading) that are very useful for certain classes of programs, such
as state machines and event simulations. It seems possible to add this
feature to Java in a manner similar to the way enums will be added in Java
1.5 (by the compiler creating a class and adding code behind the scene).
Is there any interest for adding this feature to the Java language?
Ken
that they are adding something they call iterators to the language. These
seem very similar to Python generators in that they are methods that save
their state between invocations and return to the exact point where they
left off when called again (that was a brief and not altogether complete
description).
These constructs can be used to create lightweight coroutines ("cooperative"
multi-threading) that are very useful for certain classes of programs, such
as state machines and event simulations. It seems possible to add this
feature to Java in a manner similar to the way enums will be added in Java
1.5 (by the compiler creating a class and adding code behind the scene).
Is there any interest for adding this feature to the Java language?
Ken