Implementing a blog in Common Lisp: Part 2

Velte continues his interesting tutorial.

(defmethod initialize-instance :after ((obj blog-post) &key)
"If :url-part wasn't non-nil when making the instance, generate it automatically."
cond ((eq nil (url-part obj))
(setf (url-part obj) (make-url-part (title obj))))))
The above is an interesting example of "aspect-oriented" programming!! Note the :after keyword and the typng of the argument.

I haven't had time to set this all up and follow along yet, perhaps next weekend will be quieter!!

Powered by ScribeFire.

No comments: