I've been itching to replace some of the hand-crafted (and therefore
hard to maintain) lists in maxima-font-lock.el with lists generated by
maxima. To do this, I would like to reliably determine if a symbol
points to a function, constant, special variable, etc.
Here is what I have
(defvar *toplevel-functions* '())
(defvar *toplevel-constants* '())
(defvar *toplevel-specials* '())
(do-symbols (s :maxima)
(unless (or (= 0 (length (symbol-name s))) (string-not-equal "$" (symbol-name s) :end2 1))
(if (functionp s) (push s *toplevel-functions*))
(if (constant s) (push s *toplevel-constants*))
(if (specialp s) (push s *toplevel-specials*))))
which gives me
MAXIMA> *toplevel-constants*
($MINF $INF $%PHI $UND $INFINITY $IND $%E $%I $%GAMMA $CONSTANT $%PI)
MAXIMA> (length *toplevel-specials*)
381
MAXIMA> (length *toplevel-functions*)
705
Suggestions?
TIA,
Leo