diff options
| author | 2022-09-19 16:54:35 -0700 | |
|---|---|---|
| committer | 2022-09-19 16:54:42 -0700 | |
| commit | c2f6c7eeb4f7925b2ab54938d443f9af91abd185 (patch) | |
| tree | f93cf86dc37890ad0cbf3d2c175748fbd659d70c | |
| parent | Fix errors reported by W3C HTML Validator. (diff) | |
Use HTML entity ⇒ for double right arrow.
| -rw-r--r-- | srfi-225.html | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/srfi-225.html b/srfi-225.html index 86acaad..47f8e10 100644 --- a/srfi-225.html +++ b/srfi-225.html @@ -105,23 +105,23 @@ is the relevant one.</p> <p><code>(dictionary?</code> <em>dto obj</em><code>)</code></p> <p>Returns <code>#t</code> if <em>obj</em> answers <code>#t</code> to the type predicate stored in <em>dto</em> and <code>#f</code> otherwise.</p> -<blockquote><pre>(dictionary? dto dict) => #t -(dictionary? dto 35) => #f</pre></blockquote> +<blockquote><pre>(dictionary? dto dict) ⇒ #t +(dictionary? dto 35) ⇒ #f</pre></blockquote> <p><code>(dict-empty?</code> <em>dto dict</em><code>)</code></p> <p>Returns <code>#t</code> if <em>dict</em> contains no associations and <code>#f</code> if it does contain associations.</p> -<blockquote><pre>(dict-empty? dto '()) => #t -(dict-empty? dto dict) => #f</pre></blockquote> +<blockquote><pre>(dict-empty? dto '()) ⇒ #t +(dict-empty? dto dict) ⇒ #f</pre></blockquote> <p><code>(dict-contains?</code> <em>dto dict key</em><code>)</code></p> <p>Returns <code>#t</code> if one of the keys of <em>dict</em> is the same as <em>key</em>, and <code>#f</code> otherwise.</p> -<blockquote><pre>(dict-contains? dto dict 1) => #t -(dict-contains? dto dict 2) => #f</pre></blockquote> +<blockquote><pre>(dict-contains? dto dict 1) ⇒ #t +(dict-contains? dto dict 2) ⇒ #f</pre></blockquote> <p><code>(dict=?</code> <em>dto = dict1 dict2</em><code>)</code></p> <p>Returns <code>#t</code> if the keys of <em>dict1</em> and <em>dict2</em> are the same, and the corresponding values are the same in the sense of the <em>=</em> argument.</p> <blockquote><pre> -(dict=? dto = dict '((5 . 6) (3 . 4) (1 . 2)))> #t -(dict=? dto = dict '((1 . 2) (3 . 5))) => #f</pre></blockquote> <p>Returns <code>#t</code> if <em>dto</em> describes pure dictionaries. +(dict=? dto = dict '((5 . 6) (3 . 4) (1 . 2))) ⇒ #t +(dict=? dto = dict '((1 . 2) (3 . 5))) ⇒ #f</pre></blockquote> <p id="dict-purep"><code>(dict-pure?</code> <em>dto dict</em><code>)</code></p> The <em>dict</em> argument is required for the sake of uniformity with other generic procedures, but it can have any value.</p> @@ -131,15 +131,15 @@ with other generic procedures, but it can have any value.</p> on the corresponding value and returns its result. If <em>key</em> is not a key of <em>dict</em>, then invokes the thunk <em>failure</em> and returns its result. The default value of <em>failure</em> signals an error; the default value of <em>success</em> is the identity procedure.</p> -<blockquote><pre>(dict-ref dto dict 1 (lambda () '()) list) => +<blockquote><pre>(dict-ref dto dict 1 (lambda () '()) list) ⇒ (2) ; Success wraps value in a list -(dict-ref dto dict 2 (lambda () '()) list) => +(dict-ref dto dict 2 (lambda () '()) list) ⇒ () ; Failure returns empty list</pre></blockquote> <p><code>(dict-ref/default</code> <em>dto dict key default</em><code>)</code></p> <p>If <em>key</em> is the same as some key of <em>dict</em>, returns the corresponding value. If not, returns <em>default</em>.</p> -<blockquote><pre>(dict-ref/default dto dict 1 #f) => 2 -(dict-ref/default dto dict 2 #f) => #f</pre></blockquote> +<blockquote><pre>(dict-ref/default dto dict 1 #f) ⇒ 2 +(dict-ref/default dto dict 2 #f) ⇒ #f</pre></blockquote> <p><code>(dict-comparator</code> <em>dto dict</em><code>)</code></p> <p>Return a comparator representing the type predicate, equality predicate, ordering predicate, and hash function of <em>dict</em>. @@ -156,35 +156,35 @@ convention is not used in this SRFI.</p> <p>Returns a dictionary that contains all the associations of <em>dict</em> plus those specified by <em>objs</em>, which alternate between keys and values. If a key to be added already exists in <em>dict</em>, the new value prevails.</p> -<blockquote><pre> (dict-set dto dict 7 8) => +<blockquote><pre> (dict-set dto dict 7 8) ⇒ ((1 . 2) (3 . 4) (5 . 6) (7 . 8))) -(dict-set dto dict 3 5) => +(dict-set dto dict 3 5) ⇒ ((3 . 5) (1 . 2) (5 . 6)))</pre></blockquote> <p><code>(dict-adjoin</code> <em>dto dict obj</em> ...<code>)</code><br> <p>Returns a dictionary that contains all the associations of <em>dict</em> plus those specified by <em>objs</em>, which alternate between keys and values. If a key to be added already exists in <em>dict</em>, the old value prevails.</p> -<blockquote><pre> (dict-adjoin dto dict 7 8) => +<blockquote><pre> (dict-adjoin dto dict 7 8) ⇒ ((7 . 8) (1 . 2) (3 . 4) (5 . 6)) -(dict-adjoin dto dict 3 5) => +(dict-adjoin dto dict 3 5) ⇒ ((1 . 2) (3 . 4) (5 . 6))</pre></blockquote> <p><code>(dict-delete</code> <em>dto dict key</em> …<code>)</code></p> <p>Returns a dictionary that contains all the associations of <em>dict</em> except those whose keys are the same as one of the <em>keys</em>. -<blockquote><pre>(dict-delete dto dict 1 3) => +<blockquote><pre>(dict-delete dto dict 1 3) ⇒ ((5 . 6)) -(dict-delete dto dict 5) => +(dict-delete dto dict 5) ⇒ ((1 . 2) (3 . 4))</pre></blockquote> <p><code>(dict-delete-all</code> <em>dto dict keylist</em><code>)</code></p> <p>The same as <code>dict-delete</code>, except that the keys to be deleted are in the list <em>keylist</em>.</p> -<blockquote><pre>(dict-delete-all dto dict '(1 3)) => ((5 . 6))</pre></blockquote> +<blockquote><pre>(dict-delete-all dto dict '(1 3)) ⇒ ((5 . 6))</pre></blockquote> <p><code>(dict-replace</code> <em>dto dict key value</em><code>)</code></p> <p>Returns a dictionary that contains all the associations of <em>dict</em> except as follows: If <em>key</em> is the same as a key of <em>dict</em>, then the association for that key is omitted and replaced by the association defined by the pair <em>key</em> and <em>value</em>. If there is no such key in <em>dict</em>, then dictionary is returned unchanged.</p> -<blockquote><pre>(dict-replace dto dict 1 3) => +<blockquote><pre>(dict-replace dto dict 1 3) ⇒ ((1 . 3) (3 . 4) (5 . 6))) </pre></blockquote> <p><code>(dict-intern</code> <em>dto dict key failure</em>)</p> <p>If there is a key in <em>dict</em> that is the same as <em>key</em>, returns two values, @@ -192,18 +192,18 @@ If there is no such key in <em>dict</em>, then dictionary is returned unchanged. Otherwise, returns two values, a dictionary that contains all the associations of <em>dict</em> and in addition a new association that maps <em>key</em> to the result of invoking <em>failure</em>, and the result of invoking <em>failure</em>.<br> -<blockquote><pre>(dict-intern dto dict 1 (lambda () #f)) => ; 2 values +<blockquote><pre>(dict-intern dto dict 1 (lambda () #f)) ⇒ ; 2 values ((1 . 2) (3 . 4) (5 . 6)) 2 -(dict-intern dto dict 2 (lambda () 0)) => ; 2 values +(dict-intern dto dict 2 (lambda () 0)) ⇒ ; 2 values ((1 . 2) (2 . 0) (3 . 4) (5 . 6)) 0</pre></blockquote> <p><code>(dict-update</code> <em>dto dict key updater</em> [<em>failure</em> [<em>success</em>] ]<code>)</code></p> <p>Retrieves the value of <em>key</em> as if by <code>dict-ref</code>, invokes <em>updater</em> on it, and sets the value of <em>key</em> to be the result of calling <em>updater</em> as if by <code>dict-set</code>, but may do so more efficiently. Returns the updated dictionary. The default value of <em>failure</em> signals an error; the default value of <em>success</em> is the identity procedure.</p> <blockquote><pre> -(dict-update dto dict 1 (lambda (x) (+ 1 x))) => +(dict-update dto dict 1 (lambda (x) (+ 1 x))) ⇒ ((1 . 3) (3 . 4) (5 . 6)) -(dict-update dto dict 2 (lambda (x) (+ 1 x))) => +(dict-update dto dict 2 (lambda (x) (+ 1 x))) ⇒ <em>error</em> </pre></blockquote> <p><code>(dict-update/default</code> <em>dto dict key updater default</em><code>)</code></p> @@ -212,10 +212,10 @@ Otherwise, returns two values, a dictionary that contains but may do so more efficiently. Returns the updated dictionary.</p> <blockquote><pre> (dict-update/default dto dict 1 - (lambda (x) (+ 1 x)) 0) => + (lambda (x) (+ 1 x)) 0) ⇒ ((1 . 3) (3 . 4) (5 . 6)) (dict-update/default dto dict 2 - (lambda (x) (+ 1 x)) 0) => + (lambda (x) (+ 1 x)) 0) ⇒ ((2 . 1) (3 . 4) (5 . 6)) </pre></blockquote> <p><code>(dict-pop</code> <em>dto dict</em><code>)</code></p> @@ -225,7 +225,7 @@ Otherwise, returns two values, a dictionary that contains If the dictionary is inherently ordered, the first association is chosen; otherwise, the chosen association is arbitrary.</p> <p>If <em>dict</em> contains no associations, it is an error.</p> -<blockquote><pre>(dict-pop dto dict) => ; 3 values +<blockquote><pre>(dict-pop dto dict) ⇒ ; 3 values ((3 . 4) (5 . 6)) 1 2</pre></blockquote> @@ -256,25 +256,25 @@ key <em>key</em>. <p><code>(dict-map</code> <em>dto proc dict</em><code>)</code></p> <p>Returns a dictionary similar to <em>dict</em> that maps each of <em>dict</em> to the result of applying <em>proc</em> to the key and corresponding value of <em>dict</em>.</p> -<blockquote><pre>(dict-map dto (lambda (k v) (- v)) dict) => +<blockquote><pre>(dict-map dto (lambda (k v) (- v)) dict) ⇒ (((1 . -2) (3 . -4) (5 . -6))</pre></blockquote> <p><code>(dict-filter</code> <em>dto pred dict</em><code>)</code></p> <p><code>(dict-remove</code> <em>dto pred dict</em><code>)</code></p> <p>Returns a dictionary similar to <em>dict</em> that contains just the associations of <em>dict</em> that satisfy / do not satisfy <em>pred</em> when it is invoked on the key and value of the association.</p> -<blockquote><pre>(dict-filter dto (lambda (k v) (= k 1)) dict) => +<blockquote><pre>(dict-filter dto (lambda (k v) (= k 1)) dict) ⇒ ((1 . 2)) -(dict-remove dto (lambda (k v) (= k 1)) dict) => +(dict-remove dto (lambda (k v) (= k 1)) dict) ⇒ ((3 . 4) (5 . 6))</pre></blockquote> <h3 id="the-whole-dictionary">The whole dictionary</h3> <p><code>(dict-size</code> <em>dto dict</em><code>)</code></p> <p>Returns an exact integer representing the number of associations in <em>dict</em>.</p> -<blockquote><pre>(dict-size dto dict) => 3</pre></blockquote> +<blockquote><pre>(dict-size dto dict) ⇒ 3</pre></blockquote> <p><code>(dict-count</code> <em>dto pred dict</em><code>)</code></p> <p>Passes each association of dictionary as two arguments to <em>pred</em> and returns the number of times that <em>pred</em> returned true as an an exact integer.</p> -<blockquote><pre>(dict-count dto (lambda (k v) (even? k)) dict) => 0</pre></blockquote> +<blockquote><pre>(dict-count dto (lambda (k v) (even? k)) dict) ⇒ 0</pre></blockquote> <p><code>(dict-any</code> <em>dto pred dict</em><code>)</code></p> <p>Passes each association of <em>dict</em> as two arguments to <em>pred</em> and returns the value of the first call to <em>pred</em> that returns true, @@ -282,8 +282,8 @@ key <em>key</em>. associations are processed in that order; otherwise, in an arbitrary order. If all calls return false, <code>dict-any</code> returns false.</p> <blockquote><pre>(define (both-even? k v) (and (even? k) (even? v))) -(dict-any dto both-even? '((2 . 4) (3 . 5))) => #t -(dict-any dto both-even? '((1 . 2) (3 . 4))) => #f</pre></blockquote> +(dict-any dto both-even? '((2 . 4) (3 . 5))) ⇒ #t +(dict-any dto both-even? '((1 . 2) (3 . 4))) ⇒ #f</pre></blockquote> <p><code>(dict-every</code> <em>dto pred dict</em><code>)</code></p> <p>Passes each association of <em>dict</em> as two arguments to <em>pred</em> and returns <code>#f</code> after the first call to <em>pred</em> that returns false, @@ -292,20 +292,20 @@ key <em>key</em>. If all calls return true, <code>dict-any</code> returns the value of the last call, or <code>#t</code> if no calls are made.</p> <blockquote><pre>(define (some-even? k v) (or (even? k) (even? v))) -(dict-every dto some-even? '((2 . 3) (3 . 4))) => #t -(dict-every dto some-even? '((1 . 3) (3 . 4))) => #f</pre></blockquote> +(dict-every dto some-even? '((2 . 3) (3 . 4))) ⇒ #t +(dict-every dto some-even? '((1 . 3) (3 . 4))) ⇒ #f</pre></blockquote> <p><code>(dict-keys</code> <em>dto dict</em><code>)</code></p> <p>Returns a list of the keys of <em>dict</em>. If the dictionary type is inherently ordered, associations appear in that order; otherwise, in an arbitrary order. The order may change when new elements are added to <em>dict</em>.</p> -<blockquote><pre>(dict-keys dto dict) => (1 3 5)</pre></blockquote> +<blockquote><pre>(dict-keys dto dict) ⇒ (1 3 5)</pre></blockquote> <p><code>(dict-values</code> <em>dto dict</em><code>)</code></p> <p>Returns a list of the values of <em>dict</em>. The results returned by <code>dict-keys</code> and <code>dict-values</code> are not necessarily ordered consistently.</p> -<blockquote><pre>(dict-values dto dict) => (2 4 6)</pre></blockquote> +<blockquote><pre>(dict-values dto dict) ⇒ (2 4 6)</pre></blockquote> <p><code>(dict-entries</code> <em>dto dict</em><code>)</code></p> <p>Returns two list values, the keys and the corresponding values.</p> -<blockquote><pre>(dict-entries dto dict) => ; 2 values +<blockquote><pre>(dict-entries dto dict) ⇒ ; 2 values (1 3 5) (2 4 6)</pre></blockquote> <p><code>(dict-fold</code> <em>dto proc knil dict</em><code>)</code></p> @@ -314,20 +314,20 @@ key <em>key</em>. For the first invocation, <em>knil</em> is used as the third argument. Returns the result of the last invocation, or <em>knil</em> if there was no invocation. Note that there is no guarantee of a consistent result if the dictionary does not have an inherent order.</p> -<blockquote><pre>(dict-fold dto + 0 '((1 . 2) (3 . 4))) => 10</pre></blockquote> +<blockquote><pre>(dict-fold dto + 0 '((1 . 2) (3 . 4))) ⇒ 10</pre></blockquote> <p><code>(dict-map->list</code> <em>dto proc dict</em><code>)</code></p> <p>Returns a list of values that result from invoking <em>proc</em> on the keys and corresponding values of <em>dict</em>.</p> <blockquote><pre> -(dict-map->list dto + (lambda (k v) v) dict) => +(dict-map->list dto + (lambda (k v) v) dict) ⇒ (2 4 6), -(dict-map->list dto - dict) => +(dict-map->list dto - dict) ⇒ (-1 -1 -1) ; subtract value from key </pre></blockquote> <p><code>(dict->alist</code> <em>dto dict</em><code>)</code></p> <p>Returns an alist whose keys and values are the keys and values of <em>dict</em>.</p> <blockquote><pre> -(dict->alist dto dict) => +(dict->alist dto dict) ⇒ ((1 . 2) (3 . 4) (5 . 6)) </pre></blockquote> <h3 id="iteration">Iteration</h3> @@ -341,7 +341,7 @@ key <em>key</em>. They can can provide additional efficiency when iterating over part of the dictionary if the dictionary is ordered. The procedure returns an unspecified value.</p> <blockquote><pre>(define (write-key key value) (write key)) -(dict-for-each dto write-key dict) => unspecified +(dict-for-each dto write-key dict) ⇒ unspecified ; writes "135" to current output</pre></blockquote> <b>FIXME</b> <p><code>(dict->generator</code> <em>dto dict</em> [ <em>start</em> [ <em>end</em> ] ] <code>)</code></p> <p>Returns a <a href="https://srfi.schemers.org/srfi-158/srfi-158.html">SRFI 158 generator</a> |
