Skip to content

Instantly share code, notes, and snippets.

@tangrammer
Created October 4, 2025 10:16
Show Gist options
  • Select an option

  • Save tangrammer/0608097c1a8ffedf246b6f9646058d4d to your computer and use it in GitHub Desktop.

Select an option

Save tangrammer/0608097c1a8ffedf246b6f9646058d4d to your computer and use it in GitHub Desktop.
(require '[semantic]
'[semantic.observation.type :as observation.type]
'[semantic.observation.type.catalog])
(semantic/observe! :dev/yorba-id :semantic.observation.type/docs
{:documentation/content "Hello yorba docs!"})
#_{:semantic/subject :dev/yorba-id,
:semantic/observation #:documentation{:content "Hello yorba docs!"},
:semantic.observation/type :semantic.observation.type/docs}
(semantic/read-observation :dev/yorba-id :semantic.observation.type/docs)
;;=> #:documentation{:content "Hello yorba docs!"}
(observation.type/implementers :semantic.observation.type/docs)
;;=> #{:dev/yorba-id}
(mapv #(semantic/read-observation % :semantic.observation.type/docs) (observation.type/implementers :semantic.observation.type/docs))
;;=> [#:documentation{:content "Hello yorba docs!"}]
(semantic/observe! :dev/yorba-foo :semantic.observation.type/docs
{:documentation/content "Hello yorba foo!"})
#_{:semantic/subject :dev/yorba-foo,
:semantic/observation #:documentation{:content "Hello yorba foo!"},
:semantic.observation/type :semantic.observation.type/docs}
(mapv #(semantic/read-observation % :semantic.observation.type/docs) (observation.type/implementers :semantic.observation.type/docs))
;;=> [#:documentation{:content "Hello yorba docs!"} #:documentation{:content "Hello yorba foo!"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment