Skip to content

Instantly share code, notes, and snippets.

@benmmurphy
benmmurphy / gist:1306071
Created October 22, 2011 14:40
Eclipse Verify Error (20110916-0149)
package sslnpn;
import java.io.IOException;
import org.junit.Test;
public class StackMapTest {
private boolean check;
@benmmurphy
benmmurphy / gist:1191571
Created September 3, 2011 18:23
Suspendable Future Implementation for Scala
/* scalac -P:continuations:enable */
import scala.util.continuations._
import scala.collection.mutable._
class Future[A] private (ctx: => A @suspendable) {
private var res:Option[A] = None
def await() : A @suspendable = {
if (res.isEmpty) {
@benmmurphy
benmmurphy / gist:1191381
Created September 3, 2011 15:55
Future
import scala.util.continuations._
import scala.collection.mutable._
class Future {
def await : Unit @suspendable = {
/* .... */
shift { k : (Unit => Unit) =>
}
}
@benmmurphy
benmmurphy / gist:1189857
Created September 2, 2011 20:40
stratify js
function pause(t) {
waitfor() {
window.setTimeout(resume, t);
}
}
var object = {
pause_then_alert : function() {
pause(1000);