0

I want to know, if there is some possibility of inspecting an object as slime inspector does.

For example, using libyaml I get the following result, it worked well:

ELISP> (yaml-read-from-string "
language: generic
sudo: false
before_install:
  - echo foobar
  - ls
script:
  - make test
")
#<hash-table equal 4/65 0x432245a9>
ELISP> (setq h (yaml-read-from-string "
language: generic
sudo: false
before_install:
  - echo foobar
  - ls
script:
  - make test
"))
#<hash-table equal 4/65 0x42ffa861>
ELISP> (gethash "language" h)
"generic"
ELISP> (gethash "sudo" h)
nil
ELISP> (gethash "before_install" h)
["echo foobar" "ls"]

ELISP> (gethash "script" h)
["make test"]

ELISP> h
#<hash-table equal 4/65 0x42ffa861>
ELISP> (describe-symbol h)
*** Eval error ***  You didn’t specify a function or variable
ELISP> (describe-symbol 'h)
1 (#o1, #x1, ?\C-a)
ELISP> (describe-variable h)
"You did not specify a variable"
ELISP> (describe-variable 'h)
"h’s value is #<hash-table equal 4/65 0x42ffa861>

Documentation:
Not documented as a variable."

Finally, I noticed that there is a print, princ, prin1 or format representation for that with the format function:

(format "%s" h)
"#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data (language generic sudo nil before_install [echo foobar ls] script [make test]))"
ELISP> (format "%S" h)
"#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data (\"language\" \"generic\" \"sudo\" nil \"before_install\" [\"echo foobar\" \"ls\"] \"script\" [\"make test\"]))"

as pointed here

So my question is: How do I inspect data dumper ,the h variable, otherwise?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.