Skip to content

Commit

Permalink
README: Update and clarify several ambiguous points.
Browse files Browse the repository at this point in the history
  • Loading branch information
aartaka committed Sep 18, 2023
1 parent badb27d commit 0b93fa5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,21 @@ more valuable.
NJSON has strict requirements on the returned data, but this
strictness enables a rich set of JSON-handling primitives/helpers. You
can
- safely ~:use #:njson~ in your packages if you want short and convenient JSON
operations there;

- or you can define a package local nickname for ~:njson/aliases~ to be
a mere ~j:~ (using ~trivial-package-local-nicknames~), so that even
shorter helpers (just a couple of characters longer than the regular
CL constructs) are available:
- ~(:use #:cl #:njson)~ in your packages if you want short and
convenient JSON operations there. It's safe, because NJSON shadows
no symbols from CL.

- Or you can define a package local nickname for ~:njson/aliases~ to
be a mere ~j:~ (using ~trivial-package-local-nicknames~), so that
even shorter helpers (just a couple of characters longer than the
regular CL constructs) are available:
#+begin_src lisp
(trivial-package-local-nicknames:add-package-local-nickname :j :njson/aliases :YOUR-PACKAGE)
;; And then use it like.
(j:get ...)
(j:decode ...)
(j:if ...)
(j:match ...)
#+end_src

See the next section for the functions/macros NJSON exports.
Expand Down Expand Up @@ -148,6 +151,8 @@ Note the pathname indexing—it uses the [[https://www.rfc-editor.org/rfc/rfc690

A stricter version of =jget= that throws =no-key= error when there's nothing under the given key in the provided object.

Will be merged into =jget= with the next major release.

** FUNCTION njson:jcopy (alias: njson/aliases:copy)

Copies the whole thing it's passed, no mater the nesting, into a fresh new equal object. Makes all the arrays adjustable and fillable for further possibly destructive use.
Expand Down

0 comments on commit 0b93fa5

Please sign in to comment.