Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created October 3, 2010 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiredman/608171 to your computer and use it in GitHub Desktop.
Save hiredman/608171 to your computer and use it in GitHub Desktop.
(defn a-if [predicate yes no]
(a-selectp (comp boolean predicate)
true yes
false no))
(def bs
(a-comp
;;b13
(a-if available?
pass-through
five-oh-three-unavailable)
;;b12
(a-if known-method?
pass-through
five-oh-one-not-implemented)
;;b11
(a-if uri-too-long?
four-one-one-uri-too-long
pass-through)
;;b10
(a-if method-allowed-on-this-resource?
pass-through
four-oh-five-method-not-allowed)
;;b9
(a-if malformed-request?
four-oh-oh-bad-request
pass-through)
;;b8
(a-if authorized?
pass-through
four-oh-one-unauthorized)
;;b7
(a-if forbidden?
four-oh-three-forbidden
pass-through)
;;b6
(a-if unkown-or-unsupported-content?
five-oh-one-not-implemented
pass-through)
;;b5
(a-if unknown-content-type?
four-one-five-unsupported-media-type
pass-through)
;;b4
(a-if request-entity-too-large?
four-one-three-request-entity-too-large
pass-through)
;;b3
(a-if options?
two-oh-oh-ok
pass-through)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment