This post originated from an RSS feed registered with Python Buzz
by Martin Skou.
Original Post: Scan path example
Feed Title: Python Fanatic
Feed URL: http://blog.1x.dk/feeds/posts/default
Feed Description: On Python web development.
(defmacro aif (test-form then-form &optional else-form) "Anaphoric Macro makes it possible to use value of if calculation without let assignment first" `(let ((it ,test-form)) (if it ,then-form ,else-form)))
(defun find-part (part sequence) "Find part as as substring in sequence elements, return first occurence or nil (find-part \"abc\" (list \"x\" \"yabc\" \"z\")) ==> (list \"yabc\" \"z\")" (member part sequence :test (lambda (a b) (search a b))))
(defun get-cmdline-opt (name) "Handle arguments like -x y -p w (get-cmdline-opt -x) => y" (second (member name (command-line-arguments:get-command-line-arguments) :test 'equal )))
(defun split-and-lower (str) "Lowercase and split around / and return all but first item" (cdr (split-sequence:split-sequence #\/ (string-downcase str))))