Changeset 12880 in project


Ignore:
Timestamp:
12/26/08 15:12:29 (12 years ago)
Author:
sjamaan
Message:

Temporary hack to fix example sections in wiki eggdoc pages

Location:
wiki
Files:
58 edited

Legend:

Unmodified
Added
Removed
  • wiki/9p

    r12515 r12880  
    5175179p protocol directly.
    518518
    519 <example>
     519<examples><example>
    520520<expr>
    521521(use 9p-client posix unix-sockets)
     
    531531    (9p:client-disconnect con)))
    532532</expr>
    533 </example>
     533</example></examples>
    534534
    535535This prints something like
  • wiki/autoload

    r8778 r12880  
    4646=== Examples
    4747
    48 <example>
     48<examples><example>
    4949<init>(use autoload)</init>
    5050;; load iconv procedures lazily
    5151(autoload iconv iconv iconv-open)
    52 </example>
     52</example></examples>
    5353
    54 <example>
     54<examples><example>
    5555<init>(use autoload)</init>
    5656;; load some sqlite procedures lazily with "-" names
    5757(autoload sqlite (sqlite:open sqlite-open)
    5858                 (sqlite:execute sqlite-execute))
    59 </example>
     59</example></examples>
    6060
    61 <example>
     61<examples><example>
    6262<init>(use autoload)</init>
    6363;; load md5 library, falling back on slower scheme version
    6464(autoload scheme-md5 (md5:digest scheme-md5:digest))
    6565(autoload md5 (md5:digest #f scheme-md5:digest))
    66 </example>
     66</example></examples>
    6767
    6868=== License
  • wiki/awk

    r8885 r12880  
    3232Count non-comment lines in Scheme file:
    3333
    34 <example>
     34<examples><example>
    3535<init>(use awk)</init>
    3636<expr>(print
     
    3838   ("^[ \t]*;" nlines)
    3939   (else (add1 nlines)))</expr>
    40 </example>
     40</example></examples>
    4141
    4242Strip blank lines:
    4343
    44 <example>
     44<examples><example>
    4545<init>(use awk)</init>
    4646<expr>(awk (read-line) (line) ()
    4747  ("[^ \t]" (print line)) )</expr>
    48 </example>
     48</example></examples>
    4949
    5050Compute maximal line length:
    5151
    52 <example>
     52<examples><example>
    5353<init>(use awk)</init>
    5454<expr>(print
    5555  (awk (read-line) (line) ([max-len 0])
    5656    (#t (max max-len (string-length line))))</expr>
    57 </example>
     57</example></examples>
    5858
    5959Sort /etc/passwd file:
    6060
    61 <example>
     61<examples><example>
    6262<init>(use awk)</init>
    6363<expr>(define (read-passwd . port)
     
    7373    (#t (cons (cons (car fields) line) ans)) )
    7474  (lambda (x y) (string<? (car x) (car y))))))</expr>
    75 </example>
     75</example></examples>
    7676
    7777=== Changelog
  • wiki/bb

    r10844 r12880  
    11301130=== Examples
    11311131
    1132 <example>
     1132<examples><example>
    11331133<init>(use bb)
    11341134
     
    11561156
    11571157(bb:run)
    1158 </example>
     1158</example></examples>
    11591159
    11601160A very simple shell:
    11611161
    1162 <example>
     1162<examples><example>
    11631163<init>(require-extension extras posix srfi-17 bb)
    11641164
     
    12031203(bb:show w)
    12041204(bb:run)
    1205 </example>
     1205</example></examples>
    12061206
    12071207A simple "notes" application:
    12081208
    1209 <example>
     1209<examples><example>
    12101210<init>(use utils srfi-17 bb)
    12111211
     
    13431343
    13441344(bb:run)
    1345 </example>
     1345</example></examples>
    13461346
    13471347Event handlers usage:
    13481348
    1349 <example>
     1349<examples><example>
    13501350<init>(use srfi-17 bb)
    13511351
     
    13751375(bb:show w)
    13761376(bb:run)
    1377 </example>
     1377</example></examples>
    13781378
    13791379=== Changelog
  • wiki/binary-parse

    r8864 r12880  
    6565==== Usage example
    6666
    67 <example>
     67<examples><example>
    6868<init>(use binary-parse)</init>
    6969(define bit-reader (make-bit-reader (lambda () #b11000101)))
     
    7373<expr>(bit-reader 4)</expr>
    7474<result>2</result>
    75 </example>
     75</example></examples>
    7676
    7777==== Notes on the algorithm.
  • wiki/c3

    r8882 r12880  
    3434=== Examples
    3535
    36 <example>
     36<examples><example>
    3737<init>(use c3)</init>
    3838<expr>;; by Michele Simionato
     
    5555(class-cpl A)
    5656(A B C D E F object top) ; E <-> F</expr>
    57 </example>
     57</example></examples>
    5858
    59 <example>
     59<examples><example>
    6060<init>(use c3)</init>
    6161<expr>;; second example
     
    7474(class-cpl A)
    7575(A B E C D F object top) ; identical</expr>
    76 </example>
     76</example></examples>
    7777
    78 <example>
     78<examples><example>
    7979<init>(use c3)</init>
    8080<expr>;; Pedroni's example
     
    9696(class-cpl Z)
    9797(Z K1 K2 K3 D A B C E object top) ; E <-> C</expr>
    98 </example>
     98</example></examples>
    9999
    100100=== Changelog
  • wiki/charconv

    r8969 r12880  
    4444Example:
    4545
    46 <example>
     46<examples><example>
    4747<init>(use charconv)</init>
    4848<expr>(with-input-from-encoded-file "/usr/share/edict/edict" "EUC-JP" read-line)</expr>
    49 </example>
     49</example></examples>
    5050
    5151<procedure>(read-encoded-string ENC [N [PORT]])</procedure>
     
    102102example,
    103103
    104 <example>
     104<examples><example>
    105105<expr>(open-encoded-input-file file "*")    ; guess with no locale</expr>
    106106<expr>(open-encoded-input-file file "*DE")  ; guess with a German locale</expr>
    107 </example>
     107</example></examples>
    108108
    109109For compatibility with the Gauche convention, the encoding "*JP" is
  • wiki/complex

    r8978 r12880  
    6767that mark the used numeric primitives to disable in-lining:
    6868
    69 <example>
     69<examples><example>
    7070<init>(use complex)</init>
    7171<expr>
     
    7878"0.+1.1752011936438i"
    7979</result>
    80 </example>
     80</example></examples>
    8181
    8282(This has been fixed in Chicken version 1.72 and higher)
  • wiki/datatype

    r8994 r12880  
    5555==== Example
    5656
    57 <example>
     57<examples><example>
    5858<expr>
    5959; A simple binary tree with numbers:
     
    7575</expr>
    7676<result>((33 . 44) . 55)</result>
    77 </example>
     77</example></examples>
    7878
    7979=== Changelog
  • wiki/defstruct

    r12598 r12880  
    3232native {{define-record}}):
    3333
    34 <example>
     34<examples><example>
    3535<expr>(defstruct point x y)</expr>
    3636<result>
     
    4141  ...)
    4242</result>
    43 </example>
     43</example></examples>
    4444
    4545Additionally, a constructor procedure {{make-STRUCTNAME}} is defined,
     
    4747arguments:
    4848
    49 <example>
     49<examples><example>
    5050<expr>
    5151(make-point x: 99 y: 42)
    5252</expr>
    5353<result>; a point with x = 99 and y = 42</result>
    54 </example>
     54</example></examples>
    5555
    5656=== License
  • wiki/eggref/4/9p

    r12166 r12880  
    5175179p protocol directly.
    518518
    519 <example>
     519<examples><example>
    520520<init>
    521521(require-library 9p-client unix-sockets)
     
    534534    (9p:client-disconnect con)))
    535535</expr>
    536 </example>
     536</example></examples>
    537537
    538538This prints something like
  • wiki/eggref/4/base64

    r12512 r12880  
    1818== Examples
    1919
    20 <example>
     20<examples><example>
    2121<init>
    2222(require-library base64)
     
    3636"thequickbrownfoxjumpsoverthelazydog"
    3737</result>
    38 </example>
     38</example></examples>
    3939
    4040== About this egg
  • wiki/eggref/4/datatype

    r12166 r12880  
    5555==== Example
    5656
    57 <example>
     57<examples><example>
    5858<expr>
    5959; A simple binary tree with numbers:
     
    7575</expr>
    7676<result>((33 . 44) . 55)</result>
    77 </example>
     77</example></examples>
    7878
    7979=== Changelog
  • wiki/eggref/4/defstruct

    r12581 r12880  
    3232native {{define-record}}):
    3333
    34 <example>
     34<examples><example>
    3535<init>
    3636(require-extension defstruct)
     
    4444  ...)
    4545</result>
    46 </example>
     46</example></examples>
    4747
    4848Additionally, a constructor procedure {{make-STRUCTNAME}} is defined,
     
    5050arguments:
    5151
    52 <example>
     52<examples><example>
    5353<expr>
    5454(define p1 (make-point x: 99 y: 42))
     
    5656</expr>
    5757<result>; a point with x = 99 and y = 42</result>
    58 </example>
     58</example></examples>
    5959
    6060On Chicken 4 and higher, there are also two procedures {{update-STRUCTNAME}}
     
    6262selected values in an existing record:
    6363
    64 <example>
     64<examples><example>
    6565<expr>
    6666(define p2 (update-point p1 x: 100))
     
    7777</expr>
    7878<result>#t</result>
    79 </example>
     79</example></examples>
    8080
    8181=== License
  • wiki/eggref/4/epeg

    r12512 r12880  
    131131from the epeg distribution tarball.
    132132
    133 <example>
     133<examples><example>
    134134<init>
    135135(use epeg)
  • wiki/eggref/4/intarweb

    r12873 r12880  
    175175lists of values as values:
    176176
    177 <example>
     177<examples><example>
    178178<expr>
    179179(headers `((host ("example.com" . 8080))
     
    182182          old-headers)
    183183</expr>
    184 </example>
     184</example></examples>
    185185
    186186This adds the named headers to the existing headers in
  • wiki/eggref/4/lazy-ffi

    r12397 r12880  
    145145=== Examples
    146146
    147 <example>
     147<examples><example>
    148148<expr>
    149149#~"libc.so.6"
     
    160160  (list r box) )   ==> (0.456 #f64(123.0))
    161161</expr>
    162 </example>
     162</example></examples>
    163163
    164164Here the "Hello, world" example from the GTK 2.0 tutorial:
    165165
    166 <example>
     166<examples><example>
    167167<expr>
    168168;; Compile like this:
     
    216216(#~gtk_main safe: #t)
    217217</expr>
    218 </example>
     218</example></examples>
    219219
    220220Calling a pointer directly:
    221221
    222 <example>
     222<examples><example>
    223223<expr>
    224224#~"libdl.so.2"
     
    236236(#~~ (address->pointer 1077736272) "42.1" return: double:)    ; ==> 42.1
    237237</expr>
    238 </example>
     238</example></examples>
    239239
    240240=== Changelog
  • wiki/eggref/4/regex-case

    r12166 r12880  
    4242=== Examples
    4343
    44 <example>
     44<examples><example>
    4545<init>(use regex-case)</init>
    4646<expr>
     
    5858<expr>(test "???")</expr>
    5959<result>nothing</result>
    60 </example>
     60</example></examples>
    6161
    62 <example>
     62<examples><example>
    6363<init>(use regex-case)</init>
    6464<expr>
     
    6767</expr>
    6868<result>"23"</result>
    69 </example>
     69</example></examples>
    7070
    71 <example>
     71<examples><example>
    7272<init>(use regex-case)</init>
    7373<expr>
     
    7676</expr>
    7777<result>("http" "www.foo.com" "/index.html" "index.html")</result>
    78 </example>
     78</example></examples>
    7979
    8080=== Changelog
  • wiki/eggref/4/spiffy

    r12875 r12880  
    263263requested hostname, showing different websites for different hosts:
    264264
    265 <example>
     265<examples><example>
    266266<expr>
    267267(vhost-map `(("foo\\.bar\\.com" .
     
    278278                     (continue))))))
    279279</expr>
    280 </example>
     280</example></examples>
    281281
    282282In this example, if a client accesses
     
    380380response. Example:
    381381
    382 <example>
     382<examples><example>
    383383<expr>
    384384(send-status 404 "Not found"
    385385 "Sorry, page not found! Please try <a href='/search.ws'>our search page</a>")
    386386</expr>
    387 </example>
     387</example></examples>
    388388
    389389<procedure>(send-static-file filename)</procedure>
  • wiki/eggref/4/sxml-transforms

    r12166 r12880  
    224224
    225225For example, to make a procedure that quotes special HTML characters, do:
    226 <example>
     226<examples><example>
    227227(make-char-quotator
    228228    '((#\< . "&lt;") (#\> . "&gt;") (#\& . "&amp;") (#\" . "&quot;")))
    229 </example>
     229</example></examples>
    230230
    231231==== Chicken-specific modifications
     
    255255
    256256Example:
    257 <example>
     257<examples><example>
    258258<expr>(& "ndash" "quot")</expr>
    259259<result>"&ndash;&quot;"</result>
    260 </example>
     260</example></examples>
    261261
    262262
  • wiki/environments

    r9216 r12880  
    155155=== Examples:
    156156
    157 <example>
     157<examples><example>
    158158<expr>
    159159; create an immutable environment with all R5RS procedures:
     
    173173(eval '(set! abc #f) my-env)     ;==>   Error
    174174</expr>
    175 </example>
     175</example></examples>
    176176
    177177=== Changelog
  • wiki/expat

    r9223 r12880  
    139139A silly example:
    140140
    141 <example>
     141<examples><example>
    142142<init>(use expat)</init>
    143143<expr>
     
    163163(expat:destroy-parser p)
    164164</expr>
    165 </example>
     165</example></examples>
    166166
    167167This will output:
     
    204204  <!ENTITY abcdef "this is a test">
    205205
    206 <example>
     206<examples><example>
    207207<init>(use utils expat)</init>
    208208<expr>
     
    224224(expat:destroy-parser p)
    225225</expr>
    226 </example>
     226</example></examples>
    227227
    228228=== Changelog
  • wiki/ezxdisp

    r9226 r12880  
    117117=== Examples
    118118
    119 <example>
     119<examples><example>
    120120<expr>
    121121(define ezx (ezx-init 100 100 "Hello, ezxdisp"))
     
    130130(ezx-quit ezx)
    131131</expr>
    132 </example>
     132</example></examples>
    133133
    134134A more elaborate example is in the egg distribution in a file named
  • wiki/ftp

    r9232 r12880  
    136136=== Example
    137137
    138 <example>
     138<examples><example>
    139139<expr>
    140140; Connect to FTP server:
     
    156156(ftp:disconnect f)
    157157</expr>
    158 </example>
     158</example></examples>
    159159
    160160=== Changelog
  • wiki/g2

    r9236 r12880  
    178178=== Example
    179179
    180 <example>
     180<examples><example>
    181181<init>(require-extension g2)</init>
    182182<expr>
     
    191191(g2:close d)
    192192</expr>
    193 </example>
     193</example></examples>
    194194
    195195=== Changelog
  • wiki/generalised-case

    r9245 r12880  
    3737=== Example
    3838
    39 <example>
     39<examples><example>
    4040<init>(use generalised-case)</init>
    4141<expr>
     
    4848<result>1</result>
    4949<output>bar, foo or qux</output>
    50 </example>
     50</example></examples>
    5151
    5252=== Changelog
  • wiki/glut

    r9263 r12880  
    296296A most trivial example: a white rectangle
    297297
    298 <example>
     298<examples><example>
    299299<init>(require-extension gl glut)</init>
    300300<expr>
     
    315315(glut:MainLoop)
    316316</expr>
    317 </example>
     317</example></examples>
    318318
    319319The well-known "gears" example can be found in the {{gears.scm}} file
  • wiki/gmp

    r9271 r12880  
    5757Here is a tiny example of the interface usage:
    5858
    59 <example>
     59<examples><example>
    6060<init>(require-extension gmp)</init>
    6161<expr>
     
    8585        (mpz_clear mpz3))
    8686</expr>
    87 </example>
     87</example></examples>
    8888
    8989For the high level functions that I have not implemented:
     
    9696Here is an example of how the special function {{mpf_get_str}} is handled:
    9797
    98 <example>
     98<examples><example>
    9999<expr>
    100100(let (  (mpf1 (make-mpf_t))
     
    113113        (mpf_clear mpf1))
    114114</expr>
    115 </example>
     115</example></examples>
    116116
    117117
  • wiki/inline

    r9278 r12880  
    4444(these are ignored, when {{inline}} is used in compiled code).
    4545
    46 <example>
     46<examples><example>
    4747<expr>
    4848(inline "int foo(int n) { return(n * 2); }")
     
    5353        (foreign-parse "int foo(int n) { return(n * 2); }") )
    5454</expr>
    55 </example>
     55</example></examples>
    5656
    5757<procedure>(inline:compile STRING [OPTIONS])</procedure>
     
    6868forms, if you don't want them to be processed by the FFI parser:
    6969
    70 <example>
     70<examples><example>
    7171<expr>
    7272(inline #<<EOF
     
    100100(genimages 64 64)
    101101</expr>
    102 </example>
     102</example></examples>
    103103
    104104<parameter>inline:cache</parameter>
  • wiki/irc

    r9287 r12880  
    293293A minimalistic bot that shows the current time, when asked:
    294294
    295 <example>
     295<examples><example>
    296296<init>(require-extension irc posix)</init>
    297297<expr>
     
    313313(irc:run-message-loop con debug: #t)
    314314</expr>
    315 </example>
     315</example></examples>
    316316
    317317=== Changelog
  • wiki/japi

    r9293 r12880  
    308308=== Examples
    309309
    310 <example>
     310<examples><example>
    311311<init>(require 'japi)</init>
    312312<expr>
     
    318318(j:quit)
    319319</expr>
    320 </example>
    321 
    322 <example>
     320</example></examples>
     321
     322<examples><example>
    323323<init>(require 'japi)</init>
    324324<expr>
     
    357357(j:quit)
    358358</expr>
    359 </example>
     359</example></examples>
    360360
    361361=== Changelog
  • wiki/lazy-ffi

    r9297 r12880  
    140140=== Examples
    141141
    142 <example>
     142<examples><example>
    143143<expr>
    144144#~"libc.so.6"
     
    155155  (list r box) )   ==> (0.456 #f64(123.0))
    156156</expr>
    157 </example>
     157</example></examples>
    158158
    159159Here the "Hello, world" example from the GTK 2.0 tutorial:
    160160
    161 <example>
     161<examples><example>
    162162<expr>
    163163;; Compile like this:
     
    211211(#~gtk_main safe: #t)
    212212</expr>
    213 </example>
     213</example></examples>
    214214
    215215Calling a pointer directly:
    216216
    217 <example>
     217<examples><example>
    218218<expr>
    219219#~"libdl.so.2"
     
    231231(#~~ (address->pointer 1077736272) "42.1" return: double:)    ; ==> 42.1
    232232</expr>
    233 </example>
     233</example></examples>
    234234
    235235=== Changelog
  • wiki/mailbox

    r9450 r12880  
    128128=== Example
    129129
    130 <example>
     130<examples><example>
    131131<init>(require-extension mailbox)</init>
    132132<expr>
     
    146146  '(33 44 55 hello) )
    147147</expr>
    148 </example>
     148</example></examples>
    149149
    150150=== Changelog
  • wiki/mapm

    r9455 r12880  
    472472Calculate Fibonacci numbers:
    473473
    474 <example>
     474<examples><example>
    475475<init>(require 'mapm)</init>
    476476<expr>
     
    482482
    483483(print (apm->integer-string (fib 10000)))
    484 </example>
     484</example></examples>
    485485
    486486Calculate <nowiki>&pi;</nowiki>:
    487487
    488 <example>
     488<examples><example>
    489489<init>(require 'mapm)</init>
    490490<expr>
     
    526526  (print (apm->fixpt-string (compute-pi p))))
    527527</expr>
    528 </example>
     528</example></examples>
    529529
    530530=== Changelog
  • wiki/ncurses

    r9476 r12880  
    450450=== Example
    451451
    452 <example>
     452<examples><example>
    453453<init>
    454454(declare (block) (fixnum) (usual-integrations))
     
    552552(main)
    553553</expr>
    554 </example>
     554</example></examples>
    555555
    556556=== License
  • wiki/octave

    r9484 r12880  
    5858=== Example
    5959
    60 <example>
     60<examples><example>
    6161<init>(use posix octave)</init>
    6262<expr>
     
    101101(octave:stop)
    102102</expr>
    103 </example>
     103</example></examples>
    104104
    105105=== Limitations
  • wiki/pcap

    r9522 r12880  
    176176=== Examples
    177177
    178 <example>
     178<examples><example>
    179179<init>(require 'pcap)</init>
    180180<expr>
     
    191191  (pcap-close p))
    192192</expr>
    193 </example>
     193</example></examples>
    194194
    195195Now we initiate a ping to 192.168.100.1.  The output is:
  • wiki/pop3

    r9554 r12880  
    6868=== Example
    6969
    70 <example>
     70<examples><example>
    7171<init>(use pop3)</init>
    7272<expr>
     
    8484(smtp:disconnect s)
    8585</expr>
    86 </example>
     86</example></examples>
    8787
    8888=== Changelog
  • wiki/postgresql

    r11942 r12880  
    200200=== Example
    201201
    202 <example>
     202<examples><example>
    203203<expr>
    204204(let ([conn (pg:connect '((dbname . "johs")))])
     
    216216  (pg:close conn))
    217217</expr>
    218 </example>
     218</example></examples>
    219219
    220220=== Changelog
  • wiki/ppi

    r9559 r12880  
    9595
    9696Example :
    97 <example><expr>(ppi-data-out 5)</expr></example> sets D2 and D0 to logical 1
     97<examples><example><expr>(ppi-data-out 5)</expr></example></examples> sets D2 and D0 to logical 1
    9898
    9999
    100 <example><expr>(ppi-status-in)</expr></example> -> 8 * S3 + 16 * S4 + 32 * S5 + 64 * S6 + 128 * ~S7
     100<examples><example><expr>(ppi-status-in)</expr></example></examples> -> 8 * S3 + 16 * S4 + 32 * S5 + 64 * S6 + 128 * ~S7
    101101reads the contents of the status register.
    102102
  • wiki/regex-case

    r9574 r12880  
    4242=== Examples
    4343
    44 <example>
     44<examples><example>
    4545<init>(use regex-case)</init>
    4646<expr>
     
    5858<expr>(test "???")</expr>
    5959<result>nothing</result>
    60 </example>
     60</example></examples>
    6161
    62 <example>
     62<examples><example>
    6363<init>(use regex-case)</init>
    6464<expr>
     
    6767</expr>
    6868<result>"23"</result>
    69 </example>
     69</example></examples>
    7070
    71 <example>
     71<examples><example>
    7272<init>(use regex-case)</init>
    7373<expr>
     
    7676</expr>
    7777<result>("http" "www.foo.com" "/index.html" "index.html")</result>
    78 </example>
     78</example></examples>
    7979
    8080=== Changelog
  • wiki/sandbox

    r12770 r12880  
    194194=== Example
    195195
    196 <example>
     196<examples><example>
    197197<expr>(safe-eval 123)</expr>
    198198<result>123</result>
     
    229229<expr>(safe-eval '(make-vector 100) allocation-limit: 100)</expr>
    230230<output>error ("allocation limit exceeded")</output>
    231 </example>
     231</example></examples>
    232232
    233233=== Changelog
  • wiki/smtp

    r9634 r12880  
    6363=== Example
    6464
    65 <example>
     65<examples><example>
    6666<init>(use smtp)</init>
    6767<expr>
     
    7272(smtp:disconnect s)
    7373</expr>
    74 </example>
     74</example></examples>
    7575
    7676=== Changelog
  • wiki/spread

    r9645 r12880  
    181181A simple sender/receiver pair:
    182182
    183 <example>
     183<examples><example>
    184184<init>(require-extension spread posix srfi-1)</init>
    185185<expr>
     
    199199  (loop) )
    200200</expr>
    201 </example>
    202 
    203 <example>
     201</example></examples>
     202
     203<examples><example>
    204204<init>(require-extension spread)</init>
    205205<expr>
     
    220220    (loop) ) )
    221221</expr>
    222 </example>
     222</example></examples>
    223223
    224224=== Changelog
  • wiki/sqlite

    r9647 r12880  
    7676Create a table of number pairs:
    7777
    78 <example>
     78<examples><example>
    7979<init>(use sqlite)</init>
    8080<expr>
     
    109109(sqlite:close db)  ; cleaning up is always good.
    110110</expr>
    111 </example>
     111</example></examples>
    112112
    113113=== Changelog
  • wiki/srfi-37

    r9653 r12880  
    2929=== Example
    3030
    31 <example>
     31<examples><example>
    3232<expr>
    3333#!/usr/local/bin/csi -script
     
    6565(display (make-string nl #\newline))
    6666</expr>
    67 </example>
     67</example></examples>
    6868
    6969=== Changelog
  • wiki/srfi-40

    r9656 r12880  
    9898=== Examples
    9999
    100 <example>
     100<examples><example>
    101101<expr>
    102102(define stream-ref
     
    131131<expr>(stream-ref primes 200)</expr>
    132132<result>1229</result>
    133 </example>
     133</example></examples>
    134134
    135 <example>
     135<examples><example>
    136136<expr>
    137137(define mul-streams
     
    158158</expr>
    159159<result>2.71828182845905</result>
    160 </example>
     160</example></examples>
    161161
    162162=== Changelog
  • wiki/srfi-47

    r9674 r12880  
    4343=== Examples
    4444
    45 <example>
     45<examples><example>
    4646<init>(use srfi-47)</init>
    4747<expr>
     
    6060</expr>
    6161<output>foo</output>
    62 </example>
     62</example></examples>
    6363
    6464=== Changelog
  • wiki/stream-base64

    r9678 r12880  
    2929==== Encoding a stream
    3030
    31 <example>
     31<examples><example>
    3232<init>(use stream-base64)</init>
    3333<expr>
     
    3838      (current-input-port))))
    3939</expr>
    40 </example>
     40</example></examples>
    4141
    4242==== Decoding a stream
    4343
    44 <example>
     44<examples><example>
    4545<init>(use stream-base64)</init>
    4646<expr>
     
    5151      (current-input-port))))
    5252</expr>
    53 </example>
     53</example></examples>
    5454
    5555=== Changelog
  • wiki/stream-ext

    r12749 r12880  
    5454
    5555<examples testgroup="stream-xcons" filename="stream-ext">
    56 <example>
     56<examples><example>
    5757<expr>(stream-xcons (stream 2 3) 1)</expr>
    5858<result>(stream 1 2 3)</result>
    5959<resultcmp>(cut stream= equal? <...>)</resultcmp>
    60 </example>
    61 <example>
     60</example></examples>
     61<examples><example>
    6262<expr>(stream-xcons (stream 2 3 4) 1)</expr>
    6363<result>(stream 1 2 3 4)</result>
    6464<resultcmp>(cut stream= = <...>)</resultcmp>
    65 </example>
     65</example></examples>
    6666</examples>
    6767
     
    8080
    8181<examples testgroup="stream-cons*" filename="stream-ext">
    82 <example>
     82<examples><example>
    8383<expr>(stream-cons* 1 2 3 (stream 4))</expr>
    8484<result>(stream 1 2 3 4)</result>
    8585<resultcmp>(cut stream= = <...>)</resultcmp>
    86 </example>
    87 <example>
     86</example></examples>
     87<examples><example>
    8888<expr>(stream-cons* (stream 4))</expr>
    8989<result>(stream 4)</result>
    9090<resultcmp>(cut stream= = <...>)</resultcmp>
    91 </example>
     91</example></examples>
    9292</examples>
    9393
     
    111111
    112112<examples testgroup="make-stream" filename="stream-ext">
    113 <example>
     113<examples><example>
    114114<expr>(make-stream 4 0)</expr>
    115115<result>(stream 0 0 0 0)</result>
    116116<resultcmp>(cut stream= = <...>)</resultcmp>
    117 </example>
     117</example></examples>
    118118</examples>
    119119
     
    133133
    134134<examples testgroup="make-stream" filename="stream-ext">
    135 <example>
     135<examples><example>
    136136<expr>(stream-tabulate 4 (lambda (x) (* x x)))</expr>
    137137<result>(stream 0 4 9 16)</result>
    138138<resultcmp>(cut stream= = <...>)</resultcmp>
    139 </example>
     139</example></examples>
    140140</examples>
    141141
     
    165165
    166166<examples testgroup="stream-iota" filename="stream-ext">
    167 <example>
     167<examples><example>
    168168<expr>(stream-iota 5)</expr>
    169169<result>(stream 0 1 2 3 4)</result>
    170170<resultcmp>(cut stream= = <...>)</resultcmp>
    171 </example>
    172 <example>
     171</example></examples>
     172<examples><example>
    173173<expr>(stream-iota 5 0 -0.1)</expr>
    174174<result>(stream 0 -0.1 -0.2 -0.3 -0.4)</result>
    175175<resultcmp>(cut stream= = <...>)</resultcmp>
    176 </example>
     176</example></examples>
    177177</examples>
    178178
     
    418418
    419419<examples testgroup="stream-xcons" filename="stream-ext">
    420 <example>
     420<examples><example>
    421421<expr>(with-output-to-stream (lambda () (format #t "hi")))</expr>
    422422<result>(stream #\h #\i)</result>
    423423<resultcmp>(cut stream= equal? <...>)</resultcmp>
    424 </example>
     424</example></examples>
    425425</examples>
    426426
     
    454454<examples testgroup='with-input-from-stream' filename='stream-ext'>
    455455
    456 <example>
     456<examples><example>
    457457<expr>(with-input-from-stream (stream #\" #\a #\b #\c #\") read)</expr>
    458458<result>"abc"</result>
    459 </example>
     459</example></examples>
    460460
    461461</examples>
  • wiki/structures

    r9691 r12880  
    140140=== Example
    141141
    142 <example>
     142<examples><example>
    143143<init>(use structures)</init>
    144144<expr>
     
    193193</expr>
    194194<output>100</output>
    195 </example>
     195</example></examples>
    196196
    197197=== Changelog
  • wiki/svnwiki-chicken

    r12750 r12880  
    9797<examples filename='svnwiki-chicken' testgroup='definition-list?'>
    9898
    99 <example>
     99<examples><example>
    100100<expr>(definition-list? (string->stream "(foo)"))</expr>
    101101<result>#t</result>
    102 </example>
    103 
    104 <example>
     102</example></examples>
     103
     104<examples><example>
    105105<expr>(definition-list? (string->stream "(foo bar)"))</expr>
    106106<result>#t</result>
    107 </example>
    108 
    109 <example>
     107</example></examples>
     108
     109<examples><example>
    110110<expr>(definition-list? (string->stream "foo"))</expr>
    111111<result>#f</result>
    112 </example>
    113 
    114 <example>
     112</example></examples>
     113
     114<examples><example>
    115115<expr>(definition-list? (string->stream "(  )"))</expr>
    116116<result>#f</result>
    117 </example>
    118 
    119 <example>
     117</example></examples>
     118
     119<examples><example>
    120120<expr>(definition-list? (string->stream ""))</expr>
    121121<result>#f</result>
    122 </example>
     122</example></examples>
    123123
    124124</examples>
     
    139139<examples filename='svnwiki-chicken' testgroup='get-definition-name'>
    140140
    141 <example>
     141<examples><example>
    142142<expr>(stream->string (get-definition-name (string->stream "foo")))</expr>
    143143<result>"foo"</result>
    144 </example>
    145 
    146 <example>
     144</example></examples>
     145
     146<examples><example>
    147147<expr>(stream->string (get-definition-name (string->stream "(foo)")))</expr>
    148148<result>"foo"</result>
    149 </example>
    150 
    151 <example>
     149</example></examples>
     150
     151<examples><example>
    152152<expr>(stream->string (get-definition-name (string->stream "(foo bar)")))</expr>
    153153<result>"foo"</result>
    154 </example>
    155 
    156 <example>
     154</example></examples>
     155
     156<examples><example>
    157157<expr>(stream->string (get-definition-name (string->stream "(stream= proc str str ...)")))</expr>
    158158<result>"stream="</result>
    159 </example>
     159</example></examples>
    160160
    161161</examples>
  • wiki/sxml-transforms

    r12809 r12880  
    226226
    227227For example, to make a procedure that quotes special HTML characters, do:
    228 <example>
     228<examples><example>
    229229(make-char-quotator
    230230    '((#\< . "&lt;") (#\> . "&gt;") (#\& . "&amp;") (#\" . "&quot;")))
    231 </example>
     231</example></examples>
    232232
    233233==== Chicken-specific modifications
     
    257257
    258258Example:
    259 <example>
     259<examples><example>
    260260<expr>(& "ndash" "quot")</expr>
    261261<result>"&ndash;&quot;"</result>
    262 </example>
     262</example></examples>
    263263
    264264
  • wiki/tagged-begin

    r8869 r12880  
    99Example 1 ({{tagged-begin}} returns {{(void)}})
    1010
    11 <example>
     11<examples><example>
    1212<init>(use tagged-begin)</init>
    1313<expr>(let ([i 0])
     
    1717   i)</expr>
    1818<result>41</result>
    19 </example>
     19</example></examples>
    2020
    2121Example 2 ({{tagged-begin}} returns {{42}})
    2222
    23 <example>
     23<examples><example>
    2424<init>(use tagged-begin)</init>
    2525<expr>(let ([i 0])
     
    2929         (return i)))</expr>
    3030<result>42</result>
    31 </example>
     31</example></examples>
    3232
    3333Example 3 ({{tagged-begin}} returns {{43}})
    3434
    35 <example>
     35<examples><example>
    3636<init>(use tagged-begin)</init>
    3737<expr>(let ([i 0])
     
    4343    b    (go a)))</expr>
    4444<result>43</result>
    45 </example>
     45</example></examples>
    4646
    4747Example 4 ([[http://www.emacswiki.org/cgi-bin/wiki.pl?StateMachine]])
    4848
    49 <example>
     49<examples><example>
    5050<init>(use tagged-begin)</init>
    5151<expr>(begin
     
    76769
    7777We're done printing the odd numbers between 0 and 10</output>
    78 </example>
     78</example></examples>
    7979
    8080Example 5 ( Knuth: "The Art of Computer Programming", vol1, p.176): Inplace inversion of a permutation represented as a vector.
    8181
    82 <example>
     82<examples><example>
    8383<init>(use tagged-begin)</init>
    8484<expr>(begin
     
    113113  permutation)</expr>
    114114<result>#(dummy 3 2 6 5 4 1)</result>
    115 </example>
     115</example></examples>
    116116
    117117Example 6 (The CommonLisp Hyper Spec examples of {{tagbody}})
    118118
    119 <example>
     119<examples><example>
    120120<init>(use tagged-begin)</init>
    121121<expr>(begin
     
    144144  (list val (f1 #f) (f1 #t)))</expr>
    145145<result>(15 2 1)</result>
    146 </example>
     146</example></examples>
    147147
    148148Example 7: Demonstrates lexical scoping of tagged-begins, and that an inner tagged-begin can use an outer tag.
    149149
    150 <example>
     150<examples><example>
    151151<init>(use tagged-begin)</init>
    152152<expr>(tagged-begin
     
    155155 b (return 'hello-world))</expr>
    156156<result>hello-world</result>
    157 </example>
     157</example></examples>
    158158
    159159Example 8: Demonstrates that tags are lexically shadowed.
    160160
    161 <example>
     161<examples><example>
    162162<init>(use tagged-begin)</init>
    163163<expr>(tagged-begin
     
    169169 c (return 'correct))</expr>
    170170<result>correct</result>
    171 </example>
     171</example></examples>
    172172
    173173Expansion example:
    174174
    175 <example>
     175<examples><example>
    176176<init>(use tagged-begin)</init>
    177177<expr>(pp (macroexpand
     
    202202                 (b (lambda () (set! val (+ val 8)) (return (void)))))
    203203          (g14))))))</output>
    204 </example>
     204</example></examples>
    205205
    206206== Authors
  • wiki/tcp-server

    r8840 r12880  
    1010A simple time-of-day server:
    1111
    12 <example>
     12<examples><example>
    1313<init>(require-extension tcp-server posix)</init>
    1414<expr>((make-tcp-server
     
    1717    (write-line (seconds->string (current-seconds))) ) )
    1818 #t)</expr>
    19 </example>
     19</example></examples>
    2020
    2121== Author
  • wiki/test-infrastructure

    r8851 r12880  
    671671Here's an example:
    672672
    673 <example>
     673<examples><example>
    674674(test-case "exn1" d e
    675675    ([exn1 (make-composite-condition
     
    684684  (expect-exception "3" ((property foo (equal? bar "zip"))
    685685                         (property abc (equal? cbs "pbs"))) (signal exn1)))
    686 </example>
     686</example></examples>
    687687
    688688
     
    14491449Here is a simple example:
    14501450
    1451 <example>
     1451<examples><example>
    14521452(let ((result
    14531453  ;; output-style-human function requires a single test package
     
    14661466
    14671467  (output-style-human result))
    1468 </example>
     1468</example></examples>
    14691469
    14701470The above example, when evaluated, will produce some human readable
  • wiki/udp

    r8871 r12880  
    77== Example
    88
    9 <example>
     9<examples><example>
    1010<init>(require 'udp)</init>
    1111<expr>(begin
     
    1818 (udp-close-socket s))</expr>
    1919<output>26 bytes from 127.0.0.1:13: Wed Dec 24 11:53:14 2003</output>
    20 </example>
     20</example></examples>
    2121
    2222== Author
  • wiki/wiki-syntax-chicken

    r11449 r12880  
    5151
    5252If your example has more than one line, just put them within ''one''
    53 {{<expr>}} tag.  Do ''not'' put empty lines in an {{<example>}} tag.
     53{{<expr>}} tag.  Do ''not'' put empty lines in an {{<examples><example>}} tag.
    5454You can put empty lines within {{<expr>}}, though.
    5555
Note: See TracChangeset for help on using the changeset viewer.