This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* try { | |
* var foo = 3 | |
* raise "some exception" | |
* console.log("do some stuff"); | |
* } catch(msg) { | |
* console.log("caught exception") | |
* proceed | |
* } | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo() { | |
console.log("before exception"); | |
_raise("some exception", function() { | |
console.log("after exception"); | |
}) | |
} | |
function bar() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "continuation" | |
module Proceedable | |
class ProceedableException < Exception | |
def initialize(msg, cont) | |
super(msg) | |
@cont = cont | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function iterator(f, bindings) { | |
bindings = bindings || {}; | |
var matches = f.toString().match(/function[^(]*\(\s*(\w+)\s*\)[^{]*(.*)/); | |
if (!matches) { | |
console.log("iterator function has wrong format, please use only one argument"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait DebugRewriter extends org.kiama.rewriting.CallbackRewriter { | |
import org.bitbucket.inkytonik.dsprofile.Events.{Event, Start} | |
import org.bitbucket.inkytonik.dsprofile.Events | |
Events.profiling = true | |
// ... some outputbuffering and pretty printing here | |
override def rewriting[T] (oldTerm : T, newTerm : T) : T = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Option(value) { | |
this.value = value; | |
this.some = arguments.length == 1 | |
} | |
Option.none = new Option() | |
Option.some = v => new Option(v) | |
Option.prototype.iterator = function () { | |
if (this.some) yield this.value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait Nat | |
sealed trait Zero extends Nat | |
sealed trait Succ[N <: Nat] extends Nat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalavaadin | |
import com.vaadin.{ ui => orig } | |
import scala.language.implicitConversions | |
import scala.collection.mutable | |
import scala.collection.JavaConversions | |
package object ui { | |
// Adding new Methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vaadin.scala | |
package server | |
import com.vaadin.{ server => orig } | |
import scala.language.implicitConversions | |
import scala.PartialFunction.condOpt | |
import apigen.annotations.accessors | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.bstudios.collection.mutable | |
import scala.collection.mutable._ | |
import scala.collection.generic._ | |
import scala.collection.convert.Wrappers._ | |
class IdentityHashMap[A, B] extends JMapWrapper[A, B](new java.util.IdentityHashMap) | |
with JMapWrapperLike[A, B, IdentityHashMap[A, B]] { | |
override def empty = new IdentityHashMap[A, B] | |
} |
OlderNewer