Skip to content

Instantly share code, notes, and snippets.

@moonpolysoft
Created July 24, 2009 05:43
Show Gist options
  • Save moonpolysoft/153871 to your computer and use it in GitHub Desktop.
Save moonpolysoft/153871 to your computer and use it in GitHub Desktop.
def fromErlang(x: OtpErlangTuple) : Thingie = {
x.elements match {
case Array(Atom("set"), id : OtpErlangLong, list : OtpErlangList) =>
...
trait OtpConversions {
implicit def erlangLongToInteger(erl : OtpErlangLong) : Int = erl.intValue
implicit def erlangAtomToString(erl : OtpErlangAtom) : String = erl.atomValue
}
object Atom extends OtpConversions {
def unapply(v : OtpErlangAtom) : Option[String] = {
Some(v)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment