Skip to content

Commit 7eb1eb3

Browse files
Use two spaces after periods per convention.
1 parent f838f04 commit 7eb1eb3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

srfi-180.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ <h2 id="rationale">Rationale</h2>
5959
<p>The mapping between JSON types and Scheme objects is not trivial because a given mapping might not be the best for every situations. That is one of the reason why this library expose a stream reader, in order to allow users to specify the scheme representation and have efficient code.</p>
6060
<h2 id="specification">Specification</h2>
6161
<h3 id="json-error-obj-boolean"><code>(json-error? obj) → boolean</code></h3>
62-
<p>Returns <code>#t</code> is <code>OBJ</code> is an error object. This exception can be raised during <code>json-stream-read</code>, <code>json-read</code> or <code>json-write</code>.</p>
62+
<p>Returns <code>#t</code> is <code>OBJ</code> is an error object. This exception can be raised during <code>json-stream-read</code>, <code>json-read</code> or <code>json-write</code>.</p>
6363
<h3 id="json-error-reason-obj-string"><code>(json-error-reason obj) → string</code></h3>
64-
<p>Return a string explaining the reason of the error. This should be human readable.</p>
64+
<p>Return a string explaining the reason for the error. This should be human-readable.</p>
6565
<h3 id="json-null-obj-boolean"><code>(json-null? obj) → boolean</code></h3>
66-
<p>Return <code>#t</code> if <code>OBJ</code> is the scheme symbol <code>'null</code> representing in Scheme the JSON <code>null</code>. In any other cases, return <code>#f</code>.</p>
66+
<p>Return <code>#t</code> if <code>OBJ</code> is the scheme symbol <code>'null</code> representing in Scheme the JSON <code>null</code>. In any other cases, return <code>#f</code>.</p>
6767
<h3 id="json-stream-read-proc-port-unspecified"><code>(json-stream-read proc [port]) → unspecified</code></h3>
68-
<p>Streaming event-based JSON reader. <code>PORT</code> must be a textual input port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-input-port</code>. The returned value is unspecified.</p>
68+
<p>Streaming event-based JSON reader. <code>PORT</code> must be a textual input port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-input-port</code>. The returned value is unspecified.</p>
6969
<p><code>json-stream-read</code> should raise an object that satisfy the predicate <code>json-error?</code> in cases where the JSON is invalid.</p>
70-
<p><code>json-stream-read</code> will call <code>PROC</code> with two arguments. The first argument is the event <code>type</code>, the second argument is the event <code>obj</code>. Since the value that can be taken by <code>obj</code> depends on the value of <code>type</code>, they are presented together in the following paragraph.</p>
71-
<p>The first arguments is noted <code>type</code>. It is a symbol. It can be the following:</p>
70+
<p><code>json-stream-read</code> will call <code>PROC</code> with two arguments. The first argument is the event <code>type</code>, the second argument is the event <code>obj</code>. Since the value that can be taken by <code>obj</code> depends on the value of <code>type</code>, they are presented together in the following paragraph.</p>
71+
<p>The first arguments is noted <code>type</code>. It is a symbol. It can be the following:</p>
7272
<ul>
7373
<li><code>'json-structure</code></li>
7474
<li><code>'json-value</code></li>
@@ -79,7 +79,7 @@ <h3 id="json-stream-read-proc-port-unspecified"><code>(json-stream-read proc [po
7979
<ul>
8080
<li><p><code>'array-open</code> symbol denoting that an array should be constructed.</p></li>
8181
<li><p><code>'array-close</code> symbol denoting that the construction of the array for which the last <code>'array-open</code> was emitted and not closed, is finished.</p></li>
82-
<li><p><code>'object-open'</code> symbol denoting that an object should be constructed. The object's key-value pairs are emitted in sequence like property list (plist). The keys will be produced by <code>(proc 'json-structure some-symbol)</code>, that is, the key is always a symbol. The production of the key is always followed by the production of a value. Otherwise, the JSON would be invalid and <code>json-stream-read</code> would raise error. The production of the value can be a <code>'json-value</code> but can also be <code>'json-structure</code> with <code>obj</code> strictly equivalent <code>'array-open</code> or <code>'object-open</code>. This events will be followed by other events. Eventually, an associated <code>'object-close</code> event is emitted.</p></li>
82+
<li><p><code>'object-open'</code> symbol denoting that an object should be constructed. The object's key-value pairs are emitted in sequence like property list (plist). The keys will be produced by <code>(proc 'json-structure some-symbol)</code>, that is, the key is always a symbol. The production of the key is always followed by the production of a value. Otherwise, the JSON would be invalid and <code>json-stream-read</code> would raise error. The production of the value can be a <code>'json-value</code> but can also be <code>'json-structure</code> with <code>obj</code> strictly equivalent <code>'array-open</code> or <code>'object-open</code>. This events will be followed by other events. Eventually, an associated <code>'object-close</code> event is emitted.</p></li>
8383
<li><p><code>'object-close</code> symbol denoting that the construction of the object for which the last <code>object-open</code> was emitted and not closed, is finished.</p></li>
8484
</ul></li>
8585
<li><p>If type is <code>'json-value</code>, then <code>obj</code> is scheme object that can be of the following types:</p>
@@ -89,8 +89,8 @@ <h3 id="json-stream-read-proc-port-unspecified"><code>(json-stream-read proc [po
8989
<li><p>string</p></li>
9090
</ul></li>
9191
</ul>
92-
<p><strong>Note:</strong> This document does not prescribes a validating parser. But in cases where the input JSON is valid, <code>json-parse</code> must emit the correct sequence of events.</p>
93-
<p><strong>Note:</strong> Given <code>type</code> is <code>'json-value</code>, then there is two occasions where <code>obj</code> can be a symbol: 1) the JSON contains a <code>null</code> value, in that case <code>'null</code> symbol is produced; 2) In a JSON object, keys are produced with the type <code>'json-value</code> and the <code>obj</code> as a symbol. In particular the key <code>&quot;null&quot;</code> will be represented with <code>'null</code> symbol and JSON <code>null</code> too: that does not have bad consequences for the user.</p>
92+
<p><strong>Note:</strong> This document does not prescribes a validating parser. But in cases where the input JSON is valid, <code>json-parse</code> must emit the correct sequence of events.</p>
93+
<p><strong>Note:</strong> Given <code>type</code> is <code>'json-value</code>, then there is two occasions where <code>obj</code> can be a symbol: 1) the JSON contains a <code>null</code> value, in that case <code>'null</code> symbol is produced; 2) In a JSON object, keys are produced with the type <code>'json-value</code> and the <code>obj</code> as a symbol. In particular the key <code>&quot;null&quot;</code> will be represented with <code>'null</code> symbol and JSON <code>null</code> too: that does not have bad consequences for the user.</p>
9494
<h4 id="example-one">Example One</h4>
9595
<p>Take for instance the following JSON text:</p>
9696
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript">[<span class="kw">true</span><span class="op">,</span> <span class="kw">false</span><span class="op">,</span> <span class="dv">42</span><span class="op">,</span> <span class="kw">null</span>]</code></pre></div>
@@ -116,7 +116,7 @@ <h4 id="example-two">Example Two</h4>
116116
(proc &#39;json-structure &#39;object-close)
117117
(proc &#39;json-structure &#39;array-close)</code></pre></div>
118118
<h3 id="json-read-port-object"><code>(json-read [port]) → object</code></h3>
119-
<p>JSON reader procedure. <code>PORT</code> must be a textual input port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-input-port</code>. The returned value is a scheme object.</p>
119+
<p>JSON reader procedure. <code>PORT</code> must be a textual input port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-input-port</code>. The returned value is a scheme object.</p>
120120
<p>The mapping between JSON types and Scheme objects is the following:</p>
121121
<ul>
122122
<li><code>null</code> → the symbol <code>'null</code></li>
@@ -128,8 +128,8 @@ <h3 id="json-read-port-object"><code>(json-read [port]) → object</code></h3>
128128
<li>object → association list with keys that are symbols</li>
129129
</ul>
130130
<h3 id="json-write-obj-port-unspecified"><code>(json-write obj [port]) → unspecified</code></h3>
131-
<p>JSON writer procedure. <code>PORT</code> must be a textual output port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-output-port</code>. The returned value is unspecified.</p>
132-
<p><code>json-write</code> will validate that <code>OBJ</code> can be serialized into JSON before writing to <code>PORT</code>. In the case where <code>OBJ</code> is not an object or composition of the following types, an error that satisfy <code>json-error?</code> is raised:</p>
131+
<p>JSON writer procedure. <code>PORT</code> must be a textual output port. The default value of <code>PORT</code> is the value returned by the procedure <code>current-output-port</code>. The returned value is unspecified.</p>
132+
<p><code>json-write</code> will validate that <code>OBJ</code> can be serialized into JSON before writing to <code>PORT</code>. In the case where <code>OBJ</code> is not an object or composition of the following types, an error that satisfy <code>json-error?</code> is raised:</p>
133133
<ul>
134134
<li>symbol <code>'null</code></li>
135135
<li>boolean</li>
@@ -147,7 +147,7 @@ <h2 id="copyright">Copyright</h2>
147147
<p>Test files under <code>json/files</code> copyright &copy; 2016 Nicolas Seriot.</p>
148148
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
149149
<p>The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.</p>
150-
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
150+
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
151151
<hr>
152152
<address>Editor: <a href="mailto:srfi-editors+at+srfi+dot+schemers+dot+org">Arthur A. Gleckler</a></address>
153153
</body>

0 commit comments

Comments
 (0)