Xah Talk Show 2025-07-05 Ep675 Golang vs Emacs Lisp Hashtable. Part 2
xah talk show ep675 1c407
(setq starttime (format-time-string "%s") )
(setq xinputdir "c:/Users/xah/web/" )
(setq xdir-names-ignore-list
'(
".git"
"emacs_manual"
"js_es2011"
"js_es2015"
"node_api"
))
(setq
xfilelist
(directory-files-recursively
xinputdir
""
nil
(lambda (x)
(let ((xdirname (file-name-nondirectory x)))
(seq-every-p
(lambda (ignorename)
(if (string-equal xdirname ignorename) nil t))
xdir-names-ignore-list)))))
(setq xtable (make-hash-table :test 'equal))
(mapc
(lambda (x)
(puthash x 1 xtable))
xfilelist)
(setq endtime (format-time-string "%s") )
(let (newbuf)
(setq newbuf (get-buffer-create "*xtable output*"))
(with-output-to-temp-buffer newbuf
(print (format "time spent: %s"
(- (string-to-number endtime) (string-to-number starttime))))
(print (format "total items: %s" (hash-table-count xtable)))
(princ (let (xlist)
(maphash (lambda (k _) (push (format "%s" k) xlist)) xtable)
(mapconcat 'identity xlist "\n"))))
(switch-to-buffer newbuf))