From 7404d4e18e298c1454dd31c9ee84ca1a1c977726 Mon Sep 17 00:00:00 2001
From: clinton Backgrounds
@@ -114,8 +117,7 @@ on a 24" screen.
Classes are defined with defclass
-(defclass name (superclasses ...) - ((slot-name :accessor slot-accessor ...) +(defclass name (superclasses ...) + ((slot-name :accessor slot-accessor ...) ...) (class-options ...)) -(defclass example () - ((foo :accessor foo-of :initform 5))) +(defclass example () + ((foo :accessor foo-of :initform 5))) -(defclass example-child (example) - ((bar :accessor bar-of :initform (list 1 2 3)))) +(defclass example-child (example) + ((bar :accessor bar-of :initform (list 1 2 3))))
Slot defintions have several options; the above example shows only the @@ -260,18 +260,18 @@ implementation. This allows writing rich layered protocols which can enable selective modification of individual facets with minimal code.
-(defgeneric generic (parameters ...) +(defgeneric generic (parameters ...) (options) ...) -(defmethod generic-name ((parameter type) parameter ...) - "documentation string" +(defmethod generic-name ((parameter type) parameter ...) + "documentation string" body) -(defgeneric foo (bar baz quux) - (:documentation "Process the baz with the quux capacitor to make the +(defgeneric foo (bar baz quux) + (:documentation "Process the baz with the quux capacitor to make the foo widget fly into the sky at warp speed")) -(defmethod foo ((bar example) baz (quux capacitor)) +(defmethod foo ((bar example) baz (quux capacitor)) (launch bar (process-with quux baz)))@@ -399,34 +399,34 @@ languages to expose a reflective MOP.
-(defgeneric example-inspect (instance) - (:documentation "Simple object inspector using CLOS MOP")) +(defgeneric example-inspect (instance) + (:documentation "Simple object inspector using CLOS MOP")) -(defmethod example-inspect ((instance t)) - (format t "Simple Object~% Value: ~S~%" instance)) +(defmethod example-inspect ((instance t)) + (format t "Simple Object~% Value: ~S~%" instance)) -(defmethod example-inspect ((instance standard-object)) - (let ((class (class-of instance))) - (format t "Class: ~S, Superclasses: ~S~%" +(defmethod example-inspect ((instance standard-object)) + (let ((class (class-of instance))) + (format t "Class: ~S, Superclasses: ~S~%" (class-name class) (mapcar #'class-name (class-precedence-list class))) - (let ((slot-names (mapcar #'slot-definition-name + (let ((slot-names (mapcar #'slot-definition-name (class-slots class)))) - (format t "Slots: ~%~{ ~S~%~}" slot-names) + (format t "Slots: ~%~{ ~S~%~}" slot-names) (inspect-loop slot-names instance #'example-inspect)))) -(defun inspect-loop (slots instance inspector) - (format t "Enter slot to inspect or :pop to go up one level: ") +(defun inspect-loop (slots instance inspector) + (format t "Enter slot to inspect or :pop to go up one level: ") (finish-output) - (let* ((slot (read)) + (let* ((slot (read)) (found-slot (member slot slots))) - (cond (found-slot + (cond (found-slot (funcall inspector (slot-value instance slot)) (funcall inspector instance)) - ((eq slot :pop) t) + ((eq slot :pop) t) (t - (format t "~S is invalid. Valid slot names: ~S~%" + (format t "~S is invalid. Valid slot names: ~S~%" slot slots) (inspect-loop slots instance inspector))))) @@ -466,61 +466,61 @@ level dirties the inheritance heirarchy and adds uneccesary meta details to the program.-;;; This metaclass adds a slot to instances which use it, and so the -;;; system is defined in its own package to avoid name conflicts -(defpackage :observer - (:use :cl #+sbcl :sb-mop) - (:export observable register-observer unregister-observer)) +;;; This metaclass adds a slot to instances which use it, and so the +;;; system is defined in its own package to avoid name conflicts +(defpackage :observer + (:use :cl #+sbcl :sb-mop) + (:export observable register-observer unregister-observer)) -(in-package :observer) +(in-package :observer) -;;; Metaclass -(defclass observable (standard-class) +;;; Metaclass +(defclass observable (standard-class) () - (:documentation "Metaclass for observable objects")) + (:documentation "Metaclass for observable objects")) -(defmethod compute-slots ((class observable)) - "Add a slot for storing observers to observable instances" +(defmethod compute-slots ((class observable)) + "Add a slot for storing observers to observable instances" (cons (make-instance 'standard-effective-slot-definition - :name 'observers - :initform '(make-hash-table) - :initfunction #'(lambda () (make-hash-table))) + :name 'observers + :initform '(make-hash-table) + :initfunction #'(lambda () (make-hash-table))) (call-next-method))) -(defmethod validate-superclass ((class observable) +(defmethod validate-superclass ((class observable) (super standard-class)) t) -(defun register-observer (instance slot-name key closure) +(defun register-observer (instance slot-name key closure) (register-observer-with-class (class-of instance) instance slot-name key closure)) -(defun unregister-observer (instance slot-name key) +(defun unregister-observer (instance slot-name key) (unregister-observer-with-class (class-of instance) instance slot-name key)) -(defun get-observers (instance slot-name) +(defun get-observers (instance slot-name) (get-observers-with-class (class-of instance) instance slot-name)) -(defun add-observer-table (instance slot-name) +(defun add-observer-table (instance slot-name) (setf (gethash slot-name (slot-value instance 'observers)) (make-hash-table))) -(defgeneric register-observer-with-class (class instance slot-name key closure)) -(defgeneric unregister-observer-with-class (class +(defgeneric register-observer-with-class (class instance slot-name key closure)) +(defgeneric unregister-observer-with-class (class instance slot-name key)) -(defmethod register-observer-with-class ((class observable) +(defmethod register-observer-with-class ((class observable) instance slot-name key @@ -528,34 +528,34 @@ details to the program. (setf (gethash key (or (gethash slot-name (slot-value instance 'observers)) - ;; Lazily add observer hash tables + ;; Lazily add observer hash tables (add-observer-table instance slot-name))) closure)) -(defmethod unregister-observer-with-class ((class observable) +(defmethod unregister-observer-with-class ((class observable) instance slot-name key) (remhash key (gethash slot-name (slot-value instance 'observers)))) -(defmethod get-observers-with-class ((class observable) +(defmethod get-observers-with-class ((class observable) instance slot-name) (gethash slot-name (slot-value instance 'observers))) -(defmethod (setf slot-value-using-class) :before (new-value +(defmethod (setf slot-value-using-class) :before (new-value (class observable) instance slot) - (let ((slot-name (slot-definition-name slot))) - (if (not (eq 'observers slot-name)) - (let ((observers + (let ((slot-name (slot-definition-name slot))) + (if (not (eq 'observers slot-name)) + (let ((observers (get-observers instance (slot-definition-name slot)))) - (if observers - (maphash #'(lambda (key observer) + (if observers + (maphash #'(lambda (key observer) (funcall observer - (if (slot-boundp instance slot-name) + (if (slot-boundp instance slot-name) (slot-value instance slot-name) nil) new-value)) @@ -782,8 +782,8 @@ notes, and so the 331 pages might not actually take that long to read. - diff --git a/Music I Enjoy.html b/Music I Enjoy.html index 33d53be..ee2d533 100644 --- a/Music I Enjoy.html +++ b/Music I Enjoy.html @@ -7,7 +7,10 @@ - + + +Music I Enjoy
@@ -166,9 +169,7 @@ heard this album many times, and will listen again many more. - diff --git a/Music.html b/Music.html index b27f96c..ea08413 100644 --- a/Music.html +++ b/Music.html @@ -7,7 +7,10 @@ - + + +Music
@@ -61,8 +64,10 @@ with Watain in Northern Virginia. - diff --git a/My Bicycle.html b/My Bicycle.html index 035bd45..08889f9 100644 --- a/My Bicycle.html +++ b/My Bicycle.html @@ -7,7 +7,10 @@ - + + +Clinton's Bicycle
@@ -258,10 +261,8 @@ metal, clearly. - diff --git a/Old Viewpoints.html b/Old Viewpoints.html index 085e52c..caca30e 100644 --- a/Old Viewpoints.html +++ b/Old Viewpoints.html @@ -7,7 +7,10 @@ - + + +The Weak Must Die
@@ -94,10 +97,10 @@ trashy works which have become popular to the masses. - diff --git a/Olive Pita.html b/Olive Pita.html index 655014f..59cac09 100644 --- a/Olive Pita.html +++ b/Olive Pita.html @@ -98,7 +98,10 @@ can impart such a nice flavor. - diff --git a/Pita.html b/Pita.html index aac0d33..acced17 100644 --- a/Pita.html +++ b/Pita.html @@ -123,9 +123,9 @@ lighter if you'd like. - diff --git a/Politics.html b/Politics.html index 04419de..ca6db79 100644 --- a/Politics.html +++ b/Politics.html @@ -363,8 +363,10 @@ Learned Ignorance and Weakness - diff --git a/Quotations.html b/Quotations.html index e048fa3..94d31a1 100644 --- a/Quotations.html +++ b/Quotations.html @@ -7,7 +7,10 @@ - + + +Quotations
@@ -76,8 +79,7 @@ to the dictates of his own personal tastes and urge for expression. - diff --git a/Reading.html b/Reading.html index 550c3d9..1b965f2 100644 --- a/Reading.html +++ b/Reading.html @@ -7,7 +7,10 @@ - + + +The Printed Word Is Stronger Than Nuclear Arms
@@ -479,7 +482,10 @@ Design - diff --git a/Roasted Garlic.html b/Roasted Garlic.html index d07e2da..4332edf 100644 --- a/Roasted Garlic.html +++ b/Roasted Garlic.html @@ -89,10 +89,7 @@ oven if you have a need for an absurd amount of roasted garlic. - diff --git a/SCWM.html b/SCWM.html index 9e804f3..14bd8f2 100644 --- a/SCWM.html +++ b/SCWM.html @@ -7,7 +7,10 @@ - + + +Scheme Your Windows
@@ -107,10 +110,10 @@ I have yet to test the others. If not usingsystem.scwmrc
it is use to at least include the bits that enable debugging.-(define debug #t) +(define debug #t) -(if debug - (begin +(if debug + (begin (add-hook! module-loaded-hook display-module-loaded) (set! %load-verbosely #t) (debug-enable 'debug 'backtrace) @@ -154,12 +157,12 @@ easier. GDS requires a Guile built with threads to work properly (use-modules (ice-9 gds-client) (ice-9 threads)) -;;; GDS thread (in case it must be killed during debugging, ...) -(define cke-gds-thread #f) +;;; GDS thread (in case it must be killed during debugging, ...) +(define cke-gds-thread #f) -(define (connect-to-debugging-server) +(define (connect-to-debugging-server) (set! cke-gds-thread - (call-with-new-thread (lambda () (run-utility)))) + (call-with-new-thread (lambda () (run-utility)))) cke-gds-thread)@@ -175,16 +178,16 @@ running. interaction with guile.-(require 'gds) -(require 'gds-server) -(require 'gds-scheme) +(require 'gds) +(require 'gds-server) +(require 'gds-scheme) -(defvar guile-scratch-buffer-name "*guile-scratch*" - "Name of the Guile evaluation scratch buffer") +(defvar guile-scratch-buffer-name "*guile-scratch*" + "Name of the Guile evaluation scratch buffer") -(defun make-guile-scratch-buffer () +(defun make-guile-scratch-buffer () (interactive) - (let ((scratch-buf (generate-new-buffer guile-scratch-buffer-name))) + (let ((scratch-buf (generate-new-buffer guile-scratch-buffer-name))) (switch-to-buffer scratch-buf) (scheme-mode) (gds-auto-associate-buffer))) @@ -234,10 +237,10 @@ to it, hint hint). - diff --git a/Site Software.html b/Site Software.html index c37164f..c787239 100644 --- a/Site Software.html +++ b/Site Software.html @@ -10,7 +10,7 @@ - +Site Software
@@ -129,7 +129,8 @@ could be generally useful for other things. - diff --git a/Sourdough Rye.html b/Sourdough Rye.html index 2334e29..2098b9f 100644 --- a/Sourdough Rye.html +++ b/Sourdough Rye.html @@ -165,10 +165,9 @@ wish). - diff --git a/TRUTH.html b/TRUTH.html index c04ba45..4f70751 100644 --- a/TRUTH.html +++ b/TRUTH.html @@ -7,7 +7,10 @@ - + + +Absolute Truths Which Cannot Be Denied
@@ -83,10 +86,10 @@ abandon logic as an anachronism of times long past - diff --git a/UCWNotes.html b/UCWNotes.html index 7dc59ed..b751c91 100644 --- a/UCWNotes.html +++ b/UCWNotes.html @@ -7,7 +7,10 @@ - + + +Roadmap to UCW Codebase
@@ -157,19 +160,19 @@ application mixins you find useful.src/rerl/standard-classes.lisp
-(defclass standard-application (application) - ((url-prefix :initarg :url-prefix - :documentation "A string specifying the +(defclass standard-application (application) + ((url-prefix :initarg :url-prefix + :documentation "A string specifying the start (prefix) of all the urls this app should handle. This value is used by the standard-server to decide what app a particular request is aimed at and for generating links to actions within the app. ") - (www-roots :initarg :www-roots - :documentation "A list of directories (pathname + (www-roots :initarg :www-roots + :documentation "A list of directories (pathname specifiers) or cons-cell (URL-subdir . pathname) to use when looking for static files.") - (dispatchers :initarg :dispatchers - :documentation "A list of request + (dispatchers :initarg :dispatchers + :documentation "A list of request dispatchers. The user supplied list of dispatchers is extended with other dispatchers that are required for UCW to function properly (action-dispatcher, a parenscript-dispatcher, etc). If @@ -177,17 +180,17 @@ you want full control over the active dispatchers use the (setf application.dispatchers) accessor or, if you want control over the order of the dispathcers, (slot-value instance 'dispatchers).")) - (:documentation "The default UCW application class.")) + (:documentation "The default UCW application class."))src/rerl/modular-application/modular-application.lisp
-(defclass modular-application-mixin () +(defclass modular-application-mixin () () - (:documentation "Superclass for all application mixins.")) + (:documentation "Superclass for all application mixins.")) -(defclass modular-application (standard-application modular-application-mixin) +(defclass modular-application (standard-application modular-application-mixin) ...)@@ -197,8 +200,8 @@ Cookiesrc/rerl/modular-application/cookie-module.lisp
-(defclass cookie-session-application-module (modular-application-mixin) - (:documentation "Class for applications which use cookies for sesion tracking. +(defclass cookie-session-application-module (modular-application-mixin) + (:documentation "Class for applications which use cookies for sesion tracking. Cookie session applications work exactly like standard-applications except that when the session is not found @@ -216,8 +219,8 @@ L10nsrc/rerl/modular-application/l10n-module.lisp
-(defclass l10n-application-module (modular-application-mixin) - (:documentation "Application class which can handle l10n requests.")) +(defclass l10n-application-module (modular-application-mixin) + (:documentation "Application class which can handle l10n requests."))@@ -227,9 +230,9 @@ Securesrc/rerl/modular-application/security-module.lisp
-(defclass secure-application-module (modular-application-mixin) - (:documentation - "Mixin class for applications which require authorized access. +(defclass secure-application-module (modular-application-mixin) + (:documentation + "Mixin class for applications which require authorized access. Concrete application must specialize the following methods: APPLICATION-FIND-USER (APPLICATION USERNAME) APPLICATION-CHECK-PASSWORD (APPLICATION USER PASSWORD) @@ -250,8 +253,8 @@ metaclass is set.src/rerl/standard-component/standard-component.lisp
-(defmacro defcomponent (name supers slots &rest options) - "Macro for defining a component class. +(defmacro defcomponent (name supers slots &rest options) + "Macro for defining a component class. This macro is used to create component classes and provides options for easily creating the methods which often accompany a @@ -282,8 +285,8 @@ extra options are allowed: CALL's this component class passing all the arguments passed to the action as initargs.") -;;; Extra Slot Options -"Other than the initargs for standard slots the following +;;; Extra Slot Options +"Other than the initargs for standard slots the following options can be passed to component slots: :backtrack [ T | NIL | FUNCTION-NAME ] - Specify that this slot @@ -310,13 +313,13 @@ Windows-(defclass window-component () +(defclass window-component () ((content-type))) -(defclass simple-window-component (window-component) +(defclass simple-window-component (window-component) ((title) (stylesheet) - (javascript :documentation "List of javascript includes. + (javascript :documentation "List of javascript includes. Each element must be a list whose first value is either the symbol :SRC or :JS. @@ -350,29 +353,29 @@ to insert messages into the browser status bar.(defcomponent status-bar () - ((messages :documentation "An ALIST of the messages to + ((messages :documentation "An ALIST of the messages to show. Each element is a cons of the form (SEVERITY . MESSAGE). SEVERITY is one of :ERROR, :WARN, :INFO and MESSAGE is a string which will be html-escaped.") ...) - (:documentation "Stateless status bar to display messages.")) + (:documentation "Stateless status bar to display messages.")) -(defgeneric add-message (status-bar msg &key severity &allow-other-keys) - (:documentation "Add the message text MSG to STATUS-BAR with +(defgeneric add-message (status-bar msg &key severity &allow-other-keys) + (:documentation "Add the message text MSG to STATUS-BAR with severity SEVERITY."))(defcomponent status-bar-mixin () - ((status-bar :accessor status-bar - :initarg status-bar - :component (status-bar)))) + ((status-bar :accessor status-bar + :initarg status-bar + :component (status-bar)))) -(defmethod show-status-bar ((win status-bar-mixin)) +(defmethod show-status-bar ((win status-bar-mixin)) (render (status-bar win))) -(defgeneric show-message (msg &key severity &allow-other-keys) - (:documentation "Show a message in the status bar. Only works if +(defgeneric show-message (msg &key severity &allow-other-keys) + (:documentation "Show a message in the status bar. Only works if current window is a status-bar-mixin"))@@ -382,10 +385,10 @@ severity SEVERITY."))-(defclass redirect-component () - ((target :accessor target :initarg :target)) - (:metaclass standard-component-class) - (:documentation "Send a client redirect. +(defclass redirect-component () + ((target :accessor target :initarg :target)) + (:metaclass standard-component-class) + (:documentation "Send a client redirect. This component, which must be used as a window-component, redirects the client to the url specified in the target slot. A @@ -399,7 +402,7 @@ The redirect component never answers."))(defun/cc meta-refresh () - "Cause a meta-refresh (a freshly got (GET) url) at this point. + "Cause a meta-refresh (a freshly got (GET) url) at this point. This is useful in order to have a GET url after a form POST's actions have completed running. The user can then refresh to his heart's content.") @@ -413,10 +416,10 @@ Containers
-(defclass container () +(defclass container () (...) - (:metaclass standard-component-class) - (:documentation "Allow multiple components to share the same place. + (:metaclass standard-component-class) + (:documentation "Allow multiple components to share the same place. The container component serves to manage a set of components. It does not provide any render impementation, which is the @@ -448,8 +451,8 @@ be converted into (component . component) form."))-(defclass switching-container ... - (:documentation "A simple renderable container component. +(defclass switching-container ... + (:documentation "A simple renderable container component. This component is like the regular CONTAINER but serves to manage a set of components which share the same place in the UI. Therefore it provides @@ -478,7 +481,7 @@ components.")))(defcomponent tabbed-pane (switching-container) - (:documentation "Component for providing the user with a standard \"tabbed pane\" GUI widget.")) + (:documentation "Component for providing the user with a standard \"tabbed pane\" GUI widget."))Provides a generic tabbed pane that renders a nested div split into a @@ -498,9 +501,9 @@ user.
-(defclass login () +(defclass login () ((username) (password) (message)) - (:documentation "Generic login (input username and password) component. + (:documentation "Generic login (input username and password) component. This component, which must be embedded in another component, presents the user with a simple two fielded login form. @@ -516,12 +519,12 @@ The default implementaion of login-successful simply answers t, no default implementation of check-credentials is provided. Developers should use sub-classes of login for which all the required methods have been definined.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class))-(defgeneric check-credentials (login) - (:documentation "Returns T if LOGIN is valid.")) +(defgeneric check-credentials (login) + (:documentation "Returns T if LOGIN is valid.")) (defaction login-successful ((l login)) (answer t)) @@ -538,15 +541,15 @@ all the required methods have been definined.") protocol details follow.-(defmethod check-credentials ((self user-login)) - (let* ((username (value (username self))) +(defmethod check-credentials ((self user-login)) + (let* ((username (value (username self))) (password (value (password self))) (user (find-application-user username))) - (when (and user (check-user-password user password)) + (when (and user (check-user-password user password)) user))) -(defgeneric application-find-user (application username) - (:documentation "Find USER by USERNAME for APPLICATION.")) +(defgeneric application-find-user (application username) + (:documentation "Find USER by USERNAME for APPLICATION."))@@ -555,19 +558,19 @@ protocol details follow.-(defclass error-message (simple-window-component) - ((message :accessor message :initarg :message :initform "ERROR [no message specified]")) - (:documentation "Generic component for showing server side +(defclass error-message (simple-window-component) + ((message :accessor message :initarg :message :initform "ERROR [no message specified]")) + (:documentation "Generic component for showing server side error messages.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class)) -(defclass error-component (error-message) - ((condition :accessor error.condition :initarg :condition :initform nil) - (backtrace :accessor error.backtrace :initarg :backtrace)) - (:documentation "Generic component for showing server side +(defclass error-component (error-message) + ((condition :accessor error.condition :initarg :condition :initform nil) + (backtrace :accessor error.backtrace :initarg :backtrace)) + (:documentation "Generic component for showing server side error conditions. Unlike ERROR-MESSAGE this component also attempts to display a backtrace.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class))@@ -576,16 +579,16 @@ protocol details follow.-(defclass info-message () - ((message :initarg :message :accessor message) - (ok-text :initarg :ok-text :accessor ok-text :initform "Ok.")) - (:documentation "Component for showing a message to the user. +(defclass info-message () + ((message :initarg :message :accessor message) + (ok-text :initarg :ok-text :accessor ok-text :initform "Ok.")) + (:documentation "Component for showing a message to the user. If the OK-TEXT slot is non-NIL component will use that as the text for a link which, when clicked, causes the component to answer. It follows that if OK-TEXT is NIL this component will never answer.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class))@@ -594,10 +597,10 @@ never answer."src/components/option-dialog.lisp
-(defclass option-dialog (template-component) +(defclass option-dialog (template-component) ((message) (options) (confirm)) - (:default-initargs :template-name "ucw/option-dialog.tal") - (:documentation "Component for querying the user. + (:default-initargs :template-name "ucw/option-dialog.tal") + (:documentation "Component for querying the user. The value of the slot MESSAGE is used as a general heading. @@ -608,13 +611,13 @@ will answer VALUE. If the CONFIRM slot is T the user will be presented with a second OPTION-DIALOG asking the user if they are sure they want to submit that value.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class))A macro to present an option dialog is provided.
-(defmacro option-dialog ((message-spec &rest message-args) &body options) +(defmacro option-dialog ((message-spec &rest message-args) &body options) ...)@@ -632,28 +635,28 @@ Forms-(defclass form-field () - ((validators :documentation "List of validators which will be +(defclass form-field () + ((validators :documentation "List of validators which will be applied to this field.") - (initially-validate :documentation "When non-NIL the + (initially-validate :documentation "When non-NIL the validators will be run as soon as the page is rendered."))) -(defgeneric value (form-field) - (:documentation "The lispish translated value that represents the form-field.")) - -(defgeneric (setf value) (new-value form-field) - (:documentation "Set the value of a form-field with translation to client.")) - -(defclass generic-html-input (form-field html-element) - ((client-value :accessor client-value :initarg :client-value - :initform "" - :documentation "The string the client submitted along with this field.") - (name :accessor name :initarg :name :initform nil) - (accesskey :accessor accesskey :initarg :accesskey :initform nil) - (tooltip :accessor tooltip :initarg :tooltip :initform nil) - (tabindex :accessor tabindex :initarg :tabindex :initform nil)) - (:default-initargs :dom-id (js:gen-js-name-string :prefix "_ucw_"))) +(defgeneric value (form-field) + (:documentation "The lispish translated value that represents the form-field.")) + +(defgeneric (setf value) (new-value form-field) + (:documentation "Set the value of a form-field with translation to client.")) + +(defclass generic-html-input (form-field html-element) + ((client-value :accessor client-value :initarg :client-value + :initform "" + :documentation "The string the client submitted along with this field.") + (name :accessor name :initarg :name :initform nil) + (accesskey :accessor accesskey :initarg :accesskey :initform nil) + (tooltip :accessor tooltip :initarg :tooltip :initform nil) + (tabindex :accessor tabindex :initarg :tabindex :initform nil)) + (:default-initargs :dom-id (js:gen-js-name-string :prefix "_ucw_")))Fields are rendered into the extended
<ucw:input
yaclml tag which @@ -662,9 +665,9 @@ set to(client-value FIELD)
, and you should usevalue
Lisp value associated with it.-(deftag-macro <ucw:input (&attribute accessor action reader writer name id (default nil) - &allow-other-attributes others) - "Generic INPUT tag replacement. +(deftag-macro <ucw:input (&attribute accessor action reader writer name id (default nil) + &allow-other-attributes others) + "Generic INPUT tag replacement. If the ACCESSOR attribute is specified then it must be a PLACE and it's value will be used to fill the input, when the form is @@ -682,39 +685,39 @@ the latest wins.") list.-(defclass validator () - ((message :accessor message :initarg :message :initform nil))) +(defclass validator () + ((message :accessor message :initarg :message :initform nil))) -(defgeneric validate (field validator) - (:documentation "Validate a form-field with a validator.")) +(defgeneric validate (field validator) + (:documentation "Validate a form-field with a validator.")) -(defgeneric javascript-check (field validator) - (:documentation "Generate javascript code for checking FIELD against VALIDATOR. +(defgeneric javascript-check (field validator) + (:documentation "Generate javascript code for checking FIELD against VALIDATOR. This is the convenience entry point to generate-javascript-check, methods defined on this generic funcition should return a list of javascript code (as per parenscript) which tests against the javascript variable value.")) -(defgeneric javascript-invalid-handler (field validator) - (:documentation "The javascript code body for when a field is invalid.")) +(defgeneric javascript-invalid-handler (field validator) + (:documentation "The javascript code body for when a field is invalid.")) -(defgeneric javascript-valid-handler (field validator) - (:documentation "Generate the javascript body for when a field is valid.")) +(defgeneric javascript-valid-handler (field validator) + (:documentation "Generate the javascript body for when a field is valid."))Standard Form Fields
-(defclass string-field (generic-html-input) +(defclass string-field (generic-html-input) ((input-size) (maxlength))) -(defclass password-field (string-field)) -(defclass number-field (string-field)) -(defclass integer-field (number-field)) +(defclass password-field (string-field)) +(defclass number-field (string-field)) +(defclass integer-field (number-field)) -(defclass in-field-string-field (string-field) - ((in-field-label :documentation "This slot, if non-NIL, will be +(defclass in-field-string-field (string-field) + ((in-field-label :documentation "This slot, if non-NIL, will be used as an initial field label. An initial field label is a block of text which is placed inside the input element and removed as soon @@ -722,53 +725,53 @@ javascript variable value.")) field is overidden by an initial :client-value argument."))) -(defclass textarea-field (generic-html-input) +(defclass textarea-field (generic-html-input) ((rows) (cols))) -(defclass date-field (form-field widget-component) +(defclass date-field (form-field widget-component) ((year) (month) (day))) -(defclass dmy-date-field (date-field) - (:documentation "Date fields which orders the inputs day/month/year")) -(defclass mdy-date-field (date-field)) +(defclass dmy-date-field (date-field) + (:documentation "Date fields which orders the inputs day/month/year")) +(defclass mdy-date-field (date-field)) -(defclass select-field (generic-html-input) - ((data-set :documentation "The values this select chooses +(defclass select-field (generic-html-input) + ((data-set :documentation "The values this select chooses from.")) - (:documentation "Form field used for selecting one value from a + (:documentation "Form field used for selecting one value from a list of available options.")) -(defgeneric render-value (select-field value) - (:documentation "This function will be passed each value in the field's +(defgeneric render-value (select-field value) + (:documentation "This function will be passed each value in the field's data-set and must produce the body of the corresponding <ucw:option tag.")) -(defclass mapping-select-field (select-field) - (:documentation "Class used when we want to chose the values of +(defclass mapping-select-field (select-field) + (:documentation "Class used when we want to chose the values of a certain mapping based on the keys. We render the keys in the select and return the corresponding value from the VALUE method.")) -(defclass hash-table-select-field (mapping-select-field)) -(defclass alist-select-field (mapping-select-field)) -(defclass plist-select-field (mapping-select-field)) +(defclass hash-table-select-field (mapping-select-field)) +(defclass alist-select-field (mapping-select-field)) +(defclass plist-select-field (mapping-select-field)) -(defclass radio-group (generic-html-input) +(defclass radio-group (generic-html-input) ((value-widgets))) -(defclass radio-button (generic-html-input) +(defclass radio-button (generic-html-input) ((value) - (group :documentation "The RADIO-GROUP this button is a part + (group :documentation "The RADIO-GROUP this button is a part of.")) - (:documentation "A widget representing a single radio + (:documentation "A widget representing a single radio button. Should be used in conjunction with a RADIO-GROUP.")) -(defmethod add-value ((group radio-group) value) - "Adds radio-button with value to group") +(defmethod add-value ((group radio-group) value) + "Adds radio-button with value to group") -(defclass checkbox-field (generic-html-input)) -(defclass file-upload-field (generic-html-input)) -(defclass submit-button (generic-html-input) +(defclass checkbox-field (generic-html-input)) +(defclass file-upload-field (generic-html-input)) +(defclass submit-button (generic-html-input) ((label)))@@ -780,14 +783,14 @@ attached to the contents of the file. TheContent-Type
header shoul be set to the MIME type of the file being uploaded.-(defgeneric mime-part-headers (mime-part) - (:documentation "Returns an alist of the headers of MIME-PART. +(defgeneric mime-part-headers (mime-part) + (:documentation "Returns an alist of the headers of MIME-PART. The alist must be of the form (NAME . VALUE) where both NAME and VALUE are strings.")) -(defgeneric mime-part-body (mime-part) - (:documentation "Returns the body of MIME-PART.")) +(defgeneric mime-part-body (mime-part) + (:documentation "Returns the body of MIME-PART."))@@ -795,35 +798,35 @@ VALUE are strings."))Standard Validators
-(defclass not-empty-validator (validator)) +(defclass not-empty-validator (validator)) -(defclass value-validator (validator) - (:documentation "Validators that should only be applied if there is a value. +(defclass value-validator (validator) + (:documentation "Validators that should only be applied if there is a value. That is, they always succeed on nil.")) -(defclass length-validator (value-validator) - ((min-length :accessor min-length :initarg :min-length - :initform nil) - (max-length :accessor max-length :initarg :max-length - :initform nil))) +(defclass length-validator (value-validator) + ((min-length :accessor min-length :initarg :min-length + :initform nil) + (max-length :accessor max-length :initarg :max-length + :initform nil))) -(defclass string=-validator (validator) - ((other-field :accessor other-field :initarg :other-field)) - (:documentation "Ensures that a field is string= to another one.")) +(defclass string=-validator (validator) + ((other-field :accessor other-field :initarg :other-field)) + (:documentation "Ensures that a field is string= to another one.")) -(defclass regex-validator (value-validator) - ((regex :accessor regex :initarg :regex :initform nil))) +(defclass regex-validator (value-validator) + ((regex :accessor regex :initarg :regex :initform nil))) -(defclass e-mail-address-validator (regex-validator)) +(defclass e-mail-address-validator (regex-validator)) -(defclass phone-number-validator (regex-validator)) +(defclass phone-number-validator (regex-validator)) -(defclass is-a-number-validator (value-validator)) -(defclass is-an-integer-validator (is-a-number-validator)) +(defclass is-a-number-validator (value-validator)) +(defclass is-an-integer-validator (is-a-number-validator)) -(defclass number-range-validator (is-a-number-validator) - ((min-value :accessor min-value :initarg :min-value :initform nil) - (max-value :accessor max-value :initarg :max-value :initform nil))) +(defclass number-range-validator (is-a-number-validator) + ((min-value :accessor min-value :initarg :min-value :initform nil) + (max-value :accessor max-value :initarg :max-value :initform nil)))@@ -835,13 +838,13 @@ the form boilerplate and then calls yourrender
.(defcomponent simple-form (html-element) - ((submit-method :accessor submit-method - :initform "post" - :initarg :submit-method) - (dom-id :accessor dom-id - :initform (js:gen-js-name-string :prefix "_ucw_simple_form_") - :initarg :dom-id)) - (:default-initargs :dom-id "ucw-simple-form")) + ((submit-method :accessor submit-method + :initform "post" + :initarg :submit-method) + (dom-id :accessor dom-id + :initform (js:gen-js-name-string :prefix "_ucw_simple_form_") + :initarg :dom-id)) + (:default-initargs :dom-id "ucw-simple-form"))@@ -854,21 +857,21 @@ TemplatesInfrastructure for loading TAL templates as a view of a component.
-(defclass template-component (component)) +(defclass template-component (component)) (defcomponent simple-template-component (template-component) - ((environment :initarg :environment :initform nil))) + ((environment :initarg :environment :initform nil))) -(defgeneric template-component-environment (component) - (:documentation "Create the TAL environment for rendering COMPONENT's template. +(defgeneric template-component-environment (component) + (:documentation "Create the TAL environment for rendering COMPONENT's template. Methods defined on this generic function must return a TAL environment: a list of TAL binding sets (see the documentation for YACLML:MAKE-STANDARD-ENVIRONMENT for details on TAL environments.)") - (:method-combination nconc)) + (:method-combination nconc)) -(defmethod template-component-environment nconc ((component template-component)) - "Create the basic TAL environment. +(defmethod template-component-environment nconc ((component template-component)) + "Create the basic TAL environment. Binds the symbol ucw:component to the component object itself, also puts the object COMPONENT on the environment (after the @@ -876,8 +879,8 @@ binding of ucw:component) so that slots are, by default, visable." (make-standard-environment `((component . ,component)) component)) -(defmethod render ((component template-component)) - "Render a template based component. +(defmethod render ((component template-component)) + "Render a template based component. Calls the component's template. The name of the template is the value returned by the generic function @@ -903,9 +906,9 @@ Utility Mixin Componentssrc/components/range-view.lisp
-(defclass range-view (template-component) - (:default-initargs :template-name "ucw/range-view.tal") - (:documentation "Component for showing the user a set of data one \"window\" at a time. +(defclass range-view (template-component) + (:default-initargs :template-name "ucw/range-view.tal") + (:documentation "Component for showing the user a set of data one \"window\" at a time. The data set is presented one \"window\" at a time with links to the the first, previous, next and last window. Each window shows @@ -918,16 +921,16 @@ each item of DATA. In order to change the rendering of the single elements of a range view developer's should create a sub class of RANGE-VIEW and define their RENDER-RANGE-VIEW-ITEM methods on that.") - (:metaclass standard-component-class)) + (:metaclass standard-component-class))-(defgeneric render-range-view-item (range-view item) - (:documentation "Render a single element of a range-view.") - (:method ((range-view range-view) (item t)) - "Standard implementation of RENDER-RANGE-VIEW-ITEM. Simply +(defgeneric render-range-view-item (range-view item) + (:documentation "Render a single element of a range-view.") + (:method ((range-view range-view) (item t)) + "Standard implementation of RENDER-RANGE-VIEW-ITEM. Simply applies ITEM to princ (via <:as-html)." - (declare (ignore range-view)) + (declare (ignore range-view)) (<:as-html item)))@@ -940,13 +943,13 @@ for defining lightweight widgets embedded within other components.src/components/html-element.lisp
-(defclass html-element (component) +(defclass html-element (component) ((css-class) (dom-id) (css-style) (extra-tags) (events)) - (:documentation "An HTML element. + (:documentation "An HTML element. HTML elements control aspects that are relevant to almost all tags. @@ -968,16 +971,16 @@ added."))-(defclass widget-component (html-element) +(defclass widget-component (html-element) () - (:documentation "A widget which should be wrapped in a <div>.")) + (:documentation "A widget which should be wrapped in a <div>.")) -(defclass inline-widget-component (html-element) +(defclass inline-widget-component (html-element) () - (:documentation "A widget which should be wrapped in <span> and not <div>")) + (:documentation "A widget which should be wrapped in <span> and not <div>")) -(defmethod render :wrap-around ((widget widget-component))) -(defmethod render :wrap-around ((widget inline-widget-component))) +(defmethod render :wrap-around ((widget widget-component))) +(defmethod render :wrap-around ((widget inline-widget-component)))@@ -1010,9 +1013,9 @@ into a task.-(defclass task-component (standard-component) +(defclass task-component (standard-component) (...) - (:documentation "A controller for a single task or operation to + (:documentation "A controller for a single task or operation to be performed by the user. A task component's START action is called as soon as the @@ -1021,7 +1024,7 @@ RENDER method, in fact they have no graphical representation but serve only to order a sequence of other components.")) (defgeneric/cc start (task) - (:documentation "action which gets called automatically when + (:documentation "action which gets called automatically when task-component is active. Use defaction to define your own \"start\" action"))@@ -1033,18 +1036,18 @@ task-component is active. Use defaction to define your own(defcomponent cached-component () - ((cached-output :accessor cached-output :initform nil - :documentation "A string holding the output to + ((cached-output :accessor cached-output :initform nil + :documentation "A string holding the output to use for this component. This string will be written directly to the html stream and is changed by the REFRESH-COMPONENT-OUTPUT method." ) - (timeout :accessor timeout :initarg :timeout - :documentation "An value specifying how often this + (timeout :accessor timeout :initarg :timeout + :documentation "An value specifying how often this component needs to be refreshed. The exact interpretation of the value depends on the type of caching used class.")) - (:documentation "Component which caches its output. + (:documentation "Component which caches its output. The component caching API is built around the generic functions COMPONENT-DIRTY-P and REFRESH-COMPONENT-OUTPUT and a method on @@ -1052,26 +1055,26 @@ RENDER, see the respective docstrings for more details. Do not use CACHED-COMPONENT directly, use one its subclasses.")) -(defgeneric component-dirty-p (component) - (:documentation "Returns T is COMPONENT's cache is invalid.")) +(defgeneric component-dirty-p (component) + (:documentation "Returns T is COMPONENT's cache is invalid.")) -(defgeneric update-cache (component) - (:documentation "Update COMPONENT's cache variables after a refresh.")) +(defgeneric update-cache (component) + (:documentation "Update COMPONENT's cache variables after a refresh.")) (defcomponent timeout-cache-component (cached-component) - ((last-refresh :accessor last-refresh :initform nil - :documentation "The time, exrpessed as a + ((last-refresh :accessor last-refresh :initform nil + :documentation "The time, exrpessed as a universal time, when the component was last rendered.")) - (:default-initargs - :timeout (* 30 60 60)) - (:documentation "Render the component at most every TIMEOUT seconds.")) + (:default-initargs + :timeout (* 30 60 60)) + (:documentation "Render the component at most every TIMEOUT seconds.")) (defcomponent num-hits-cache-component (cached-component) - ((hits-since-refresh :accessor hits-since-refresh - :initform nil - :documentation "Number of views since last refresh.")) - (:default-initargs :timeout 10) - (:documentation "Render the component every TIMEOUT views.")) + ((hits-since-refresh :accessor hits-since-refresh + :initform nil + :documentation "Number of views since last refresh.")) + (:default-initargs :timeout 10) + (:documentation "Render the component every TIMEOUT views."))Subclass and override
component-dirty-p
to do something useful @@ -1096,8 +1099,8 @@ you want to render a component in place as part of another component just callrender
on it instead.-(defmacro call (component-type &rest component-init-args) - "Stop the execution of the current action and pass control to +(defmacro call (component-type &rest component-init-args) + "Stop the execution of the current action and pass control to a freshly created component of type COMPONENT-TYPE. COMPONENT-INIT-ARGS are passed directly to the underlying @@ -1110,15 +1113,15 @@ Notes: This macro assumes that the lexcial variable UCW:SELF is bound to the calling component.") -(answer VAL) ; answer parent component ONLY IN ACTIONS +(answer VAL) ; answer parent component ONLY IN ACTIONS -(ok SELF VAL) ; Used to answer a component anywhere and what answer - ; expands into +(ok SELF VAL) ; Used to answer a component anywhere and what answer + ; expands into -(jump COMPONENT-NAME &REST ARGS) ; is similar to call, but replaces - ; the current component with the new - ; one and drops any backtracks (back - ; button will no longer work) +(jump COMPONENT-NAME &REST ARGS) ; is similar to call, but replaces + ; the current component with the new + ; one and drops any backtracks (back + ; button will no longer work)
(call COMPONENT-NAME &ARGS INIT-ARGS)
callsCOMPONENT-NAME
and returns @@ -1134,9 +1137,9 @@ component for most of UCW to work.(defaction NAME (first ...) ...) - ; (roughly) expands into + ; (roughly) expands into (defmethod/cc NAME (first ...) - (let ((self first)) + (let ((self first)) ...))@@ -1151,9 +1154,9 @@ macroexpansion!"). Entry Points-(defentry-point url (:application APPLICATION - :class DISPATCHER-CLASS) - (PARAM1 ... PARAMN) ; GET / POST vars, bound in body +(defentry-point url (:application APPLICATION + :class DISPATCHER-CLASS) + (PARAM1 ... PARAMN) ; GET / POST vars, bound in body body)@@ -1164,15 +1167,15 @@ follows. The entry point allows files to be streamed to user when the url audio.ucw?file=FOO is used.-(defentry-point "^(audio.ucw|)$" (:application *golf-test-app* - :class regexp-dispatcher) +(defentry-point "^(audio.ucw|)$" (:application *golf-test-app* + :class regexp-dispatcher) (file) (call 'audio-file-window - :audio-file (make-instance 'audio-file - :type :vorbis - :data (file->bytes (open + :audio-file (make-instance 'audio-file + :type :vorbis + :data (file->bytes (open file - :element-type 'unsigned-byte))))) + :element-type 'unsigned-byte)))))@@ -1183,8 +1186,8 @@ Dispatchingsrc/rerl/standard-dispatcher.lisp
-(defgeneric matcher-match (matcher application context) - (:documentation "Abstract method for subclasses to implement a +(defgeneric matcher-match (matcher application context) + (:documentation "Abstract method for subclasses to implement a matcher. This method would return multiple-values according to matcher internal nature. @@ -1194,16 +1197,16 @@ request, it is allowed to modify CONTEXT or APPLICATION, even in that case methods defined on this function must not modify CONTEXT's application nor rebind *context*.")) -(defgeneric handler-handle (handler application context matcher-result) - (:documentation "Abstract function for handler classes to +(defgeneric handler-handle (handler application context matcher-result) + (:documentation "Abstract function for handler classes to implement in order to handle a request matched by relevant matcher. These methods may modify context as they wish since they'r matched, request will be closed after this method is run.")) -(defgeneric dispatch (dispatcher application context) - (:documentation "Entry point into a dispatcher. Must return T +(defgeneric dispatch (dispatcher application context) + (:documentation "Entry point into a dispatcher. Must return T if the context has been handled or NIL if it hasn't. No methods defined on this function may rebind *context*, nor @@ -1214,9 +1217,9 @@ application nor rebind *context*."))-(defclass my-matcher (abstract-matcher) ...) -(defclass my-handler (abstract-handler) ...) -(defclass my-dispatcher (abstract-dispatcher my-matcher my-handler) +(defclass my-matcher (abstract-matcher) ...) +(defclass my-handler (abstract-handler) ...) +(defclass my-dispatcher (abstract-dispatcher my-matcher my-handler) ...)@@ -1224,7 +1227,7 @@ application nor rebind *context*.")) Simple Dispatcher-(:documentation "This class of dispatchers avoids all of UCW's +(:documentation "This class of dispatchers avoids all of UCW's standard call/cc (and therefore frame/backtracking/component) mechanism. @@ -1240,15 +1243,15 @@ Server-(defun create-server (&key - (backend `(,*ucw-backend-type* :host ,*ucw-backend-host* - :port ,*ucw-backend-port*)) +(defun create-server (&key + (backend `(,*ucw-backend-type* :host ,*ucw-backend-host* + :port ,*ucw-backend-port*)) (applications *ucw-applications*) (start-p t) (server-class *ucw-server-class*) (log-root-directory (truename *ucw-log-root-directory*)) (log-level *ucw-log-level*)) - "Creates and returns a UCW server according to SERVER-CLASS, HOST and + "Creates and returns a UCW server according to SERVER-CLASS, HOST and PORT. Affects *DEFAULT-SERVER*. BACKEND is a list of (BACKEND-TYPE &rest INITARGS). BACKEND-TYPE @@ -1265,7 +1268,7 @@ server. Logs are generated in verbosity defined by LOG-LEVEL and directed to LOG-ROOT-DIRECTORY if defined." ... - server) ; return server, naturally + server) ; return server, naturally@@ -1279,8 +1282,8 @@ Inspector(defaction call-inspector ((component component) datum) - "Call an inspector for DATUM on the component COMPONENT." - (call 'ucw-inspector :datum datum)) + "Call an inspector for DATUM on the component COMPONENT." + (call 'ucw-inspector :datum datum))@@ -1300,8 +1303,8 @@ must also have the/
(which is counterintuitive given the behavior most unix things that don't want the/
at the end of the name).-:www-roots (list '("dojo/" . - #P"/home/clinton/src/ucw/darcs/ucw_dev/wwwroot/dojo/")) +:www-roots (list '("dojo/" . + #P"/home/clinton/src/ucw/darcs/ucw_dev/wwwroot/dojo/"))@@ -1349,11 +1352,10 @@ you wish to have content interspersed with yaclml tags. - diff --git a/William Blake.html b/William Blake.html index 7dc515e..8a90dd4 100644 --- a/William Blake.html +++ b/William Blake.html @@ -7,7 +7,10 @@ - + + +William Blake
@@ -178,7 +181,10 @@ Thus Sang the No, there's nothing here about X, so be quiet. + diff --git a/William James - The PhD Octopus.html b/William James - The PhD Octopus.html index 5738f88..e5b02d5 100644 --- a/William James - The PhD Octopus.html +++ b/William James - The PhD Octopus.html @@ -7,7 +7,10 @@ - + + +William James - The PhD Octopus
@@ -345,9 +348,7 @@ to guard us from a future so unmanly and so unbeautiful! - diff --git a/William James - The Varieties of Religious Experience.html b/William James - The Varieties of Religious Experience.html index bc5896c..6cacb42 100644 --- a/William James - The Varieties of Religious Experience.html +++ b/William James - The Varieties of Religious Experience.html @@ -7,7 +7,10 @@ - + + +William James - The Varieties of Religious Experience
@@ -864,8 +867,10 @@ uebermensch or Taoist] - diff --git a/Window Maker Themes.html b/Window Maker Themes.html index 65efe04..42d2b92 100644 --- a/Window Maker Themes.html +++ b/Window Maker Themes.html @@ -7,7 +7,10 @@ - + + +Window Maker Themes
@@ -134,10 +137,8 @@ RAM. - diff --git a/Wisdom.html b/Wisdom.html index 622f7ff..4201f14 100644 --- a/Wisdom.html +++ b/Wisdom.html @@ -309,7 +309,10 @@ stinks. One should not go to church if one wants to breathe - diff --git a/index.html b/index.html index a038821..d327e74 100644 --- a/index.html +++ b/index.html @@ -230,10 +230,8 @@ wrote and darcs. - -- 2.20.1