Skip to content

Instantly share code, notes, and snippets.

(def route-list (atom {}))
(defmacro with-name
[name route]
(swap! route-list assoc name (nth route 1))
route)
;; Needs to get fancier to handle generating routes with parameters
(defn url-for
[route-name]
from decorator import decorator
import inspect
@decorator
def deco(f, *a, **kw):
# set a default keyword arg
if 'foo' not in kw:
kw['foo'] = 'bar'
return f(*a, **kw)