diff options
author | colin <colin@cicadas.surf> | 2024-08-24 10:31:37 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-08-24 10:31:37 -0700 |
commit | 71ab563b2b0f4763ac266d6359fba492514bda65 (patch) | |
tree | b9a6a3f9a83bf81adfe131eb28a2d626951b94fc /src/endpoint.lisp | |
parent | 33046c1a1cec3819245f13d960c6072aa73aee65 (diff) |
Add: slot-value-mapper
Diffstat (limited to 'src/endpoint.lisp')
-rw-r--r-- | src/endpoint.lisp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/endpoint.lisp b/src/endpoint.lisp index 00f681f..4ec68b6 100644 --- a/src/endpoint.lisp +++ b/src/endpoint.lisp @@ -356,6 +356,12 @@ the ;." :note "Error during the parsing of the body."))))))) + +(defun apply-slot-value-mappers (class initargs) + (loop :for (arg value) :on initargs :by #'cddr + :collect arg + :collect (slot-value-mapper class arg value))) + (defun instantiate-endpoint (class args) "This attempts to instantiate CLASS, filling slots found in ARGS by searching for their values in the hunchentoot:*request*. @@ -371,8 +377,10 @@ the ;." (body-args (extract-initargs args (collect-body class)))) (apply #'make-instance class - (reduce #'merge-plists - (list extracted-args params-args body-args))))) + (apply-slot-value-mappers + class + (reduce #'merge-plists + (list extracted-args params-args body-args)))))) (defun build-handler (class) "Create a hunchentoot dispatch function that instantiates and handles |