object
generator extends AnyRef
Type Members
-
sealed
trait
Iteration[+T] extends AnyRef
-
case class
Yield[+T](result: T, next: () ⇒ Iteration[T]) extends Iteration[T] with Product with Serializable
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
object
Done extends Iteration[Nothing] with Product with Serializable
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
generate[T](result: T): Unit @util.continuations.package.cps[grizzled.generator.Iteration[T]]
-
def
generator[T](body: ⇒ Unit @util.continuations.package.cps[grizzled.generator.Iteration[T]]): Iterator[T]
-
final
def
getClass(): java.lang.Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
trampoline[T](body: ⇒ Iteration[T]): Iterator[T]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Functions that can be used to simulate Python-style generators. Adapted liberally from Rich Dougherty's solution, as outlined in Stack Overflow: http://stackoverflow.com/questions/2201882#2215182
Example usage:
This package uses the Scala compilers continuations plug-in. The above example must be compiled with tha plug-in enabled. Use the
-P:continuations:enableflag.