diff --git a/docs/manual.scr b/docs/manual.scr index 3babdc4..4af16f4 100644 --- a/docs/manual.scr +++ b/docs/manual.scr @@ -285,6 +285,10 @@ resulting string to @c(path). Any remaining arguments are sent to The package @c(kutils-mop) contains utilities taking advantage of the metaobject protocol. +The @c(list-all-slots) will return a list of all slots in an object. +@cl:with-package[name="kutils-mop"]( +@cl:doc(function list-all-slots)) + The @c(make-instance-from-hash-table) function will attempt to create an instance of an object from a hash table. @@ -391,6 +395,9 @@ utilities".) described in "Miscellaneous utilities" under "Clojure-inspired functions".) +@item(@c(list-all-slots) is a function defined in @c(kmop/kmop.list), +described in "Metaobject utilities".) + @item(@c(macroexpand-n) is a function defined in @c(kutils.lisp), described in "Miscellaneous utilities" under "General".) @@ -503,6 +510,7 @@ Alphabetical documentation for all exported symbols. @cl:doc(macro iflet*) @cl:doc(macro in) @cl:doc(function interpose) +@cl:doc(function list-all-slots) @cl:doc(function macroexpand-n) @cl:doc(macro mapv) @cl:doc(function mkkw) diff --git a/kmop/kmop.lisp b/kmop/kmop.lisp index 6fed6ff..11b85ea 100644 --- a/kmop/kmop.lisp +++ b/kmop/kmop.lisp @@ -30,7 +30,7 @@ (mapcar #'closer-mop:slot-definition-initargs slots))) -(defun get-all-slots (class-sym &optional (package *package*)) +(defun list-all-slots (class-sym &optional (package *package*)) (let ((class-val (find-class (find-symbol (mkstr class-sym) @@ -89,6 +89,6 @@ should use underscores. The slot type is used to determine whether to attempt to parse another object as a hash table entry." (whenlet ((class-sym (class-symbol class-type)) (arglst (zip-initargs-hash-table - (get-all-slots class-type package) + (list-all-slots class-type package) table snake-case))) (apply #'make-instance class-sym arglst))) diff --git a/kmop/package.lisp b/kmop/package.lisp index a942b88..0260352 100644 --- a/kmop/package.lisp +++ b/kmop/package.lisp @@ -2,4 +2,5 @@ (defpackage #:kutils-mop (:use #:cl #:kutils) - (:export #:make-instance-from-hash-table)) + (:export #:make-instance-from-hash-table + #:list-all-slots))