Changeset 10513 in project


Ignore:
Timestamp:
04/18/08 02:54:03 (11 years ago)
Author:
Ivan Raikov
Message:

Version increased to 3.1.6

Location:
chicken/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/README

    r10477 r10513  
    33  (c)2000-2008 Felix L. Winkelmann
    44
    5   version 3.1.5
     5  version 3.1.6
    66
    77
  • chicken/trunk/buildversion

    r10477 r10513  
    1 3.1.5
     13.1.6
  • chicken/trunk/manual/Basic mode of operation

    r10207 r10513  
    5454dynamically into a running application.
    5555
    56 Previous: [[Getting started]]
     56Previous: [[Overview]]
    5757Next: [[Using the compiler]]
  • chicken/trunk/manual/Callbacks

    r9902 r10513  
    6464statically allocated memory (for example by using {{object-evict}}).
    6565
    66 {{define-external}} forms should only be defined at top-level, they
    67 do not obey lexical scoping, as the bodies of external procedures
    68 are called without a dynamic environment: the call from C just passes
    69 the normal arguments and no environment information.
    70 
    7166Results of type {{scheme-object}} returned by {{define-external}}
    7267are always allocated in the secondary heap, that is, not in the stack.
  • chicken/trunk/manual/Locations

    r9419 r10513  
    7171</enscript>
    7272
    73 See [[http://chicken.wiki.br/location-and-c-string-star|location and c-string*]] for a tip on returning a {{c-string*}} type.
     73See [[location-and-c-string-star|location and c-string*]] for a tip on returning a {{c-string*}} type.
    7474
    7575{{location}} returns a value of type {{c-pointer}}, when given
  • chicken/trunk/manual/Non-standard read syntax

    r5945 r10513  
    1515 #;EXPRESSION
    1616
    17 Treats {{EXPRESSION}} as a comment.
    18 
     17Treats {{EXPRESSION}} as a comment.  That is, the comment runs through the whole S-expression, regardless of newlines, which saves you from having to comment out every line, or add a newline in the middle of your parens to make the commenting of the last line work, or other things like that.
    1918=== External Representation
    2019
  • chicken/trunk/manual/Supported language

    r10003 r10513  
    1111* [[Declarations]]               
    1212* [[Parameters]]                 
    13 * [[Unit library]] Basic Scheme definitions
    14 * [[Unit eval]] Evaluation and macro-handling
    15 * [[Unit extras]] Useful utility definitions
    16 * [[Unit srfi-1]] List library
    17 * [[Unit srfi-4]] Homogeneous numeric vectors
    18 * [[Unit srfi-13]] String library
    19 * [[Unit srfi-14]] Character set library             
    20 * [[Unit match]] Pattern matching runtime-support
    21 * [[Unit regex]] Regular expressions
    22 * [[Unit srfi-18]] Multithreading
    23 * [[Unit srfi-69]] Hash tables
     13* [[Unit library]] basic Scheme definitions
     14* [[Unit eval]] evaluation and macro-handling
     15* [[Unit data-structures]] data structures
     16* [[Unit extras]] useful utility definitions
     17* [[Unit srfi-1]] list library
     18* [[Unit srfi-4]] homogeneous numeric vectors
     19* [[Unit srfi-13]] string library
     20* [[Unit srfi-14]] character set library             
     21* [[Unit srfi-69]] hash tables             
     22* [[Unit match]] pattern matching runtime-support
     23* [[Unit regex]] regular expressions
     24* [[Unit srfi-18]] multithreading
    2425* [[Unit posix]] Unix-like services
    2526* [[Unit utils]] Shell scripting and file operations
    26 * [[Unit tcp]] Basic TCP-sockets
    27 * [[Unit lolevel]] Low-level operations
     27* [[Unit tcp]] basic TCP-sockets
     28* [[Unit lolevel]] low-level operations
    2829
    2930Previous: [[Using the interpreter]]
  • chicken/trunk/manual/The User's Manual

    r10477 r10513  
    33== The User's Manual
    44
    5 This is the user's manual for the CHICKEN Scheme compiler, version 3.1.5
     5This is the user's manual for the Chicken Scheme compiler, version 3.1.6.
    66
    77; [[Getting started]] : What is CHICKEN and how do I use it?
     
    2828
    2929; [[Bibliography]] : Links to documents that may be of interest.
     30
  • chicken/trunk/manual/Unit extras

    r10003 r10513  
    44== Unit extras
    55
    6 This unit contains a collection of useful utility definitions.
     6This unit contains a collection of useful utility definitions. 
    77This unit is used by default, unless the program
    88is compiled with the {{-explicit-use}} option.
    9 
    10 
    11 
    12 === Lists
    13 
    14 
    15 ==== alist-ref
    16 
    17  [procedure] (alist-ref KEY ALIST [TEST [DEFAULT]])
    18 
    19 Looks up {{KEY}} in {{ALIST}} using {{TEST}} as the comparison function (or {{eqv?}} if
    20 no test was given) and returns the cdr of the found pair, or {{DEFAULT}} (which defaults to {{#f}}).
    21 
    22 
    23 ==== alist-update!
    24 
    25  [procedure] (alist-update! KEY VALUE ALIST [TEST])
    26 
    27 If the list {{ALIST}} contains a pair of the form {{(KEY . X)}}, then this procedure
    28 replaces {{X}} with {{VALUE}} and returns {{ALIST}}. If {{ALIST}} contains no such item, then
    29 {{alist-update!}} returns {{((KEY . VALUE) . ALIST)}}. The optional argument
    30 {{TEST}} specifies the comparison procedure to search a matching pair in {{ALIST}}
    31 and defaults to {{eqv?}}.
    32 
    33 
    34 ==== atom?
    35 
    36  [procedure] (atom? X)
    37 
    38 Returns {{#t}} if {{X}} is not a pair. This is identical to {{not-pair?}} from [[Unit srfi-1]] but
    39 kept for historical reasons.
    40 
    41 
    42 ==== rassoc
    43 
    44  [procedure] (rassoc KEY LIST [TEST])
    45 
    46 Similar to {{assoc}}, but compares {{KEY}} with the {{cdr}} of each pair in {{LIST}} using
    47 {{TEST}} as the comparison procedures (which defaults to {{eqv?}}.
    48 
    49 
    50 ==== butlast
    51 
    52  [procedure] (butlast LIST)
    53 
    54 Returns a fresh list with all elements but the last of {{LIST}}.
    55 
    56 
    57 ==== chop
    58 
    59  [procedure] (chop LIST N)
    60 
    61 Returns a new list of sublists, where each sublist contains {{N}}
    62 elements of {{LIST}}. If {{LIST}} has a length that is not
    63 a multiple of {{N}}, then the last sublist contains the remaining
    64 elements.
    65 
    66 <enscript highlight=scheme>
    67 (chop '(1 2 3 4 5 6) 2) ==> ((1 2) (3 4) (5 6))
    68 (chop '(a b c d) 3)     ==> ((a b c) (d))
    69 </enscript>
    70 
    71 
    72 ==== compress
    73 
    74  [procedure] (compress BLIST LIST)
    75 
    76 Returns a new list with elements taken from {{LIST}} with
    77 corresponding true values in the list {{BLIST}}.
    78 
    79 <enscript highlight=scheme>
    80 (define nums '(99 100 110 401 1234))
    81 (compress (map odd? nums) nums)      ==> (99 401)
    82 </enscript>
    83 
    84 
    85 ==== flatten
    86 
    87  [procedure] (flatten LIST1 ...)
    88 
    89 Returns {{LIST1 ...}} concatenated together, with nested lists
    90 removed (flattened).
    91 
    92 
    93 ==== intersperse
    94 
    95  [procedure] (intersperse LIST X)
    96 
    97 Returns a new list with {{X}} placed between each element.
    98 
    99 
    100 ==== join
    101 
    102  [procedure] (join LISTOFLISTS [LIST])
    103 
    104 Concatenates the lists in {{LISTOFLISTS}} with {{LIST}} placed
    105 between each sublist. {{LIST}} defaults to the empty list.
    106 
    107 <enscript highlight=scheme>
    108 (join '((a b) (c d) (e)) '(x y)) ==> (a b x y c d x y e)
    109 (join '((p q) () (r (s) t)) '(-))  ==> (p q - - r (s) t)
    110 </enscript>
    111 
    112 {{join}} could be implemented as follows:
    113 
    114 <enscript highlight=scheme>
    115 (define (join lstoflsts #!optional (lst '()))
    116   (apply append (intersperse lstoflists lst)) )
    117 </enscript>
    118 
    119 
    120 ==== shuffle
    121 
    122  [procedure] (shuffle LIST)
    123 
    124 Returns {{LIST}} with its elements sorted in a random order.
    125 
    126 
    127 ==== tail?
    128 
    129  [procedure] (tail? X LIST)
    130 
    131 Returns true if {{X}} is one of the tails (cdr's) of {{LIST}}.
    132 
    1339
    13410
     
    228104
    229105
    230 === Queues
    231 
    232 
    233 ==== list->queue
    234 
    235  [procedure] (list->queue LIST)
    236 
    237 Returns {{LIST}} converted into a queue, where the first element
    238 of the list is the same as the first element of the queue. The resulting
    239 queue may share memory with the list and the list should not be modified
    240 after this operation.
    241 
    242 
    243 ==== make-queue
    244 
    245  [procedure] (make-queue)
    246 
    247 Returns a newly created queue.
    248 
    249 
    250 ==== queue?
    251 
    252  [procedure] (queue? X)
    253 
    254 Returns {{#t}} if {{X}} is a queue, or {{#f}} otherwise.
    255 
    256 
    257 ==== queue->list
    258 
    259  [procedure] (queue->list QUEUE)
    260 
    261 Returns {{QUEUE}} converted into a list, where the first element
    262 of the list is the same as the first element of the queue. The resulting
    263 list may share memory with the queue object and should not be modified.
    264 
    265 
    266 ==== queue-add!
    267 
    268  [procedure] (queue-add! QUEUE X)
    269 
    270 Adds {{X}} to the rear of {{QUEUE}}.
    271 
    272 
    273 ==== queue-empty?
    274 
    275  [procedure] (queue-empty? QUEUE)
    276 
    277 Returns {{#t}} if {{QUEUE}} is empty, or {{#f}} otherwise.
    278 
    279 
    280 ==== queue-first
    281 
    282  [procedure] (queue-first QUEUE)
    283 
    284 Returns the first element of {{QUEUE}}. If {{QUEUE}} is empty
    285 an error is signaled
    286 
    287 
    288 ==== queue-last
    289 
    290  [procedure] (queue-last QUEUE)
    291 
    292 Returns the last element of {{QUEUE}}. If {{QUEUE}} is empty
    293 an error is signaled
    294 
    295 
    296 ==== queue-remove!
    297 
    298  [procedure] (queue-remove! QUEUE)
    299 
    300 Removes and returns the first element of {{QUEUE}}. If {{QUEUE}}
    301 is empty an error is signaled
    302 
    303 
    304 ==== queue-push-back!
    305 
    306  [procedure] (queue-push-back! QUEUE ITEM)
    307 
    308 Pushes an item into the first position of a queue, i.e. the next
    309 {{queue-remove!}} will return {{ITEM}}.
    310 
    311 
    312 ==== queue-push-back-list!
    313 
    314  [procedure] (queue-push-back-list! QUEUE LIST)
    315 
    316 Pushes the items in item-list back onto the queue,
    317 so that {{(car LIST)}} becomes the next removable item.
    318 
    319 
    320 
    321 === Sorting
    322 
    323 
    324 ==== merge
    325 
    326  [procedure] (merge LIST1 LIST2 LESS?)
    327  [procedure] (merge! LIST1 LIST2 LESS?)
    328 
    329 Joins two lists in sorted order. {{merge!}} is the destructive
    330 version of merge. {{LESS?  }} should be a procedure of two arguments,
    331 that returns true if the first argument is to be ordered before the
    332 second argument.
    333 
    334 
    335 ==== sort
    336 
    337  [procedure] (sort SEQUENCE LESS?)
    338  [procedure] (sort! SEQUENCE LESS?)
    339 
    340 Sort {{SEQUENCE}}, which should be a list or a vector. {{sort!}}
    341 is the destructive version of sort.
    342 
    343 
    344 ==== sorted?
    345 
    346  [procedure] (sorted? SEQUENCE LESS?)
    347 
    348 Returns true if the list or vector {{SEQUENCE}} is already sorted.
    349 
    350 
    351 
    352106=== Random numbers
    353107
     
    357111 [procedure] (random-seed [SEED])
    358112
    359 Seeds the random number generator with {{SEED}} (an exact integer) or
     113Seeds the random number generator with {{SEED}} (an exact integer) or 
    360114{{(current-seconds)}} if {{SEED}} is not given.
    361115
     
    441195input is read from the port that is the current value of {{(current-input-port)}}.
    442196After all expressions are read, and if the argument is a port, then the port will
    443 not be closed. The {{READER}} argument specifies the procedure used to read
     197not be closed. The {{READER}} argument specifies the procedure used to read 
    444198expressions from the given file or port and defaults to {{read}}. The reader
    445199procedure will be called with a single argument (an input port).
     
    478232
    479233Read or write {{NUM}} characters from/to {{PORT}}, which defaults to the
    480 value of {{(current-input-port)}} or {{(current-output-port)}}, respectively.
     234value of {{(current-input-port)}} or {{(current-output-port)}}, respectively. 
    481235If {{NUM}} is {{#f}} or not given, then all data
    482236up to the end-of-file is read, or, in the case of {{write-string}} the whole
     
    522276
    523277
    524 === Strings
    525 
    526 
    527 ==== conc
    528 
    529  [procedure] (conc X ...)
    530 
    531 Returns a string with the string-represenation of all arguments concatenated
    532 together. {{conc}} could be implemented as
    533 
    534 <enscript highlight=scheme>
    535 (define (conc . args)
    536   (apply string-append (map ->string args)) )
    537 </enscript>
    538 
    539 
    540 
    541 ==== ->string
    542 
    543  [procedure] (->string X)
    544 
    545 Returns a string-representation of {{X}}.
    546 
    547 
    548 ==== string-chop
    549 
    550  [procedure] (string-chop STRING LENGTH)
    551 
    552 Returns a list of substrings taken by ''chopping'' {{STRING}} every {{LENGTH}}
    553 characters:
    554 
    555 <enscript highlight=scheme>
    556 (string-chop "one two three" 4)  ==>  ("one " "two " "thre" "e")
    557 </enscript>
    558 
    559 
    560 
    561 ==== string-chomp
    562 
    563  [procedure] (string-chomp STRING [SUFFIX])
    564 
    565 If {{STRING}} ends with {{SUFFIX}}, then this procedure returns a copy of its first argument with the suffix
    566 removed, otherwise returns {{STRING}} unchanged. {{SUFFIX}} defaults to {{"\n"}}.
    567 
    568 
    569 ==== string-compare3
    570 
    571  [procedure] (string-compare3 STRING1 STRING2)
    572  [procedure] (string-compare3-ci STRING1 STRING2)
    573 
    574 Perform a three-way comparison between the {{STRING1}} and {{STRING2}},
    575 returning either {{-1}} if {{STRING1}} is lexicographically less
    576 than {{STRING2}}, {{0}} if it is equal, or {{1}} if it s greater.
    577 {{string-compare3-ci}} performs a case-insensitive comparison.
    578 
    579 
    580 ==== string-intersperse
    581 
    582  [procedure] (string-intersperse LIST [STRING])
    583 
    584 Returns a string that contains all strings in {{LIST}} concatenated
    585 together.  {{STRING}} is placed between each concatenated string and
    586 defaults to {{" "}}.
    587 
    588 <enscript highlight=scheme>
    589 (string-intersperse '("one" "two") "three")
    590 </enscript>
    591 
    592 is equivalent to
    593 
    594 <enscript highlight=scheme>
    595 (apply string-append (intersperse '("one" "two") "three"))
    596 </enscript>
    597 
    598 
    599 ==== string-split
    600 
    601  [procedure] (string-split STRING [DELIMITER-STRING [KEEPEMPTY]])
    602 
    603 Split string into substrings separated by the given delimiters. If
    604 no delimiters are specified, a string comprising the tab, newline and space characters
    605 is assumed. If the
    606 parameter {{KEEPEMPTY}} is given and not {{#f}}, then empty
    607 substrings are retained:
    608 
    609 <enscript highlight=scheme>
    610 (string-split "one  two  three") ==> ("one" "two" "three")
    611 (string-split "foo:bar::baz:" ":" #t) ==> ("foo" "bar" "" "baz" "")
    612 </enscript>
    613 
    614 
    615 ==== string-translate
    616 
    617  [procedure] (string-translate STRING FROM [TO])
    618 
    619 Returns a fresh copy of {{STRING}} with characters matching
    620 {{FROM}} translated to {{TO}}.  If {{TO}} is omitted, then
    621 matching characters are removed. {{FROM}} and {{TO}} may be
    622 a character, a string or a list. If both {{FROM}} and {{TO}}
    623 are strings, then the character at the same position in {{TO}}
    624 as the matching character in {{FROM}} is substituted.
    625 
    626 
    627 ==== string-translate*
    628 
    629  [procedure] (string-translate* STRING SMAP)
    630 
    631 Substitutes elements of {{STRING}} according to {{SMAP}}.
    632 {{SMAP}} should be an association-list where each element of the list
    633 is a pair of the form {{(MATCH \. REPLACEMENT)}}. Every occurrence of
    634 the string {{MATCH}} in {{STRING}} will be replaced by the string
    635 {{REPLACEMENT}}:
    636 
    637 <enscript highlight=scheme>
    638 (string-translate*
    639   "<h1>this is a \"string\"</h1>"
    640   '(("<" . "&lt;") (">" . "&gt;") ("\"" . "&quot;")) )
    641 =>  "&lt;h1&gt;this is a &quot;string&quot;&lt;/h1&gt;"
    642 </enscript>
    643 
    644 
    645 ==== substring=?
    646 
    647  [procedure] (substring=? STRING1 STRING2 [START1 [START2 [LENGTH]]])
    648  [procedure] (substring-ci=? STRING1 STRING2 [START1 [START2 [LENGTH]]])
    649 
    650 Returns {{#t}} if the strings {{STRING1}} and {{STRING2}} are equal, or
    651 {{#f}} otherwise.
    652 The comparison starts at the positions {{START1}} and {{START2}} (which default
    653 to 0), comparing {{LENGTH}} characters (which defaults to the minimum of the remaining
    654 length of both strings).
    655 
    656 
    657 ==== substring-index
    658 
    659  [procedure] (substring-index WHICH WHERE [START])
    660  [procedure] (substring-index-ci WHICH WHERE [START])
    661 
    662 Searches for first index in string {{WHERE}} where string
    663 {{WHICH}} occurs.  If the optional argument {{START}} is given,
    664 then the search starts at that index.  {{substring-index-ci}}
    665 is a case-insensitive version of {{substring-index}}.
    666 
    667 
    668 
    669 === Combinators
    670 
    671 
    672 ==== any?
    673 
    674  [procedure] (any? X)
    675 
    676 Ignores its argument and always returns {{#t}}. This is actually useful sometimes.
    677 
    678 
    679 ==== none?
    680 
    681  [procedure] (none? X)
    682 
    683 Ignores its argument and always returns {{#f}}. This is actually useful sometimes.
    684 
    685 
    686 ==== always?
    687 
    688  [procedure] (always? ...)
    689 
    690 Ignores its arguments and always returns {{#t}}. This is actually useful sometimes.
    691 
    692 
    693 ==== never?
    694 
    695  [procedure] (never? ...)
    696 
    697 Ignores its arguments and always returns {{#f}}. This is actually useful sometimes.
    698 
    699 
    700 ==== constantly
    701 
    702  [procedure] (constantly X ...)
    703 
    704 Returns a procedure that always returns the values {{X ...}} regardless of the number and value of its arguments.
    705 
    706 <enscript highlight=scheme>
    707 (constantly X) <=> (lambda args X)
    708 </enscript>
    709 
    710 
    711 ==== complement
    712 
    713  [procedure] (complement PROC)
    714 
    715 Returns a procedure that returns the boolean inverse of {{PROC}}.
    716 
    717 <enscript highlight=scheme>
    718 (complement PROC) <=> (lambda (x) (not (PROC x)))
    719 </enscript>
    720 
    721 
    722 ==== compose
    723 
    724  [procedure] (compose PROC1 PROC2 ...)
    725 
    726 Returns a procedure that represents the composition of the
    727 argument-procedures {{PROC1 PROC2 ...}}.
    728 
    729 <enscript highlight=scheme>
    730 (compose F G) <=> (lambda args
    731                       (call-with-values
    732                          (lambda () (apply G args))
    733                          F))
    734 </enscript>
    735 
    736 {{(compose)}} is equivalent to {{values}}.
    737 
    738 
    739 ==== conjoin
    740 
    741  [procedure] (conjoin PRED ...)
    742 
    743 Returns a procedure that returns {{#t}} if its argument satisfies the
    744 predicates {{PRED ...}}.
    745 <enscript highlight=scheme>
    746 ((conjoin odd? positive?) 33)   ==>  #t
    747 ((conjoin odd? positive?) -33)  ==>  #f
    748 </enscript>
    749 
    750 
    751 ==== disjoin
    752 
    753  [procedure] (disjoin PRED ...)
    754 
    755 Returns a procedure that returns {{#t}} if its argument satisfies any
    756 predicate {{PRED ...}}.
    757 <enscript highlight=scheme>
    758 ((disjoin odd? positive?) 32)    ==>  #t
    759 ((disjoin odd? positive?) -32)   ==>  #f
    760 </enscript>
    761 
    762 
    763 ==== each
    764 
    765  [procedure] (each PROC ...)
    766 
    767 Returns a procedure that applies {{PROC ...}} to its arguments, and returns the result(s)
    768 of the last procedure application. For example
    769 
    770 <enscript highlight=scheme>
    771 (each pp eval)
    772 </enscript>
    773 
    774 is equivalent to
    775 
    776 <enscript highlight=scheme>
    777 (lambda args
    778   (apply pp args)
    779   (apply eval args) )
    780 </enscript>
    781 
    782 {{(each PROC)}} is equivalent to {{PROC}} and {{(each)}} is equivalent to
    783 {{noop}}.
    784 
    785 
    786 ==== flip
    787 
    788  [procedure] (flip PROC)
    789 
    790 Returns a two-argument procedure that calls {{PROC}} with its
    791 arguments swapped:
    792 <enscript highlight=scheme>
    793 (flip PROC) <=> (lambda (x y) (PROC y x))
    794 </enscript>
    795 
    796 
    797 ==== identity
    798 
    799  [procedure] (identity X)
    800 
    801 Returns its sole argument {{X}}.
    802 
    803 
    804 ==== project
    805 
    806  [procedure] (project N)
    807 
    808 Returns a procedure that returns its {{N}}th argument (starting from 0).
    809 
    810 
    811 ==== list-of
    812 
    813  [procedure] (list-of PRED)
    814 
    815 Returns a procedure of one argument that returns {{#t}} when
    816 applied to a list of elements that all satisfy the predicate procedure
    817 {{PRED}}, or {{#f}} otherwise.
    818 
    819 <enscript highlight=scheme>
    820 ((list-of even?) '(1 2 3))   ==> #f
    821 ((list-of number?) '(1 2 3)) ==> #t
    822 </enscript>
    823 
    824 
    825 ==== noop
    826 
    827  [procedure] (noop X ...)
    828 
    829 Ignores it's arguments, does nothing and returns an unspecified value.
    830 
    831 
    832 ==== o
    833 
    834  [procedure] (o PROC ...)
    835 
    836 A single value version of {{compose}} (slightly faster). {{(o)}} is equivalent
    837 to {{identity}}.
    838 
    839 
    840 ==== left-section
    841 
    842  [procedure] (left-section PROC ARG0 ...)
    843 
    844 Returns an n-ary procedure that partially applies its' arguments {{ARG0 ...}}
    845 from the left (normal order). Sort of a n-ary curry.
    846 
    847 
    848 ==== right-section
    849 
    850  [procedure] (right-section PROC ARG0 ...)
    851 
    852 Returns an n-ary procedure that partially applies its' arguments {{ARG0 ...}}
    853 from the right (reverse order). Sort of a n-ary curry.
    854 
    855 
    856 === Binary searching
    857 
    858 
    859 ==== binary-search
    860 
    861  [procedure] (binary-search SEQUENCE PROC)
    862 
    863 Performs a binary search in {{SEQUENCE}}, which should be a sorted
    864 list or vector.  {{PROC}} is called to compare items in the sequence,
    865 should accept a single argument and return an exact integer: zero if the
    866 searched value is equal to the current item, negative if the searched
    867 value is ''less'' than the current item, and positive otherwise.
    868 Returns the index of the found value or {{#f}} otherwise.
    869 
    870 Previous: [[Unit eval]]
     278Previous: [[Unit data-structures]]
    871279
    872280Next: [[Unit srfi-1]]
  • chicken/trunk/manual/Unit library

    r9845 r10513  
    105105is negative or {{0}} if {{N}} is zero. {{signum}} is exactness preserving.
    106106
     107
    107108==== finite?
    108109
     
    111112Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise.
    112113
    113 ==== flonum-print-precision
    114 
    115  [procedure] (flonum-print-precision [PRECISION])
    116 
    117 Returns the existing number of digits after the decimal place used in printing
    118 a {{flonum}}.
    119 
    120 The optional {{non-negative-fixnum}} {{PRECISION}} sets the current print
    121 precision.
    122114
    123115
  • chicken/trunk/manual/Unit posix

    r9845 r10513  
    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?)
     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
     
    114115 [procedure] (glob PATTERN1 ...)
    115116
    116 Returns a list of the pathnames of all existing files matching
    117 {{PATTERN1 ...}}, which should be strings containing the usual
    118 file-patterns (with {{*}} matching zero or more characters and
    119 {{?}} matching zero or one character).
     117Returns a list of the pathnames of all existing files matching {{PATTERN1 ...}}, which should be strings containing the usual file-patterns (with {{*}} matching zero or more characters and {{?}} matching zero or one character).  Bug: wildcard characters are only recognized in the rightmost portion of the pattern.
    120118
    121119==== canonical-path
     
    124122
    125123Returns a canonical path for {{NAME}}, which should be a string
    126 containing a path-or-filename.  The string returned by
     124containing a path-or-filename.  The string returned by 
    127125{{canonical-path}} is OS dependent; it may be quoted and used in
    128126a shell on the calling machine. (Quoting is suggested as shell
     
    132130
    133131The prefix for {{NAME}} determines what path to prepend.  If {{NAME}}
    134 begins with a {{"~/"}}, this prefix is stripped and the user's
     132begins with a {{"~/"}}, this prefix is stripped and the user's 
    135133home directory is added.  If beginning with {{/}} or a DRIVE-LETTER:\\
    136134combination, no additional path is added.  Otherwise, the current
     
    139137a {{/}} or is empty, the appropriate slash is appended to the tail.
    140138
    141 No directories or files are actually tested for existence; this
     139No directories or files are actually tested for existence; this 
    142140procedure only canonicalises path syntax.
    143141
     
    467465 [procedure] (stat-socket? FILENAME)
    468466
    469 These procedures return {{#t}} if the {{FILENAME}} given is of the
     467These procedures return {{#t}} if the {{FILENAME}} given is of the 
    470468appropriate type.
    471469
     
    802800for the signal with the code {{SIGNUM}}. {{PROC}} is called
    803801with the signal number as its sole argument. If the argument {{PROC}} is {{#f}}
    804 then any signal handler will be removed.
     802then any signal handler will be removed, and the corresponding signal set to {{SIG_IGN}}.
    805803
    806804Note that is is unspecified in which thread of execution the signal handler will be invoked.
     
    949947 [procedure] (seconds->local-time SECONDS)
    950948
    951 Converts the time value represented in {{SECONDS}} into a ten-element vector
    952 ({{TIME-VECTOR}}) of the form {{#(seconds minutes hours mday month year wday
    953 yday dstflag timezone)}}, in the following format:
     949Breaks down the time value represented in {{SECONDS}} into a 10
     950element vector of the form {{#(seconds minutes hours mday month
     951year wday yday dstflag timezone)}}, in the following format:
    954952
    955953; seconds (0) : the number of seconds after the minute (0 - 59)
     
    966964==== local-time->seconds
    967965
    968  [procedure] (local-time->seconds TIME-VECTOR)
    969 
    970 Converts the {{TIME-VECTOR}} representing the time value relative to the
    971 current timezone into the number of seconds since the first of January, 1970
    972 UTC.
     966 [procedure] (local-time->seconds VECTOR)
     967
     968Converts the ten-element vector {{VECTOR}} representing the time value relative to
     969the current timezone into
     970the number of seconds since the first of January, 1970 UTC.
    973971
    974972==== local-timezone-abbreviation
     
    982980 [procedure] (seconds->string SECONDS)
    983981
    984 Converts the local time represented in {{SECONDS}} into a string of the form
    985 {{"Tue May 21 13:46:22 1991"}}.
     982Converts the local time represented in {{SECONDS}} into a string
     983of the form {{"Tue May 21 13:46:22 1991"}}.
    986984
    987985==== seconds->utc-time
     
    989987 [procedure] (seconds->utc-time SECONDS)
    990988
    991 Similar to {{seconds->local-time}}, but interprets {{SECONDS}} as UTC time.
     989Similar to {{seconds->local-time}}, but interpretes {{SECONDS}}
     990as UTC time.
    992991
    993992==== utc-time->seconds
    994993
    995  [procedure] (utc-time->seconds TIME-VECTOR)
    996 
    997 Converts the {{TIME-VECTOR}} representing the UTC time value into the number of
    998 seconds since the first of January, 1970 UTC.
     994 [procedure] (utc-time->seconds VECTOR)
     995
     996Converts the ten-element vector {{VECTOR}} representing the UTC time value into
     997the number of seconds since the first of January, 1970 UTC.
    999998
    1000999==== time->string
    10011000
    1002  [procedure] (time->string TIME-VECTOR [FORMAT-STRING])
    1003 
    1004 Converts the {{TIME-VECTOR}} into a string of the form {{"Tue May 21 13:46:22
     1001 [procedure] (time->string VECTOR)
     1002
     1003Converts the broken down time represented in the 10 element vector
     1004{{VECTOR}} into a string of the form {{"Tue May 21 13:46:22
    100510051991"}}.
    1006 
    1007 When the optional {{FORMAT-STRING}} is supplied the time is formatted using
    1008 the C library routine {{strftime}}.
    1009 
    1010 ==== string->time
    1011 
    1012  [procedure] (string->time TIME-STRING [FORMAT-STRING])
    1013 
    1014 Parse the {{TIME-STRING}} using the C library routine {{strptime}} and return a
    1015 {{TIME-VECTOR}}.
    1016 
    1017 Not available for the ''Windows'' platform.
    10181006
    10191007
     
    12651253 set-root-directory!
    12661254 utc-time->seconds
    1267  string->time
    12681255
    12691256==== Additional Definitions
  • chicken/trunk/manual/Unit regex

    r9418 r10513  
    1313<enscript highlight=scheme>
    1414(require 'regex)
    15 (test-feature? 'pcre) => t
     15(feature? 'pcre) => #t
    1616</enscript>
    1717
  • chicken/trunk/manual/Unit srfi-14

    r5945 r10513  
    1717Previous: [[Unit srfi-13]]
    1818
    19 Next: [[Unit match]]
     19Next: [[Unit srfi-69]]
  • chicken/trunk/manual/Unit srfi-18

    r10003 r10513  
    8585the number of milliseconds since process startup.
    8686
     87=== milliseconds->time
     88
     89 [procedure] (milliseconds->time ms)
     90
     91Converts into a time object an exact integer representing
     92the number of milliseconds since process startup.
     93
     94This 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:
     95
     96 (define (thread-sleep!/ms ms)
     97   (thread-sleep!
     98    (milliseconds->time (+ ms (current-milliseconds)))))
    8799
    88100Previous: [[Unit regex]]
    89101
    90 Next: [[Unit srfi-69]]
     102Next: [[Unit posix]]
  • chicken/trunk/manual/Unit utils

    r6691 r10513  
    136136
    137137
     138=== File move/copy
     139
     140==== file-copy
     141
     142 [procedure] (file-copy ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)
     143
     144Copies {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}},
     145{{BLOCKSIZE}} bytes at a time.  {{BLOCKSIZE}} defaults to 1024, and must be
     146a positive integer.  Returns the number of bytes copied on success, or errors
     147on failure.  {{CLOBBER}} determines the behaviour of {{file-copy}} when
     148{{NEWFILE}} is already extant.  When set to {{#f}} (default), an error is
     149signalled.  When set to any other value, {{NEWFILE}} is overwritten.
     150{{file-copy}} will work across filesystems and devices and is not
     151platform-dependent.
     152
     153==== file-move
     154
     155 [procedure] (file-move ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)
     156
     157Moves {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}}, with
     158the same semantics as {{file-copy}}, above.  {{file-move}} is safe across
     159filesystems and devices (unlike {{file-rename}}).  It is possible for an
     160error to be signalled despite partial success if {{NEWFILE}} could be created
     161and fully written but removing {{ORIGFILE}} fails.
     162
     163
    138164=== Iterating over input lines and files
    139165
  • chicken/trunk/manual/chicken-setup

    r9418 r10513  
    546546; {{-tree FILENAME}} : Download and show the repository catalog
    547547; {{-svn URL}} : Fetch extension from [[http://subversion.tigris.org|Subversion]] repository
     548; {{-svn-trunk URL}} : Fetch extension from trunk in [[http://subversion.tigris.org|Subversion]] repository
    548549; {{-revision REV}} : Specifies SVN revision to check out
    549550; {{-local PATHNAME}} : Fetch extension from local file
  • chicken/trunk/version.scm

    r10477 r10513  
    1 (define-constant +build-version+ "3.1.5")
     1(define-constant +build-version+ "3.1.6")
Note: See TracChangeset for help on using the changeset viewer.