public final class Next extends Object implements Serializable, Continuation
f under {#link #e} and pass the
result to k immediately, or to suspend execution by yielding yield,
and when the execution is resumed, continue by passing the resume value to k
(or throw the resume value to the catch handler as specified by e.)Continuation.Halt| Modifier and Type | Field and Description |
|---|---|
Env |
e |
Block |
f |
Continuation |
k |
Outcome |
yield
If the program getting executed wants to yield a value and suspend its execution,
this value is set to non-null.
|
HALT| Constructor and Description |
|---|
Next(Block f,
Env e,
Continuation k) |
Next(Env e,
Continuation k,
Outcome yield) |
| Modifier and Type | Method and Description |
|---|---|
static Next |
go0(Outcome v,
Continuable c)
Crestes a
Next object that
causes the interpreter loop to keep evaluating the continuation represented by Continuable
by passing the outcome (or throwing it). |
Next |
receive(Object _)
As a
Continuation, just ignore the argument. |
Next |
run()
Resumes the execution of this program state, until it yields a value or finishes computation.
|
Outcome |
run(int max)
for testing only
|
Next |
step()
Executes one step
|
static Next |
terminate(Object v)
Creates a
Next object that terminates the computation and either returns a value. |
static Next |
terminate0(Outcome v)
Creates a
Next object that terminates the computation and either returns a value or throw an exception. |
static Next |
unhandledException(Throwable t)
Creates a
Next object that terminates the computation by throwing an exception. |
static Next |
yield(Object v,
Env e,
Continuation k)
Creates a
Next object that
causes the interpreter loop to exit with the specified value, then optionally allow the interpreter
to resume with the specified Continuation. |
static Next |
yield0(Outcome v,
Continuable c)
Creates a
Next object that
causes the interpreter loop to exit with the specified value, then optionally allow the interpreter
to resume to the continuation represented by Continuable. |
public final Block f
public final Env e
public final Continuation k
public Next(Block f, Env e, Continuation k)
public Next(Env e, Continuation k, Outcome yield)
public Next run()
public Outcome run(int max)
public Next step()
public static Next yield(Object v, Env e, Continuation k)
Next object that
causes the interpreter loop to exit with the specified value, then optionally allow the interpreter
to resume with the specified Continuation.public static Next yield0(Outcome v, Continuable c)
Next object that
causes the interpreter loop to exit with the specified value, then optionally allow the interpreter
to resume to the continuation represented by Continuable.public static Next go0(Outcome v, Continuable c)
Next object that
causes the interpreter loop to keep evaluating the continuation represented by Continuable
by passing the outcome (or throwing it).public static Next terminate(Object v)
Next object that terminates the computation and either returns a value.public static Next unhandledException(Throwable t)
Next object that terminates the computation by throwing an exception.public static Next terminate0(Outcome v)
Next object that terminates the computation and either returns a value or throw an exception.public Next receive(Object _)
Continuation, just ignore the argument.receive in interface ContinuationCopyright © 2011–2019. All rights reserved.