My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

This library provides a mechanism to define reusable method implementations for Clojure's deftype. For example, to create a deftype that implements the metadata protocol, write

(ns my-ns
  (:use [methods-a-la-carte.core :only (deftype+)]
            [methods-a-la-carte.implementations :only (metadata)]))

(deftype+ Foo
  [foo bar __meta]
  ~@(metadata __meta))

The namespace methods-a-la-carte.implementations contains all the methods used in Clojure's defrecord, plus some variants such as field lookup (get and keyword) without the possibility of adding keys that is provided by the full map protocol.

Powered by Google Project Hosting