How to pprint all globals?



I want to pprint all defined items and I tried:

(mapc pprint (globals))

but this gives me only the names of each symbol, each in one line, and at the end the first item pprinted.

Is it possible to print out all function definitions with one command (or one function)?


Ulisp-2.4-esp with 4 MByte PSRAM support

Sorry, last post was wrong. The result is the items each in one line, returning a list with all items.


What you want is:

(defun pp ()
   (lambda (x) (pprint (eval x)) (terpri))

Run it by typing:


Alternatively, a fancier version that prints each definition starting with defun is:

(defun pp ()
   (lambda (x)
     (let ((v (eval x)))
       (unless (eq x 'pp)
         (when (eq (car v) 'lambda)
           (pprint (cons 'defun (cons x (cdr v)))))


Yes, that’s what I wanted, thank you very much!


As of uLisp Version 2.3 this feature is now built in to uLisp, using the function: