| Paste number 24268: | function handler for Araneida |
| Pasted by: | nowhereman |
| 2 years, 4 months ago | |
| #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 |
| 2 years, 4 months ago | |
| 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))) |