| Paste number 24268: | function handler for Araneida |
| Pasted by: | nowhereman |
| When: | 2 years, 10 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+IQ4 |
| Channel: | #lisp |
| Paste contents: |
(defclass function-handler (handler)
((function :accessor get-function :initarg :function)))
(defmethod handle-request-response ((handler function-handler) method request)
(let ((function (get-function handler)))
(if (symbolp function)
(funcall (symbol-function function) method request)
(funcall function method request))))Annotations for this paste:
| Annotation number 1: | It happens funcall can cope with either a function or a symbol |
| Pasted by: | nowhereman |
| When: | 2 years, 10 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+IQ4#1 |
| Paste contents: |
defclass function-handler (handler)
((function :accessor get-function :initarg :function)))
(defmethod handle-request-response ((handler function-handler) method request)
(funcall (get-function handler) method request)))