Skip to content

Instantly share code, notes, and snippets.

--langdef=scala
--langmap=scala:.scala
--regex-Scala=/^[ \t]*(abstract[ \t]*)*(sealed[ \t]*)*(case[ \t]*)*class[ \t]*([a-zA-Z0-9_]+)/\4/c,classes/
--regex-Scala=/^(case[ \t]*)*[ \t]*object[ \t]*([a-zA-Z0-9_]+)/\2/o,objects/
--regex-Scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/\1/t,traits/
--regex-Scala=/[ \t]*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:=]/\1/m,methods/
--regex-Scala=/[ \t]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
--regex-Scala=/[ \t]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/v,variables/
--regex-Scala=/^[ \t]*type[ \t]*([a-zA-Z0-9_]+)[ \t]*[\[<>=]/\1/T,types/
--regex-Scala=/^[ \t]*import[ \t]*([a-zA-Z0-9_{}., \t=>]+$)/\1/i,includes/
class ThreadLocal[T](init: => T) extends java.lang.ThreadLocal[T] with Function0[T] {
override def initialValue:T = init
def apply = get
def :=(value: T) { set(value) }
}