I would like to suggest to improve the Maxima user function apropos.
This is the last result of some work to get a working function apropos:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Utility function to filter a list LST with a function FN
;;; e.g. (filter #'(lambda(x) (if (oddp x) x)) '(1 2 3 4 5 6 7)) --> (1
3 5 7)
(defun filter (fn lst)
(let ((acc nil))
(dolist (x lst)
(let ((val (funcall fn x)))
(if val (push val acc))))
(nreverse acc)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmspec $apropos (s)
(let ((acc nil))
(setq s (car (margs s)))
(cond ((stringp s)
;; A list of all Maxima names which contain the string S.
(setq acc (append acc (apropos-list (stripdollar
s) :maxima)))
;; Filter the names which are Maxima User symbols starting
;; with % or $ and remove duplicates.
($listify
($setify
(cons '(mlist)
(filter #'(lambda (x)
(cond ((eq (getcharn x 1) #\$) x)
((eq (getcharn x 1) #\%)
;; Change to a verb, when
present.
(if (setq y (get x 'noun))
y
x))
(t nil)))
acc)))))
(t
(merror
(intl:gettext "apropos: The argument has to be a
string."))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
The function works like the description in the manual. The argument is a
string, because we get problems when using a symbol as I have already
written in the bug report "apropos" - ID: 1602849. The function displays
all names of the function regardless if the name is a noun or a verb and
removes the duplicates.
apropos("") returns a list with all Maxima Symbols including the
symbols, which are definied by the user or shared code.
The function does not check the number of arguments, but ignores more
then one argument.
This will be an example for the symbols which have "gamma" in the name:
(%i1) apropos("gamma");
(%o1) [%gamma, %gammagreek, gamma, gammagreek, gammalim, gamma_expand,
gamma_imag, gamma_incomplete, gamma_incomplete_generalized,
gamma_incomplete_regularized, gamma_radius, Gamma, log_gamma,
makegamma,
gamma_incomplete_generalized_regularized]
Furthermore, I would like to suggest to move the function apropos in the
manual to chapter "3.4 Functions and Variables for Help". At last, I
would like to suggest to add all functions apropos, demo, example, and
describe to the category help.
Dieter Kaiser