ztellman/gloss — pull request #7 by ibodrov (2012-03-26 13:30:36+00:00)
Title: Default field value support

Patch to add default field value support.

Example:

(defcodec example {:a :int32 :b (default :int32 7)})
(encode example {:a 4})
(decode example *1) => {:a 4 :b 7}

Also, it works with nested types:
(defcodec example {:a :int32 :b (default (repeated :int32 :prefix :none) [1 2 3])})
(encode example {:a 4})
(decode example *1) => {:a 4 :b [1 2 3]}