A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.gnu.org/software/emacs/manual/html_node/elisp/JSONRPC-JSON-object-format.html below:

JSONRPC JSON object format (GNU Emacs Lisp Reference Manual)

Next: Deferred JSONRPC requests, Previous: Process-based JSONRPC connections, Up: JSONRPC communication   [Contents][Index]

33.32.3 JSONRPC JSON object format

JSONRPC JSON objects are exchanged as Lisp plists (see Property Lists): JSON-compatible plists are handed to the dispatcher functions and, likewise, JSON-compatible plists should be given to jsonrpc-notify, jsonrpc-request, and jsonrpc-async-request.

To facilitate handling plists, this library makes liberal use of cl-lib library (see cl-lib in Common Lisp Extensions for GNU Emacs Lisp) and suggests (but doesn’t force) its clients to do the same. A macro jsonrpc-lambda can be used to create a lambda for destructuring a JSON-object like in this example:

(jsonrpc-async-request
 myproc :frobnicate `(:foo "trix")
 :success-fn (jsonrpc-lambda (&key bar baz &allow-other-keys)
               (message "Server replied back with %s and %s!"
                        bar baz))
 :error-fn (jsonrpc-lambda (&key code message _data)
             (message "Sadly, server reports %s: %s"
                      code message)))

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4