coroutine support

Lukas Stadler lukas.stadler at jku.at
Thu Nov 19 11:31:17 PST 2009


Rémi Forax schrieb:
> Could you re-explain where I have to put annotations and which one ?
>   
Of course. If you want to yield a value within generate then the 
contents of the generate-stackframe need to be stored. In order to allow 
this it needs to be marked as @Continuable:

@Continuable
@Override
protected Object generate(Object arg) {
  System.out.println("generate called with "+arg);
  yield("1");
  yield("2");
  return null;
}

If you remove the @Continuable you should get an Exception telling you 
not to do that.

regards,
 Lukas


More information about the mlvm-dev mailing list