Changeset 13659 in project for chicken


Ignore:
Timestamp:
03/10/09 10:11:14 (11 years ago)
Author:
felix winkelmann
Message:

small manual fixes; merged wiki changes (rev. 13647) into manual

Location:
chicken/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/manual/Unit files

    r11644 r13659  
    1212==== absolute-pathname?
    1313
    14  [procedure] (absolute-pathname? PATHNAME)
     14<procedure>(absolute-pathname? PATHNAME)</procedure>
    1515
    1616Returns {{#t}} if the string {{PATHNAME}} names an absolute
     
    1919==== decompose-pathname
    2020
    21  [procedure] (decompose-pathname PATHNAME)
     21<procedure>(decompose-pathname PATHNAME)</procedure>
    2222
    2323Returns three values: the directory-, filename- and extension-components
     
    2828==== make-absolute-pathname
    2929
    30  [procedure] (make-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])
    31  [procedure] (make-absolute-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])
     30<procedure>(make-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure>
     31<procedure>(make-absolute-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure>
    3232
    3333Returns a string that names the file with the
     
    4343==== pathname-directory
    4444
    45  [procedure] (pathname-directory PATHNAME)
     45<procedure>(pathname-directory PATHNAME)</procedure>
    4646
    4747==== pathname-file
    4848
    49  [procedure] (pathname-file PATHNAME)
     49<procedure>(pathname-file PATHNAME)</procedure>
    5050
    5151==== pathname-extension
    5252
    53  [procedure] (pathname-extension PATHNAME)
     53<procedure>(pathname-extension PATHNAME)</procedure>
    5454
    5555Accessors for the components of {{PATHNAME}}. If the pathname does
     
    5858==== pathname-replace-directory
    5959
    60  [procedure] (pathname-replace-directory PATHNAME DIRECTORY)
     60<procedure>(pathname-replace-directory PATHNAME DIRECTORY)</procedure>
    6161
    6262==== pathname-replace-file
    6363
    64  [procedure] (pathname-replace-file PATHNAME FILENAME)
     64<procedure>(pathname-replace-file PATHNAME FILENAME)</procedure>
    6565
    6666==== pathname-replace-extension
    6767
    68  [procedure] (pathname-replace-extension PATHNAME EXTENSION)
     68<procedure>(pathname-replace-extension PATHNAME EXTENSION)</procedure>
    6969
    7070Return a new pathname with the specified component of {{PATHNAME}}
     
    7373==== pathname-strip-directory
    7474
    75  [procedure] (pathname-strip-directory PATHNAME)
     75<procedure>(pathname-strip-directory PATHNAME)</procedure>
    7676
    7777==== pathname-strip-extension
    7878
    79  [procedure] (pathname-strip-extension PATHNAME)
     79<procedure>(pathname-strip-extension PATHNAME)</procedure>
    8080
    8181Return a new pathname with the specified component of {{PATHNAME}}
     
    8484==== directory-null?
    8585
    86  [procedure] (directory-null? DIRECTORY)
     86<procedure>(directory-null? DIRECTORY)</procedure>
    8787
    8888Does the {{DIRECTORY}} consist only of path separators and the period?
     
    9595==== create-temporary-file
    9696
    97  [procedure] (create-temporary-file [EXTENSION])
     97<procedure>(create-temporary-file [EXTENSION])</procedure>
    9898
    9999Creates an empty temporary file and returns its pathname. If
     
    107107==== delete-file*
    108108
    109  [procedure] (delete-file* FILENAME)
     109<procedure>(delete-file* FILENAME)</procedure>
    110110
    111111If the file {{FILENAME}} exists, it is deleted and {{#t}}
     
    118118==== file-copy
    119119
    120  [procedure] (file-copy ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)
     120<procedure>(file-copy ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)</procedure>
    121121
    122122Copies {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}},
     
    131131==== file-move
    132132
    133  [procedure] (file-move ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)
     133<procedure>(file-move ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)</procedure>
    134134
    135135Moves {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}}, with
  • chicken/trunk/manual/Unit library

    r13562 r13659  
    3434==== bit-set?
    3535
    36  [procedure] (bit-set? N INDEX)
     36<procedure>(bit-set? N INDEX)</procedure>
    3737
    3838Returns {{#t}} if the bit at the position {{INDEX}} in the integer {{N}} is
     
    8787==== Arithmetic floating-point operations
    8888
    89 In safe mode, these procedures throw a type error with non-float arguments. In
    90 unsafe mode, these procedures do not check their arguments. A non-flonum
    91 argument in unsafe mode can crash the system.
     89arguments (except {{flonum?}}, which returns {{#f}}). In unsafe mode,
     90these procedures do not check their arguments. A non-flonum argument
     91in unsafe mode can crash the system.
    9292
    9393; [procedure] (flonum? X)
     
    126126==== finite?
    127127
    128  [procedure] (finite? N)
     128<procedure>(finite? N)</procedure>
    129129
    130130Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise.
     
    143143==== current-output-port
    144144
    145  [procedure] (current-output-port [PORT])
     145<procedure>(current-output-port [PORT])</procedure>
    146146
    147147Returns default output port. If {{PORT}} is given, then that port is selected
     
    153153==== current-error-port
    154154
    155  [procedure] (current-error-port [PORT])
     155<procedure>(current-error-port [PORT])</procedure>
    156156
    157157Returns default error output port. If {{PORT}} is given, then that port is
     
    164164==== flush-output
    165165
    166  [procedure] (flush-output [PORT])
     166<procedure>(flush-output [PORT])</procedure>
    167167
    168168Write buffered output to the given output-port. {{PORT}} defaults
     
    172172==== port-name
    173173
    174  [procedure] (port-name [PORT])
     174<procedure>(port-name [PORT])</procedure>
    175175
    176176Fetch filename from {{PORT}}. This returns the filename that was used to open
     
    181181==== port-position
    182182
    183  [procedure] (port-position [PORT])
     183<procedure>(port-position [PORT])</procedure>
    184184
    185185Returns the current position of {{PORT}} as two values: row and column number.
     
    191191==== set-port-name!
    192192
    193  [procedure] (set-port-name! PORT STRING)
     193<procedure>(set-port-name! PORT STRING)</procedure>
    194194
    195195Sets the name of {{PORT}} to {{STRING}}.
     
    201201==== delete-file
    202202
    203  [procedure] (delete-file STRING)
     203<procedure>(delete-file STRING)</procedure>
    204204
    205205Deletes the file with the pathname {{STRING}}. If the file does
     
    209209==== file-exists?
    210210
    211  [procedure] (file-exists? STRING)
     211<procedure>(file-exists? STRING)</procedure>
    212212
    213213Returns {{STRING}} if a file with the given pathname exists, or
     
    217217==== rename-file
    218218
    219  [procedure] (rename-file OLD NEW)
     219<procedure>(rename-file OLD NEW)</procedure>
    220220
    221221Renames the file or directory with the pathname {{OLD}} to
     
    227227==== get-output-string
    228228
    229  [procedure] (get-output-string PORT)
     229<procedure>(get-output-string PORT)</procedure>
    230230
    231231Returns accumulated output of a port created with
     
    235235==== open-input-string
    236236
    237  [procedure] (open-input-string STRING)
     237<procedure>(open-input-string STRING)</procedure>
    238238
    239239Returns a port for reading from {{STRING}}.
     
    242242==== open-output-string
    243243
    244  [procedure] (open-output-string)
     244<procedure>(open-output-string)</procedure>
    245245
    246246Returns a port for accumulating output in a string.
     
    266266==== features
    267267
    268  [procedure] (features)
     268<procedure>(features)</procedure>
    269269
    270270Returns a list of all registered features that will be accepted as valid
     
    274274==== feature?
    275275
    276  [procedure] (feature? ID ...)
     276<procedure>(feature? ID ...)</procedure>
    277277
    278278Returns {{#t}} if all features with the given feature-identifiers {{ID ...}}
     
    282282==== register-feature!
    283283
    284  [procedure] (register-feature! FEATURE ...)
     284<procedure>(register-feature! FEATURE ...)</procedure>
    285285
    286286Register one or more features that will be accepted as valid
     
    291291==== unregister-feature!
    292292
    293  [procedure] (unregister-feature! FEATURE ...)
     293<procedure>(unregister-feature! FEATURE ...)</procedure>
    294294
    295295Unregisters the specified feature-identifiers. {{FEATURE ...}}
     
    314314==== get-keyword
    315315
    316  [procedure] (get-keyword KEYWORD ARGLIST [THUNK])
     316<procedure>(get-keyword KEYWORD ARGLIST [THUNK])</procedure>
    317317
    318318Returns the argument from {{ARGLIST}} specified under the keyword
     
    333333==== keyword?
    334334
    335  [procedure] (keyword? X)
     335<procedure>(keyword? X)</procedure>
    336336
    337337Returns {{#t}} if {{X}} is a keyword symbol, or {{#f}}
     
    341341==== keyword->string
    342342
    343  [procedure] (keyword->string KEYWORD)
     343<procedure>(keyword->string KEYWORD)</procedure>
    344344
    345345Transforms {{KEYWORD}} into a string.
     
    348348==== string->keyword
    349349
    350  [procedure] (string->keyword STRING)
     350<procedure>(string->keyword STRING)</procedure>
    351351
    352352Returns a keyword with the name {{STRING}}.
     
    402402==== breakpoint
    403403
    404  [procedure] (breakpoint [NAME])
     404<procedure>(breakpoint [NAME])</procedure>
    405405
    406406Programmatically triggers a breakpoint (similar to the {{,br}} top-level csi
     
    494494==== argv
    495495
    496  [procedure] (argv)
     496<procedure>(argv)</procedure>
    497497
    498498Return a list of all supplied command-line arguments. The first item in
     
    505505==== exit
    506506
    507  [procedure] (exit [CODE])
     507<procedure>(exit [CODE])</procedure>
    508508
    509509Exit the running process and return exit-code, which defaults to 0
     
    514514==== build-platform
    515515
    516  [procedure] (build-platform)
     516<procedure>(build-platform)</procedure>
    517517
    518518Returns a symbol specifying the toolset which has been used for
     
    528528==== chicken-version
    529529
    530  [procedure] (chicken-version [FULL])
     530<procedure>(chicken-version [FULL])</procedure>
    531531
    532532Returns a string containing the version number of the CHICKEN runtime
     
    537537==== errno
    538538
    539  [procedure] (errno)
     539<procedure>(errno)</procedure>
    540540
    541541Returns the error code of the last system call.
     
    554554==== machine-byte-order
    555555
    556  [procedure] (machine-byte-order)
     556<procedure>(machine-byte-order)</procedure>
    557557
    558558Returns the symbol {{little-endian}} or {{big-endian}}, depending on the
     
    562562==== machine-type
    563563
    564  [procedure] (machine-type)
     564<procedure>(machine-type)</procedure>
    565565
    566566Returns a symbol specifying the processor on which this process is
     
    582582==== on-exit
    583583
    584  [procedure] (on-exit THUNK)
     584<procedure>(on-exit THUNK)</procedure>
    585585
    586586Schedules the zero-argument procedures {{THUNK}} to be executed before
     
    592592==== software-type
    593593
    594  [procedure] (software-type)
     594<procedure>(software-type)</procedure>
    595595
    596596Returns a symbol specifying the operating system on which this process
     
    606606==== software-version
    607607
    608  [procedure] (software-version)
     608<procedure>(software-version)</procedure>
    609609
    610610Returns a symbol specifying the operating system version on which this
     
    625625==== c-runtime
    626626
    627  [procedure] (c-runtime)
     627<procedure>(c-runtime)</procedure>
    628628
    629629Returns a symbol that designates what kind of C runtime library has been linked
     
    635635==== system
    636636
    637  [procedure] (system STRING)
     637<procedure>(system STRING)</procedure>
    638638
    639639Execute shell command. The functionality offered by this procedure
     
    643643
    644644
    645 
     645On a UNIX system, that value is the raw return value of waitpid(2), which contains signal, core dump and exit status.    It is 0 on success.  To pull out the signal number or exit status portably requires POSIX calls, but in a pinch you can use something like this:
     646
     647 ;; Returns two values: #t if the process exited normally or #f otherwise;
     648 ;; and either the exit status, or the signal number if terminated via signal.
     649 (define (process-status rc)
     650   (define (wait-signaled? x) (not (= 0 (bitwise-and x 127))))
     651   (define (wait-signal x) (bitwise-and x 127))
     652   (define (wait-exit-status x) (arithmetic-shift x -8))
     653   (if (wait-signaled? rc)
     654       (values #f (wait-signal rc))
     655       (values #t (wait-exit-status rc))))
     656
     657 #;> (process-status (system "exit 42"))
     658 #t
     659 42
    646660
    647661=== Execution time
     
    651665==== cpu-time
    652666
    653  [procedure] (cpu-time)
     667<procedure>(cpu-time)</procedure>
    654668
    655669Returns the used CPU time of the current process in milliseconds as
     
    661675==== current-milliseconds
    662676
    663  [procedure] (current-milliseconds)
     677<procedure>(current-milliseconds)</procedure>
    664678
    665679Returns the number of milliseconds since process- or machine startup.
     
    668682==== current-seconds
    669683
    670  [procedure] (current-seconds)
     684<procedure>(current-seconds)</procedure>
    671685
    672686Returns the number of seconds since midnight, Jan. 1, 1970.
     
    675689==== current-gc-milliseconds
    676690
    677  [procedure] (current-gc-milliseconds)
     691<procedure>(current-gc-milliseconds)</procedure>
    678692
    679693Returns the number of milliseconds spent in major garbage collections since
     
    689703==== enable-warnings
    690704
    691  [procedure] (enable-warnings [BOOL])
     705<procedure>(enable-warnings [BOOL])</procedure>
    692706
    693707Enables or disables warnings, depending on wether {{BOOL}} is true or false.
     
    700714==== error
    701715
    702  [procedure] (error [LOCATION] [STRING] EXP ...)
     716<procedure>(error [LOCATION] [STRING] EXP ...)</procedure>
    703717
    704718Prints error message, writes all extra arguments to the
     
    713727==== get-call-chain
    714728
    715  [procedure] (get-call-chain [START [THREAD]])
     729<procedure>(get-call-chain [START [THREAD]])</procedure>
    716730
    717731Returns a list with the call history. Backtrace information
     
    726740==== print-call-chain
    727741
    728  [procedure] (print-call-chain [PORT [START [THREAD]]])
     742<procedure>(print-call-chain [PORT [START [THREAD]]])</procedure>
    729743
    730744Prints a backtrace of the procedure call history to {{PORT}},
     
    734748==== print-error-message
    735749
    736  [procedure] (print-error-message EXN [PORT [STRING]])
     750<procedure>(print-error-message EXN [PORT [STRING]])</procedure>
    737751
    738752Prints an appropriate error message to {{PORT}} (which defaults to the
     
    746760==== procedure-information
    747761
    748  [procedure] (procedure-information PROC)
     762<procedure>(procedure-information PROC)</procedure>
    749763
    750764Returns an s-expression with debug information for the procedure {{PROC}}, or
     
    754768==== reset
    755769
    756  [procedure] (reset)
     770<procedure>(reset)</procedure>
    757771
    758772Reset program (Invokes {{reset-handler}}).
     
    761775==== warning
    762776
    763  [procedure] (warning STRING EXP ...)
     777<procedure>(warning STRING EXP ...)</procedure>
    764778
    765779Displays a warning message (if warnings are enabled with {{enable-warnings}}) and
     
    769783==== singlestep
    770784
    771  [procedure] (singlestep THUNK)
     785<procedure>(singlestep THUNK)</procedure>
    772786
    773787Executes the code in the zero-procedure {{THUNK}} in single-stepping mode.
     
    781795==== gc
    782796
    783  [procedure] (gc [FLAG])
     797<procedure>(gc [FLAG])</procedure>
    784798
    785799Invokes a garbage-collection and returns the number of free bytes in the heap.
     
    790804==== memory-statistics
    791805
    792  [procedure] (memory-statistics)
     806<procedure>(memory-statistics)</procedure>
    793807
    794808Performs a major garbage collection and returns a three element vector
     
    801815==== set-finalizer!
    802816
    803  [procedure] (set-finalizer! X PROC)
     817<procedure>(set-finalizer! X PROC)</procedure>
    804818
    805819Registers a procedure of one argument {{PROC}}, that will be
     
    815829==== set-gc-report!
    816830
    817  [procedure] (set-gc-report! FLAG)
     831<procedure>(set-gc-report! FLAG)</procedure>
    818832
    819833Print statistics after every GC, depending on {{FLAG}}. A value of
     
    832846==== promise?
    833847
    834  [procedure] (promise? X)
     848<procedure>(promise? X)</procedure>
    835849
    836850Returns {{#t}} if {{X}} is a promise returned by {{delay}}, or
     
    844858==== reverse-list->string
    845859
    846  [procedure] (reverse-list->string LIST)
     860<procedure>(reverse-list->string LIST)</procedure>
    847861
    848862Returns a string with the characters in {{LIST}} in reverse order. This is
     
    855869==== gensym
    856870
    857  [procedure] (gensym [STRING-OR-SYMBOL])
     871<procedure>(gensym [STRING-OR-SYMBOL])</procedure>
    858872
    859873Returns a newly created uninterned symbol. If an argument is provided,
     
    863877==== string->uninterned-symbol
    864878
    865  [procedure] (string->uninterned-symbol STRING)
     879<procedure>(string->uninterned-symbol STRING)</procedure>
    866880
    867881Returns a newly created, unique symbol with the name {{STRING}}.
     
    873887==== port?
    874888
    875  [procedure] (port? X)
     889<procedure>(port? X)</procedure>
    876890
    877891Returns {{#t}} if {{X}} is a port object or {{#f}}
     
    881895==== print
    882896
    883  [procedure] (print [EXP1 ...])
     897<procedure>(print [EXP1 ...])</procedure>
    884898
    885899Outputs the optional arguments {{EXP1 ...}} using {{display}} and
     
    890904==== print*
    891905
    892  [procedure] (print* [EXP1 ...])
     906<procedure>(print* [EXP1 ...])</procedure>
    893907
    894908Similar to {{print}}, but does not output a terminating newline
     
    902916==== char-name
    903917
    904  [procedure] (char-name SYMBOL-OR-CHAR [CHAR])
     918<procedure>(char-name SYMBOL-OR-CHAR [CHAR])</procedure>
    905919
    906920This procedure can be used to inquire about character names or to
     
    936950==== make-blob
    937951
    938  [procedure] (make-blob SIZE)
     952<procedure>(make-blob SIZE)</procedure>
    939953
    940954Returns a blob object of {{SIZE}} bytes, aligned on an 8-byte boundary,
     
    943957==== blob?
    944958
    945  [procedure] (blob? X)
     959<procedure>(blob? X)</procedure>
    946960
    947961Returns {{#t}} if {{X}} is a blob object, or
     
    950964==== blob-size
    951965
    952  [procedure] (blob-size BLOB)
     966<procedure>(blob-size BLOB)</procedure>
    953967
    954968Returns the number of bytes in {{BLOB}}.
     
    956970==== blob->string
    957971
    958  [procedure] (blob->string BLOB)
     972<procedure>(blob->string BLOB)</procedure>
    959973
    960974Returns a string with the contents of {{BLOB}}.
     
    962976==== string->blob
    963977
    964  [procedure] (string->blob STRING)
     978<procedure>(string->blob STRING)</procedure>
    965979
    966980Returns a blob with the contents of {{STRING}}.
     
    968982==== blob=?
    969983
    970  [procedure] (blob=? BLOB1 BLOB2)
     984<procedure>(blob=? BLOB1 BLOB2)</procedure>
    971985
    972986Returns {{#t}} if the two argument blobs are of the same
     
    979993==== vector-copy!
    980994
    981  [procedure] (vector-copy! VECTOR1 VECTOR2 [COUNT])
     995<procedure>(vector-copy! VECTOR1 VECTOR2 [COUNT])</procedure>
    982996
    983997Copies contents of {{VECTOR1}} into {{VECTOR2}}. If the
     
    9911005==== vector-resize
    9921006
    993  [procedure] (vector-resize VECTOR N [INIT])
     1007<procedure>(vector-resize VECTOR N [INIT])</procedure>
    9941008
    9951009Creates and returns a new vector with the contents of {{VECTOR}} and length
     
    10041018==== void
    10051019
    1006  [procedure] (void)
     1020<procedure>(void)</procedure>
    10071021
    10081022Returns an unspecified value.
     
    10141028==== call/cc
    10151029
    1016  [procedure] (call/cc PROCEDURE)
     1030<procedure>(call/cc PROCEDURE)</procedure>
    10171031
    10181032An alias for {{call-with-current-continuation}}.
     
    10211035==== continuation-capture
    10221036
    1023  [procedure] (continuation-capture PROCEDURE)
     1037<procedure>(continuation-capture PROCEDURE)</procedure>
    10241038
    10251039Creates a continuation object representing the current continuation and
     
    10331047==== continuation?
    10341048
    1035  [procedure] (continuation? X)
     1049<procedure>(continuation? X)</procedure>
    10361050
    10371051Returns {{#t}} if {{X}} is a continuation object, or {{#f}} otherwise. Please
     
    10441058==== continuation-graft
    10451059
    1046  [procedure] (continuation-graft CONT THUNK)
     1060<procedure>(continuation-graft CONT THUNK)</procedure>
    10471061
    10481062Calls the procedure {{THUNK}} with no arguments and the implicit continuation
     
    10521066==== continuation-return
    10531067
    1054  [procedure] (continuation-return CONT VALUE ...)
     1068<procedure>(continuation-return CONT VALUE ...)</procedure>
    10551069
    10561070Returns the value(s) to the continuation {{CONT}}. {{continuation-return}} could
     
    10731087==== setter
    10741088
    1075  [procedure] (setter PROCEDURE)
     1089<procedure>(setter PROCEDURE)</procedure>
    10761090
    10771091Returns the setter-procedure of {{PROCEDURE}}, or signals an error if
     
    10851099==== getter-with-setter
    10861100
    1087  [procedure] (getter-with-setter GETTER SETTER)
     1101<procedure>(getter-with-setter GETTER SETTER)</procedure>
    10881102
    10891103Returns a copy of the procedure {{GETTER}} with the associated setter procedure
     
    10971111==== define-reader-ctor
    10981112
    1099  [procedure] (define-reader-ctor SYMBOL PROC)
     1113<procedure>(define-reader-ctor SYMBOL PROC)</procedure>
    11001114
    11011115Define new read-time constructor for {{#,}} read syntax. For further information, see
     
    11051119==== set-read-syntax!
    11061120
    1107  [procedure] (set-read-syntax! CHAR-OR-SYMBOL PROC)
     1121<procedure>(set-read-syntax! CHAR-OR-SYMBOL PROC)</procedure>
    11081122
    11091123When the reader encounters the non-whitespace character {{CHAR}} while reading
     
    11421156==== set-sharp-read-syntax!
    11431157
    1144  [procedure] (set-sharp-read-syntax! CHAR-OR-SYMBOL PROC)
     1158<procedure>(set-sharp-read-syntax! CHAR-OR-SYMBOL PROC)</procedure>
    11451159
    11461160Similar to {{set-read-syntax!}}, but allows defining new {{#<CHAR> ...}} reader syntax.
     
    11501164==== set-parameterized-read-syntax!
    11511165
    1152  [procedure] (set-parameterized-read-syntax! CHAR-OR-SYMBOL PROC)
     1166<procedure>(set-parameterized-read-syntax! CHAR-OR-SYMBOL PROC)</procedure>
    11531167
    11541168Similar to {{set-sharp-read-syntax!}}, but intended for defining reader syntax of the
     
    11611175==== copy-read-table
    11621176
    1163  [procedure] (copy-read-table READ-TABLE)
     1177<procedure>(copy-read-table READ-TABLE)</procedure>
    11641178
    11651179Returns a copy of the given read-table. You can access the currently active read-table
  • chicken/trunk/manual/Unit ports

    r11646 r13659  
    1212==== with-output-to-port
    1313
    14  [procedure] (with-output-to-port PORT THUNK)
     14<procedure>(with-output-to-port PORT THUNK)</procedure>
    1515
    1616Call procedure {{THUNK}} with the current output-port temporarily
     
    1919==== make-input-port
    2020
    21  [procedure] (make-input-port READ READY? CLOSE [PEEK])
     21<procedure>(make-input-port READ READY? CLOSE [PEEK])</procedure>
    2222
    2323Returns a custom input port. Common operations on this
     
    3737==== make-output-port
    3838
    39  [procedure] (make-output-port WRITE CLOSE [FLUSH])
     39<procedure>(make-output-port WRITE CLOSE [FLUSH])</procedure>
    4040
    4141Returns a custom output port. Common operations on this port are handled
     
    4949==== with-error-output-to-port
    5050
    51  [procedure] (with-error-output-to-port PORT THUNK)
     51<procedure>(with-error-output-to-port PORT THUNK)</procedure>
    5252
    5353Call procedure {{THUNK}} with the current error output-port
     
    5757==== with-input-from-port
    5858
    59  [procedure] (with-input-from-port PORT THUNK)
     59<procedure>(with-input-from-port PORT THUNK)</procedure>
    6060
    6161Call procedure {{THUNK}} with the current input-port temporarily
     
    6767==== call-with-input-string
    6868
    69  [procedure] (call-with-input-string STRING PROC)
     69<procedure>(call-with-input-string STRING PROC)</procedure>
    7070
    7171Calls the procedure {{PROC}} with a single argument that is a
     
    7575==== call-with-output-string
    7676
    77  [procedure] (call-with-output-string PROC)
     77<procedure>(call-with-output-string PROC)</procedure>
    7878
    7979Calls the procedure {{PROC}} with a single argument that is a
     
    8383==== with-input-from-string
    8484
    85  [procedure] (with-input-from-string STRING THUNK)
     85<procedure>(with-input-from-string STRING THUNK)</procedure>
    8686
    8787Call procedure {{THUNK}} with the current input-port temporarily
     
    9191==== with-output-to-string
    9292
    93  [procedure] (with-output-to-string THUNK)
     93<procedure>(with-output-to-string THUNK)</procedure>
    9494
    9595Call procedure {{THUNK}} with the current output-port temporarily
     
    101101==== port-for-each
    102102
    103  [procedure] (port-for-each FN THUNK)
     103<procedure>(port-for-each FN THUNK)</procedure>
    104104
    105105Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}}
     
    108108==== port-map
    109109
    110  [procedure] (port-map FN THUNK)
     110<procedure>(port-map FN THUNK)</procedure>
    111111
    112112Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}}
     
    115115==== port-fold
    116116
    117  [procedure] (port-map FN ACC THUNK)
     117<procedure>(port-map FN ACC THUNK)</procedure>
    118118
    119119Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}},
     
    126126==== make-broadcast-port
    127127
    128  [procedure] (make-broadcast-port PORT ...)
     128<procedure>(make-broadcast-port PORT ...)</procedure>
    129129
    130130Returns a custom output port that emits everything written into it to
     
    134134==== make-concatenated-port
    135135
    136  [procedure] (make-concatenated-port PORT1 PORT2 ...)
     136<procedure>(make-concatenated-port PORT1 PORT2 ...)</procedure>
    137137
    138138Returns a custom input port that reads its input from {{PORT1}}, until it
  • chicken/trunk/manual/Unit posix

    r12790 r13659  
    7171==== change-directory
    7272
    73  [procedure] (change-directory NAME)
     73<procedure>(change-directory NAME)</procedure>
    7474
    7575Changes the current working directory to {{NAME}}.
     
    7777==== current-directory
    7878
    79  [procedure] (current-directory [DIR])
     79<procedure>(current-directory [DIR])</procedure>
    8080
    8181Returns the name of the current working directory. If the optional argument {{DIR}} is given,
     
    8484==== create-directory
    8585
    86  [procedure] (create-directory NAME)
    87 
    88 Creates a directory with the pathname {{NAME}}.
     86<procedure>(create-directory NAME #!optional PARENTS?)</procedure>
     87
     88Creates a directory with the pathname {{NAME}}.  If the {{PARENTS?}} argument
     89is given and not false, any nonextant parent directories are also created.
    8990
    9091==== delete-directory
    9192
    92  [procedure] (delete-directory NAME)
     93<procedure>(delete-directory NAME)</procedure>
    9394
    9495Deletes the directory with the pathname {{NAME}}. The directory has
     
    9798==== directory
    9899
    99  [procedure] (directory [PATHNAME [SHOW-DOTFILES?]])
     100<procedure>(directory [PATHNAME [SHOW-DOTFILES?]])</procedure>
    100101
    101102Returns a list with all files that are contained in the directory with the name {{PATHNAME}}
     
    105106==== directory?
    106107
    107  [procedure] (directory? NAME)
     108<procedure>(directory? NAME)</procedure>
    108109
    109110Returns {{#t}} if there exists a file with the name {{NAME}}
     
    112113==== glob
    113114
    114  [procedure] (glob PATTERN1 ...)
     115<procedure>(glob PATTERN1 ...)</procedure>
    115116
    116117Returns a list of the pathnames of all existing files matching
     
    121122==== canonical-path
    122123
    123  [procedure] (canonical-path NAME)
     124<procedure>(canonical-path NAME)</procedure>
    124125
    125126Returns a canonical path for {{NAME}}, which should be a string
     
    144145==== set-root-directory!
    145146
    146  [procedure] (set-root-directory! STRING)
     147<procedure>(set-root-directory! STRING)</procedure>
    147148
    148149Sets the root directory for the current process to the path given in {{STRING}}
     
    156157==== call-with-output-pipe
    157158
    158  [procedure] (call-with-input-pipe CMDLINE PROC [MODE])
    159  [procedure] (call-with-output-pipe CMDLINE PROC [MODE])
     159<procedure>(call-with-input-pipe CMDLINE PROC [MODE])</procedure>
     160<procedure>(call-with-output-pipe CMDLINE PROC [MODE])</procedure>
    160161
    161162Call {{PROC}} with a single argument: a input- or output port
     
    167168==== close-output-pipe
    168169
    169  [procedure] (close-input-pipe PORT)
    170  [procedure] (close-output-pipe PORT)
     170<procedure>(close-input-pipe PORT)</procedure>
     171<procedure>(close-output-pipe PORT)</procedure>
    171172
    172173Closes the pipe given in {{PORT}} and waits until the connected
     
    176177==== create-pipe
    177178
    178  [procedure] (create-pipe)
     179<procedure>(create-pipe)</procedure>
    179180
    180181The fundamental pipe-creation operator. Calls the C function
     
    184185==== open-input-pipe
    185186
    186  [procedure] (open-input-pipe CMDLINE [MODE])
     187<procedure>(open-input-pipe CMDLINE [MODE])</procedure>
    187188
    188189Spawns a subprocess with the command-line string {{CMDLINE}} and
     
    193194==== open-output-pipe
    194195
    195  [procedure] (open-output-pipe CMDLINE [MODE])
     196<procedure>(open-output-pipe CMDLINE [MODE])</procedure>
    196197
    197198Spawns a subprocess with the command-line string {{CMDLINE}} and
     
    207208==== with-output-to-pipe
    208209
    209  [procedure] (with-input-from-pipe CMDLINE THUNK [MODE])
    210  [procedure] (with-output-to-pipe CMDLINE THUNK [MODE])
     210<procedure>(with-input-from-pipe CMDLINE THUNK [MODE])</procedure>
     211<procedure>(with-output-to-pipe CMDLINE THUNK [MODE])</procedure>
    211212
    212213Temporarily set the value of
     
    240241==== create-fifo
    241242
    242  [procedure] (create-fifo FILENAME [MODE])
     243<procedure>(create-fifo FILENAME [MODE])</procedure>
    243244
    244245Creates a FIFO with the name {{FILENAME}} and the permission bits
     
    246247
    247248<enscript highlight=scheme>
    248  [procedure] (+ perm/irwxu perm/irwxg perm/irwxo)
     249 (+ perm/irwxu perm/irwxg perm/irwxo)
    249250</enscript>
    250251
    251252==== fifo?
    252253
    253  [procedure] (fifo? FILENAME)
     254<procedure>(fifo? FILENAME)</procedure>
    254255
    255256Returns {{#t}} if the file with the name {{FILENAME}} names
     
    261262==== duplicate-fileno
    262263
    263  [procedure] (duplicate-fileno OLD [NEW])
     264<procedure>(duplicate-fileno OLD [NEW])</procedure>
    264265
    265266If {{NEW}} is given, then the file-descriptor {{NEW}} is opened
     
    269270==== file-close
    270271
    271  [procedure] (file-close FILENO)
     272<procedure>(file-close FILENO)</procedure>
    272273
    273274Closes the input/output file with the file-descriptor {{FILENO}}.
     
    275276==== file-open
    276277
    277  [procedure] (file-open FILENAME FLAGS [MODE])
     278<procedure>(file-open FILENAME FLAGS [MODE])</procedure>
    278279
    279280Opens the file specified with the string {{FILENAME}} and open-flags
     
    289290==== file-mkstemp
    290291
    291  [procedure] (file-mkstemp TEMPLATE-FILENAME)
     292<procedure>(file-mkstemp TEMPLATE-FILENAME)</procedure>
    292293
    293294Create a file based on the given {{TEMPLATE-FILENAME}}, in which
     
    309310==== file-read
    310311
    311  [procedure] (file-read FILENO SIZE [BUFFER])
     312<procedure>(file-read FILENO SIZE [BUFFER])</procedure>
    312313
    313314Reads {{SIZE}} bytes from the file with the file-descriptor
     
    319320==== file-select
    320321
    321  [procedure] (file-select READFDLIST WRITEFDLIST [TIMEOUT])
     322<procedure>(file-select READFDLIST WRITEFDLIST [TIMEOUT])</procedure>
    322323
    323324Waits until any of the file-descriptors given in the lists
     
    336337==== file-write
    337338
    338  [procedure] (file-write FILENO BUFFER [SIZE])
     339<procedure>(file-write FILENO BUFFER [SIZE])</procedure>
    339340
    340341Writes the contents of the string or bytevector {{BUFFER}} into
     
    345346==== file-control
    346347
    347  [procedure] (file-control FILENO COMMAND [ARGUMENT])
     348<procedure>(file-control FILENO COMMAND [ARGUMENT])</procedure>
    348349
    349350Performs the fcntl operation {{COMMAND}} with the given
     
    354355==== open-output-file*
    355356
    356  [procedure] (open-input-file* FILENO [OPENMODE])
    357  [procedure] (open-output-file* FILENO [OPENMODE])
     357<procedure>(open-input-file* FILENO [OPENMODE])</procedure>
     358<procedure>(open-output-file* FILENO [OPENMODE])</procedure>
    358359
    359360Opens file for the file-descriptor {{FILENO}} for input or output
     
    365366==== port->fileno
    366367
    367  [procedure] (port->fileno PORT)
     368<procedure>(port->fileno PORT)</procedure>
    368369
    369370If {{PORT}} is a file- or tcp-port, then a file-descriptor is returned for
     
    377378==== file-modification-time
    378379
    379  [procedure] (file-access-time FILE)
    380  [procedure] (file-change-time FILE)
    381  [procedure] (file-modification-time FILE)
     380<procedure>(file-access-time FILE)</procedure>
     381<procedure>(file-change-time FILE)</procedure>
     382<procedure>(file-modification-time FILE)</procedure>
    382383
    383384Returns time (in seconds) of the last access, modification or change of {{FILE}}. {{FILE}}
     
    387388==== file-stat
    388389
    389  [procedure] (file-stat FILE [LINK])
     390<procedure>(file-stat FILE [LINK])</procedure>
    390391
    391392Returns a 13-element vector with the following contents: inode-number,
     
    404405==== file-position
    405406
    406  [procedure] (file-position FILE)
     407<procedure>(file-position FILE)</procedure>
    407408
    408409Returns the current file position of {{FILE}}, which should be a
     
    411412==== file-size
    412413
    413  [procedure] (file-size FILENAME)
     414<procedure>(file-size FILENAME)</procedure>
    414415
    415416Returns the size of the file designated by {{FILE}}.  {{FILE}}
     
    420421==== regular-file?
    421422
    422  [procedure] (regular-file? FILENAME)
     423<procedure>(regular-file? FILENAME)</procedure>
    423424
    424425Returns true, if {{FILENAME}} names a regular file (not a directory or symbolic link).
     
    426427==== file-owner
    427428
    428  [procedure] (file-owner FILE)
     429<procedure>(file-owner FILE)</procedure>
    429430
    430431Returns the user-id of {{FILE}}.  {{FILE}} may be a filename
     
    433434==== file-permissions
    434435
    435  [procedure] (file-permissions FILE)
     436<procedure>(file-permissions FILE)</procedure>
    436437
    437438Returns the permission bits for {{FILE}}. You can test this value
     
    443444==== file-execute-access?
    444445
    445  [procedure] (file-read-access? FILENAME)
    446  [procedure] (file-write-access? FILENAME)
    447  [procedure] (file-execute-access? FILENAME)
     446<procedure>(file-read-access? FILENAME)</procedure>
     447<procedure>(file-write-access? FILENAME)</procedure>
     448<procedure>(file-execute-access? FILENAME)</procedure>
    448449
    449450These procedures return {{#t}} if the current user has read,
     
    459460==== stat-socket?
    460461
    461  [procedure] (stat-regular? FILENAME)
    462  [procedure] (stat-directory? FILENAME)
    463  [procedure] (stat-char-device? FILENAME)
    464  [procedure] (stat-block-device? FILENAME)
    465  [procedure] (stat-fifo? FILENAME)
    466  [procedure] (stat-symlink? FILENAME)
    467  [procedure] (stat-socket? FILENAME)
     462<procedure>(stat-regular? FILENAME)</procedure>
     463<procedure>(stat-directory? FILENAME)</procedure>
     464<procedure>(stat-char-device? FILENAME)</procedure>
     465<procedure>(stat-block-device? FILENAME)</procedure>
     466<procedure>(stat-fifo? FILENAME)</procedure>
     467<procedure>(stat-symlink? FILENAME)</procedure>
     468<procedure>(stat-socket? FILENAME)</procedure>
    468469
    469470These procedures return {{#t}} if the {{FILENAME}} given is of the
     
    475476==== file-truncate
    476477
    477  [procedure] (file-truncate FILE OFFSET)
     478<procedure>(file-truncate FILE OFFSET)</procedure>
    478479
    479480Truncates the file {{FILE}} to the length {{OFFSET}},
     
    484485==== set-file-position!
    485486
    486  [procedure] (set-file-position! FILE POSITION [WHENCE])
    487  [procedure] (set! (file-position FILE) POSITION)
     487<procedure>(set-file-position! FILE POSITION [WHENCE])</procedure>
     488<procedure>(set! (file-position FILE) POSITION)</procedure>
    488489
    489490Sets the current read/write position of {{FILE}} to
     
    498499==== change-file-mode
    499500
    500  [procedure] (change-file-mode FILENAME MODE)
     501<procedure>(change-file-mode FILENAME MODE)</procedure>
    501502
    502503Changes the current file mode of the file named {{FILENAME}}
     
    507508==== change-file-owner
    508509
    509  [procedure] (change-file-owner FILENAME UID GID)
     510<procedure>(change-file-owner FILENAME UID GID)</procedure>
    510511
    511512Changes the owner information of the file named {{FILENAME}} to
     
    518519==== current-process-id
    519520
    520  [procedure] (current-process-id)
     521<procedure>(current-process-id)</procedure>
    521522
    522523Returns the process ID of the current process.
     
    524525==== parent-process-id
    525526
    526  [procedure] (parent-process-id)
     527<procedure>(parent-process-id)</procedure>
    527528
    528529Returns the process ID of the parent of the current process.
     
    530531==== process-group-id
    531532
    532  [procedure] (process-group-id PID)
     533<procedure>(process-group-id PID)</procedure>
    533534
    534535Returns the process group ID of the process specified by {{PID}}.
     
    536537==== process-execute
    537538
    538  [procedure] (process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST]])
     539<procedure>(process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST]])</procedure>
    539540
    540541Creates a new child process and replaces the running process with it
     
    550551==== process-fork
    551552
    552  [procedure] (process-fork [THUNK])
     553<procedure>(process-fork [THUNK])</procedure>
    553554
    554555Creates a new child process with the UNIX system call
     
    559560==== process-run
    560561
    561  [procedure] (process-run COMMANDLINE])
    562  [procedure] (process-run COMMAND ARGUMENT-LIST)
     562<procedure>(process-run COMMANDLINE])</procedure>
     563<procedure>(process-run COMMAND ARGUMENT-LIST)</procedure>
    563564
    564565Creates a new child process. The PID of the new process is returned.
     
    570571==== process-signal
    571572
    572  [procedure] (process-signal PID [SIGNAL])
     573<procedure>(process-signal PID [SIGNAL])</procedure>
    573574
    574575Sends {{SIGNAL}} to the process with the id {{PID}} using the
     
    578579==== process-wait
    579580
    580  [procedure] (process-wait [PID [NOHANG]])
     581<procedure>(process-wait [PID [NOHANG]])</procedure>
    581582
    582583Suspends the current process until the child process with
     
    593594==== process
    594595
    595  [procedure] (process COMMANDLINE)
    596  [procedure] (process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])
     596<procedure>(process COMMANDLINE)</procedure>
     597<procedure>(process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])</procedure>
    597598
    598599Creates a subprocess and returns three values: an input port from
     
    612613==== process*
    613614
    614  [procedure] (process* COMMANDLINE)
    615  [procedure] (process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])
     615<procedure>(process* COMMANDLINE)</procedure>
     616<procedure>(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])</procedure>
    616617
    617618Like {{process}} but returns 4 values: an input port from
     
    623624==== sleep
    624625
    625  [procedure] (sleep SECONDS)
     626<procedure>(sleep SECONDS)</procedure>
    626627
    627628Puts the process to sleep for {{SECONDS}}. Returns either 0 if
     
    631632==== create-session
    632633
    633  [procedure] (create-session)
     634<procedure>(create-session)</procedure>
    634635
    635636Creates a new session if the calling process is not a process group leader and returns
     
    641642==== symbolic-link?
    642643
    643  [procedure] (symbolic-link? FILENAME)
     644<procedure>(symbolic-link? FILENAME)</procedure>
    644645
    645646Returns true, if {{FILENAME}} names a symbolic link.
     
    647648==== create-symbolic-link
    648649
    649  [procedure] (create-symbolic-link OLDNAME NEWNAME)
     650<procedure>(create-symbolic-link OLDNAME NEWNAME)</procedure>
    650651
    651652Creates a symbolic link with the filename {{NEWNAME}} that points
     
    654655==== read-symbolic-link
    655656
    656  [procedure] (read-symbolic-link FILENAME)
     657<procedure>(read-symbolic-link FILENAME)</procedure>
    657658
    658659Returns the filename to which the symbolic link {{FILENAME}} points.
     
    660661==== file-link
    661662
    662  [procedure] (file-link OLDNAME NEWNAME)
     663<procedure>(file-link OLDNAME NEWNAME)</procedure>
    663664
    664665Creates a hard link from {{OLDNAME}} to {{NEWNAME}} (both strings).
     
    669670==== current-user-id
    670671
    671  [procedure] (current-user-id)
     672<procedure>(current-user-id)</procedure>
    672673 [setter] (set! (current-user-id) UID)
    673674
     
    676677==== current-effective-user-id
    677678
    678  [procedure] (current-effective-user-id)
     679<procedure>(current-effective-user-id)</procedure>
    679680 [setter] (set! (current-effective-user-id) UID)
    680681
     
    683684==== user-information
    684685
    685  [procedure] (user-information USER [AS-VECTOR])
     686<procedure>(user-information USER [AS-VECTOR])</procedure>
    686687
    687688If {{USER}} specifes a valid username (as a string) or user ID, then the user
     
    694695==== current-group-id
    695696
    696  [procedure] (current-group-id)
     697<procedure>(current-group-id)</procedure>
    697698 [setter] (set! (current-group-id) GID)
    698699
     
    701702==== current-effective-group-id
    702703
    703  [procedure] (current-effective-group-id)
     704<procedure>(current-effective-group-id)</procedure>
    704705 [setter] (set! (current-effective-group-id) GID)
    705706
     
    709710==== group-information
    710711
    711  [procedure] (group-information GROUP)
     712<procedure>(group-information GROUP)</procedure>
    712713
    713714If {{GROUP}} specifies a valid group-name or group-id, then this
     
    718719==== get-groups
    719720
    720  [procedure] (get-groups)
     721<procedure>(get-groups)</procedure>
    721722
    722723Returns a list with the supplementary group IDs of the current user.
     
    727728==== set-groups!
    728729
    729  [procedure] (set-groups! GIDLIST)
     730<procedure>(set-groups! GIDLIST)</procedure>
    730731
    731732Sets the supplementrary group IDs of the current user to the IDs given in the list {{GIDLIST}}.
     
    735736==== initialize-groups
    736737
    737  [procedure] (initialize-groups USERNAME BASEGID)
     738<procedure>(initialize-groups USERNAME BASEGID)</procedure>
    738739
    739740Sets the supplementrary group IDs of the current user to the IDs from the user with name {{USERNAME}}
     
    744745==== set-process-group-id!
    745746
    746  [procedure] (set-process-group-id! PID PGID)
     747<procedure>(set-process-group-id! PID PGID)</procedure>
    747748 [setter] (set! (process-group-id PID) PGID)
    748749
     
    754755==== file-lock
    755756
    756  [procedure] (file-lock PORT [START [LEN]])
     757<procedure>(file-lock PORT [START [LEN]])</procedure>
    757758
    758759Locks the file associated with {{PORT}} for reading or
     
    765766==== file-lock/blocking
    766767
    767  [procedure] (file-lock/blocking PORT [START [LEN]])
     768<procedure>(file-lock/blocking PORT [START [LEN]])</procedure>
    768769
    769770Similar to {{file-lock}}, but if a lock is held on the file,
     
    772773==== file-test-lock
    773774
    774  [procedure] (file-test-lock PORT [START [LEN]])
     775<procedure>(file-test-lock PORT [START [LEN]])</procedure>
    775776
    776777Tests whether the file associated with {{PORT}} is locked for reading
     
    780781==== file-unlock
    781782
    782  [procedure] (file-unlock LOCK)
     783<procedure>(file-unlock LOCK)</procedure>
    783784
    784785Unlocks the previously locked portion of a file given in {{LOCK}}.
     
    789790==== set-alarm!
    790791
    791  [procedure] (set-alarm! SECONDS)
     792<procedure>(set-alarm! SECONDS)</procedure>
    792793
    793794Sets an internal timer to raise the {{signal/alrm}}
     
    797798==== set-signal-handler!
    798799
    799  [procedure] (set-signal-handler! SIGNUM PROC)
     800<procedure>(set-signal-handler! SIGNUM PROC)</procedure>
    800801
    801802Establishes the procedure of one argument {{PROC}} as the handler
    802803for the signal with the code {{SIGNUM}}. {{PROC}} is called
    803804with the signal number as its sole argument. If the argument {{PROC}} is {{#f}}
    804 then any signal handler will be removed.
     805then any signal handler will be removed, and the corresponding signal set to {{SIG_IGN}}.
    805806
    806807Note that is is unspecified in which thread of execution the signal handler will be invoked.
     
    808809==== signal-handler
    809810
    810  [procedure] (signal-handler SIGNUM)
     811<procedure>(signal-handler SIGNUM)</procedure>
    811812
    812813Returns the signal handler for the code {{SIGNUM}} or {{#f}}.
     
    814815==== set-signal-mask!
    815816
    816  [procedure] (set-signal-mask! SIGLIST)
     817<procedure>(set-signal-mask! SIGLIST)</procedure>
    817818
    818819Sets the signal mask of the current process to block all signals given
     
    822823==== signal-mask
    823824
    824  [procedure] (signal-mask)
     825<procedure>(signal-mask)</procedure>
    825826
    826827Returns the signal mask of the current process.
     
    828829==== signal-masked?
    829830
    830  [procedure] (signal-masked? SIGNUM)
     831<procedure>(signal-masked? SIGNUM)</procedure>
    831832
    832833Returns whether the signal for the code {{SIGNUM}} is currently masked.
     
    834835==== signal-mask!
    835836
    836  [procedure] (signal-mask! SIGNUM)
     837<procedure>(signal-mask! SIGNUM)</procedure>
    837838
    838839Masks (blocks) the signal for the code {{SIGNUM}}.
     
    840841==== signal-unmask!
    841842
    842  [procedure] (signal-unmask! SIGNUM)
     843<procedure>(signal-unmask! SIGNUM)</procedure>
    843844
    844845Unmasks (unblocks) the signal for the code {{SIGNUM}}.
     
    875876=== Environment access
    876877
    877 ==== get-environment-variables
     878==== current-environment
    878879
    879880 [procedure] (get-environment-variables)
     
    884885==== setenv
    885886
    886  [procedure] (setenv VARIABLE VALUE)
     887<procedure>(setenv VARIABLE VALUE)</procedure>
    887888
    888889Sets the environment variable named {{VARIABLE}} to
     
    892893==== unsetenv
    893894
    894  [procedure] (unsetenv VARIABLE)
     895<procedure>(unsetenv VARIABLE)</procedure>
    895896
    896897Removes the definition of the environment variable {{VARIABLE}} from
     
    910911==== map-file-to-memory
    911912
    912  [procedure] (map-file-to-memory ADDRESS LEN PROTECTION FLAG FILENO [OFFSET])
     913<procedure>(map-file-to-memory ADDRESS LEN PROTECTION FLAG FILENO [OFFSET])</procedure>
    913914
    914915Maps a section of a file to memory using the C function
     
    927928==== memory-mapped-file-pointer
    928929
    929  [procedure] (memory-mapped-file-pointer MMAP)
     930<procedure>(memory-mapped-file-pointer MMAP)</procedure>
    930931
    931932Returns a machine pointer to the start of the memory region to which
     
    934935==== unmap-file-from-memory
    935936
    936  [procedure] (unmap-file-from-memory MMAP [LEN])
     937<procedure>(unmap-file-from-memory MMAP [LEN])</procedure>
    937938
    938939Unmaps the section of a file mapped to memory using the C function
     
    947948==== seconds->local-time
    948949
    949  [procedure] (seconds->local-time SECONDS)
     950<procedure>(seconds->local-time SECONDS)</procedure>
    950951
    951952Breaks down the time value represented in {{SECONDS}} into a 10
     
    966967==== local-time->seconds
    967968
    968  [procedure] (local-time->seconds VECTOR)
     969<procedure>(local-time->seconds VECTOR)</procedure>
    969970
    970971Converts the ten-element vector {{VECTOR}} representing the time value relative to
     
    974975==== local-timezone-abbreviation
    975976
    976  [procedure] (local-timezone-abbreviation)
     977<procedure>(local-timezone-abbreviation)</procedure>
    977978
    978979Returns the abbreviation for the local timezone as a string.
     
    980981==== seconds->string
    981982
    982  [procedure] (seconds->string SECONDS)
     983<procedure>(seconds->string SECONDS)</procedure>
    983984
    984985Converts the local time represented in {{SECONDS}} into a string
     
    987988==== seconds->utc-time
    988989
    989  [procedure] (seconds->utc-time SECONDS)
     990<procedure>(seconds->utc-time SECONDS)</procedure>
    990991
    991992Similar to {{seconds->local-time}}, but interpretes {{SECONDS}}
     
    994995==== utc-time->seconds
    995996
    996  [procedure] (utc-time->seconds VECTOR)
     997<procedure>(utc-time->seconds VECTOR)</procedure>
    997998
    998999Converts the ten-element vector {{VECTOR}} representing the UTC time value into
     
    10011002==== time->string
    10021003
    1003  [procedure] (time->string VECTOR [FORMAT])
     1004<procedure>(time->string VECTOR)</procedure>
    10041005
    10051006Converts the broken down time represented in the 10 element vector
     
    10241025==== _exit
    10251026
    1026  [procedure] (_exit [CODE])
     1027<procedure>(_exit [CODE])</procedure>
    10271028
    10281029Exits the current process without flushing any buffered output (using
     
    10641065==== find-files
    10651066
    1066  [procedure] (find-files DIRECTORY PREDICATE [ACTION [IDENTITY [LIMIT]]])
     1067<procedure>(find-files DIRECTORY PREDICATE [ACTION [IDENTITY [LIMIT]]])</procedure>
    10671068
    10681069Recursively traverses the contents of {{DIRECTORY}} (which should
     
    10891090==== get-host-name
    10901091
    1091  [procedure] (get-host-name)
     1092<procedure>(get-host-name)</procedure>
    10921093
    10931094Returns the hostname of the machine that this process is running on.
     
    10951096==== system-information
    10961097
    1097  [procedure] (system-information)
     1098<procedure>(system-information)</procedure>
    10981099
    10991100Invokes the UNIX system call {{uname()}} and returns a list of 5 values:
     
    11041105==== set-buffering-mode!
    11051106
    1106  [procedure] (set-buffering-mode! PORT MODE [BUFSIZE])
     1107<procedure>(set-buffering-mode! PORT MODE [BUFSIZE])</procedure>
    11071108
    11081109Sets the buffering-mode for the file associated with {{PORT}} to
     
    11161117==== terminal-name
    11171118
    1118  [procedure] (terminal-name PORT)
     1119<procedure>(terminal-name PORT)</procedure>
    11191120
    11201121Returns the name of the terminal that is connected to {{PORT}}.
     
    11221123==== terminal-port?
    11231124
    1124  [procedure] (terminal-port? PORT)
     1125<procedure>(terminal-port? PORT)</procedure>
    11251126
    11261127Returns {{#t}} if {{PORT}} is connected to a terminal and
     
    12291230Exceptions to the above procedure definitions.
    12301231
    1231  [procedure] (create-pipe [MODE])
     1232<procedure>(create-pipe [MODE])</procedure>
    12321233
    12331234The optional parameter {{MODE}}, default {{open/binary | open/noinherit}}. This can be {{open/binary}} or
    12341235{{open/text}}, optionally or'ed with {{open/noinherit}}.
    12351236
    1236  [procedure] (process-wait [PID [NOHANG]])
     1237<procedure>(process-wait [PID [NOHANG]])</procedure>
    12371238
    12381239{{process-wait}} always returns {{#t}} for a terminated process and only the exit
     
    12401241communication method.)
    12411242
    1242  [procedure] (process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])
    1243  [procedure] (process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
    1244  [procedure] (process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
     1243<procedure>(process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])</procedure>
     1244<procedure>(process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])</procedure>
     1245<procedure>(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])</procedure>
    12451246
    12461247The optional parameter {{EXACT-FLAG}}, default {{#f}}. When {{#f}} any argument string with
     
    12771278 set-root-directory!
    12781279 utc-time->seconds
    1279  string->time
    12801280
    12811281==== Additional Definitions
     
    13021302==== process-spawn
    13031303
    1304  [procedure] (process-spawn MODE COMMAND [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])
     1304<procedure>(process-spawn MODE COMMAND [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])</procedure>
    13051305
    13061306Creates and runs a new process with the given {{COMMAND}} filename and the optional
  • chicken/trunk/manual/Unit regex

    r12929 r13659  
    195195
    196196
    197 === make-anchored-pattern
    198 
    199  [procedure] (make-anchored-pattern REGEXP [WITHOUT-BOL [WITHOUT-EOL]])
    200 
    201 Makes an anchored pattern from {{REGEXP}} (a string or a precompiled regular
    202 expression) and returns the updated pattern. When {{WITHOUT-BOL}} is {{#t}} the
    203 beginning-of-line anchor is not added. When {{WITHOUT-EOL}} is {{#t}} the
    204 end-of-line anchor is not added.
    205 
    206 The {{WITHOUT-BOL}} and {WITHOUT-EOL}} arguments are ignored for a precompiled regular
    207 expression.
    208 
    209 
    210197Previous: [[Unit srfi-14]]
    211198
  • chicken/trunk/manual/Unit srfi-18

    r7187 r13659  
    3232
    3333** Any pending {{dynamic-wind}} thunks.
     34
     35* When an error is triggered inside the execution context of a thread, the default exception-handler will simply terminate the thread (and store the error condition for later use). Pending {{dynamic-wind}} thunks will ''not'' be invoked. Use a custom exception handler for the thread in that case.
    3436
    3537The following procedures are provided, in addition to the procedures defined in SRFI-18:
     
    8587the number of milliseconds since process startup.
    8688
     89=== milliseconds->time
     90
     91 [procedure] (milliseconds->time ms)
     92
     93Converts into a time object an exact integer representing
     94the number of milliseconds since process startup.
     95
     96This procedure may be useful in combination with {{thread-sleep!}} when your compilation unit is using {{(declare fixnum-arithmetic)}}.  In that case you won't be able to pass an inexact value to {{thread-sleep!}}, but you can do the following:
     97
     98 (define (thread-sleep!/ms ms)
     99   (thread-sleep!
     100    (milliseconds->time (+ ms (current-milliseconds)))))
    87101
    88102Previous: [[Unit regex]]
  • chicken/trunk/manual/Unit tcp

    r12227 r13659  
    1616=== tcp-listen
    1717
    18  [procedure] (tcp-listen TCPPORT [BACKLOG [HOST]])
     18<procedure>(tcp-listen TCPPORT [BACKLOG [HOST]])</procedure>
    1919
    2020Creates and returns a TCP listener object that listens for connections on {{TCPPORT}}, which
     
    2626=== tcp-listener?
    2727
    28  [procedure] (tcp-listener? X)
     28<procedure>(tcp-listener? X)</procedure>
    2929
    3030Returns {{#t}} if {{X}} is a TCP listener object, or {{#f}} otherwise.
     
    3333=== tcp-close
    3434
    35  [procedure] (tcp-close LISTENER)
     35<procedure>(tcp-close LISTENER)</procedure>
    3636
    3737Reclaims any resources associated with {{LISTENER}}.
     
    4040=== tcp-accept
    4141
    42  [procedure] (tcp-accept LISTENER)
     42<procedure>(tcp-accept LISTENER)</procedure>
    4343
    4444Waits until a connection is established on the port on which
     
    5252and {{tcp-write-timeout}}, respectively, to determine the maximal
    5353number of milliseconds to wait for input/output before a timeout
    54 error is signalled by raising an exception of the kinds {{(exn i/o net)}}.
     54error is signalled.
    5555
    5656Note: this operation and any I/O on the ports returned will not block
     
    6060=== tcp-accept-ready?
    6161
    62  [procedure] (tcp-accept-ready? LISTENER)
     62<procedure>(tcp-accept-ready? LISTENER)</procedure>
    6363
    6464Returns {{#t}} if there are any connections pending on {{LISTENER}}, or {{#f}}
     
    6868=== tcp-listener-port
    6969
    70  [procedure] (tcp-listener-port LISTENER)
     70<procedure>(tcp-listener-port LISTENER)</procedure>
    7171
    7272Returns the port number assigned to {{LISTENER}} (If you pass {{0}} to {{tcp-listen}},
     
    7575=== tcp-listener-fileno
    7676
    77  [procedure] (tcp-listener-fileno LISTENER)
     77<procedure>(tcp-listener-fileno LISTENER)</procedure>
    7878
    7979Returns the file-descriptor associated with {{LISTENER}}.
     
    8282=== tcp-connect
    8383
    84  [procedure] (tcp-connect HOSTNAME [TCPPORT])
     84<procedure>(tcp-connect HOSTNAME [TCPPORT])</procedure>
    8585
    8686Establishes a client-side TCP connection to the machine with the name
     
    9494{{tcp-write-timeout}}, respectively, to determine the maximal number
    9595of milliseconds to wait for input/output before a timeout error is
    96 signalled by raising an exception of the kinds {{(exn i/o net)}}.
     96signalled.
    9797
    9898If the {{TCPPORT}} is omitted, the port is parsed from the {{HOSTNAME}} string.  The format expected is {{HOSTNAME:PORT}}.  The {{PORT}} can either be a string representation of an integer or a service name which is translated to an integer using the POSIX function [[http://www.opengroup.org/onlinepubs/009695399/functions/getservbyname.html|{{getservbyname}}]].
     
    103103=== tcp-addresses
    104104
    105  [procedure] (tcp-addresses PORT)
     105<procedure>(tcp-addresses PORT)</procedure>
    106106
    107107Returns two values for the input- or output-port {{PORT}} (which should be a port returned
     
    113113=== tcp-port-numbers
    114114
    115  [procedure] (tcp-port-numbers PORT)
     115<procedure>(tcp-port-numbers PORT)</procedure>
    116116
    117117Returns two values for the input- or output-port {{PORT}} (which should be a port returned
     
    122122=== tcp-abandon-port
    123123
    124  [procedure] (tcp-abandon-port PORT)
     124<procedure>(tcp-abandon-port PORT)</procedure>
    125125
    126126Marks the socket port {{PORT}} as abandoned. This is mainly useful to close down a port
  • chicken/trunk/manual/Using the compiler

    r13538 r13659  
    373373; [parameter] user-pass : Holds a procedure of one argument. This procedure is applied to each toplevel expression '''after''' macro-expansion.  The result of the procedure is then compiled in place of the original expression.
    374374
    375 ; [parameter] user-pass-2 : Holds a procedure of one argument, which is called with the canonicalized node-graph as its sole argument. The result is ignored, so this pass has to mutate the node-structure to cause any effect.
    376 
    377375; [parameter] user-post-analysis-pass : Holds a procedure that will be called after every performed program analysis pass. The procedure (when defined) will be called with seven arguments: a symbol indicating the analysis pass, the program database, the current node graph, a getter and a setter-procedure which can be used to access and manipulate the program database, which holds various information about the compiled program, a pass iteration count, and an analysis continuation flag. The getter procedure should be called with two arguments: a symbol representing the binding for which information should be retrieved, and a symbol that specifies the database-entry. The current value of the database entry will be returned or {{#f}}, if no such entry is available. The setter procedure is called with three arguments: the symbol and key and the new value. The pass iteration count currently is meaningful only for the 'opt pass. The analysis continuation flag will be {{#f}} for the last 'opt pass. For information about the contents of the program database contact the author.
    378376
  • chicken/trunk/manual/faq

    r13452 r13659  
    9696There is an extension based on the GNU Multiprecision Package that implements most of the full
    9797numeric tower, see [[http://chicken.wiki.br/numbers|numbers]].
    98 
    99 
    100 ==== How can I specialize a generic function method to match instances of every class?
    101 
    102 Specializing a method on {{<object>}} doesn't work on primitive data objects like
    103 numbers, strings, etc. so for example
    104 
    105 <enscript highlight=scheme>
    106 (define-method (foo (x <my-class>)) ...)
    107 (define-method (foo (x <object>)) ...)
    108 (foo 123)
    109 </enscript>
    110 
    111 will signal an error, because to applicable method can be found. To specialize a method for primitive
    112 objects, use {{<top>}}:
    113 
    114 <enscript highlight=scheme>
    115 (define-method (foo (x <top>)) ...)
    116 </enscript>
    11798
    11899
     
    150131
    151132
    152 ==== Why do I get an "Error: invalid syntax: ..." using 'match' and 'syntax-case'?
    153 
    154 The built-in 'match' macro is incompatible with 'syntax-case'. Use the  [[http://www.call-with-current-continuation.org/eggs/matchable.html|matchable egg]] instead.
     133=== Why are `dynamic-wind' thunks not executed when a SRFI-18 thread signals an error?
     134
     135Here is what Marc Feeley, the author of [[http://srfi.schemers.org/srfi-18|SRFI-18]] has to
     136say about this subject:
     137
     138    >No the default exception handler shouldn't invoke the after
     139    > thunks of the current continuation.  That's because the
     140    > exception handler doesn't "continue" at the initial
     141    > continuation of that thread.  Here are the relevant words of
     142    > SRFI 18:
     143   
     144    >
     145    >  Moreover, in this dynamic environment the exception handler
     146    >  is bound to the "initial exception handler" which is a unary
     147    >  procedure which causes the (then) current thread to store in
     148    >  its end-exception field an "uncaught exception" object whose
     149    >  "reason" is the argument of the handler, abandon all mutexes
     150    >  it owns, and finally terminate.
     151    >
     152   
     153    >The rationale is that, when an uncaught exception occurs in a
     154    >thread the thread is in bad shape and things have gone
     155    >sufficiently wrong that there is no universally acceptable way to
     156    >continue execution.  Executing after thunks could require a
     157    >whole lot of processing that the thread is not in a shape to do.
     158    >So the safe thing is to terminate the thread.  If the programmer
     159    >knows how to recover from an exception, then he can capture the
     160    >continuation early on, and install an exception handler which
     161    >invokes the continuation.  When the continuation is invoked the
     162    >after thunks will execute.
    155163
    156164
  • chicken/trunk/scripts/wiki2html.scm

    r13581 r13659  
    44
    55
    6 (use regex srfi-1 extras utils)
     6(use regex srfi-1 extras utils srfi-13 posix)
    77(use htmlprag matchable)
    88
     
    4444;;; Global state
    4545
    46 (define *toc* #f)
    4746(define *tags* '())
    4847(define *open* '())
     48(define *manual-pages* '())
    4949
    5050(define (push-tag tag out)
     
    133133                     (first m)
    134134                     (continue m))))
    135                  ((string-search(rx `(: bos ,+link+)) rest) =>
     135                 ((string-search (rx `(: bos ,+link+)) rest) =>
    136136                  (lambda (m)
    137                     (string-append
    138                      "<a href='" (clean (second m)) "'>"
    139                      (clean (or (third m) (second m)))
    140                      "</a>"
    141                      (continue m))))
     137                    (let ((m1 (string-trim-both (second m))))
     138                      (string-append
     139                       (cond ((or (string=? "toc:" m1)
     140                                  (string-search (rx '(: bos (* space) "tags:")) m1) )
     141                              "")
     142                             ((member m1 *manual-pages*)
     143                              (string-append
     144                               "<a href='" m1 ".html'>" m1 "</a>"))
     145                             (else
     146                              (string-append
     147                               "<a href='" (clean (second m)) "'>"
     148                               (clean (or (third m) (second m)))
     149                               "</a>")))
     150                       (continue m)))))
    142151                 ((string-search (rx `(: bos ,+bold+)) rest) =>
    143152                  (lambda (m)
     
    153162      str))
    154163
     164(define (convert)
     165  (let ((sxml (html->sxml (open-input-string (with-output-to-string wiki->html)))))
     166    (define (walk n)
     167      (match n
     168        (('*PI* . _) n)
     169        (('enscript strs ...)
     170         `(pre ,@strs))
     171        (('procedure strs ...)
     172         `(pre "\n [procedure] " (tt ,@strs)))
     173        (((? symbol? tag) . body)
     174         `(,tag ,@(map walk body)))
     175        (_ n)))
     176    (display (shtml->html (walk sxml)))))
     177
    155178
    156179;;; Normalize text
     
    160183
    161184
    162 ;;; run it
     185;;; Run it
    163186
    164 (let ((sxml (html->sxml (open-input-string (with-output-to-string wiki->html)))))
    165   (define (walk n)
    166     (match n
    167       (('*PI* . _) n)
    168       (('enscript strs ...)
    169        `(pre ,@strs))
    170       (((? symbol? tag) . body)
    171        `(,tag ,@(map walk body)))
    172       (_ n)))
    173   (sxml->html (walk sxml)))
     187(define (main args)
     188  (match args
     189    ((dir)
     190     (set! *manual-pages* (map pathname-strip-directory (directory dir)))
     191     (convert))
     192    (_ (print "usage: wiki2html MANUALDIRECTORY")
     193       (exit 1))))
     194
     195(main (command-line-arguments))
Note: See TracChangeset for help on using the changeset viewer.