Changeset 38209 in project


Ignore:
Timestamp:
02/29/20 15:15:43 (5 weeks ago)
Author:
sjamaan
Message:

Sync wiki manual to match 5.2.0 release

Location:
wiki/man/5
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wiki/man/5/Declarations

    r35531 r38209  
    154154
    155155
     156=== unroll-limit
     157
     158 [declaration specifier] (unroll-limit LIMIT)
     159
     160Sets the maximum number of times a self-recursive call is inlined and
     161so effectively "unrolled". The default limit is 1.
     162
     163
    156164=== keep-shadowed-macros
    157165
  • wiki/man/5/Getting started

    r37854 r38209  
    238238 $ csi
    239239 CHICKEN
    240  (c) 2008-2019, The CHICKEN Team
     240 (c) 2008-2020, The CHICKEN Team
    241241 (c) 2000-2007, Felix L. Winkelmann
    242  Version 5.1.0 (rev 6653dce)
     242 Version 5.2.0 (rev 317468e4)
    243243 linux-unix-gnu-x86-64 [ 64bit dload ptables ]
    244 
    245  #;1>
     244 
     245 Type ,? for help.
     246 #;1>
    246247
    247248This brings up a brief banner, and then the prompt. You can use this
  • wiki/man/5/Module (chicken base)

    r37966 r38209  
    11881188{{(scheme base)}} library.
    11891189
    1190 
    1191 ==== define-record-printer
    1192 
    1193 <macro>(define-record-printer (NAME RECORDVAR PORTVAR) BODY ...)</macro><br>
    1194 <macro>(define-record-printer NAME PROCEDURE)</macro>
     1190==== record-printer
     1191
     1192<procedure>(record-printer NAME)</procedure><br>
     1193
     1194Returns the procedure used to print records of the type {{NAME}} if
     1195one has been set with {{set-record-printer!}}, {{#f}} otherwise.
     1196
     1197==== set-record-printer!
     1198
     1199<procedure>(set-record-printer! NAME PROCEDURE)</procedure><br>
     1200<procedure>(set! (record-printer NAME) PROCEDURE)</procedure>
    11951201
    11961202Defines a printing method for record of the type {{NAME}} by
     
    12061212  (z foo-z))
    12071213(define f (make-foo 1 2 3))
    1208 (define-record-printer (foo x out)
    1209   (fprintf out "#,(foo ~S ~S ~S)"
    1210            (foo-x x) (foo-y x) (foo-z x)) )
     1214(set-record-printer! foo
     1215  (lambda (x out)
     1216    (fprintf out "#,(foo ~S ~S ~S)"
     1217             (foo-x x) (foo-y x) (foo-z x))))
    12111218(define-reader-ctor 'foo make-foo)
    12121219(define s (with-output-to-string
  • wiki/man/5/Module (chicken irregex)

    r37734 r38209  
    223223(irregex-replace/all "[aeiou]" "hello world" "*") => "h*ll* w*rld"
    224224
     225(irregex-replace/all '(* "poo ") "poo poo platter" "*") => "**p*l*a*t*t*e*r"
     226
    225227(irregex-replace "(.)(.)" "ab" 2 1 "*")  => "ba*"
    226228
     
    242244returning a list of each instance of the pattern matched disregarding
    243245the substrings in between.
     246
     247Empty matches will result in subsequent single character string in
     248{{irregex-split}}, or empty strings in {{irregex-extract}}.
     249
     250<enscript highlight="scheme">
     251(irregex-split "[aeiou]*" "foobarbaz") => '("f" "b" "r" "b" "z")
     252
     253(irregex-extract "[aeiou]*" "foobarbaz") => '("" "oo" "" "a" "" "" "a" "")
     254</enscript>
     255
    244256
    245257==== irregex-fold
     
    289301                   (lambda (i s) (reverse s))))
    290302</enscript>
     303
     304Note if an empty match is found {{<kons>}} will be called on that
     305empty string, and to avoid an infinite loop matching will resume at
     306the next char.  It is up to the programmer to do something sensible
     307with the skipped char in this case.
     308
    291309
    292310=== Extended SRE Syntax
  • wiki/man/5/Module (chicken keyword)

    r37717 r38209  
    1818[[http://srfi.schemers.org/srfi-88/srfi-88.html|SRFI-88]].
    1919
     20There is also a {{srfi-88}} or {{(srfi 88)}} module which only
     21includes the standard procedures from the SRFI document, without the
     22CHICKEN extensions.  {{(chicken keyword)}} offers the complete set of
     23procedures, both CHICKEN-specific and standard SRFI-88.
    2024
    2125==== get-keyword
  • wiki/man/5/Module (chicken memory representation)

    r38074 r38209  
    124124=== Record instance
    125125
    126 As illustration, the SRFI 9 definition:
    127 
    128 <enscript highlight=scheme>
    129 (define-record-type point
    130   (make-point x y)
    131   point?
     126
     127==== make-record-instance
     128
     129<procedure>(make-record-instance SYMBOL ARG1 ...)</procedure>
     130
     131Returns a new instance of the record type {{SYMBOL}}, with its
     132slots initialized to {{ARG1 ...}}.  To illustrate:
     133
     134<enscript highlight=scheme>
     135(define-record-type point (make-point x y) point?
    132136  (x point-x point-x-set!)
    133137  (y point-y point-y-set!))
    134138</enscript>
    135139
    136 could expand into:
     140expands into something quite similar to:
    137141
    138142<enscript highlight=scheme>
    139143(begin
    140   (import (chicken base))
    141   (import (chicken memory representation))
    142   (define (make-point x y)   (make-record-instance 'point x y))
    143   (define (point? x)         (record-instance? x 'point))
    144   (define (point-x-set! p x) (record-instance-slot-set! p 0 x))
    145   (define point-x            (getter-with-setter (cut record-instance-slot <> 0) point-x-set!))
    146   (define (point-y-set! p y) (record-instance-slot-set! p 1 y))
    147   (define point-y            (getter-with-setter (cut record-instance-slot <> 1) point-y-set!)))
    148 </enscript>
    149 
    150 
    151 ==== make-record-instance
    152 
    153 <procedure>(make-record-instance SYMBOL ARG1 ...)</procedure>
    154 
    155 Returns a new instance of the record type {{SYMBOL}}, with its
    156 slots initialized to {{ARG1 ...}}.
     144  (define (make-point x y)
     145    (make-record-instance 'point x y) )
     146  (define (point? x)
     147    (and (record-instance? x)
     148         (eq? 'point (block-ref x 0)) ) )
     149  (define (point-x p) (block-ref p 1))
     150  (define (point-x-set! p x) (block-set! p 1 x))
     151  (define (point-y p) (block-ref p 2))
     152  (define (point-y-set! p y) (block-set! p 1 y)) )
     153</enscript>
    157154
    158155
  • wiki/man/5/Module scheme

    r37365 r38209  
    28502850
    28512851The lists must be lists, and proc must be a procedure taking as many
    2852 arguments as there are lists and returning a single value. If more than
    2853 one list is given, then they must all be the same length. Map applies
     2852arguments as there are lists and returning a single value. Map applies
    28542853proc element-wise to the elements of the lists and returns a list of
    28552854the results, in order. The dynamic order in which proc is applied to
    28562855the elements of the lists is unspecified.
     2856
     2857Like in SRFI-1, this procedure allows the arguments to be of unequal
     2858length; it terminates when the shortest list runs out.  This is a
     2859CHICKEN extension to R5RS.
    28572860
    28582861 (map cadr '((a b) (d e) (g h)))   
     
    28842887             '(0 1 2 3 4))
    28852888   v)                                        ===>  #(0 1 4 9 16)
     2889
     2890Like in SRFI-1, this procedure allows the arguments to be of unequal
     2891length; it terminates when the shortest list runs out.  This is a
     2892CHICKEN extension to R5RS.
    28862893
    28872894<procedure>(force promise)</procedure><br>
  • wiki/man/5/The User's Manual

    r38064 r38209  
    77</nowiki>
    88
    9 This is the manual for CHICKEN Scheme, version 5.1.0
     9This is the manual for CHICKEN Scheme, version 5.2.0
    1010
    1111* [[Getting started]] : What is CHICKEN and how do I use it?
  • wiki/man/5/Using the compiler

    r37717 r38209  
    166166
    167167; -no-usual-integrations : Specifies that standard procedures and certain internal procedures may be redefined, and can not be inlined. This is equivalent to declaring {{(not usual-integrations)}}.
     168
     169; -unroll-limit LIMIT : Specifies how often direct recursive calls should be "unrolled" by inlining the procedure body at the call site. The default limit is 1.
    168170
    169171; -version : Prints the version and some copyright information and exit the compiler.
     
    218220; {{-:hgPERCENTAGE}} : Sets the growth rate of the heap in percent. If the heap is exhausted, then it will grow by {{PERCENTAGE}}. The default is 200.
    219221
    220 ; {{-:hiNUMBER}} : Specifies the initial heap size
    221 
    222 ; {{-:hmNUMBER}} : Specifies a maximal heap size. The default is (2GB - 15).
    223 
    224 ; {{-:hsPERCENTAGE}} : Sets the shrink rate of the heap in percent. If no more than a quarter of {{PERCENTAGE}} of the heap is used, then it will shrink to {{PERCENTAGE}}. The default is 50.  Note: If you want to make sure that the heap never shrinks, specify a value of {{0}}.  (this can be useful in situations where an optimal heap-size is known in advance).
     222; {{-:hiNUMBER}} : Specifies the initial heap size (this number includes both heap semispaces, therefore only half of it is actually available to the program).
     223
     224; {{-:hmNUMBER}} : Specifies a maximal heap size (including both semispaces). The default is (2GB - 15).
     225
     226; {{-:hsPERCENTAGE}} : Sets the shrink rate of the heap in percent. The heap is shrunk to {{PERCENTAGE}} when the watermark is reached. The default is 50.  Note: If you want to make sure that the heap never shrinks, specify a value of {{0}}.  (this can be useful in situations where an optimal heap-size is known in advance).
     227
     228; {{-:huPERCENTAGE}} : Sets the memory usage watermark below which heap shrinking is triggered. The default is 25.
    225229
    226230; {{-:o}} : Disables detection of stack overflows at run-time.
Note: See TracChangeset for help on using the changeset viewer.