Changeset 39212 in project


Ignore:
Timestamp:
11/10/20 20:02:50 (2 weeks ago)
Author:
Zipheir
Message:

Fix arrow characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/srfi-196

    r39211 r39212  
    7272<enscript highlight="scheme">
    7373(range->list (range 26 (lambda (n) (integer->char (+ 65 n)))))
    74   ⇑ (#\A #\B #\C #\D #\E 
 #\Z)
     74  ⇒ (#\A #\B #\C #\D #\E 
 #\Z)
    7575
    7676(range->list (range 10 (lambda (n) (expt 1/2 n))))
    77   ⇑ (1 1/2 1/4 
 1/512)
     77  ⇒ (1 1/2 1/4 
 1/512)
    7878</enscript>
    7979
     
    9292<enscript highlight="scheme">
    9393(range->list (numeric-range 0 1 1/10))
    94   ⇑ (0 1/10 1/5 3/10 2/5 1/2 3/5 7/10 4/5 9/10)
    95 
    96 (range->list (numeric-range 5 -5 -3)) ⇑ (5 2 -1 -4)
     94  ⇒ (0 1/10 1/5 3/10 2/5 1/2 3/5 7/10 4/5 9/10)
     95
     96(range->list (numeric-range 5 -5 -3)) ⇒ (5 2 -1 -4)
    9797</enscript>
    9898
     
    113113<enscript highlight="scheme">
    114114(range->list (vector-range #(1 3 5 7 9)))
    115   ⇑ (1 3 5 7 9)
     115  ⇒ (1 3 5 7 9)
    116116</enscript>
    117117
     
    124124<enscript highlight="scheme">
    125125(range->list (string-range "abcde"))
    126   ⇑ (#\a #\b #\c #\d #\e)
     126  ⇒ (#\a #\b #\c #\d #\e)
    127127</enscript>
    128128
     
    134134(range->list (range-append (numeric-range 0 3)
    135135                           (numeric-range 3 6)))
    136   ⇑ (0 1 2 3 4 5)
     136  ⇒ (0 1 2 3 4 5)
    137137</enscript>
    138138==== Predicates
     
    147147====== Examples
    148148<enscript highlight="scheme">
    149 (range=? = (numeric-range 10 30) (numeric-range 10 30)) ⇑ #t
    150 (range=? = (numeric-range 5 10) (numeric-range 6 11)) ⇑ #f
    151 (range=? eqv? (numeric-range 0 0) (range 0 (lambda (i) i))) ⇑ #t
     149(range=? = (numeric-range 10 30) (numeric-range 10 30)) ⇒ #t
     150(range=? = (numeric-range 5 10) (numeric-range 6 11)) ⇒ #f
     151(range=? eqv? (numeric-range 0 0) (range 0 (lambda (i) i))) ⇒ #t
    152152</enscript>
    153153==== Accessors
     
    158158====== Example
    159159<enscript highlight="scheme">
    160 (range-length (numeric-range 10 30)) ⇑ 20
     160(range-length (numeric-range 10 30)) ⇒ 20
    161161</enscript>
    162162
     
    166166====== Examples
    167167<enscript highlight="scheme">
    168 (range-ref (numeric-range 10 30) 5) ⇑ 15
    169 (range-ref (range 2 (lambda (i) (not (zero? i)))) 1) ⇑ #t
     168(range-ref (numeric-range 10 30) 5) ⇒ 15
     169(range-ref (range 2 (lambda (i) (not (zero? i)))) 1) ⇒ #t
    170170</enscript>
    171171
     
    175175====== Example
    176176<enscript highlight="scheme">
    177 (range-first (numeric-range 10 30)) ⇑ 10
     177(range-first (numeric-range 10 30)) ⇒ 10
    178178</enscript>
    179179
     
    183183====== Example
    184184<enscript highlight="scheme">
    185 (range-last (numeric-range 10 30)) ⇑ 29
     185(range-last (numeric-range 10 30)) ⇒ 29
    186186</enscript>
    187187==== Iteration
     
    194194(let-values (((ra rb) (range-split-at (numeric-range 10 20) 5)))
    195195  (values (range->list ra) (range->list rb)))
    196     ⇑ (10 11 12 13 14)
     196    ⇒ (10 11 12 13 14)
    197197      (15 16 17 18 19)
    198198</enscript>
     
    204204<enscript highlight="scheme">
    205205(range->list (subrange (numeric-range 5 15) 5 8))
    206   ⇑ (10 11 12)
     206  ⇒ (10 11 12)
    207207
    208208(range->list (subrange (string-range "abcdefghij") 2 8))
    209   ⇑ (#\c #\d #\e #\f #\g #\h)
     209  ⇒ (#\c #\d #\e #\f #\g #\h)
    210210</enscript>
    211211
     
    216216<enscript highlight="scheme">
    217217(map range->list (range-segment (numeric-range 0 12) 4))
    218   ⇑ ((0 1 2 3) (4 5 6 7) (8 9 10 11))
     218  ⇒ ((0 1 2 3) (4 5 6 7) (8 9 10 11))
    219219
    220220(map range->list (range-segment (numeric-range 0 2 1/3) 4))
    221   ⇑ ((0 1/3 2/3 1) (4/3 5/3))
     221  ⇒ ((0 1/3 2/3 1) (4/3 5/3))
    222222</enscript>
    223223===== range-take and range-take-right
     
    232232<enscript highlight="scheme">
    233233(range->list (range-take (numeric-range 0 10) 5))
    234   ⇑ (0 1 2 3 4)
     234  ⇒ (0 1 2 3 4)
    235235
    236236(range->list (range-take-right (numeric-range 0 10) 5))
    237   ⇑ (5 6 7 8 9)
     237  ⇒ (5 6 7 8 9)
    238238</enscript>
    239239===== range-drop and range-drop-right
     
    248248<enscript highlight="scheme">
    249249(range->list (range-drop (numeric-range 0 10) 5))
    250   ⇑ (5 6 7 8 9)
     250  ⇒ (5 6 7 8 9)
    251251
    252252(range->list (range-drop-right (numeric-range 0 10) 5))
    253   ⇑ (0 1 2 3 4)
     253  ⇒ (0 1 2 3 4)
    254254</enscript>
    255255
     
    259259====== Examples
    260260<enscript highlight="scheme">
    261 (range-count even? (numeric-range 0 10)) ⇑ 5
    262 (range-count < (numeric-range 0 10 2) (numeric-range 5 15)) ⇑ 5
     261(range-count even? (numeric-range 0 10)) ⇒ 5
     262(range-count < (numeric-range 0 10 2) (numeric-range 5 15)) ⇒ 5
    263263</enscript>
    264264
     
    268268====== Examples
    269269<enscript highlight="scheme">
    270 (range-any odd? (numeric-range 0 10)) ⇑ #t
    271 (range-any odd? (numeric-range 0 10 2)) ⇑ #f
    272 (range-any < (numeric-range 0 10 2) (numeric-range 5 15)) ⇑ #t
     270(range-any odd? (numeric-range 0 10)) ⇒ #t
     271(range-any odd? (numeric-range 0 10 2)) ⇒ #f
     272(range-any < (numeric-range 0 10 2) (numeric-range 5 15)) ⇒ #t
    273273</enscript>
    274274
     
    278278====== Examples
    279279<enscript highlight="scheme">
    280 (range-every integer? (numeric-range 0 10)) ⇑ #t
    281 (range-every odd? (numeric-range 0 10)) ⇑ #f
    282 (range-every < (numeric-range 0 10 2) (numeric-range 5 15)) ⇑ #f
     280(range-every integer? (numeric-range 0 10)) ⇒ #t
     281(range-every odd? (numeric-range 0 10)) ⇒ #f
     282(range-every < (numeric-range 0 10 2) (numeric-range 5 15)) ⇒ #f
    283283</enscript>
    284284===== range-map, range-map->list, and range-map->vector
     
    294294====== Examples
    295295<enscript highlight="scheme">
    296 (range->list (range-map square (numeric-range 5 10))) ⇑ (25 36 49 64 81)
     296(range->list (range-map square (numeric-range 5 10))) ⇒ (25 36 49 64 81)
    297297
    298298(range->list (range-map + (numeric-range 0 5) (numeric-range 5 10)))
    299   ⇑ (5 7 9 11 13)
    300 
    301 (range-map->list square (numeric-range 5 10)) ⇑ (25 36 49 64 81)
    302 
    303 (range-map->vector square (numeric-range 5 10)) ⇑ #(25 36 49 64 81)
     299  ⇒ (5 7 9 11 13)
     300
     301(range-map->list square (numeric-range 5 10)) ⇒ (25 36 49 64 81)
     302
     303(range-map->vector square (numeric-range 5 10)) ⇒ #(25 36 49 64 81)
    304304</enscript>
    305305
     
    312312  (range-for-each (lambda (i) (vector-set! vec i (* i i)))
    313313                  (numeric-range 0 5))
    314   vec) ⇑ #(0 1 4 9 16)
     314  vec) ⇒ #(0 1 4 9 16)
    315315</enscript>
    316316===== range-filter-map and range-filter-map->list
     
    326326(range->list (range-filter-map (lambda (x) (and (even? x) (* x x)))
    327327                               (numeric-range 0 10)))
    328   ⇑ (0 4 16 36 64)
     328  ⇒ (0 4 16 36 64)
    329329
    330330(range-filter-map->list (lambda (x y)
     
    332332                        (numeric-range 0 10 2)
    333333                        (numeric-range 5 15))
    334   ⇑ (0 12 28 48 72)
     334  ⇒ (0 12 28 48 72)
    335335</enscript>
    336336===== range-filter, range-filter->list, range-remove, and range->remove->list
     
    351351<enscript highlight="scheme">
    352352(range->list (range-filter even? (numeric-range 0 10)))
    353   ⇑ (0 2 4 6 8)
     353  ⇒ (0 2 4 6 8)
    354354
    355355(range-filter->list odd? (numeric-range 0 10))
    356   ⇑ (1 3 5 7 9)
     356  ⇒ (1 3 5 7 9)
    357357
    358358(range->list (range-remove even? (numeric-range 0 10)))
    359   ⇑ (1 3 5 7 9)
     359  ⇒ (1 3 5 7 9)
    360360
    361361(range-remove->list odd? (numeric-range 0 10))
    362   ⇑ (0 2 4 6 8)
     362  ⇒ (0 2 4 6 8)
    363363</enscript>
    364364===== range-fold and range-fold-right
     
    373373<enscript highlight="scheme">
    374374(range-fold (lambda (n _) (+ 1 n)) 0 (numeric-range 0 30))
    375   ⇑ 30
     375  ⇒ 30
    376376
    377377(range-fold + 0 (numeric-range 0 100) (numeric-range 50 70))
    378   ⇑ 1380
     378  ⇒ 1380
    379379
    380380(range-fold-right xcons '() (numeric-range 0 10))
    381   ⇑ (0 1 2 3 4 5 6 7 8 9)
     381  ⇒ (0 1 2 3 4 5 6 7 8 9)
    382382
    383383(range-fold-right (lambda (lis x y) (cons (+ x y) lis))
     
    385385                  (numeric-range 3 6)
    386386                  (numeric-range 5 12))
    387   ⇑ (8 10 12)
     387  ⇒ (8 10 12)
    388388</enscript>
    389389==== Searching
     
    398398====== Examples
    399399<enscript highlight="scheme">
    400 (range-index (lambda (x) (> x 10)) (numeric-range 5 15)) ⇑ 6
    401 
    402 (range-index odd? (numeric-range 0 10 2)) ⇑ #f
    403 
    404 (range-index = (numeric-range 0 12 2) (numeric-range 5 15)) ⇑ 5
    405 
    406 (range-index-right odd? (numeric-range 0 5)) ⇑ 3
     400(range-index (lambda (x) (> x 10)) (numeric-range 5 15)) ⇒ 6
     401
     402(range-index odd? (numeric-range 0 10 2)) ⇒ #f
     403
     404(range-index = (numeric-range 0 12 2) (numeric-range 5 15)) ⇒ 5
     405
     406(range-index-right odd? (numeric-range 0 5)) ⇒ 3
    407407</enscript>
    408408===== range-take-while and range-take-while-right
     
    418418(range->list (range-take-while (lambda (x) (< x 10))
    419419                               (numeric-range 5 15)))
    420   ⇑ (5 6 7 8 9)
     420  ⇒ (5 6 7 8 9)
    421421
    422422(range->list (range-take-while-right (lambda (x) (> x 10))
    423423                                     (numeric-range 5 15)))
    424   ⇑ (11 12 13 14)
     424  ⇒ (11 12 13 14)
    425425</enscript>
    426426===== range-drop-while and range-drop-while-right
     
    436436(range->list (range-drop-while (lambda (x) (< x 10))
    437437                               (numeric-range 5 15)))
    438   ⇑ (10 11 12 13 14)
     438  ⇒ (10 11 12 13 14)
    439439
    440440(range->list (range-drop-while-right (lambda (x) (> x 10))
    441441                                     (numeric-range 5 15)))
    442   ⇑ (5 6 7 8 9 10)
     442  ⇒ (5 6 7 8 9 10)
    443443</enscript>
    444444==== Conversion
     
    455455====== Examples
    456456<enscript highlight="scheme">
    457 (range->list (numeric-range 0 0)) ⇑ ()
    458 
    459 (range->vector (range 2 (lambda (i) (not (zero? i))))) ⇑ #(#f #t)
     457(range->list (numeric-range 0 0)) ⇒ ()
     458
     459(range->vector (range 2 (lambda (i) (not (zero? i))))) ⇒ #(#f #t)
    460460
    461461(range->string (range 5 (lambda (i) (integer->char (+ 65 i)))))
    462   ⇑ "ABCDE"
     462  ⇒ "ABCDE"
    463463</enscript>
    464464
     
    468468====== Example
    469469<enscript highlight="scheme">
    470 (range->list (vector->range #(1 3 5 7 9))) ⇑ (1 3 5 7 9)
     470(range->list (vector->range #(1 3 5 7 9))) ⇒ (1 3 5 7 9)
    471471</enscript>
    472472
     
    477477<enscript highlight="scheme">
    478478(generator->list (range->generator (numeric-range 0 10)))
    479   ⇑ (0 1 2 3 4 5 6 7 8 9)
     479  ⇒ (0 1 2 3 4 5 6 7 8 9)
    480480</enscript>
    481481=== Implementation
Note: See TracChangeset for help on using the changeset viewer.