Paste number 24268: function handler for Araneida

Index of paste annotations: 1

Paste number 24268: function handler for Araneida
Pasted by: nowhereman
2 years, 4 months ago
#lisp
Paste contents:
Raw Source | XML | Display As
(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:
Raw Source | Display As
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)
)
)

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.