This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
NewerOlder