Changeset 13659 in project
- Timestamp:
- 03/10/09 10:11:14 (11 years ago)
- Location:
- chicken/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
chicken/trunk/manual/Unit files
r11644 r13659 12 12 ==== absolute-pathname? 13 13 14 [procedure] (absolute-pathname? PATHNAME) 14 <procedure>(absolute-pathname? PATHNAME)</procedure> 15 15 16 16 Returns {{#t}} if the string {{PATHNAME}} names an absolute … … 19 19 ==== decompose-pathname 20 20 21 [procedure] (decompose-pathname PATHNAME) 21 <procedure>(decompose-pathname PATHNAME)</procedure> 22 22 23 23 Returns three values: the directory-, filename- and extension-components … … 28 28 ==== make-absolute-pathname 29 29 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> 32 32 33 33 Returns a string that names the file with the … … 43 43 ==== pathname-directory 44 44 45 [procedure] (pathname-directory PATHNAME) 45 <procedure>(pathname-directory PATHNAME)</procedure> 46 46 47 47 ==== pathname-file 48 48 49 [procedure] (pathname-file PATHNAME) 49 <procedure>(pathname-file PATHNAME)</procedure> 50 50 51 51 ==== pathname-extension 52 52 53 [procedure] (pathname-extension PATHNAME) 53 <procedure>(pathname-extension PATHNAME)</procedure> 54 54 55 55 Accessors for the components of {{PATHNAME}}. If the pathname does … … 58 58 ==== pathname-replace-directory 59 59 60 [procedure] (pathname-replace-directory PATHNAME DIRECTORY) 60 <procedure>(pathname-replace-directory PATHNAME DIRECTORY)</procedure> 61 61 62 62 ==== pathname-replace-file 63 63 64 [procedure] (pathname-replace-file PATHNAME FILENAME) 64 <procedure>(pathname-replace-file PATHNAME FILENAME)</procedure> 65 65 66 66 ==== pathname-replace-extension 67 67 68 [procedure] (pathname-replace-extension PATHNAME EXTENSION) 68 <procedure>(pathname-replace-extension PATHNAME EXTENSION)</procedure> 69 69 70 70 Return a new pathname with the specified component of {{PATHNAME}} … … 73 73 ==== pathname-strip-directory 74 74 75 [procedure] (pathname-strip-directory PATHNAME) 75 <procedure>(pathname-strip-directory PATHNAME)</procedure> 76 76 77 77 ==== pathname-strip-extension 78 78 79 [procedure] (pathname-strip-extension PATHNAME) 79 <procedure>(pathname-strip-extension PATHNAME)</procedure> 80 80 81 81 Return a new pathname with the specified component of {{PATHNAME}} … … 84 84 ==== directory-null? 85 85 86 [procedure] (directory-null? DIRECTORY) 86 <procedure>(directory-null? DIRECTORY)</procedure> 87 87 88 88 Does the {{DIRECTORY}} consist only of path separators and the period? … … 95 95 ==== create-temporary-file 96 96 97 [procedure] (create-temporary-file [EXTENSION]) 97 <procedure>(create-temporary-file [EXTENSION])</procedure> 98 98 99 99 Creates an empty temporary file and returns its pathname. If … … 107 107 ==== delete-file* 108 108 109 [procedure] (delete-file* FILENAME) 109 <procedure>(delete-file* FILENAME)</procedure> 110 110 111 111 If the file {{FILENAME}} exists, it is deleted and {{#t}} … … 118 118 ==== file-copy 119 119 120 [procedure] (file-copy ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE) 120 <procedure>(file-copy ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)</procedure> 121 121 122 122 Copies {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}}, … … 131 131 ==== file-move 132 132 133 [procedure] (file-move ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE) 133 <procedure>(file-move ORIGFILE NEWFILE #!optional CLOBBER BLOCKSIZE)</procedure> 134 134 135 135 Moves {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}}, with -
chicken/trunk/manual/Unit library
r13562 r13659 34 34 ==== bit-set? 35 35 36 [procedure] (bit-set? N INDEX) 36 <procedure>(bit-set? N INDEX)</procedure> 37 37 38 38 Returns {{#t}} if the bit at the position {{INDEX}} in the integer {{N}} is … … 87 87 ==== Arithmetic floating-point operations 88 88 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 argumentin unsafe mode can crash the system.89 arguments (except {{flonum?}}, which returns {{#f}}). In unsafe mode, 90 these procedures do not check their arguments. A non-flonum argument 91 in unsafe mode can crash the system. 92 92 93 93 ; [procedure] (flonum? X) … … 126 126 ==== finite? 127 127 128 [procedure] (finite? N) 128 <procedure>(finite? N)</procedure> 129 129 130 130 Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise. … … 143 143 ==== current-output-port 144 144 145 [procedure] (current-output-port [PORT]) 145 <procedure>(current-output-port [PORT])</procedure> 146 146 147 147 Returns default output port. If {{PORT}} is given, then that port is selected … … 153 153 ==== current-error-port 154 154 155 [procedure] (current-error-port [PORT]) 155 <procedure>(current-error-port [PORT])</procedure> 156 156 157 157 Returns default error output port. If {{PORT}} is given, then that port is … … 164 164 ==== flush-output 165 165 166 [procedure] (flush-output [PORT]) 166 <procedure>(flush-output [PORT])</procedure> 167 167 168 168 Write buffered output to the given output-port. {{PORT}} defaults … … 172 172 ==== port-name 173 173 174 [procedure] (port-name [PORT]) 174 <procedure>(port-name [PORT])</procedure> 175 175 176 176 Fetch filename from {{PORT}}. This returns the filename that was used to open … … 181 181 ==== port-position 182 182 183 [procedure] (port-position [PORT]) 183 <procedure>(port-position [PORT])</procedure> 184 184 185 185 Returns the current position of {{PORT}} as two values: row and column number. … … 191 191 ==== set-port-name! 192 192 193 [procedure] (set-port-name! PORT STRING) 193 <procedure>(set-port-name! PORT STRING)</procedure> 194 194 195 195 Sets the name of {{PORT}} to {{STRING}}. … … 201 201 ==== delete-file 202 202 203 [procedure] (delete-file STRING) 203 <procedure>(delete-file STRING)</procedure> 204 204 205 205 Deletes the file with the pathname {{STRING}}. If the file does … … 209 209 ==== file-exists? 210 210 211 [procedure] (file-exists? STRING) 211 <procedure>(file-exists? STRING)</procedure> 212 212 213 213 Returns {{STRING}} if a file with the given pathname exists, or … … 217 217 ==== rename-file 218 218 219 [procedure] (rename-file OLD NEW) 219 <procedure>(rename-file OLD NEW)</procedure> 220 220 221 221 Renames the file or directory with the pathname {{OLD}} to … … 227 227 ==== get-output-string 228 228 229 [procedure] (get-output-string PORT) 229 <procedure>(get-output-string PORT)</procedure> 230 230 231 231 Returns accumulated output of a port created with … … 235 235 ==== open-input-string 236 236 237 [procedure] (open-input-string STRING) 237 <procedure>(open-input-string STRING)</procedure> 238 238 239 239 Returns a port for reading from {{STRING}}. … … 242 242 ==== open-output-string 243 243 244 [procedure] (open-output-string) 244 <procedure>(open-output-string)</procedure> 245 245 246 246 Returns a port for accumulating output in a string. … … 266 266 ==== features 267 267 268 [procedure] (features) 268 <procedure>(features)</procedure> 269 269 270 270 Returns a list of all registered features that will be accepted as valid … … 274 274 ==== feature? 275 275 276 [procedure] (feature? ID ...) 276 <procedure>(feature? ID ...)</procedure> 277 277 278 278 Returns {{#t}} if all features with the given feature-identifiers {{ID ...}} … … 282 282 ==== register-feature! 283 283 284 [procedure] (register-feature! FEATURE ...) 284 <procedure>(register-feature! FEATURE ...)</procedure> 285 285 286 286 Register one or more features that will be accepted as valid … … 291 291 ==== unregister-feature! 292 292 293 [procedure] (unregister-feature! FEATURE ...) 293 <procedure>(unregister-feature! FEATURE ...)</procedure> 294 294 295 295 Unregisters the specified feature-identifiers. {{FEATURE ...}} … … 314 314 ==== get-keyword 315 315 316 [procedure] (get-keyword KEYWORD ARGLIST [THUNK]) 316 <procedure>(get-keyword KEYWORD ARGLIST [THUNK])</procedure> 317 317 318 318 Returns the argument from {{ARGLIST}} specified under the keyword … … 333 333 ==== keyword? 334 334 335 [procedure] (keyword? X) 335 <procedure>(keyword? X)</procedure> 336 336 337 337 Returns {{#t}} if {{X}} is a keyword symbol, or {{#f}} … … 341 341 ==== keyword->string 342 342 343 [procedure] (keyword->string KEYWORD) 343 <procedure>(keyword->string KEYWORD)</procedure> 344 344 345 345 Transforms {{KEYWORD}} into a string. … … 348 348 ==== string->keyword 349 349 350 [procedure] (string->keyword STRING) 350 <procedure>(string->keyword STRING)</procedure> 351 351 352 352 Returns a keyword with the name {{STRING}}. … … 402 402 ==== breakpoint 403 403 404 [procedure] (breakpoint [NAME]) 404 <procedure>(breakpoint [NAME])</procedure> 405 405 406 406 Programmatically triggers a breakpoint (similar to the {{,br}} top-level csi … … 494 494 ==== argv 495 495 496 [procedure] (argv) 496 <procedure>(argv)</procedure> 497 497 498 498 Return a list of all supplied command-line arguments. The first item in … … 505 505 ==== exit 506 506 507 [procedure] (exit [CODE]) 507 <procedure>(exit [CODE])</procedure> 508 508 509 509 Exit the running process and return exit-code, which defaults to 0 … … 514 514 ==== build-platform 515 515 516 [procedure] (build-platform) 516 <procedure>(build-platform)</procedure> 517 517 518 518 Returns a symbol specifying the toolset which has been used for … … 528 528 ==== chicken-version 529 529 530 [procedure] (chicken-version [FULL]) 530 <procedure>(chicken-version [FULL])</procedure> 531 531 532 532 Returns a string containing the version number of the CHICKEN runtime … … 537 537 ==== errno 538 538 539 [procedure] (errno) 539 <procedure>(errno)</procedure> 540 540 541 541 Returns the error code of the last system call. … … 554 554 ==== machine-byte-order 555 555 556 [procedure] (machine-byte-order) 556 <procedure>(machine-byte-order)</procedure> 557 557 558 558 Returns the symbol {{little-endian}} or {{big-endian}}, depending on the … … 562 562 ==== machine-type 563 563 564 [procedure] (machine-type) 564 <procedure>(machine-type)</procedure> 565 565 566 566 Returns a symbol specifying the processor on which this process is … … 582 582 ==== on-exit 583 583 584 [procedure] (on-exit THUNK) 584 <procedure>(on-exit THUNK)</procedure> 585 585 586 586 Schedules the zero-argument procedures {{THUNK}} to be executed before … … 592 592 ==== software-type 593 593 594 [procedure] (software-type) 594 <procedure>(software-type)</procedure> 595 595 596 596 Returns a symbol specifying the operating system on which this process … … 606 606 ==== software-version 607 607 608 [procedure] (software-version) 608 <procedure>(software-version)</procedure> 609 609 610 610 Returns a symbol specifying the operating system version on which this … … 625 625 ==== c-runtime 626 626 627 [procedure] (c-runtime) 627 <procedure>(c-runtime)</procedure> 628 628 629 629 Returns a symbol that designates what kind of C runtime library has been linked … … 635 635 ==== system 636 636 637 [procedure] (system STRING) 637 <procedure>(system STRING)</procedure> 638 638 639 639 Execute shell command. The functionality offered by this procedure … … 643 643 644 644 645 645 On 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 646 660 647 661 === Execution time … … 651 665 ==== cpu-time 652 666 653 [procedure] (cpu-time) 667 <procedure>(cpu-time)</procedure> 654 668 655 669 Returns the used CPU time of the current process in milliseconds as … … 661 675 ==== current-milliseconds 662 676 663 [procedure] (current-milliseconds) 677 <procedure>(current-milliseconds)</procedure> 664 678 665 679 Returns the number of milliseconds since process- or machine startup. … … 668 682 ==== current-seconds 669 683 670 [procedure] (current-seconds) 684 <procedure>(current-seconds)</procedure> 671 685 672 686 Returns the number of seconds since midnight, Jan. 1, 1970. … … 675 689 ==== current-gc-milliseconds 676 690 677 [procedure] (current-gc-milliseconds) 691 <procedure>(current-gc-milliseconds)</procedure> 678 692 679 693 Returns the number of milliseconds spent in major garbage collections since … … 689 703 ==== enable-warnings 690 704 691 [procedure] (enable-warnings [BOOL]) 705 <procedure>(enable-warnings [BOOL])</procedure> 692 706 693 707 Enables or disables warnings, depending on wether {{BOOL}} is true or false. … … 700 714 ==== error 701 715 702 [procedure] (error [LOCATION] [STRING] EXP ...) 716 <procedure>(error [LOCATION] [STRING] EXP ...)</procedure> 703 717 704 718 Prints error message, writes all extra arguments to the … … 713 727 ==== get-call-chain 714 728 715 [procedure] (get-call-chain [START [THREAD]]) 729 <procedure>(get-call-chain [START [THREAD]])</procedure> 716 730 717 731 Returns a list with the call history. Backtrace information … … 726 740 ==== print-call-chain 727 741 728 [procedure] (print-call-chain [PORT [START [THREAD]]]) 742 <procedure>(print-call-chain [PORT [START [THREAD]]])</procedure> 729 743 730 744 Prints a backtrace of the procedure call history to {{PORT}}, … … 734 748 ==== print-error-message 735 749 736 [procedure] (print-error-message EXN [PORT [STRING]]) 750 <procedure>(print-error-message EXN [PORT [STRING]])</procedure> 737 751 738 752 Prints an appropriate error message to {{PORT}} (which defaults to the … … 746 760 ==== procedure-information 747 761 748 [procedure] (procedure-information PROC) 762 <procedure>(procedure-information PROC)</procedure> 749 763 750 764 Returns an s-expression with debug information for the procedure {{PROC}}, or … … 754 768 ==== reset 755 769 756 [procedure] (reset) 770 <procedure>(reset)</procedure> 757 771 758 772 Reset program (Invokes {{reset-handler}}). … … 761 775 ==== warning 762 776 763 [procedure] (warning STRING EXP ...) 777 <procedure>(warning STRING EXP ...)</procedure> 764 778 765 779 Displays a warning message (if warnings are enabled with {{enable-warnings}}) and … … 769 783 ==== singlestep 770 784 771 [procedure] (singlestep THUNK) 785 <procedure>(singlestep THUNK)</procedure> 772 786 773 787 Executes the code in the zero-procedure {{THUNK}} in single-stepping mode. … … 781 795 ==== gc 782 796 783 [procedure] (gc [FLAG]) 797 <procedure>(gc [FLAG])</procedure> 784 798 785 799 Invokes a garbage-collection and returns the number of free bytes in the heap. … … 790 804 ==== memory-statistics 791 805 792 [procedure] (memory-statistics) 806 <procedure>(memory-statistics)</procedure> 793 807 794 808 Performs a major garbage collection and returns a three element vector … … 801 815 ==== set-finalizer! 802 816 803 [procedure] (set-finalizer! X PROC) 817 <procedure>(set-finalizer! X PROC)</procedure> 804 818 805 819 Registers a procedure of one argument {{PROC}}, that will be … … 815 829 ==== set-gc-report! 816 830 817 [procedure] (set-gc-report! FLAG) 831 <procedure>(set-gc-report! FLAG)</procedure> 818 832 819 833 Print statistics after every GC, depending on {{FLAG}}. A value of … … 832 846 ==== promise? 833 847 834 [procedure] (promise? X) 848 <procedure>(promise? X)</procedure> 835 849 836 850 Returns {{#t}} if {{X}} is a promise returned by {{delay}}, or … … 844 858 ==== reverse-list->string 845 859 846 [procedure] (reverse-list->string LIST) 860 <procedure>(reverse-list->string LIST)</procedure> 847 861 848 862 Returns a string with the characters in {{LIST}} in reverse order. This is … … 855 869 ==== gensym 856 870 857 [procedure] (gensym [STRING-OR-SYMBOL]) 871 <procedure>(gensym [STRING-OR-SYMBOL])</procedure> 858 872 859 873 Returns a newly created uninterned symbol. If an argument is provided, … … 863 877 ==== string->uninterned-symbol 864 878 865 [procedure] (string->uninterned-symbol STRING) 879 <procedure>(string->uninterned-symbol STRING)</procedure> 866 880 867 881 Returns a newly created, unique symbol with the name {{STRING}}. … … 873 887 ==== port? 874 888 875 [procedure] (port? X) 889 <procedure>(port? X)</procedure> 876 890 877 891 Returns {{#t}} if {{X}} is a port object or {{#f}} … … 881 895 ==== print 882 896 883 [procedure] (print [EXP1 ...]) 897 <procedure>(print [EXP1 ...])</procedure> 884 898 885 899 Outputs the optional arguments {{EXP1 ...}} using {{display}} and … … 890 904 ==== print* 891 905 892 [procedure] (print* [EXP1 ...]) 906 <procedure>(print* [EXP1 ...])</procedure> 893 907 894 908 Similar to {{print}}, but does not output a terminating newline … … 902 916 ==== char-name 903 917 904 [procedure] (char-name SYMBOL-OR-CHAR [CHAR]) 918 <procedure>(char-name SYMBOL-OR-CHAR [CHAR])</procedure> 905 919 906 920 This procedure can be used to inquire about character names or to … … 936 950 ==== make-blob 937 951 938 [procedure] (make-blob SIZE) 952 <procedure>(make-blob SIZE)</procedure> 939 953 940 954 Returns a blob object of {{SIZE}} bytes, aligned on an 8-byte boundary, … … 943 957 ==== blob? 944 958 945 [procedure] (blob? X) 959 <procedure>(blob? X)</procedure> 946 960 947 961 Returns {{#t}} if {{X}} is a blob object, or … … 950 964 ==== blob-size 951 965 952 [procedure] (blob-size BLOB) 966 <procedure>(blob-size BLOB)</procedure> 953 967 954 968 Returns the number of bytes in {{BLOB}}. … … 956 970 ==== blob->string 957 971 958 [procedure] (blob->string BLOB) 972 <procedure>(blob->string BLOB)</procedure> 959 973 960 974 Returns a string with the contents of {{BLOB}}. … … 962 976 ==== string->blob 963 977 964 [procedure] (string->blob STRING) 978 <procedure>(string->blob STRING)</procedure> 965 979 966 980 Returns a blob with the contents of {{STRING}}. … … 968 982 ==== blob=? 969 983 970 [procedure] (blob=? BLOB1 BLOB2) 984 <procedure>(blob=? BLOB1 BLOB2)</procedure> 971 985 972 986 Returns {{#t}} if the two argument blobs are of the same … … 979 993 ==== vector-copy! 980 994 981 [procedure] (vector-copy! VECTOR1 VECTOR2 [COUNT]) 995 <procedure>(vector-copy! VECTOR1 VECTOR2 [COUNT])</procedure> 982 996 983 997 Copies contents of {{VECTOR1}} into {{VECTOR2}}. If the … … 991 1005 ==== vector-resize 992 1006 993 [procedure] (vector-resize VECTOR N [INIT]) 1007 <procedure>(vector-resize VECTOR N [INIT])</procedure> 994 1008 995 1009 Creates and returns a new vector with the contents of {{VECTOR}} and length … … 1004 1018 ==== void 1005 1019 1006 [procedure] (void) 1020 <procedure>(void)</procedure> 1007 1021 1008 1022 Returns an unspecified value. … … 1014 1028 ==== call/cc 1015 1029 1016 [procedure] (call/cc PROCEDURE) 1030 <procedure>(call/cc PROCEDURE)</procedure> 1017 1031 1018 1032 An alias for {{call-with-current-continuation}}. … … 1021 1035 ==== continuation-capture 1022 1036 1023 [procedure] (continuation-capture PROCEDURE) 1037 <procedure>(continuation-capture PROCEDURE)</procedure> 1024 1038 1025 1039 Creates a continuation object representing the current continuation and … … 1033 1047 ==== continuation? 1034 1048 1035 [procedure] (continuation? X) 1049 <procedure>(continuation? X)</procedure> 1036 1050 1037 1051 Returns {{#t}} if {{X}} is a continuation object, or {{#f}} otherwise. Please … … 1044 1058 ==== continuation-graft 1045 1059 1046 [procedure] (continuation-graft CONT THUNK) 1060 <procedure>(continuation-graft CONT THUNK)</procedure> 1047 1061 1048 1062 Calls the procedure {{THUNK}} with no arguments and the implicit continuation … … 1052 1066 ==== continuation-return 1053 1067 1054 [procedure] (continuation-return CONT VALUE ...) 1068 <procedure>(continuation-return CONT VALUE ...)</procedure> 1055 1069 1056 1070 Returns the value(s) to the continuation {{CONT}}. {{continuation-return}} could … … 1073 1087 ==== setter 1074 1088 1075 [procedure] (setter PROCEDURE) 1089 <procedure>(setter PROCEDURE)</procedure> 1076 1090 1077 1091 Returns the setter-procedure of {{PROCEDURE}}, or signals an error if … … 1085 1099 ==== getter-with-setter 1086 1100 1087 [procedure] (getter-with-setter GETTER SETTER) 1101 <procedure>(getter-with-setter GETTER SETTER)</procedure> 1088 1102 1089 1103 Returns a copy of the procedure {{GETTER}} with the associated setter procedure … … 1097 1111 ==== define-reader-ctor 1098 1112 1099 [procedure] (define-reader-ctor SYMBOL PROC) 1113 <procedure>(define-reader-ctor SYMBOL PROC)</procedure> 1100 1114 1101 1115 Define new read-time constructor for {{#,}} read syntax. For further information, see … … 1105 1119 ==== set-read-syntax! 1106 1120 1107 [procedure] (set-read-syntax! CHAR-OR-SYMBOL PROC) 1121 <procedure>(set-read-syntax! CHAR-OR-SYMBOL PROC)</procedure> 1108 1122 1109 1123 When the reader encounters the non-whitespace character {{CHAR}} while reading … … 1142 1156 ==== set-sharp-read-syntax! 1143 1157 1144 [procedure] (set-sharp-read-syntax! CHAR-OR-SYMBOL PROC) 1158 <procedure>(set-sharp-read-syntax! CHAR-OR-SYMBOL PROC)</procedure> 1145 1159 1146 1160 Similar to {{set-read-syntax!}}, but allows defining new {{#<CHAR> ...}} reader syntax. … … 1150 1164 ==== set-parameterized-read-syntax! 1151 1165 1152 [procedure] (set-parameterized-read-syntax! CHAR-OR-SYMBOL PROC) 1166 <procedure>(set-parameterized-read-syntax! CHAR-OR-SYMBOL PROC)</procedure> 1153 1167 1154 1168 Similar to {{set-sharp-read-syntax!}}, but intended for defining reader syntax of the … … 1161 1175 ==== copy-read-table 1162 1176 1163 [procedure] (copy-read-table READ-TABLE) 1177 <procedure>(copy-read-table READ-TABLE)</procedure> 1164 1178 1165 1179 Returns a copy of the given read-table. You can access the currently active read-table -
chicken/trunk/manual/Unit ports
r11646 r13659 12 12 ==== with-output-to-port 13 13 14 [procedure] (with-output-to-port PORT THUNK) 14 <procedure>(with-output-to-port PORT THUNK)</procedure> 15 15 16 16 Call procedure {{THUNK}} with the current output-port temporarily … … 19 19 ==== make-input-port 20 20 21 [procedure] (make-input-port READ READY? CLOSE [PEEK]) 21 <procedure>(make-input-port READ READY? CLOSE [PEEK])</procedure> 22 22 23 23 Returns a custom input port. Common operations on this … … 37 37 ==== make-output-port 38 38 39 [procedure] (make-output-port WRITE CLOSE [FLUSH]) 39 <procedure>(make-output-port WRITE CLOSE [FLUSH])</procedure> 40 40 41 41 Returns a custom output port. Common operations on this port are handled … … 49 49 ==== with-error-output-to-port 50 50 51 [procedure] (with-error-output-to-port PORT THUNK) 51 <procedure>(with-error-output-to-port PORT THUNK)</procedure> 52 52 53 53 Call procedure {{THUNK}} with the current error output-port … … 57 57 ==== with-input-from-port 58 58 59 [procedure] (with-input-from-port PORT THUNK) 59 <procedure>(with-input-from-port PORT THUNK)</procedure> 60 60 61 61 Call procedure {{THUNK}} with the current input-port temporarily … … 67 67 ==== call-with-input-string 68 68 69 [procedure] (call-with-input-string STRING PROC) 69 <procedure>(call-with-input-string STRING PROC)</procedure> 70 70 71 71 Calls the procedure {{PROC}} with a single argument that is a … … 75 75 ==== call-with-output-string 76 76 77 [procedure] (call-with-output-string PROC) 77 <procedure>(call-with-output-string PROC)</procedure> 78 78 79 79 Calls the procedure {{PROC}} with a single argument that is a … … 83 83 ==== with-input-from-string 84 84 85 [procedure] (with-input-from-string STRING THUNK) 85 <procedure>(with-input-from-string STRING THUNK)</procedure> 86 86 87 87 Call procedure {{THUNK}} with the current input-port temporarily … … 91 91 ==== with-output-to-string 92 92 93 [procedure] (with-output-to-string THUNK) 93 <procedure>(with-output-to-string THUNK)</procedure> 94 94 95 95 Call procedure {{THUNK}} with the current output-port temporarily … … 101 101 ==== port-for-each 102 102 103 [procedure] (port-for-each FN THUNK) 103 <procedure>(port-for-each FN THUNK)</procedure> 104 104 105 105 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}} … … 108 108 ==== port-map 109 109 110 [procedure] (port-map FN THUNK) 110 <procedure>(port-map FN THUNK)</procedure> 111 111 112 112 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}} … … 115 115 ==== port-fold 116 116 117 [procedure] (port-map FN ACC THUNK) 117 <procedure>(port-map FN ACC THUNK)</procedure> 118 118 119 119 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}}, … … 126 126 ==== make-broadcast-port 127 127 128 [procedure] (make-broadcast-port PORT ...) 128 <procedure>(make-broadcast-port PORT ...)</procedure> 129 129 130 130 Returns a custom output port that emits everything written into it to … … 134 134 ==== make-concatenated-port 135 135 136 [procedure] (make-concatenated-port PORT1 PORT2 ...) 136 <procedure>(make-concatenated-port PORT1 PORT2 ...)</procedure> 137 137 138 138 Returns a custom input port that reads its input from {{PORT1}}, until it -
chicken/trunk/manual/Unit posix
r12790 r13659 71 71 ==== change-directory 72 72 73 [procedure] (change-directory NAME) 73 <procedure>(change-directory NAME)</procedure> 74 74 75 75 Changes the current working directory to {{NAME}}. … … 77 77 ==== current-directory 78 78 79 [procedure] (current-directory [DIR]) 79 <procedure>(current-directory [DIR])</procedure> 80 80 81 81 Returns the name of the current working directory. If the optional argument {{DIR}} is given, … … 84 84 ==== create-directory 85 85 86 [procedure] (create-directory NAME) 87 88 Creates a directory with the pathname {{NAME}}. 86 <procedure>(create-directory NAME #!optional PARENTS?)</procedure> 87 88 Creates a directory with the pathname {{NAME}}. If the {{PARENTS?}} argument 89 is given and not false, any nonextant parent directories are also created. 89 90 90 91 ==== delete-directory 91 92 92 [procedure] (delete-directory NAME) 93 <procedure>(delete-directory NAME)</procedure> 93 94 94 95 Deletes the directory with the pathname {{NAME}}. The directory has … … 97 98 ==== directory 98 99 99 [procedure] (directory [PATHNAME [SHOW-DOTFILES?]]) 100 <procedure>(directory [PATHNAME [SHOW-DOTFILES?]])</procedure> 100 101 101 102 Returns a list with all files that are contained in the directory with the name {{PATHNAME}} … … 105 106 ==== directory? 106 107 107 [procedure] (directory? NAME) 108 <procedure>(directory? NAME)</procedure> 108 109 109 110 Returns {{#t}} if there exists a file with the name {{NAME}} … … 112 113 ==== glob 113 114 114 [procedure] (glob PATTERN1 ...) 115 <procedure>(glob PATTERN1 ...)</procedure> 115 116 116 117 Returns a list of the pathnames of all existing files matching … … 121 122 ==== canonical-path 122 123 123 [procedure] (canonical-path NAME) 124 <procedure>(canonical-path NAME)</procedure> 124 125 125 126 Returns a canonical path for {{NAME}}, which should be a string … … 144 145 ==== set-root-directory! 145 146 146 [procedure] (set-root-directory! STRING) 147 <procedure>(set-root-directory! STRING)</procedure> 147 148 148 149 Sets the root directory for the current process to the path given in {{STRING}} … … 156 157 ==== call-with-output-pipe 157 158 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> 160 161 161 162 Call {{PROC}} with a single argument: a input- or output port … … 167 168 ==== close-output-pipe 168 169 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> 171 172 172 173 Closes the pipe given in {{PORT}} and waits until the connected … … 176 177 ==== create-pipe 177 178 178 [procedure] (create-pipe) 179 <procedure>(create-pipe)</procedure> 179 180 180 181 The fundamental pipe-creation operator. Calls the C function … … 184 185 ==== open-input-pipe 185 186 186 [procedure] (open-input-pipe CMDLINE [MODE]) 187 <procedure>(open-input-pipe CMDLINE [MODE])</procedure> 187 188 188 189 Spawns a subprocess with the command-line string {{CMDLINE}} and … … 193 194 ==== open-output-pipe 194 195 195 [procedure] (open-output-pipe CMDLINE [MODE]) 196 <procedure>(open-output-pipe CMDLINE [MODE])</procedure> 196 197 197 198 Spawns a subprocess with the command-line string {{CMDLINE}} and … … 207 208 ==== with-output-to-pipe 208 209 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> 211 212 212 213 Temporarily set the value of … … 240 241 ==== create-fifo 241 242 242 [procedure] (create-fifo FILENAME [MODE]) 243 <procedure>(create-fifo FILENAME [MODE])</procedure> 243 244 244 245 Creates a FIFO with the name {{FILENAME}} and the permission bits … … 246 247 247 248 <enscript highlight=scheme> 248 [procedure](+ perm/irwxu perm/irwxg perm/irwxo)249 (+ perm/irwxu perm/irwxg perm/irwxo) 249 250 </enscript> 250 251 251 252 ==== fifo? 252 253 253 [procedure] (fifo? FILENAME) 254 <procedure>(fifo? FILENAME)</procedure> 254 255 255 256 Returns {{#t}} if the file with the name {{FILENAME}} names … … 261 262 ==== duplicate-fileno 262 263 263 [procedure] (duplicate-fileno OLD [NEW]) 264 <procedure>(duplicate-fileno OLD [NEW])</procedure> 264 265 265 266 If {{NEW}} is given, then the file-descriptor {{NEW}} is opened … … 269 270 ==== file-close 270 271 271 [procedure] (file-close FILENO) 272 <procedure>(file-close FILENO)</procedure> 272 273 273 274 Closes the input/output file with the file-descriptor {{FILENO}}. … … 275 276 ==== file-open 276 277 277 [procedure] (file-open FILENAME FLAGS [MODE]) 278 <procedure>(file-open FILENAME FLAGS [MODE])</procedure> 278 279 279 280 Opens the file specified with the string {{FILENAME}} and open-flags … … 289 290 ==== file-mkstemp 290 291 291 [procedure] (file-mkstemp TEMPLATE-FILENAME) 292 <procedure>(file-mkstemp TEMPLATE-FILENAME)</procedure> 292 293 293 294 Create a file based on the given {{TEMPLATE-FILENAME}}, in which … … 309 310 ==== file-read 310 311 311 [procedure] (file-read FILENO SIZE [BUFFER]) 312 <procedure>(file-read FILENO SIZE [BUFFER])</procedure> 312 313 313 314 Reads {{SIZE}} bytes from the file with the file-descriptor … … 319 320 ==== file-select 320 321 321 [procedure] (file-select READFDLIST WRITEFDLIST [TIMEOUT]) 322 <procedure>(file-select READFDLIST WRITEFDLIST [TIMEOUT])</procedure> 322 323 323 324 Waits until any of the file-descriptors given in the lists … … 336 337 ==== file-write 337 338 338 [procedure] (file-write FILENO BUFFER [SIZE]) 339 <procedure>(file-write FILENO BUFFER [SIZE])</procedure> 339 340 340 341 Writes the contents of the string or bytevector {{BUFFER}} into … … 345 346 ==== file-control 346 347 347 [procedure] (file-control FILENO COMMAND [ARGUMENT]) 348 <procedure>(file-control FILENO COMMAND [ARGUMENT])</procedure> 348 349 349 350 Performs the fcntl operation {{COMMAND}} with the given … … 354 355 ==== open-output-file* 355 356 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> 358 359 359 360 Opens file for the file-descriptor {{FILENO}} for input or output … … 365 366 ==== port->fileno 366 367 367 [procedure] (port->fileno PORT) 368 <procedure>(port->fileno PORT)</procedure> 368 369 369 370 If {{PORT}} is a file- or tcp-port, then a file-descriptor is returned for … … 377 378 ==== file-modification-time 378 379 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> 382 383 383 384 Returns time (in seconds) of the last access, modification or change of {{FILE}}. {{FILE}} … … 387 388 ==== file-stat 388 389 389 [procedure] (file-stat FILE [LINK]) 390 <procedure>(file-stat FILE [LINK])</procedure> 390 391 391 392 Returns a 13-element vector with the following contents: inode-number, … … 404 405 ==== file-position 405 406 406 [procedure] (file-position FILE) 407 <procedure>(file-position FILE)</procedure> 407 408 408 409 Returns the current file position of {{FILE}}, which should be a … … 411 412 ==== file-size 412 413 413 [procedure] (file-size FILENAME) 414 <procedure>(file-size FILENAME)</procedure> 414 415 415 416 Returns the size of the file designated by {{FILE}}. {{FILE}} … … 420 421 ==== regular-file? 421 422 422 [procedure] (regular-file? FILENAME) 423 <procedure>(regular-file? FILENAME)</procedure> 423 424 424 425 Returns true, if {{FILENAME}} names a regular file (not a directory or symbolic link). … … 426 427 ==== file-owner 427 428 428 [procedure] (file-owner FILE) 429 <procedure>(file-owner FILE)</procedure> 429 430 430 431 Returns the user-id of {{FILE}}. {{FILE}} may be a filename … … 433 434 ==== file-permissions 434 435 435 [procedure] (file-permissions FILE) 436 <procedure>(file-permissions FILE)</procedure> 436 437 437 438 Returns the permission bits for {{FILE}}. You can test this value … … 443 444 ==== file-execute-access? 444 445 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> 448 449 449 450 These procedures return {{#t}} if the current user has read, … … 459 460 ==== stat-socket? 460 461 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> 468 469 469 470 These procedures return {{#t}} if the {{FILENAME}} given is of the … … 475 476 ==== file-truncate 476 477 477 [procedure] (file-truncate FILE OFFSET) 478 <procedure>(file-truncate FILE OFFSET)</procedure> 478 479 479 480 Truncates the file {{FILE}} to the length {{OFFSET}}, … … 484 485 ==== set-file-position! 485 486 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> 488 489 489 490 Sets the current read/write position of {{FILE}} to … … 498 499 ==== change-file-mode 499 500 500 [procedure] (change-file-mode FILENAME MODE) 501 <procedure>(change-file-mode FILENAME MODE)</procedure> 501 502 502 503 Changes the current file mode of the file named {{FILENAME}} … … 507 508 ==== change-file-owner 508 509 509 [procedure] (change-file-owner FILENAME UID GID) 510 <procedure>(change-file-owner FILENAME UID GID)</procedure> 510 511 511 512 Changes the owner information of the file named {{FILENAME}} to … … 518 519 ==== current-process-id 519 520 520 [procedure] (current-process-id) 521 <procedure>(current-process-id)</procedure> 521 522 522 523 Returns the process ID of the current process. … … 524 525 ==== parent-process-id 525 526 526 [procedure] (parent-process-id) 527 <procedure>(parent-process-id)</procedure> 527 528 528 529 Returns the process ID of the parent of the current process. … … 530 531 ==== process-group-id 531 532 532 [procedure] (process-group-id PID) 533 <procedure>(process-group-id PID)</procedure> 533 534 534 535 Returns the process group ID of the process specified by {{PID}}. … … 536 537 ==== process-execute 537 538 538 [procedure] (process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST]]) 539 <procedure>(process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST]])</procedure> 539 540 540 541 Creates a new child process and replaces the running process with it … … 550 551 ==== process-fork 551 552 552 [procedure] (process-fork [THUNK]) 553 <procedure>(process-fork [THUNK])</procedure> 553 554 554 555 Creates a new child process with the UNIX system call … … 559 560 ==== process-run 560 561 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> 563 564 564 565 Creates a new child process. The PID of the new process is returned. … … 570 571 ==== process-signal 571 572 572 [procedure] (process-signal PID [SIGNAL]) 573 <procedure>(process-signal PID [SIGNAL])</procedure> 573 574 574 575 Sends {{SIGNAL}} to the process with the id {{PID}} using the … … 578 579 ==== process-wait 579 580 580 [procedure] (process-wait [PID [NOHANG]]) 581 <procedure>(process-wait [PID [NOHANG]])</procedure> 581 582 582 583 Suspends the current process until the child process with … … 593 594 ==== process 594 595 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> 597 598 598 599 Creates a subprocess and returns three values: an input port from … … 612 613 ==== process* 613 614 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> 616 617 617 618 Like {{process}} but returns 4 values: an input port from … … 623 624 ==== sleep 624 625 625 [procedure] (sleep SECONDS) 626 <procedure>(sleep SECONDS)</procedure> 626 627 627 628 Puts the process to sleep for {{SECONDS}}. Returns either 0 if … … 631 632 ==== create-session 632 633 633 [procedure] (create-session) 634 <procedure>(create-session)</procedure> 634 635 635 636 Creates a new session if the calling process is not a process group leader and returns … … 641 642 ==== symbolic-link? 642 643 643 [procedure] (symbolic-link? FILENAME) 644 <procedure>(symbolic-link? FILENAME)</procedure> 644 645 645 646 Returns true, if {{FILENAME}} names a symbolic link. … … 647 648 ==== create-symbolic-link 648 649 649 [procedure] (create-symbolic-link OLDNAME NEWNAME) 650 <procedure>(create-symbolic-link OLDNAME NEWNAME)</procedure> 650 651 651 652 Creates a symbolic link with the filename {{NEWNAME}} that points … … 654 655 ==== read-symbolic-link 655 656 656 [procedure] (read-symbolic-link FILENAME) 657 <procedure>(read-symbolic-link FILENAME)</procedure> 657 658 658 659 Returns the filename to which the symbolic link {{FILENAME}} points. … … 660 661 ==== file-link 661 662 662 [procedure] (file-link OLDNAME NEWNAME) 663 <procedure>(file-link OLDNAME NEWNAME)</procedure> 663 664 664 665 Creates a hard link from {{OLDNAME}} to {{NEWNAME}} (both strings). … … 669 670 ==== current-user-id 670 671 671 [procedure] (current-user-id) 672 <procedure>(current-user-id)</procedure> 672 673 [setter] (set! (current-user-id) UID) 673 674 … … 676 677 ==== current-effective-user-id 677 678 678 [procedure] (current-effective-user-id) 679 <procedure>(current-effective-user-id)</procedure> 679 680 [setter] (set! (current-effective-user-id) UID) 680 681 … … 683 684 ==== user-information 684 685 685 [procedure] (user-information USER [AS-VECTOR]) 686 <procedure>(user-information USER [AS-VECTOR])</procedure> 686 687 687 688 If {{USER}} specifes a valid username (as a string) or user ID, then the user … … 694 695 ==== current-group-id 695 696 696 [procedure] (current-group-id) 697 <procedure>(current-group-id)</procedure> 697 698 [setter] (set! (current-group-id) GID) 698 699 … … 701 702 ==== current-effective-group-id 702 703 703 [procedure] (current-effective-group-id) 704 <procedure>(current-effective-group-id)</procedure> 704 705 [setter] (set! (current-effective-group-id) GID) 705 706 … … 709 710 ==== group-information 710 711 711 [procedure] (group-information GROUP) 712 <procedure>(group-information GROUP)</procedure> 712 713 713 714 If {{GROUP}} specifies a valid group-name or group-id, then this … … 718 719 ==== get-groups 719 720 720 [procedure] (get-groups) 721 <procedure>(get-groups)</procedure> 721 722 722 723 Returns a list with the supplementary group IDs of the current user. … … 727 728 ==== set-groups! 728 729 729 [procedure] (set-groups! GIDLIST) 730 <procedure>(set-groups! GIDLIST)</procedure> 730 731 731 732 Sets the supplementrary group IDs of the current user to the IDs given in the list {{GIDLIST}}. … … 735 736 ==== initialize-groups 736 737 737 [procedure] (initialize-groups USERNAME BASEGID) 738 <procedure>(initialize-groups USERNAME BASEGID)</procedure> 738 739 739 740 Sets the supplementrary group IDs of the current user to the IDs from the user with name {{USERNAME}} … … 744 745 ==== set-process-group-id! 745 746 746 [procedure] (set-process-group-id! PID PGID) 747 <procedure>(set-process-group-id! PID PGID)</procedure> 747 748 [setter] (set! (process-group-id PID) PGID) 748 749 … … 754 755 ==== file-lock 755 756 756 [procedure] (file-lock PORT [START [LEN]]) 757 <procedure>(file-lock PORT [START [LEN]])</procedure> 757 758 758 759 Locks the file associated with {{PORT}} for reading or … … 765 766 ==== file-lock/blocking 766 767 767 [procedure] (file-lock/blocking PORT [START [LEN]]) 768 <procedure>(file-lock/blocking PORT [START [LEN]])</procedure> 768 769 769 770 Similar to {{file-lock}}, but if a lock is held on the file, … … 772 773 ==== file-test-lock 773 774 774 [procedure] (file-test-lock PORT [START [LEN]]) 775 <procedure>(file-test-lock PORT [START [LEN]])</procedure> 775 776 776 777 Tests whether the file associated with {{PORT}} is locked for reading … … 780 781 ==== file-unlock 781 782 782 [procedure] (file-unlock LOCK) 783 <procedure>(file-unlock LOCK)</procedure> 783 784 784 785 Unlocks the previously locked portion of a file given in {{LOCK}}. … … 789 790 ==== set-alarm! 790 791 791 [procedure] (set-alarm! SECONDS) 792 <procedure>(set-alarm! SECONDS)</procedure> 792 793 793 794 Sets an internal timer to raise the {{signal/alrm}} … … 797 798 ==== set-signal-handler! 798 799 799 [procedure] (set-signal-handler! SIGNUM PROC) 800 <procedure>(set-signal-handler! SIGNUM PROC)</procedure> 800 801 801 802 Establishes the procedure of one argument {{PROC}} as the handler 802 803 for the signal with the code {{SIGNUM}}. {{PROC}} is called 803 804 with the signal number as its sole argument. If the argument {{PROC}} is {{#f}} 804 then any signal handler will be removed .805 then any signal handler will be removed, and the corresponding signal set to {{SIG_IGN}}. 805 806 806 807 Note that is is unspecified in which thread of execution the signal handler will be invoked. … … 808 809 ==== signal-handler 809 810 810 [procedure] (signal-handler SIGNUM) 811 <procedure>(signal-handler SIGNUM)</procedure> 811 812 812 813 Returns the signal handler for the code {{SIGNUM}} or {{#f}}. … … 814 815 ==== set-signal-mask! 815 816 816 [procedure] (set-signal-mask! SIGLIST) 817 <procedure>(set-signal-mask! SIGLIST)</procedure> 817 818 818 819 Sets the signal mask of the current process to block all signals given … … 822 823 ==== signal-mask 823 824 824 [procedure] (signal-mask) 825 <procedure>(signal-mask)</procedure> 825 826 826 827 Returns the signal mask of the current process. … … 828 829 ==== signal-masked? 829 830 830 [procedure] (signal-masked? SIGNUM) 831 <procedure>(signal-masked? SIGNUM)</procedure> 831 832 832 833 Returns whether the signal for the code {{SIGNUM}} is currently masked. … … 834 835 ==== signal-mask! 835 836 836 [procedure] (signal-mask! SIGNUM) 837 <procedure>(signal-mask! SIGNUM)</procedure> 837 838 838 839 Masks (blocks) the signal for the code {{SIGNUM}}. … … 840 841 ==== signal-unmask! 841 842 842 [procedure] (signal-unmask! SIGNUM) 843 <procedure>(signal-unmask! SIGNUM)</procedure> 843 844 844 845 Unmasks (unblocks) the signal for the code {{SIGNUM}}. … … 875 876 === Environment access 876 877 877 ==== get-environment-variables878 ==== current-environment 878 879 879 880 [procedure] (get-environment-variables) … … 884 885 ==== setenv 885 886 886 [procedure] (setenv VARIABLE VALUE) 887 <procedure>(setenv VARIABLE VALUE)</procedure> 887 888 888 889 Sets the environment variable named {{VARIABLE}} to … … 892 893 ==== unsetenv 893 894 894 [procedure] (unsetenv VARIABLE) 895 <procedure>(unsetenv VARIABLE)</procedure> 895 896 896 897 Removes the definition of the environment variable {{VARIABLE}} from … … 910 911 ==== map-file-to-memory 911 912 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> 913 914 914 915 Maps a section of a file to memory using the C function … … 927 928 ==== memory-mapped-file-pointer 928 929 929 [procedure] (memory-mapped-file-pointer MMAP) 930 <procedure>(memory-mapped-file-pointer MMAP)</procedure> 930 931 931 932 Returns a machine pointer to the start of the memory region to which … … 934 935 ==== unmap-file-from-memory 935 936 936 [procedure] (unmap-file-from-memory MMAP [LEN]) 937 <procedure>(unmap-file-from-memory MMAP [LEN])</procedure> 937 938 938 939 Unmaps the section of a file mapped to memory using the C function … … 947 948 ==== seconds->local-time 948 949 949 [procedure] (seconds->local-time SECONDS) 950 <procedure>(seconds->local-time SECONDS)</procedure> 950 951 951 952 Breaks down the time value represented in {{SECONDS}} into a 10 … … 966 967 ==== local-time->seconds 967 968 968 [procedure] (local-time->seconds VECTOR) 969 <procedure>(local-time->seconds VECTOR)</procedure> 969 970 970 971 Converts the ten-element vector {{VECTOR}} representing the time value relative to … … 974 975 ==== local-timezone-abbreviation 975 976 976 [procedure] (local-timezone-abbreviation) 977 <procedure>(local-timezone-abbreviation)</procedure> 977 978 978 979 Returns the abbreviation for the local timezone as a string. … … 980 981 ==== seconds->string 981 982 982 [procedure] (seconds->string SECONDS) 983 <procedure>(seconds->string SECONDS)</procedure> 983 984 984 985 Converts the local time represented in {{SECONDS}} into a string … … 987 988 ==== seconds->utc-time 988 989 989 [procedure] (seconds->utc-time SECONDS) 990 <procedure>(seconds->utc-time SECONDS)</procedure> 990 991 991 992 Similar to {{seconds->local-time}}, but interpretes {{SECONDS}} … … 994 995 ==== utc-time->seconds 995 996 996 [procedure] (utc-time->seconds VECTOR) 997 <procedure>(utc-time->seconds VECTOR)</procedure> 997 998 998 999 Converts the ten-element vector {{VECTOR}} representing the UTC time value into … … 1001 1002 ==== time->string 1002 1003 1003 [procedure] (time->string VECTOR [FORMAT]) 1004 <procedure>(time->string VECTOR)</procedure> 1004 1005 1005 1006 Converts the broken down time represented in the 10 element vector … … 1024 1025 ==== _exit 1025 1026 1026 [procedure] (_exit [CODE]) 1027 <procedure>(_exit [CODE])</procedure> 1027 1028 1028 1029 Exits the current process without flushing any buffered output (using … … 1064 1065 ==== find-files 1065 1066 1066 [procedure] (find-files DIRECTORY PREDICATE [ACTION [IDENTITY [LIMIT]]]) 1067 <procedure>(find-files DIRECTORY PREDICATE [ACTION [IDENTITY [LIMIT]]])</procedure> 1067 1068 1068 1069 Recursively traverses the contents of {{DIRECTORY}} (which should … … 1089 1090 ==== get-host-name 1090 1091 1091 [procedure] (get-host-name) 1092 <procedure>(get-host-name)</procedure> 1092 1093 1093 1094 Returns the hostname of the machine that this process is running on. … … 1095 1096 ==== system-information 1096 1097 1097 [procedure] (system-information) 1098 <procedure>(system-information)</procedure> 1098 1099 1099 1100 Invokes the UNIX system call {{uname()}} and returns a list of 5 values: … … 1104 1105 ==== set-buffering-mode! 1105 1106 1106 [procedure] (set-buffering-mode! PORT MODE [BUFSIZE]) 1107 <procedure>(set-buffering-mode! PORT MODE [BUFSIZE])</procedure> 1107 1108 1108 1109 Sets the buffering-mode for the file associated with {{PORT}} to … … 1116 1117 ==== terminal-name 1117 1118 1118 [procedure] (terminal-name PORT) 1119 <procedure>(terminal-name PORT)</procedure> 1119 1120 1120 1121 Returns the name of the terminal that is connected to {{PORT}}. … … 1122 1123 ==== terminal-port? 1123 1124 1124 [procedure] (terminal-port? PORT) 1125 <procedure>(terminal-port? PORT)</procedure> 1125 1126 1126 1127 Returns {{#t}} if {{PORT}} is connected to a terminal and … … 1229 1230 Exceptions to the above procedure definitions. 1230 1231 1231 [procedure] (create-pipe [MODE]) 1232 <procedure>(create-pipe [MODE])</procedure> 1232 1233 1233 1234 The optional parameter {{MODE}}, default {{open/binary | open/noinherit}}. This can be {{open/binary}} or 1234 1235 {{open/text}}, optionally or'ed with {{open/noinherit}}. 1235 1236 1236 [procedure] (process-wait [PID [NOHANG]]) 1237 <procedure>(process-wait [PID [NOHANG]])</procedure> 1237 1238 1238 1239 {{process-wait}} always returns {{#t}} for a terminated process and only the exit … … 1240 1241 communication method.) 1241 1242 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> 1245 1246 1246 1247 The optional parameter {{EXACT-FLAG}}, default {{#f}}. When {{#f}} any argument string with … … 1277 1278 set-root-directory! 1278 1279 utc-time->seconds 1279 string->time1280 1280 1281 1281 ==== Additional Definitions … … 1302 1302 ==== process-spawn 1303 1303 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> 1305 1305 1306 1306 Creates and runs a new process with the given {{COMMAND}} filename and the optional -
chicken/trunk/manual/Unit regex
r12929 r13659 195 195 196 196 197 === make-anchored-pattern198 199 [procedure] (make-anchored-pattern REGEXP [WITHOUT-BOL [WITHOUT-EOL]])200 201 Makes an anchored pattern from {{REGEXP}} (a string or a precompiled regular202 expression) and returns the updated pattern. When {{WITHOUT-BOL}} is {{#t}} the203 beginning-of-line anchor is not added. When {{WITHOUT-EOL}} is {{#t}} the204 end-of-line anchor is not added.205 206 The {{WITHOUT-BOL}} and {WITHOUT-EOL}} arguments are ignored for a precompiled regular207 expression.208 209 210 197 Previous: [[Unit srfi-14]] 211 198 -
chicken/trunk/manual/Unit srfi-18
r7187 r13659 32 32 33 33 ** 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. 34 36 35 37 The following procedures are provided, in addition to the procedures defined in SRFI-18: … … 85 87 the number of milliseconds since process startup. 86 88 89 === milliseconds->time 90 91 [procedure] (milliseconds->time ms) 92 93 Converts into a time object an exact integer representing 94 the number of milliseconds since process startup. 95 96 This 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))))) 87 101 88 102 Previous: [[Unit regex]] -
chicken/trunk/manual/Unit tcp
r12227 r13659 16 16 === tcp-listen 17 17 18 [procedure] (tcp-listen TCPPORT [BACKLOG [HOST]]) 18 <procedure>(tcp-listen TCPPORT [BACKLOG [HOST]])</procedure> 19 19 20 20 Creates and returns a TCP listener object that listens for connections on {{TCPPORT}}, which … … 26 26 === tcp-listener? 27 27 28 [procedure] (tcp-listener? X) 28 <procedure>(tcp-listener? X)</procedure> 29 29 30 30 Returns {{#t}} if {{X}} is a TCP listener object, or {{#f}} otherwise. … … 33 33 === tcp-close 34 34 35 [procedure] (tcp-close LISTENER) 35 <procedure>(tcp-close LISTENER)</procedure> 36 36 37 37 Reclaims any resources associated with {{LISTENER}}. … … 40 40 === tcp-accept 41 41 42 [procedure] (tcp-accept LISTENER) 42 <procedure>(tcp-accept LISTENER)</procedure> 43 43 44 44 Waits until a connection is established on the port on which … … 52 52 and {{tcp-write-timeout}}, respectively, to determine the maximal 53 53 number 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)}}.54 error is signalled. 55 55 56 56 Note: this operation and any I/O on the ports returned will not block … … 60 60 === tcp-accept-ready? 61 61 62 [procedure] (tcp-accept-ready? LISTENER) 62 <procedure>(tcp-accept-ready? LISTENER)</procedure> 63 63 64 64 Returns {{#t}} if there are any connections pending on {{LISTENER}}, or {{#f}} … … 68 68 === tcp-listener-port 69 69 70 [procedure] (tcp-listener-port LISTENER) 70 <procedure>(tcp-listener-port LISTENER)</procedure> 71 71 72 72 Returns the port number assigned to {{LISTENER}} (If you pass {{0}} to {{tcp-listen}}, … … 75 75 === tcp-listener-fileno 76 76 77 [procedure] (tcp-listener-fileno LISTENER) 77 <procedure>(tcp-listener-fileno LISTENER)</procedure> 78 78 79 79 Returns the file-descriptor associated with {{LISTENER}}. … … 82 82 === tcp-connect 83 83 84 [procedure] (tcp-connect HOSTNAME [TCPPORT]) 84 <procedure>(tcp-connect HOSTNAME [TCPPORT])</procedure> 85 85 86 86 Establishes a client-side TCP connection to the machine with the name … … 94 94 {{tcp-write-timeout}}, respectively, to determine the maximal number 95 95 of milliseconds to wait for input/output before a timeout error is 96 signalled by raising an exception of the kinds {{(exn i/o net)}}.96 signalled. 97 97 98 98 If 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}}]]. … … 103 103 === tcp-addresses 104 104 105 [procedure] (tcp-addresses PORT) 105 <procedure>(tcp-addresses PORT)</procedure> 106 106 107 107 Returns two values for the input- or output-port {{PORT}} (which should be a port returned … … 113 113 === tcp-port-numbers 114 114 115 [procedure] (tcp-port-numbers PORT) 115 <procedure>(tcp-port-numbers PORT)</procedure> 116 116 117 117 Returns two values for the input- or output-port {{PORT}} (which should be a port returned … … 122 122 === tcp-abandon-port 123 123 124 [procedure] (tcp-abandon-port PORT) 124 <procedure>(tcp-abandon-port PORT)</procedure> 125 125 126 126 Marks the socket port {{PORT}} as abandoned. This is mainly useful to close down a port -
chicken/trunk/manual/Using the compiler
r13538 r13659 373 373 ; [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. 374 374 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 377 375 ; [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. 378 376 -
chicken/trunk/manual/faq
r13452 r13659 96 96 There is an extension based on the GNU Multiprecision Package that implements most of the full 97 97 numeric 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 like103 numbers, strings, etc. so for example104 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 primitive112 objects, use {{<top>}}:113 114 <enscript highlight=scheme>115 (define-method (foo (x <top>)) ...)116 </enscript>117 98 118 99 … … 150 131 151 132 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 135 Here is what Marc Feeley, the author of [[http://srfi.schemers.org/srfi-18|SRFI-18]] has to 136 say 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. 155 163 156 164 -
chicken/trunk/scripts/wiki2html.scm
r13581 r13659 4 4 5 5 6 (use regex srfi-1 extras utils )6 (use regex srfi-1 extras utils srfi-13 posix) 7 7 (use htmlprag matchable) 8 8 … … 44 44 ;;; Global state 45 45 46 (define *toc* #f)47 46 (define *tags* '()) 48 47 (define *open* '()) 48 (define *manual-pages* '()) 49 49 50 50 (define (push-tag tag out) … … 133 133 (first m) 134 134 (continue m)))) 135 ((string-search (rx `(: bos ,+link+)) rest) =>135 ((string-search (rx `(: bos ,+link+)) rest) => 136 136 (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))))) 142 151 ((string-search (rx `(: bos ,+bold+)) rest) => 143 152 (lambda (m) … … 153 162 str)) 154 163 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 155 178 156 179 ;;; Normalize text … … 160 183 161 184 162 ;;; run it185 ;;; Run it 163 186 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.