Skip to content

introspection

EricGebhart edited this page Sep 27, 2021 · 2 revisions

Introspection

Everything SPR does, is in the data store, function definitions, namespaces, everything is there to see and muck with.

Given that there should be some consistency between the modules and their namespaces. A namespace can be explored with the following SPR commands, where is the name of the namespace:

  • ls to see a list of namespaces and functions at /.

  • ls <ns> to see a summary of the namespace.

  • ls / to see a listing at the root of the datastore.

  • help <ns> to get help for the namespace.

  • help <ns>/<function> to get help for a function in the namespace.

  • pyhelp <ns> to get python help for the namespace.

  • pyhelp <ns>/<function> to get python help for a function in the namespace.

Explore datastore with ls / and show.

  • show to see the current with path and contents.
  • show /path/to/whatever to see the data tree at that point.
  • show <ns> to see the Stateful data used by the namespace, if any, possibly.
  • show /config/<ns> to see the configuration data used by the device namespace

Other ways to see things.

  • cli/msg ~/platform print the platform and wait for response.
  • log/info ~/platform print the platform to the console and log.
  • log/info ~/_with_ print the with stack as python data.

The with stack

The with stack is actually held at /_with_ by default and can be seen there with ls and show.

  • with to see the current with path and contents listing.
  • as/show-with to see the current with stack data tree.
  • ls-with to see the with stack.
  • pop-with to pop the stack. - equivalent to pop /~/\_with_path\_
  • flat-with to see a flattened map of variables in the with stack.
  • show to see the current with.

The Symbol table

The SPR namespaces are in /_Root_.

Clone this wiki locally