Page 1 of 1

Inspector v0.2: snapshot'ed symbols state of another process

Posted: Tue Sep 15, 2015 1:10 am
by hartrock
Inspector v0.2 at Github:

Now it is possible to explore another newLISP's symbols state by snapshot'ing it, and viewing the result in the browser after starting Inspector.

Snapshot'ing only needs minimal code:

Code: Select all

#!/usr/bin/env newlisp
(load "modules/Util.lsp")
(load "modules/Introspection.lsp")

;; make snapshot
(set 'filepath "/tmp/snapshot.json")
(define (make-snapshot filepath)
  (write-file filepath
              (Introspection:symbols-to-JSON (Util:symbols-all))))

(make-snapshot filepath)
(println "You may look onto snapshot's symbols by\n"
         "  http:localhost:8080/symbols.html?file="
         filepath "\n.")
Result can be viewn by http://localhost:8080/symbols.html?file ... pshot.json then: see ... sp-process for a screenshot of viewing context folders of a minimal system; and ... sp-process for more info.