finagle-clojure.scala

Utilities for interop with JVM classes generated from Scala code. Scala functions & methods expect Scala collection & function instances, not Java Collections or Clojure IFns.

Function

macro

(Function [arg-name] & body)

Create a new com.twitter.util.Function. It can be used a scala.Function1 or scala.PartialFunction. args-binding should be a vector containing one element [arg-name] the name to bind the parameter to the Function to. The apply method will be implemented with body.

Function*

(Function* apply-fn)(Function* apply-fn defined-at-class)

Function0

macro

(Function0 & body)

Create a new scala.Function0. The apply method will be implemented with body.

Function0*

(Function0* f)

Create a new scala.Function0. The apply method will be implemented with f.

LiftToFunction0

protocol

members

lift->fn0

(lift->fn0 this)

LiftToFunction1

protocol

members

lift->fn1

(lift->fn1 this)

scala-map->map

(scala-map->map m)

Convert a Scala Map to a map

Arguments:

  • m: a scala.collectin.Map

Returns:

A PersistentHashMap with the conents of m.

scala-seq->vec

(scala-seq->vec scala-seq)

Convert a Scala Seq to a vector.

Arguments:

  • scala-seq: a Scala Seq

Returns:

A PersistentVector with the contents of scala-seq.

seq->scala-buffer

(seq->scala-buffer seq)

Convert a Clojure seq to a Scala Buffer.

Arguments:

  • seq: a Clojure seq

Returns:

A Scala Buffer with the contents of seq.

tuple->vec

(tuple->vec p)

unit

The Scala Unit value.