aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/text.texi20
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 5b288d9750e..9592702ef1c 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4965,14 +4965,13 @@ represented using Lisp vectors.
4965 4965
4966@item 4966@item
4967JSON has only one map type, the object. JSON objects are represented 4967JSON has only one map type, the object. JSON objects are represented
4968using Lisp hashtables. 4968using Lisp hashtables or alists.
4969 4969
4970@end itemize 4970@end itemize
4971 4971
4972@noindent 4972@noindent
4973Note that @code{nil} doesn't represent any JSON values: this is to 4973Note that @code{nil} represents the empty JSON object, @code{@{@}},
4974avoid confusion, because @code{nil} could either represent 4974not @code{null}, @code{false}, or an empty array, all of which are
4975@code{null}, @code{false}, or an empty array, all of which are
4976different JSON values. 4975different JSON values.
4977 4976
4978 If some Lisp object can't be represented in JSON, the serialization 4977 If some Lisp object can't be represented in JSON, the serialization
@@ -4995,8 +4994,13 @@ The parsing functions will signal the following errors:
4995 4994
4996 Only top-level values (arrays and objects) can be serialized to 4995 Only top-level values (arrays and objects) can be serialized to
4997JSON. The subobjects within these top-level values can be of any 4996JSON. The subobjects within these top-level values can be of any
4998type. Likewise, the parsing functions will only return vectors and 4997type. Likewise, the parsing functions will only return vectors,
4999hashtables. 4998hashtables, and alists.
4999
5000 The parsing functions accept keyword arguments. Currently only one
5001keyword argument, @code{:object-type}, is recognized; its value can be
5002either @code{hash-table} to parse JSON objects as hashtables with
5003string keys (the default) or @code{alist} to parse them as alists.
5000 5004
5001@defun json-serialize object 5005@defun json-serialize object
5002This function returns a new Lisp string which contains the JSON 5006This function returns a new Lisp string which contains the JSON
@@ -5008,12 +5012,12 @@ This function inserts the JSON representation of @var{object} into the
5008current buffer before point. 5012current buffer before point.
5009@end defun 5013@end defun
5010 5014
5011@defun json-parse-string string 5015@defun json-parse-string string &key (object-type @code{hash-table})
5012This function parses the JSON value in @var{string}, which must be a 5016This function parses the JSON value in @var{string}, which must be a
5013Lisp string. 5017Lisp string.
5014@end defun 5018@end defun
5015 5019
5016@defun json-parse-buffer 5020@defun json-parse-buffer &key (object-type @code{hash-table})
5017This function reads the next JSON value from the current buffer, 5021This function reads the next JSON value from the current buffer,
5018starting at point. It moves point to the position immediately after 5022starting at point. It moves point to the position immediately after
5019the value if a value could be read and converted to Lisp; otherwise it 5023the value if a value could be read and converted to Lisp; otherwise it