Changeset 7276 in project
- Timestamp:
- 01/05/08 20:17:50 (12 years ago)
- Location:
- chicken/branches/release
- Files:
-
- 72 edited
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
chicken/branches/release/Makefile
r6421 r7276 34 34 35 35 36 .PHONY: all clean distclean spotless install uninstall confclean check 36 .PHONY: all clean distclean spotless install uninstall confclean check dist \ 37 libs install-libs fullcheck bootstrap 37 38 38 39 ifndef PLATFORM … … 70 71 check: 71 72 $(MAKE) -f Makefile.$(PLATFORM) check 73 fullcheck: 74 $(MAKE) -f Makefile.$(PLATFORM) fullcheck 75 dist: 76 $(MAKE) -f Makefile.$(PLATFORM) distfiles 77 csi -s misc/makedist.scm 78 libs: 79 $(MAKE) -f Makefile.$(PLATFORM) libs 80 install-libs: 81 $(MAKE) -f Makefile.$(PLATFORM) install-libs 82 bootstrap: 83 $(MAKE) -f Makefile.$(PLATFORM) bootstrap 72 84 endif -
chicken/branches/release/Makefile.cross-linux-mingw
r6577 r7276 36 36 # platform configuration 37 37 38 DLLSINPATH = 1 38 39 ARCH = x86 39 40 HACKED_APPLY = 1 … … 47 48 # commands 48 49 49 HOST =mingw3250 HOSTSYSTEM=mingw32 50 51 51 52 # options … … 60 61 C_COMPILER_GUI_RUNTIME_OPTIONS = -DC_WINDOWS_GUI 61 62 LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared 62 LIBRARIES = -lm 63 LIBRARIES = -lm -lws2_32 63 64 LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a 64 65 LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a … … 69 70 LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a 70 71 LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a 72 TARGET_C_COMPILER = gcc 73 TARGET_CXX_COMPILER = g++ 71 74 72 75 # special files … … 84 87 chicken-profile$(EXE) csc$(EXE) libchicken$(SO) \ 85 88 libuchicken$(SO) chicken-setup$(EXE) chicken.info \ 86 libchickengui$(SO) 89 libchickengui$(SO) chicken-bug$(EXE) 87 90 88 91 chicken-config.h: chicken-defaults.h -
chicken/branches/release/Makefile.cygwin
r6208 r7276 41 41 # options 42 42 43 SO = .dll 44 EXE = .exe 45 46 C_COMPILER = gcc 47 CXX_COMPILER = g++ 48 LINKER = gcc 49 50 43 51 C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H 44 52 ifdef DEBUGBUILD 45 53 C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused 46 54 else 47 C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer55 C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os 48 56 endif 49 57 C_COMPILER_SHARED_OPTIONS = -DPIC 50 LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared 51 LIBRARIES = -lm 58 LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared 59 LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,--dll-search-prefix=cyg -Wl,--export-dynamic 60 LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a \ 61 -Wl,--export-all-symbols \ 62 -Wl,--enable-auto-import \ 63 -Wl,--image-base=0x10000000 \ 64 -Wl,--dll \ 65 -Wl,--add-stdcall-alias \ 66 -Wl,--no-whole-archive 67 LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a \ 68 -Wl,--export-all-symbols \ 69 -Wl,--enable-auto-import \ 70 -Wl,--image-base=0x10000000 \ 71 -Wl,--dll \ 72 -Wl,--add-stdcall-alias \ 73 -Wl,--no-whole-archive 74 75 LIBRARIES = -lm 76 LIBCHICKEN_SO_LIBRARIES = -lm 77 LIBUCHICKEN_SO_LIBRARIES = -lm 78 LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a 79 LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a 80 52 81 53 82 # special files 54 83 55 84 CHICKEN_CONFIG_H = chicken-config.h 85 APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O) 56 86 57 87 # select default and internal settings 58 88 89 CUSTOM_CHICKEN_DEFAULTS=1 59 90 include defaults.make 60 91 … … 84 115 echo "#define HAVE_GCVT 1" >>$@ 85 116 echo "#define HAVE_SYSEXITS_H 1" >>$@ 86 echo "#define HAVE_ MEMMOVE1" >>$@117 echo "#define HAVE_DLFCN_H 1" >>$@ 87 118 echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@ 88 119 ifdef GCHOOKS … … 100 131 cat chicken-defaults.h >>$@ 101 132 133 chicken-defaults.h: 134 echo "/* generated */" >$@ 135 echo "#define C_BUILD_TAG \"$(BUILD_TAG)\"" >>$@ 136 echo "#ifndef C_INSTALL_CC" >>$@ 137 echo "# define C_INSTALL_CC \"$(C_COMPILER)\"" >>$@ 138 echo "#endif" >>$@ 139 echo "#ifndef C_INSTALL_CXX" >>$@ 140 echo "# define C_INSTALL_CXX \"$(CXX_COMPILER)\"" >>$@ 141 echo "#endif" >>$@ 142 echo "#ifndef C_INSTALL_CFLAGS" >>$@ 143 echo "# define C_INSTALL_CFLAGS \"$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@ 144 echo "#endif" >>$@ 145 echo "#ifndef C_INSTALL_LDFLAGS" >>$@ 146 echo "# define C_INSTALL_LDFLAGS \"$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)\"" >>$@ 147 echo "#endif" >>$@ 148 echo "#ifndef C_INSTALL_SHARE_HOME" >>$@ 149 echo "# define C_INSTALL_SHARE_HOME \"$(DATADIR)\"" >>$@ 150 echo "#endif" >>$@ 151 echo "#ifndef C_INSTALL_BIN_HOME" >>$@ 152 echo "# define C_INSTALL_BIN_HOME \"$(BINDIR)\"" >>$@ 153 echo "#endif" >>$@ 154 echo "#ifndef C_INSTALL_EGG_HOME" >>$@ 155 echo "# define C_INSTALL_EGG_HOME \"$(EGGDIR)\"" >>$@ 156 echo "#endif" >>$@ 157 echo "#ifndef C_INSTALL_LIB_HOME" >>$@ 158 echo "# define C_INSTALL_LIB_HOME \"$(BINDIR)\"" >>$@ 159 echo "#endif" >>$@ 160 echo "#ifndef C_INSTALL_STATIC_LIB_HOME" >>$@ 161 echo "# define C_INSTALL_STATIC_LIB_HOME \"$(LIBDIR)\"" >>$@ 162 echo "#endif" >>$@ 163 echo "#ifndef C_INSTALL_INCLUDE_HOME" >>$@ 164 echo "# define C_INSTALL_INCLUDE_HOME \"$(INCDIR)\"" >>$@ 165 echo "#endif" >>$@ 166 echo "#ifndef C_INSTALL_MORE_LIBS" >>$@ 167 echo "# define C_INSTALL_MORE_LIBS \"$(LIBRARIES)\"" >>$@ 168 echo "#endif" >>$@ 169 echo "#ifndef C_INSTALL_MORE_STATIC_LIBS" >>$@ 170 echo "# define C_INSTALL_MORE_STATIC_LIBS \"$(LIBRARIES)\"" >>$@ 171 echo "#endif" >>$@ 172 echo "#ifndef C_DEFAULT_TARGET_STACK_SIZE" >>$@ 173 echo "# define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY)" >>$@ 174 echo "#endif" >>$@ 175 echo "#ifndef C_STACK_GROWS_DOWNWARD" >>$@ 176 echo "# define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION)" >>$@ 177 echo "#endif" >>$@ 178 echo "#ifndef C_TARGET_MORE_LIBS" >>$@ 179 echo "# define C_TARGET_MORE_LIBS \"$(TARGET_LIBRARIES)\"" >>$@ 180 echo "#endif" >>$@ 181 echo "#ifndef C_TARGET_MORE_STATIC_LIBS" >>$@ 182 echo "# define C_TARGET_MORE_STATIC_LIBS \"$(TARGET_LIBRARIES)\"" >>$@ 183 echo "#endif" >>$@ 184 echo "#ifndef C_TARGET_CC" >>$@ 185 echo "# define C_TARGET_CC \"$(TARGET_C_COMPILER)\"" >>$@ 186 echo "#endif" >>$@ 187 echo "#ifndef C_TARGET_CXX" >>$@ 188 echo "# define C_TARGET_CXX \"$(TARGET_CXX_COMPILER)\"" >>$@ 189 echo "#endif" >>$@ 190 echo "#ifndef C_TARGET_CFLAGS" >>$@ 191 echo "# define C_TARGET_CFLAGS \"$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@ 192 echo "#endif" >>$@ 193 echo "#ifndef C_TARGET_LDFLAGS" >>$@ 194 echo "# define C_TARGET_LDFLAGS \"$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)\"" >>$@ 195 echo "#endif" >>$@ 196 echo "#ifndef C_CROSS_CHICKEN" >>$@ 197 echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@ 198 echo "#endif" >>$@ 199 echo "#ifndef C_TARGET_LIB_HOME" >>$@ 200 echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/bin\"" >>$@ 201 echo "#endif" >>$@ 202 echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@ 203 echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_RUN_PREFIX)/bin\"" >>$@ 204 echo "#endif" >>$@ 205 echo "#ifndef C_TARGET_SHARE_HOME" >>$@ 206 echo "# define C_TARGET_SHARE_HOME \"$(TARGET_PREFIX)/share\"" >>$@ 207 echo "#endif" >>$@ 208 echo "#ifndef C_TARGET_INCLUDE_HOME" >>$@ 209 echo "# define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/include\"" >>$@ 210 echo "#endif" >>$@ 211 echo "#ifndef C_TARGET_STATIC_LIB_HOME" >>$@ 212 echo "# define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@ 213 echo "#endif" >>$@ 214 echo "#ifndef C_CHICKEN_PROGRAM" >>$@ 215 echo "# define C_CHICKEN_PROGRAM \"$(CHICKEN_PROGRAM)\"" >>$@ 216 echo "#endif" >>$@ 217 echo "#ifndef C_CSC_PROGRAM" >>$@ 218 echo "# define C_CSC_PROGRAM \"$(CSC_PROGRAM)\"" >>$@ 219 echo "#endif" >>$@ 220 echo "#ifndef C_CSI_PROGRAM" >>$@ 221 echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@ 222 echo "#endif" >>$@ 223 echo "#ifndef C_CHICKEN_PROFILE_PROGRAM" >>$@ 224 echo "# define C_CHICKEN_PROFILE_PROGRAM \"$(CHICKEN_PROFILE_PROGRAM)\"" >>$@ 225 echo "#endif" >>$@ 226 echo "#ifndef C_CHICKEN_SETUP_PROGRAM" >>$@ 227 echo "# define C_CHICKEN_SETUP_PROGRAM \"$(CHICKEN_SETUP_PROGRAM)\"" >>$@ 228 echo "#endif" >>$@ 229 echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@ 230 echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@ 231 echo "#endif" >>$@ 232 102 233 include rules.make -
chicken/branches/release/Makefile.linux
r6577 r7276 47 47 endif 48 48 LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared 49 LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-R$(LIBDIR) 50 ifdef STATICBUILD 51 LIBRARIES = -lm 52 else 49 RUNTIME_LINKER_PATH = $(shell pwd) 50 LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-R$(RUNTIME_LINKER_PATH) 53 51 LIBRARIES = -lm -ldl 54 endif 52 NEEDS_RELINKING = yes 55 53 56 54 # special files -
chicken/branches/release/Makefile.macosx
r6577 r7276 54 54 POSTINSTALL_PROGRAM_FLAGS = -change libchicken$(SO) $(LIBDIR)/libchicken$(SO) 55 55 56 ifeq ($(ARCH),x86-64) 57 C_COMPILER_OPTIONS += -m64 58 LINKER_OPTIONS += -m64 59 endif 60 56 61 # file extensions 57 62 -
chicken/branches/release/Makefile.mingw
r6577 r7276 36 36 # platform configuration 37 37 38 DLLSINPATH = 1 38 39 ARCH = x86 39 40 HACKED_APPLY = 1 … … 66 67 LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a 67 68 LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a 69 MAKEDIR_COMMAND_OPTIONS = 68 70 69 71 # special files … … 139 141 echo # define C_INSTALL_CFLAGS "$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@ 140 142 echo #endif >>$@ 143 echo #ifndef C_INSTALL_LDFLAGS >>$@ 144 echo # define C_INSTALL_LDFLAGS "$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)" >>$@ 145 echo #endif >>$@ 141 146 echo #ifndef C_INSTALL_SHARE_HOME >>$@ 142 147 echo # define C_INSTALL_SHARE_HOME "$(DATADIR)" >>$@ … … 184 189 echo # define C_TARGET_CFLAGS "$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@ 185 190 echo #endif >>$@ 191 echo #ifndef C_TARGET_LDFLAGS >>$@ 192 echo # define C_TARGET_LDFLAGS "$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)" >>$@ 193 echo #endif >>$@ 186 194 echo #ifndef C_CROSS_CHICKEN >>$@ 187 195 echo # define C_CROSS_CHICKEN $(CROSS_CHICKEN) >>$@ -
chicken/branches/release/Makefile.mingw-msys
r6577 r7276 36 36 # platform configuration 37 37 38 DLLSINPATH = 1 38 39 ARCH = x86 39 40 HACKED_APPLY = 1 -
chicken/branches/release/NEWS
r6577 r7276 1 2.732 2 1 2.736 2 3 - added pre GC hook C-level variable 4 - Cygwin is now fully supported 5 - removed deprecated functions: 6 extension-info 7 print-backtrace 8 test-feature? 9 ___callback (chicken.h) 10 foreign-callback-lambda[*] 11 thread-deliver-signal! 12 critical-section 13 enable-interrupts 14 disable-interrupts 15 invalid-procedure-call-handler 16 - chicken-setup: can create repository catalog file from local 17 SVN checkout of egg repository 3 18 - Better cross-development support for the build system (the 4 Makefile accepts PROGRAM_PREFIX, PROGRAM_SUFFIX, HOST and TARGET 5 settings) 19 Makefile accepts various variables for customizing the build) 20 - "file-size" and "file-stat" handle file-sizes of >4GB now 21 - "find-files" collects directories as well, now [Thanks to Ivan Raikov] 22 - added "dist" target to toplevel makefile 23 - "andmap" and "ormap" have been deprecated 24 - makefiles support relinking now 6 25 7 26 2.717 -
chicken/branches/release/README
r6577 r7276 3 3 (c)2000-2007 Felix L. Winkelmann 4 4 5 Version 2.7325 version 2.739 6 6 7 7 … … 56 56 make PLATFORM=<platform> PREFIX=<destination> 57 57 58 where "PLATFORM" specifies on what kind of system CHICKEN shall 59 be built and "PREFIX" specifies where the executables and 60 libraries shall be installed. 58 where "PLATFORM" specifies on what kind of system CHICKEN 59 shall be built and "PREFIX" specifies where the executables 60 and libraries shall be installed. Out-of-directory builds are 61 currently not supported, so you must be in the toplevel source 62 directory to invoke "make". 61 63 62 64 Enter "make" without any options to see a list of supported 63 65 platforms. 64 66 65 If you build CHICKEN directly from the development sources 66 out of the subversion repository, an installed "chicken" 67 executable is required, which defaults to 68 "$PREFIX/bin/chicken". Pass "CHICKEN=<chicken-executable>" 69 to the "make" invocation to override this setting. 67 If you build CHICKEN directly from the development sources out 68 of the subversion repository, you will need a "chicken" 69 executable to generate the compiled C files from the Scheme 70 library sources. If you have a recent version of CHICKEN 71 installed, then pass "CHICKEN=<chicken-executable>" to the 72 "make" invocation to override this setting. "CHICKEN" defaults 73 to defaults to "$PREFIX/bin/chicken". 74 75 If you do not have a "chicken" binary installed, enter 76 77 make PLATFORM=<platform> PREFIX=<destination> bootstrap 78 79 which will unpack a tarball containing precompiled C sources 80 that are recent enough to generate the current version. After 81 building a statically linked "chicken" executable, all Scheme 82 sources are recompiled with it. From this stage on 83 bootstrapping isn't necessary anymore, as long as you have a 84 compiler binary in your source tree. 70 85 71 86 The build may show errors when creating the info(1) … … 128 143 A suffix to be appended to the names of all generated executables. 129 144 145 HOSTSYSTEM= 146 A "<machine>-<platform>" name prefix to use for the C compiler to to 147 use to compile the runtime system and executables. Set this variable 148 if you want to compile CHICKEN for a different architecture than 149 the one on which you are building it. 150 151 TARGETSYSTEM= 152 Similar to "HOSTSYSTEM", but specifies the name prefix to use for compiling 153 code with the "csc" compiler driver. This is required for creating 154 a "cross chicken", a specially built CHICKEN that invokes a cross 155 C compiler to build the final binaries. You will need a cross compiled 156 runtime system by building a version of CHICKEN with the "HOST" option 157 mentioned above. More information about this process and the variables 158 that you should set are provided in the CHICKEN wiki at 159 <http://chicken.wiki.br/cross-compilation>. 160 130 161 To remove CHICKEN from your file-system, enter (probably as 131 162 root): … … 182 213 5. Platform issues: 183 214 184 215 - *BSD system users *must* use GNU make ("gmake") - the makefiles 185 216 can not be processed by BSD make. 186 217 … … 194 225 `gcc'. 195 226 196 197 trouble with dynamic loading.Patching Solaris fixes the198 199 200 201 202 227 - Older versions of Solaris have a bug in ld.so that causes 228 trouble with dynamic loading. Patching Solaris fixes the 229 problem. Solaris 7 needs patch 106950-18. Solaris 8 has an 230 equivalent patch, 109147-16. 231 232 You can find out if you have these patches installed by 233 running: 203 234 204 235 % showrev -p | grep 106950 # solaris 7 205 236 % showrev -p | grep 109147 # solaris 8 206 237 207 238 - On NetBSD it might be possible that compilation fails with a 208 239 "virtual memory exhausted error". Try the following: 209 240 210 211 212 241 % unlimit datasize 242 243 - For Mac OS X, Chicken requires libdl, for loading compiled 213 244 code dynamically. This library is available on Mac OS X 10.4 214 245 (Tiger) by default. For older version you can find it here: … … 216 247 http://www.opendarwin.org/projects/dlcompat 217 248 218 - On Windows, only mingw32 <http://mingw.sourceforge.net/> is 219 supported (Microsoft Visual Studio is NOT). Makefiles for 220 mingw under MSYS and Windows shell are provided 221 (`Makefile.mingw-msys' and `Makefile.mingw'). 249 - On Mac OS X, Chicken can be built in 64-bit mode on Intel 250 Core 2 Duo systems--basically, most recent machines. The default 251 is 32-bit mode. To enable 64-bit mode, invoke `make` thusly: 252 253 make PLATFORM=macosx ARCH=x86-64 254 255 - On Windows, only mingw32 <http://mingw.sourceforge.net/> and 256 Cygwin is supported (Microsoft Visual Studio is 257 NOT). Makefiles for mingw under MSYS and Windows shell are 258 provided (`Makefile.mingw-msys' and `Makefile.mingw'). 222 259 223 Be sure that the Chicken LIBDIR is in the Path. Windows224 looks for '.dll' files along the Path.260 - Cygwin will not be able to find the chicken shared libraries 261 until Windows is rebooted. 225 262 226 263 - gcc 3.4 shows sometimes warnings of the form 227 264 228 229 265 easyffi.c: In function `f_11735': 266 easyffi.c:18697: warning: `noreturn' function does return 230 267 231 268 when compiling the system or compiled Scheme files. These … … 280 317 7. What's next? 281 318 319 If you find any bugs, or want to report a problem, please consider 320 using the "chicken-bug" tool to create a detailed bug report. 321 282 322 If you have any more questions or problems (even the slightest 283 323 problems, or the most stupid questions), then please subscribe 284 to the CHICKENmailing list or contact me at:285 286 <felix@call-with-current-continuation.org> .324 to the "chicken-users" mailing list or contact me at: 325 326 <felix@call-with-current-continuation.org> 287 327 288 328 -
chicken/branches/release/apply-hack.x86-64.s
r5970 r7276 37 37 38 38 .globl _C_do_apply_hack 39 #ifndef __APPLE__ 39 40 .type _C_do_apply_hack, @function 40 41 #endif 42 41 43 _C_do_apply_hack: 42 44 subq $8, %rsp /* force non-16 byte alignment */ -
chicken/branches/release/batch-driver.scm
r5616 r7276 39 39 40 40 41 #{compiler 41 (private 42 compiler 42 43 compiler-arguments process-command-line dump-nodes dump-undefined-globals 43 44 default-standard-bindings default-extended-bindings side-effecting-standard-bindings … … 61 62 reorganize-recursive-bindings substitution-table simplify-named-call emit-unsafe-marker 62 63 perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda* 63 transform-direct-lambdas! source-filename compressed-literals literal-compression-threshold64 transform-direct-lambdas! source-filename 64 65 debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list 65 66 string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant? … … 71 72 topological-sort print-version print-usage initialize-analysis-database dump-exported-globals 72 73 default-declarations units-used-by-default words-per-flonum default-debugging-declarations 73 default-profiling-declarations default-optimization-passes compressed-literals-initializer74 default-profiling-declarations default-optimization-passes 74 75 inline-max-size file-requirements use-import-table lookup-exports-file 75 76 foreign-string-result-reserve parameter-limit eq-inline-operator optimizable-rest-argument-operators … … 78 79 generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration 79 80 export-list do-lambda-lifting compiler-warning export-file-name 80 foreign-argument-conversion foreign-result-conversion }81 foreign-argument-conversion foreign-result-conversion) 81 82 82 83 … … 129 130 [hshrink (memq 'heap-shrinkage options)] 130 131 [kwstyle (memq 'keyword-style options)] 131 [lcthreshold (memq 'compress-literals options)]132 132 [uses-units '()] 133 133 [uunit (memq 'unit options)] … … 261 261 (register-feature! 'case-insensitive) 262 262 (case-sensitive #f) ) 263 (when (memq 'compress-literals options) 264 (compiler-warning 'usage "`the -compress-literals' option is obsolete") ) 263 265 (when kwstyle 264 266 (let ([val (option-arg kwstyle)]) … … 267 269 [(string=? "suffix" val) (keyword-style #:suffix)] 268 270 [else (quit "invalid argument to `-keyword-style' option")] ) ) ) 269 (when lcthreshold270 (let ([t (option-arg lcthreshold)])271 (set! literal-compression-threshold272 (or (string->number t)273 (quit "invalid argument to `-compress-literals' option: ~A" t) ) ) ) )274 271 (set! verbose-mode verbose) 275 272 (set! ##sys#read-error-with-line-number #t) … … 455 452 ',(cdr pl) ) ) 456 453 profile-lambda-list) 457 (let ([is (fold (lambda (clf r)458 `(let ([,(gensym)459 (set! ,(car clf)460 (##sys#read-from-string ',(cdr clf)))])461 ,r) )462 '(##core#undefined)463 compressed-literals) ] )464 (if compressed-literals-initializer465 `((##core#set! ,compressed-literals-initializer466 (lambda () ,is) ) )467 (list is) ) )468 454 exps0 469 455 (if (and (not unit-name) (not dynamic)) … … 596 582 (print-db "final-analysis" '|8| db i) 597 583 (when (and ##sys#warnings-enabled (> (- (cputime) start-time) funny-message-timeout)) 598 (display "(do n't despair- still compiling...)\n") )584 (display "(do not worry - still compiling...)\n") ) 599 585 (when export-file-name 600 586 (dump-exported-globals db export-file-name) ) … … 603 589 604 590 (begin-time) 605 (receive (node literals lambdas) (prepare-for-code-generation node3 db) 591 (receive (node literals lliterals lambdas) 592 (prepare-for-code-generation node3 db) 606 593 (end-time "preparation") 607 594 … … 610 597 (unless quiet 611 598 (printf "generating `~A' ...~%" outfile) ) 612 (generate-code literals l ambdas out filename dynamic db)599 (generate-code literals lliterals lambdas out filename dynamic db) 613 600 (when outfile (close-output-port out))) 614 601 (end-time "code generation") -
chicken/branches/release/buildversion
r6577 r7276 1 2.73 21 2.739 -
chicken/branches/release/c-backend.scm
r6325 r7276 37 37 38 38 39 #{compiler39 (private compiler 40 40 compiler-arguments process-command-line find-early-refs 41 41 default-standard-bindings default-extended-bindings side-effecting-standard-bindings … … 44 44 standard-bindings-that-never-return-false side-effect-free-standard-bindings-that-never-return-false 45 45 installation-home optimization-iterations debugging cleanup 46 file-io-only namespace-table46 file-io-only 47 47 unit-name insert-timer-checks used-units inlining external-variables 48 48 foreign-declarations emit-trace-info block-compilation line-number-database-size … … 52 52 current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants 53 53 rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used 54 mutable-constants 54 mutable-constants encode-literal 55 55 broken-constant-nodes inline-substitutions-enabled 56 56 direct-call-ids foreign-type-table first-analysis block-variable-literal? … … 74 74 topological-sort print-version print-usage initialize-analysis-database 75 75 generate-external-variables real-name real-name2 unique-id 76 default-declarations units-used-by-default words-per-flonum 76 default-declarations units-used-by-default words-per-flonum big-fixnum? 77 77 foreign-string-result-reserve parameter-limit eq-inline-operator optimizable-rest-argument-operators 78 78 membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument 79 79 default-optimization-iterations generate-foreign-callback-header generate-foreign-callback-stub-prototypes 80 80 generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration 81 foreign-argument-conversion foreign-result-conversion quick-namespace-list setup-quick-namespace-list 82 namespace-lookup compute-namespace-size} 81 foreign-argument-conversion foreign-result-conversion) 83 82 84 83 (include "tweaks") … … 102 101 (intersperse lst #\space) ) ) 103 102 104 (define (compute-namespace-size n)105 37) ; Arbitrary...106 107 103 108 104 ;;; Unique id/prefix: … … 113 109 114 110 115 ;;; Check name for namespace:116 ;;117 ;; This stuff is basically not needed. The namespace thingy once looked good, but118 ;; can not replace a proper module system. It's still available, and might be119 ;; handy for certain hacks.120 121 (define quick-namespace-list '())122 123 (define (setup-quick-namespace-list)124 (for-each125 (lambda (ns)126 (set! quick-namespace-list (append (cdr ns) quick-namespace-list)) )127 namespace-table) )128 129 (define (namespace-lookup sym)130 (and (memq sym quick-namespace-list)131 (let loop ([nslist namespace-table] [i 0])132 (cond [(null? nslist) (bomb "symbol not in namespace" sym)]133 [(memq sym (cdar nslist)) i]134 [else (loop (cdr nslist) (add1 i))] ) ) ) )135 136 137 111 ;;; Generate target code: 138 112 139 (define (generate-code literals l ambdas out source-file dynamic db)113 (define (generate-code literals lliterals lambdas out source-file dynamic db) 140 114 (let () 141 115 … … 166 140 (else (bomb "bad immediate")) ) ) 167 141 168 ((##core#literal) (gen "lf[" (first params) #\])) 142 ((##core#literal) 143 (let ((lit (first params))) 144 (if (vector? lit) 145 (gen "((C_word)li" (vector-ref lit 0) ")") 146 (gen "lf[" (first params) #\])) ) ) 169 147 170 148 ((if) … … 482 460 " http://www.call-with-current-continuation.org" #t 483 461 " " (+ 1900 year) #\- (pad0 (add1 mon)) #\- (pad0 mday) #\space (pad0 hour) #\: (pad0 min) #t 484 " " (chicken-version #t) #t 462 (string-intersperse 463 (map (cut string-append " " <> "\n") 464 (string-split (chicken-version #t) "\n") ) 465 "") 485 466 " command line: ") 486 467 (gen-list compiler-arguments) … … 511 492 used-units) 512 493 (unless (zero? n) 513 (gen #t #t "static C_TLS C_word lf[" n"];") ) ) ) 494 (gen #t #t "static C_TLS C_word lf[" n "];") ) 495 (do ((i 0 (add1 i)) 496 (llits lliterals (cdr llits))) 497 ((null? llits)) 498 (let* ((ll (##sys#lambda-info->string (car llits))) 499 (llen (string-length ll))) 500 (gen #t "static C_char C_TLS li" i "[]={C_lihdr(" 501 (arithmetic-shift llen -16) #\, 502 (bitwise-and #xff (arithmetic-shift llen -8)) #\, 503 (bitwise-and #xff llen) 504 #\)) 505 (do ((n 0 (add1 n))) 506 ((>= n llen)) 507 (gen #\, (char->integer (string-ref ll n))) ) 508 (gen "};"))))) 514 509 515 510 (define (prototypes) … … 572 567 (for-each 573 568 (lambda (s) 574 (gen #t "typedef void ( C_cdecl*C_proc" s ")(C_word")569 (gen #t "typedef void (*C_proc" s ")(C_word") 575 570 (for-each gen (make-list s ",C_word")) 576 571 (gen ") C_noret;") ) … … 651 646 652 647 (define (literal-frame) 653 (do ([i 0 ( + i 1)]648 (do ([i 0 (add1 i)] 654 649 [lits literals (cdr lits)] ) 655 650 ((null? lits)) 656 (gen-lit (car lits) (sprintf "lf[~s]" i) #t) ) )651 (gen-lit (car lits) (sprintf "lf[~s]" i)) ) ) 657 652 658 653 (define (bad-literal lit) … … 669 664 [(##sys#immediate? lit) (bad-literal lit)] 670 665 [(##core#inline "C_lambdainfop" lit) 0] 671 [(##sys#bytevector? lit) 672 (if (##sys#permanent? lit) 673 0 674 (+ 2 (words (##sys#size lit))) ) ] 666 [(##sys#bytevector? lit) (+ 2 (words (##sys#size lit))) ] ; drops "permanent" property! 675 667 [(##sys#generic-structure? lit) 676 668 (let ([n (##sys#size lit)]) … … 681 673 [else (bad-literal lit)] ) ) 682 674 683 ;; This is currently not needed but will be handy for optimized literal lists/vector constructors... 684 (define (imm-lit lit) 685 (cond [(fixnum? lit) (string-append "C_fix(" (number->string lit) ")")] 686 [(eq? #t lit) "C_SCHEME_TRUE"] 687 [(eq? #f lit) "C_SCHEME_FALSE"] 688 [(null? lit) "C_SCHEME_END_OF_LIST"] 689 [(eq? lit (void)) "C_SCHEME_UNDEFINED"] 690 [(char? lit) (string-append "C_make_character(" (number->string (char->integer lit)) ")")] 691 [(eof-object? lit) "C_SCHEME_END_OF_FILE"] 692 [(and (number? lit) (eq? 'fixnum number-type)) 693 (let ([flit (##sys#flo2fix lit)]) 694 (compiler-warning 'type "coerced inexact literal number `~S' to fixnum `~S'" lit flit) 695 (string-append "C_fix(" (number->string flit) ")") ) ] 696 [else #f] ) ) 697 698 (define (gen-lit lit to lf) 699 (cond ((fixnum? lit) 700 (if (eq? 'flonum number-type) 701 (gen #t to "=C_flonum(C_heaptop," lit ");") 702 (gen #t to "=C_fix(" lit ");") ) ) 675 (define (gen-lit lit to) 676 ;; we do simple immediate literals directly to avoid a function call: 677 (cond ((and (fixnum? lit) (not (big-fixnum? lit))) 678 (gen #t to "=C_fix(" lit ");") ) 703 679 ((block-variable-literal? lit)) 704 680 ((eq? lit (void)) 705 681 (gen #t to "=C_SCHEME_UNDEFINED;") ) 706 ((number? lit)707 (cond [(eq? 'fixnum number-type)708 (let ([flit (##sys#flo2fix lit)])709 (compiler-warning 'type "coerced inexact literal number `~S' to fixnum `~S'" lit flit)710 (gen #t to "=C_fix(" flit ");") ) ]711 [else712 (let ((str (number->string lit)))713 (if (and (> (string-length str) 1) (char-alphabetic? (string-ref str 1))) ; inf or nan?714 (gen #t to "=C_flonum(C_heaptop, C_strtod(\"" lit "\", NULL));")715 (gen #t to "=C_flonum(C_heaptop," lit ");"))) ] ) )716 682 ((boolean? lit) 717 683 (gen #t to #\= (if lit "C_SCHEME_TRUE" "C_SCHEME_FALSE") #\;) ) 718 684 ((char? lit) 719 685 (gen #t to "=C_make_character(" (char->integer lit) ");") ) 686 ((symbol? lit) ; handled slightly specially (see C_h_intern_in) 687 (let* ([str (##sys#slot lit 1)] 688 [cstr (c-ify-string str)] 689 [len (##sys#size str)] ) 690 (gen #t to "=") 691 (gen "C_h_intern(&" to #\, len #\, cstr ");") ) ) 720 692 ((null? lit) 721 693 (gen #t to "=C_SCHEME_END_OF_LIST;") ) 722 ((string? lit) (gen-string-like-lit to lit "C_static_string" #t))723 ((##core#inline "C_lambdainfop" lit) (gen-string-like-lit to lit "C_static_lambda_info" #t))724 ((pair? lit)725 (cond ((and (proper-list? lit) (pair? (cdr lit)))726 (do ((len 0 (add1 len))727 (lst lit (cdr lst)) )728 ((null? lst)729 (gen #t to "=C_h_list(" len)730 (do ((k (sub1 len) (sub1 k)))731 ((< k 0) (gen ");" #t "C_drop(" len ");"))732 (gen ",C_pick(" k #\)) ) )733 (gen-lit (car lst) "tmp" #f)734 (gen #t "C_save(tmp);") ) )735 (else736 (gen-lit (car lit) "tmp" #f)737 (gen #t "C_save(tmp);")738 (gen-lit (cdr lit) "tmp" #f)739 (gen #t to "=C_h_pair(C_restore,tmp);") ) ) )740 ((vector? lit) (gen-vector-like-lit to lit "C_h_vector"))741 ((symbol? lit)742 (let* ([str (##sys#slot lit 1)]743 [cstr (c-ify-string str)]744 [len (##sys#size str)]745 [nsi (namespace-lookup lit)] )746 (gen #t to "=")747 (if nsi748 (if lf749 (gen "C_h_intern_in(&" to #\, len #\, cstr ",stable" nsi ");")750 (gen "C_intern_in(C_heaptop," len #\, cstr ",stable" nsi ");") )751 (if lf752 (gen "C_h_intern(&" to #\, len #\, cstr ");")753 (gen "C_intern(C_heaptop," len #\, cstr ");") ) ) ) )754 694 ((##sys#immediate? lit) (bad-literal lit)) 755 ((##sys#bytevector? lit) 756 (if (##sys#permanent? lit) 757 (gen-string-like-lit to lit "C_pbytevector" #f) 758 (gen-string-like-lit to lit "C_bytevector" #t) ) ) 759 ((##sys#generic-structure? lit) (gen-vector-like-lit to lit "C_h_structure")) 760 (else (bad-literal lit)) ) ) 761 762 (define (gen-string-like-lit to lit conser top) 763 (let* ([len (##sys#size lit)] 695 ((##core#inline "C_lambdainfop" lit)) 696 (else 697 (gen #t to "=C_decode_literal(C_heaptop,") 698 (gen-string-constant (encode-literal lit)) 699 (gen ");") ) ) ) 700 701 (define (gen-string-constant str) 702 (let* ([len (##sys#size str)] 764 703 [ns (fx/ len 80)] 765 704 [srest (modulo len 80)] ) 766 (gen #t to #\= conser #\()767 (when top (gen "C_heaptop,"))768 (gen len #\,)769 705 (do ([i ns (sub1 i)] 770 706 [offset 0 (+ offset 80)] ) 771 707 ((zero? i) 772 708 (when (or (zero? len) (not (zero? srest))) 773 (gen (c-ify-string (string-like-substring lit offset len))) ) 774 (gen ");") ) 775 (gen (c-ify-string (string-like-substring lit offset (+ offset 80))) #t) ) ) ) 776 709 (gen (c-ify-string (string-like-substring str offset len))) ) ) 710 (gen (c-ify-string (string-like-substring str offset (+ offset 80))) #t) ) ) ) 711 777 712 (define (string-like-substring s start end) 778 713 (let* ([len (- end start)] … … 780 715 (##sys#copy-bytes s s2 start 0 len) 781 716 s2) ) 782 783 (define (gen-vector-like-lit to lit conser)784 (let ([len (##sys#size lit)])785 (do ([j 0 (+ j 1)]786 [n len (- n 1)] )787 ((zero? n)788 (gen #t to #\= conser #\( len)789 (do ([j (- len 1) (- j 1)])790 ((< j 0) (gen ");" #t "C_drop(" len ");"))791 (gen ",C_pick(" j #\)) ) )792 (gen-lit (##sys#slot lit j) "tmp" #f)793 (gen #t "C_save(tmp);") ) ) )794 717 795 718 (define (procedures) … … 852 775 (gen #t "C_word t" i #\;) ) ) 853 776 (cond [(eq? 'toplevel id) 854 (do ([i 0 (add1 i)]855 [ns namespace-table (cdr ns)] )856 ((null? ns))857 (gen #t "C_SYMBOL_TABLE *stable" i #\;) )858 777 (let ([ldemand (fold (lambda (lit n) (+ n (literal-size lit))) 0 literals)] 859 778 [llen (length literals)] ) … … 861 780 #t "if(toplevel_initialized) C_kontinue(t1,C_SCHEME_UNDEFINED);" 862 781 #t "else C_toplevel_entry(C_text(\"" topname "\"));") 863 (do ([i 0 (add1 i)]864 [ns namespace-table (cdr ns)] )865 ((null? ns))866 (gen #t "stable" i "=C_new_symbol_table(\""867 (caar ns) "\"," (compute-namespace-size (cdar ns)) ");") )868 782 (when disable-stack-overflow-checking 869 783 (gen #t "C_disable_overflow_check=1;") ) … … 990 904 (generate-foreign-callback-stubs foreign-callback-stubs db) 991 905 (trampolines) 992 (setup-quick-namespace-list)993 906 (procedures) 994 907 (emit-procedure-table-info lambdas source-file) … … 1181 1094 (gen #t "/* from " (cleanup rname) " */") ) 1182 1095 (generate-foreign-callback-header "" stub) 1183 (gen #\{ #t "C_word x, *a=C_alloc(" sizestr ");")1184 (gen #t "C_callback_adjust_stack _limits(a);")1096 (gen #\{ #t "C_word x,s=" sizestr ",*a=C_alloc(s);") 1097 (gen #t "C_callback_adjust_stack(a,s);") ; make sure content is below stack_bottom as well 1185 1098 (for-each 1186 1099 (lambda (v t) … … 1377 1290 ((byte) "C_fix((char)") 1378 1291 ((unsigned-byte) "C_fix(0xff&(C_word)") 1379 ((float double integer64) (sprintf "C_flonum(&~a," dest)) ;*** suboptimal for int641292 ((float double) (sprintf "C_flonum(&~a," dest)) ;*** suboptimal for int64 1380 1293 ((number) (sprintf "C_number(&~a," dest)) 1381 1294 ((nonnull-c-string c-string nonnull-c-pointer c-string* nonnull-c-string* … … 1385 1298 ((c-pointer) (sprintf "C_mpointer_or_false(&~a,(void*)" dest)) 1386 1299 ((integer integer32) (sprintf "C_int_to_num(&~a," dest)) 1300 ((integer64) (sprintf "C_a_double_to_num(&~a," dest)) 1387 1301 ((unsigned-integer unsigned-integer32) (sprintf "C_unsigned_int_to_num(&~a," dest)) 1388 1302 ((long) (sprintf "C_long_to_num(&~a," dest)) … … 1413 1327 [else (err)] ) ] 1414 1328 [else (err)] ) ) ) ) ) 1329 1330 1331 ;;; Encoded literals as strings, to be decoded by "C_decode_literal()" 1332 ;; 1333 ;; - everything hardcoded, using the FFI would be the ugly, but safer method. 1334 1335 (define (encode-literal lit) 1336 (define getbits 1337 (foreign-lambda* int ((scheme-object lit)) 1338 " 1339 #ifdef C_SIXTY_FOUR 1340 return((C_header_bits(lit) >> (24 + 32)) & 0xff); 1341 #else 1342 return((C_header_bits(lit) >> 24) & 0xff); 1343 #endif 1344 ") ) 1345 (define getsize 1346 (foreign-lambda* int ((scheme-object lit)) 1347 "return(C_header_size(lit));")) 1348 (define (encode-size n) 1349 ;; only handles sizes in the 24-bit range! 1350 (string (integer->char (bitwise-and #xff (arithmetic-shift n -16))) 1351 (integer->char (bitwise-and #xff (arithmetic-shift n -8))) 1352 (integer->char (bitwise-and #xff n)))) 1353 (define (finish str) ; can be taken out at a later stage 1354 (string-append (string #\xfe) str)) 1355 (finish 1356 (cond ((eq? #t lit) "\xff\x06\x01") 1357 ((eq? #f lit) "\xff\x06\x00") 1358 ((char? lit) (string-append "\xff\x0a" (encode-size (char->integer lit)))) 1359 ((null? lit) "\xff\x0e") 1360 ((eof-object? lit) "\xff\x3e") 1361 ((eq? (void) lit) "\xff\x1e") 1362 ((and (fixnum? lit) (not (big-fixnum? lit))) 1363 (string-append 1364 "\xff\x01" 1365 (string (integer->char (bitwise-and #xff (arithmetic-shift lit -24))) 1366 (integer->char (bitwise-and #xff (arithmetic-shift lit -16))) 1367 (integer->char (bitwise-and #xff (arithmetic-shift lit -8))) 1368 (integer->char (bitwise-and #xff lit)) ) ) ) 1369 ((number? lit) 1370 (string-append "\x55" (number->string lit) "\x00") ) 1371 ((symbol? lit) 1372 (let ((str (##sys#slot lit 1))) 1373 (string-append 1374 "\x01" 1375 (encode-size (string-length str)) 1376 str) ) ) 1377 ((##sys#immediate? lit) 1378 (bomb "invalid literal - can not encode" lit)) 1379 ((##core#inline "C_byteblockp" lit) 1380 (##sys#string-append ; relies on the fact that ##sys#string-append doesn't check 1381 (string-append 1382 (string (integer->char (getbits lit))) 1383 (encode-size (getsize lit)) ) 1384 lit) ) 1385 (else 1386 (let ((len (getsize lit))) 1387 (string-intersperse 1388 (cons* 1389 (string (integer->char (getbits lit))) 1390 (encode-size len) 1391 (list-tabulate len (lambda (i) (encode-literal (##sys#slot lit i))))) 1392 ""))))) ) -
chicken/branches/release/c-platform.scm
r5358 r7276 37 37 38 38 39 #{compiler39 (private compiler 40 40 compiler-arguments process-command-line 41 41 default-standard-bindings default-extended-bindings side-effecting-standard-bindings … … 69 69 membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument 70 70 target-include-file default-profiling-declarations 71 default-optimization-passes internal-bindings 71 default-optimization-passes internal-bindings big-fixnum? 72 72 generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration 73 foreign-argument-conversion foreign-result-conversion }73 foreign-argument-conversion foreign-result-conversion) 74 74 75 75 … … 134 134 '(debug output-file include-path heap-size stack-size unit uses keyword-style require-extension 135 135 inline-limit profile-name disable-warning emit-exports import 136 prelude postlude prologue epilogue nursery extend feature compress-literals 136 prelude postlude prologue epilogue nursery extend feature 137 compress-literals ; DEPRECATED 137 138 heap-growth heap-shrinkage heap-initial-size ffi-define ffi-include-path) ) 138 139 … … 868 869 [(eq? number-type 'fixnum)] 869 870 [n (first (node-parameters val))] 870 [( fixnum? n)] )871 [(and (fixnum? n) (not (big-fixnum? n)))] ) 871 872 (if (negative? n) 872 873 (make-node -
chicken/branches/release/chicken-bug.1
r6251 r7276 39 39 has been passed on the command line, then a description of the problem 40 40 is read from standard input, until EOF (CTRL-D) is read. 41 42 The report will be automatically e-mailed to the CHICKEN maintainers, 43 if an SMTP connection can be established. If no connection can be 44 made, the bug report will be written to a file in the current directory, 45 which should be sent to CHICKEN maintainers as it contains various 46 useful bits of information that make it easier to classify the 47 problem described. 48 41 49 Bug reports should be as detailed as possible. It is also very helpful 42 50 to include code that reproduces the problem. The more detailed the input … … 46 54 .SH BUGS 47 55 Submit bug reports by e-mail to 48 .I felix@call-with-current-continuation.org56 .I chicken-janitors@nongnu.org 49 57 50 58 .SH AUTHOR -
chicken/branches/release/chicken-bug.scm
r6252 r7276 2 2 3 3 4 (use posix utils)4 (use srfi-13 posix utils tcp extras) 5 5 6 6 … … 18 18 (define-constant +bug-report-file+ "chicken-bug-report.~a-~a-~a") 19 19 20 (define-constant + destinations+20 (define-constant +fallbackdestinations+ 21 21 "chicken-janitors@nongnu.org\nchicken-hackers@nongnu.org\nchicken-users@nongnu.org\nfelix@call-with-current-continuation.org") 22 22 23 (define-constant +destination+ "chicken-janitors@nongnu.org") 24 (define-constant +mxservers+ (list "mx10.gnu.org" "mx20.gnu.org")) 23 25 24 26 (define-foreign-variable +cc+ c-string "C_TARGET_CC") … … 28 30 29 31 (define (collect-info) 32 (print "\n--------------------------------------------------\n") 30 33 (print "This is a bug report generated by chicken-bug(1).\n") 31 34 (print "Date:\t" (seconds->string (current-seconds)) "\n") … … 36 39 (print "\tsoftware version:\t" (software-version)) 37 40 (print "\tbuild platform:\t" (build-platform) "\n") 38 (print "CHICKEN version is:\ t" (chicken-version #t) "\n")41 (print "CHICKEN version is:\n" (chicken-version #t) "\n") 39 42 (print "Home directory:\t" (chicken-home) "\n") 40 43 (printf "Include path:\t~s~%~%" ##sys#include-pathnames) … … 68 71 - read description from standard input 69 72 73 Generates a bug report file from user input or alternatively 74 from the contents of files given on the command line. 75 70 76 EOF 71 77 ) … … 77 83 This is the CHICKEN bug report generator. Please enter a detailed 78 84 description of the problem you have encountered and enter CTRL-D (EOF) 79 once you have finished. Presss CTRL-C to abort the program: 85 once you have finished. Press CTRL-C to abort the program. You can 86 also pass the description from a file (just abort now and re-invoke 87 "chicken-bug" with one or more input files given on the command-line) 80 88 81 89 EOF … … 112 120 (unless files 113 121 (set! msg (string-append msg "\n\n" (user-input)))) 122 (newline) 114 123 (match-let ((#(_ _ _ day mon yr _ _ _ _) (seconds->local-time (current-seconds)))) 115 (let* ((file (sprintf +bug-report-file+ (+ 1900 yr) (justify mon) (justify day))) 116 (port (if stdout (current-output-port) (open-output-file file)))) 117 (with-output-to-port port 118 (lambda () 119 (print msg) 120 (collect-info) ) ) 121 (unless stdout 122 (close-output-port port) 123 (print "\nA bug report has been written to `" file "'. Please send it to") 124 (print "one of the following addresses:\n\n" +destinations+) ) ) ) ) ) 124 (if stdout 125 (begin 126 (print msg) 127 (collect-info)) 128 (try-mail 129 +mxservers+ 130 (sprintf +bug-report-file+ (+ 1900 yr) (justify mon) (justify day)) 131 (mail-headers) 132 (with-output-to-string 133 (lambda () 134 (print msg) 135 (collect-info)))))))) 136 ;(let* ((file (sprintf +bug-report-file+ (+ 1900 yr) (justify mon) (justify day))) 137 ; (port (if stdout (current-output-port) (open-output-file file)))) 138 ;(with-output-to-port port 139 ; (lambda () 140 ; (print msg) 141 ; (collect-info) ) ) 142 ;(unless stdout 143 ; (close-output-port port) 144 ; (print "\nA bug report has been written to `" file "'. Please send it to") 145 ; (print "one of the following addresses:\n\n" +destinations+) ) ) ) ) ) 146 147 (define (try-mail servs fname hdrs msg) 148 (if (null? servs) 149 (begin 150 (with-output-to-file fname 151 (lambda () (print msg))) 152 (print "\nCould not send mail automatically!\n\nA bug report has been written to `" fname "'. Please send it to") 153 (print "one of the following addresses:\n\n" +fallbackdestinations+)) 154 (or (send-mail (car servs) msg hdrs fname) 155 (try-mail (cdr servs) fname hdrs msg)))) 156 157 (define (mail-date-str tm) 158 (string-append 159 (case (vector-ref tm 6) 160 ((0) "Sun, ") 161 ((1) "Mon, ") 162 ((2) "Tue, ") 163 ((3) "Wed, ") 164 ((4) "Thu, ") 165 ((5) "Fri, ") 166 ((6) "Sat, ")) 167 (string-pad (number->string (vector-ref tm 3)) 2 #\0) 168 (case (vector-ref tm 4) 169 ((0) " Jan ") 170 ((1) " Feb ") 171 ((2) " Mar ") 172 ((3) " Apr ") 173 ((4) " May ") 174 ((5) " Jun ") 175 ((6) " Jul ") 176 ((7) " Aug ") 177 ((8) " Sep ") 178 ((9) " Oct ") 179 ((10) " Nov ") 180 ((11) " Dec ")) 181 (number->string (+ 1900 (vector-ref tm 5))) 182 " " 183 (string-pad (number->string (vector-ref tm 2)) 2 #\0) 184 ":" 185 (string-pad (number->string (vector-ref tm 1)) 2 #\0) 186 ":" 187 (string-pad (number->string (vector-ref tm 0)) 2 #\0) 188 " +0000")) 189 190 (define (mail-headers) 191 (string-append 192 "Date: " (mail-date-str (seconds->utc-time (current-seconds))) "\r\n" 193 "From: \"chicken-bug user\" <chicken-bug-command@callcc.org>\r\n" 194 "To: \"Chicken Janitors\" <chicken-janitors@nongnu.org>\r\n" 195 "Subject: Automated chicken-bug output -- ")) 196 197 (define (mail-read i o) 198 (let ((v (condition-case (read-line i) 199 (var () (close-input-port i) (close-output-port o) #f)))) 200 (if v 201 (if (char-numeric? (string-ref v 0)) 202 (string->number (substring v 0 3)) 203 (mail-read i o)) 204 #f))) 205 206 (define (mail-write i o m) 207 (let ((v (condition-case (display m o) 208 (var () (close-input-port i) (close-output-port o) #f)))) 209 (if v 210 (mail-read i o) 211 #f))) 212 213 (define (mail-check i o v e k) 214 (if (and v (= v e)) 215 #t 216 (begin 217 (close-input-port i) 218 (close-output-port o) 219 (k #f)))) 220 221 (define (send-mail serv msg hdrs fname) 222 (print "connecting to " serv " ...") 223 (receive (i o) 224 (tcp-connect serv 25) 225 (call-with-current-continuation 226 (lambda (k) 227 (mail-check i o (mail-read i o) 220 k) 228 (mail-check i o (mail-write i o "HELO callcc.org\r\n") 250 k) 229 (mail-check i o (mail-write i o "MAIL FROM:<chicken-bug-command@callcc.org>\r\n") 250 k) 230 (mail-check i o (mail-write i o "RCPT TO:<chicken-janitors@nongnu.org>\r\n") 250 k) 231 (mail-check i o (mail-write i o "DATA\r\n") 354 k) 232 (mail-check i o (mail-write i o (string-append hdrs fname "\r\n\r\n" msg "\r\n.\r\n")) 250 k) 233 (display "QUIT" o) 234 (close-input-port i) 235 (close-output-port o) 236 (print "Bug report successfully mailed to the Chicken maintainers.\nThank you very much!\n\n") 237 #t)))) 125 238 126 239 (main (command-line-arguments)) -
chicken/branches/release/chicken-ffi-macros.scm
r6175 r7276 361 361 (cons ',new args) ) ) 362 362 363 (define-deprecated-macro foreign-callback-lambda foreign-safe-lambda)364 (define-deprecated-macro foreign-callback-lambda* foreign-safe-lambda*)365 (define-deprecated-macro foreign-callback-wrapper foreign-safe-wrapper)366 367 363 368 364 ;;; Not for general use, yet -
chicken/branches/release/chicken-more-macros.scm
r6175 r7276 363 363 (##sys#check-syntax 'define-constant form '(symbol _)) 364 364 `(##core#define-constant ',(car form) ,(cadr form)) ) ) 365 366 (##sys#register-macro-2 ; DEPRECATED367 'critical-section368 (lambda (form)369 `(##sys#dynamic-wind370 ##sys#disable-interrupts371 (lambda () ,@form)372 ##sys#enable-interrupts) ) )373 365 374 366 (##sys#register-macro-2 -
chicken/branches/release/chicken-setup.scm
r6577 r7276 44 44 create-directory test-compile try-compile copy-file run-verbose 45 45 required-chicken-version required-extension-version 46 cross-chicken ##sys#current-source-filename) ) 46 cross-chicken ##sys#current-source-filename host-extension) ) 47 48 49 ;;; Constants, variables and parameters 47 50 48 51 #> … … 118 121 '("-help" "-uninstall" "-list" "-run" "-repository" "-program-path" "-version" "-script" 119 122 "-fetch" "-host" "-proxy" "-keep" "-verbose" "-csc-option" "-dont-ask" "-no-install" "-docindex" "-eval" 120 "-debug" "-ls" "-release" "-test" "-fetch-tree" "-tree" "-svn" "-local" "-destdir" "-revision") ) 123 "-debug" "-ls" "-release" "-test" "-fetch-tree" "-tree" "-svn" "-local" "-destdir" "-revision" 124 "-host-extension") ) 121 125 122 126 (define-constant short-options 123 '(#\h #\u #\l #\r #\R #\P #\V #\s #\f #\H #\p #\k #\v #\c #\d #\n #\i #\e #\D #f #f #\t #f #f #f #f #f #f) ) 127 '(#\h #\u #\l #\r #\R #\P #\V #\s #\f #\H #\p #\k #\v #\c #\d #\n #\i #\e #\D #f #f #\t #f #f #f #f #f #f 128 #f) ) 124 129 125 130 (define *installed-executables* … … 134 139 (or (and-let* ((p (getenv "CHICKEN_PREFIX"))) 135 140 (make-pathname p "bin") ) 136 (getenv "CHICKEN_HOME")137 141 (foreign-value "C_INSTALL_BIN_HOME" c-string) ) ) 138 142 … … 154 158 (define program-path (make-parameter *install-bin-path*)) 155 159 (define (cross-chicken) (##sys#fudge 39)) 156 157 (define create-directory/parents 158 (let ([create-directory create-directory]) 159 (lambda (dir) 160 (let loop ([dir dir]) 161 (when (and dir (not (directory? dir))) 162 (loop (pathname-directory dir)) 163 (create-directory dir))) ) ) ) 164 165 (define create-directory 166 (let () 167 (define (verb dir) 168 (when (setup-verbose-flag) (printf " creating directory `~a'~%~!" dir)) ) 169 (if *windows-shell* 170 (lambda (dir) 171 (verb dir) 172 (create-directory/parents dir) ) 173 (lambda (dir) 174 (verb dir) 175 (system* "mkdir -p ~a" (quotewrap dir) ) ) ) ) ) 176 177 (define (quotewrap str) 178 (if (or (string-any char-whitespace? str) 179 (and *windows-shell* (string-any (lambda (c) (char=? c #\/)) str))) 180 (string-append "\"" str "\"") 181 str) ) 160 (define host-extension (make-parameter #f)) 182 161 183 162 (define setup-root-directory (make-parameter #f)) … … 189 168 (define *remove-command* (if *windows-shell* "del /Q /S" "rm -fr")) 190 169 (define *move-command* (if *windows-shell* 'move 'mv)) 191 192 170 (define *gzip-program* 'gzip) 193 171 (define *tar-program* 'tar) 194 195 172 (define *fetch-only* #f) 196 173 (define *temporary-directory* #f) … … 217 194 218 195 196 ;;; File-system routines 197 198 (define create-directory/parents 199 (let ([create-directory create-directory]) 200 (lambda (dir) 201 (let loop ([dir dir]) 202 (when (and dir (not (directory? dir))) 203 (loop (pathname-directory dir)) 204 (create-directory dir))) ) ) ) 205 206 (define create-directory 207 (let () 208 (define (verb dir) 209 (when (setup-verbose-flag) (printf " creating directory `~a'~%~!" dir)) ) 210 (if *windows-shell* 211 (lambda (dir) 212 (verb dir) 213 (create-directory/parents dir) ) 214 (lambda (dir) 215 (verb dir) 216 (system* "mkdir -p ~a" (quotewrap dir) ) ) ) ) ) 217 218 219 ;;; Helper stuff 220 221 (define (quotewrap str) 222 (if (or (string-any char-whitespace? str) 223 (and *windows-shell* (string-any (lambda (c) (char=? c #\/)) str))) 224 (string-append "\"" str "\"") 225 str) ) 226 219 227 (define (abort-setup) 220 228 (*abort-hook* #f) ) … … 292 300 `(run (csc ,@explist) ) ) 293 301 302 303 ;;; "make" functionality 304 294 305 (define (make:find-matching-line str spec) 295 306 (let ((match? (lambda (s) (string=? s str)))) … … 301 312 (list (car line)) 302 313 (car line)))) 303 (if ( ormapmatch? names)314 (if (any match? names) 304 315 line 305 316 (loop (cdr lines))))))))) … … 311 322 (and (or (list? spec) (make:form-error "specification is not a list" spec)) 312 323 (or (pair? spec) (make:form-error "specification is an empty list" spec)) 313 ( andmap324 (every 314 325 (lambda (line) 315 326 (and (or (and (list? line) (<= 2 (length line) 3)) … … 317 328 (or (or (string? (car line)) 318 329 (and (list? (car line)) 319 ( andmapstring? (car line))))330 (every string? (car line)))) 320 331 (make:form-error "line does not start with a string or list of strings" line)) 321 332 (let ((name (car line))) 322 333 (or (list? (cadr line)) 323 334 (make:line-error "second part of line is not a list" (cadr line) name) 324 ( andmap(lambda (dep)335 (every (lambda (dep) 325 336 (or (string? dep) 326 337 (make:form-error "dependency item is not a string" dep))) … … 333 344 (define (make:check-argv argv) 334 345 (or (string? argv) 335 ( andmapstring? argv)346 (every string? argv) 336 347 (error "argument is not a string or string list" argv))) 337 348 … … 358 369 (let ((reason 359 370 (or (not date) 360 ( ormap(lambda (dep)371 (any (lambda (dep) 361 372 (let ((dep2 (fixmaketarget dep))) 362 373 (unless (file-exists? dep2) … … 404 415 (case-lambda 405 416 ((spec) (make:make/proc/helper spec '())) 406 ((spec argv) (make:make/proc/helper spec argv)))) 407 408 (define-macro (make spec #!optional (argv '())) 417 ((spec argv) 418 (make:make/proc/helper 419 spec 420 (if (vector? argv) 421 (vector->list argv) 422 argv) ) ) ) ) 423 424 (define-macro (make spec #!optional (argv ''())) 409 425 (let ((form-error (lambda (s . p) (apply error s spec p)))) 410 426 (and (or (list? spec) (form-error "illegal specification (not a sequence)")) 411 427 (or (pair? spec) (form-error "empty specification")) 412 ( andmap428 (every 413 429 (lambda (line) 414 430 (and (or (and (list? line) (>= (length line) 2)) … … 428 444 spec)) 429 445 ,argv))) 446 447 448 ;;; Create new repository file 449 450 (define (create-repository-file eggdir) 451 (let ((eggs 452 (filter-map 453 (lambda (d) 454 (and-let* ((mf (or (file-exists? (make-pathname d d "meta")) 455 (file-exists? (make-pathname (list d "trunk") d "meta"))))) 456 (display mf (current-error-port)) 457 (newline (current-error-port)) 458 (cons d (with-input-from-file mf read)) ) ) 459 (directory eggdir))) ) 460 (write-char #\() 461 (for-each 462 (lambda (e) 463 (let ((needs (assq 'needs (cdr e)))) 464 (pp `(,(string->symbol (car e)) 465 () 466 ,(conc e ".egg") 467 ,@(if needs (cdr needs) '()))))) 468 *eggs*) 469 (write-char #\)))) 470 471 472 ;;; Show usage information 430 473 431 474 (define (usage) … … 453 496 -e -eval EXPRESSION evaluate expression 454 497 -t -test run test suite, if it exists 498 -host-extension compile any extensions in "host" mode 455 499 -ls EXTENSION list installed files for extension 456 500 -fetch-tree download and show repository catalog 501 -create-tree create repository catalog from SVN checkout 457 502 -tree FILENAME use repository catalog from given file 458 503 -svn URL fetch extension from subversion repository … … 467 512 ) 468 513 (exit) ) 514 515 516 ;;; Processing setup scripts 469 517 470 518 (define (make-setup-info-pathname fn #!optional (rpath (repository-path))) … … 620 668 ("a" (if *windows-shell* "lib" "a")) 621 669 (x x) ) ) ) 670 671 672 ;;; Installation 622 673 623 674 (define (install-extension id files #!optional (info '())) … … 719 770 (delete-file* (make-setup-info-pathname (->string ext))))) 720 771 772 773 ;;; More helper stuff 774 721 775 (define (repo-path #!optional ddir?) 722 776 (let ((p (if (and ddir? *destdir*) … … 796 850 (sprintf "#ifdef __cplusplus~%extern \"C\"~%#endif~%char ~a();~%int main() { ~a(); return 0; }~%" proc proc) 797 851 ldflags: (conc "-l" name) ) ) 852 853 854 ;;; HTTP repository access 798 855 799 856 (define (find-header name) … … 913 970 (x (error "(internal) invalid host" x)) ) ) ) ) 914 971 972 (define (requirements reqs) 973 (fold 974 (lambda (r reqs) 975 (cond ((symbol? r) 976 (let ((node (assq r *repository-tree*))) 977 (cond (node (append (requirements (cdddr node)) (list (car node)) reqs)) 978 ((memq r ##sys#core-library-modules) reqs) 979 (else (error "broken dependencies: extension does not exist" r) ) ) ) ) 980 (else (error "invalid requirement spec" r)))) 981 '() 982 reqs) ) 983 915 984 (define (fetch-file ext) 916 (define (requirements reqs)917 (fold918 (lambda (r reqs)919 (cond ((symbol? r)920 (let ((node (assq r *repository-tree*)))921 (cond (node (append (requirements (cdddr node)) (list (car node)) reqs))922 ((memq r ##sys#core-library-modules) reqs)923 (else (error "Broken dependencies: extension does not exist" r) ) ) ) )924 (else (requirements (eval-req r) )) ) )925 '()926 reqs) )927 985 (and (or *dont-ask* 928 986 (yes-or-no? … … 943 1001 (let ((a (and *repository-tree* (assq (string->symbol ext) *repository-tree*)))) 944 1002 (when *debug* (printf "catalog entry: ~s~%" a)) 945 (cond (a (let ((reqs (remove extension-info (delete-duplicates (requirements (cdddr a)) eq?))))1003 (cond (a (let ((reqs (remove extension-information (delete-duplicates (requirements (cdddr a)) eq?)))) 946 1004 (when (pair? reqs) 947 1005 (print "downloading required extensions " reqs " ...") … … 952 1010 (else 953 1011 (error "Extension does not exist in the repository" ext)) ) ) ) ) ) ) 1012 1013 1014 ;;; Main entry point 954 1015 955 1016 (define (install filename) … … 977 1038 (when df 978 1039 (loop (pathname-file filename)))))))) 1040 1041 1042 ;;; Documentation index generation 979 1043 980 1044 (define (doc-index #!optional ddir?) … … 1107 1171 (display "</tbody></table></body></font></html>\n") ) ) ) ) ) 1108 1172 1173 1174 ;;; Output stuff 1175 1109 1176 (define (format-string str cols #!optional right (padc #\space)) 1110 1177 (let* ((len (string-length str)) … … 1114 1181 (string-append str pad) ) ) ) 1115 1182 1183 (define get-terminal-width 1184 (let ((default-width 78)) ; Standard default terminal width 1185 (lambda () 1186 (let ((cop (current-output-port))) 1187 (if (terminal-port? cop) 1188 (with-exception-handler 1189 (lambda (_) 1190 default-width) 1191 (lambda () 1192 (call-with-values 1193 (lambda () (terminal-size cop)) 1194 (lambda (_ cols) cols)))) 1195 default-width))))) 1196 1116 1197 (define (list-installed) 1117 (for-each 1118 (lambda (f) 1119 (and-let* ((info (extension-information f))) 1120 (print (format-string (->string f) 32) 1121 " " 1122 (format-string 1123 (or (and-let* ((v (assq 'version info))) 1124 (sprintf "Version: ~A" (cadr v)) ) 1125 "") 1126 32 #t) 1127 (or (and-let* ((r (assq 'release info))) 1128 (sprintf " (Release ~a)" (cadr r)) ) 1129 "") ) ) ) 1130 (sort (delete-duplicates 1131 (grep "^[^.].*\\.*$" (map pathname-file (directory (repository-path)))) string=?) 1132 string<?) ) ) 1198 (let* ((line-width (get-terminal-width)) 1199 (eggs (sort (delete-duplicates 1200 (grep "^[^.].*\\.*$" 1201 (map pathname-file 1202 (directory (repository-path)))) string=?) 1203 string<?)) 1204 (version-number-width 1205 (fold 1206 (lambda (egg maxlen) 1207 (max maxlen 1208 (or (and-let* ((info (extension-information egg)) 1209 (v (assq 'version info))) 1210 (string-length (->string (cadr v)))) 1211 0))) 0 eggs)) 1212 (version-width (fx+ version-number-width 9)) 1213 (release-width 22) 1214 (name-width (fxmax (- line-width version-width release-width 3) 12))) 1215 (for-each 1216 (lambda (f) 1217 (and-let* ((info (extension-information f))) 1218 (print (format-string (->string f) name-width) 1219 " " 1220 (format-string 1221 (or (and-let* 1222 ((v (assq 'version info))) 1223 (sprintf "Version: ~A" 1224 (format-string (->string (cadr v)) 1225 version-number-width #t))) 1226 "") 1227 version-width #t) 1228 " " 1229 (or (and-let* ((r (assq 'release info))) 1230 (sprintf "(Release ~a)" (cadr r)) ) 1231 "") ) ) ) 1232 eggs))) 1233 1234 1235 ;;; Command line processing 1133 1236 1134 1237 (define (main args) … … 1259 1362 (set! *dont-ask* #t) 1260 1363 (loop more) ) 1364 (("-create-tree" dir . more) 1365 (create-repository-file dir) 1366 (set! anydone #t) 1367 (loop more) ) 1261 1368 (("-fetch-tree" . more) 1262 1369 (set! *fetch-tree-only* #t) 1263 1370 (set! anydone #t) 1371 (loop more) ) 1372 (("-host-extension" . more) 1373 (host-extension #t) 1264 1374 (loop more) ) 1265 1375 (((or "-run" "-script" "-proxy" "-host" "-csc-option" "-ls" "-destdir" "-tree" "-local" "-svn" "-eval")) … … 1297 1407 (build-doc-index) ) 1298 1408 (unless *keep-stuff* 1299 1300 1301 1302 1409 (for-each 1410 (lambda (f) 1411 (run (,*remove-command* ,(quotewrap f))) ) 1412 *fetched-eggs*)) 1303 1413 #f) ) ) ) ) 1304 1414 -
chicken/branches/release/chicken.1
r6423 r7276 53 53 .B \-check\-syntax 54 54 Aborts compilation process after macro-expansion and syntax checks. 55 56 .TP57 .B \-compress\-literals\ threshold58 Compiles quoted literals that exceed the size59 .BI threshold60 as strings61 and parse the strings at run-time. This reduces the size of the code and62 speeds up compile-times of the host C compiler, but has a small run-time63 performance penalty. The size of a literal is computed by counting recursively the objects64 in the literal, so a vector counts as 1 plus the count of the elements,65 a pair counts as the counts of the car and the cdr, respectively.66 All other objects count 1.67 55 68 56 .TP … … 222 210 .I \; 223 211 \. 224 The environment variable225 .B CHICKEN_HOME226 is also considered as a search path.227 212 228 213 .TP … … 423 408 424 409 .TP 425 .B CHICKEN_ HOME426 Should contain the pathname where support- and include-files can be found.410 .B CHICKEN_PREFIX 411 Is used as a prefix directory for support files, include-files and libraries. 427 412 428 413 .TP -
chicken/branches/release/chicken.h
r6180 r7276 280 280 #define ___byte_vector unsigned char * 281 281 #define ___symbol char * 282 #define ___callback283 282 #define ___safe 284 283 #define ___declare(x, y) … … 981 980 #define C_a_int_to_num(ptr, n, i) C_int_to_num(ptr, i) 982 981 #define C_a_unsigned_int_to_num(ptr, n, i) C_unsigned_int_to_num(ptr, i) 982 #define C_a_double_to_num(ptr, n) C_double_to_number(C_flonum(ptr, n)) 983 983 #define C_a_i_vector C_vector 984 984 #define C_list C_a_i_list … … 1083 1083 #define C_u_i_bit_setp(x, i) C_mk_bool((C_unfix(x) & (1 << C_unfix(i))) != 0) 1084 1084 1085 #ifdef C_BIG_ENDIAN 1086 # ifdef C_SIXTY_FOUR 1087 # define C_lihdr(x, y, z) ((C_LAMBDA_INFO_TYPE >> 56) & 0xff), \ 1088 0, 0, 0, 0, (x), (y), (z) 1089 # else 1090 # define C_lihdr(x, y, z) ((C_LAMBDA_INFO_TYPE >> 24) & 0xff), \ 1091 (x), (y), (z) 1092 # endif 1093 #else 1094 # ifdef C_SIXTY_FOUR 1095 # define C_lihdr(x, y, z) (z), (y), (x), 0, 0, 0, 0, \ 1096 ((C_LAMBDA_INFO_TYPE >> 56) & 0xff) 1097 # else 1098 # define C_lihdr(x, y, z) (z), (y), (x), \ 1099 ((C_LAMBDA_INFO_TYPE >> 24) & 0xff) 1100 # endif 1101 #endif 1102 1085 1103 #define C_end_of_main 1086 1104 … … 1117 1135 1118 1136 C_varextern C_TLS void (C_fcall *C_restart_trampoline)(void *proc) C_regparm C_noret; 1137 C_varextern C_TLS void (*C_pre_gc_hook)(int mode); 1119 1138 C_varextern C_TLS void (*C_post_gc_hook)(int mode, long ms); 1120 1139 C_varextern C_TLS void (*C_panic_hook)(C_char *msg); … … 1161 1180 C_fctexport C_word C_fcall C_callback(C_word closure, int argc); 1162 1181 C_fctexport C_word C_fcall C_callback_wrapper(void *proc, int argc); 1163 C_fctexport void C_fcall C_callback_adjust_stack_limits(C_word *base); 1182 C_fctexport void C_fcall C_callback_adjust_stack_limits(C_word *base); /* DEPRECATED */ 1183 C_fctexport void C_fcall C_callback_adjust_stack(C_word *base, int size); 1164 1184 C_fctexport void CHICKEN_parse_command_line(int argc, char *argv[], C_word *heap, C_word *stack, C_word *symbols); 1165 1185 C_fctexport void C_fcall C_toplevel_entry(C_char *name) C_regparm; … … 1504 1524 #endif 1505 1525 1526 C_fctexport C_word C_fcall C_decode_literal(C_word **ptr, C_char *str) C_regparm; 1527 1506 1528 /* defined in eval.scm: */ 1507 1529 C_fctexport void CHICKEN_get_error_message(char *buf,int bufsize); -
chicken/branches/release/chicken.scm
r4845 r7276 39 39 40 40 41 #{compiler41 (private compiler 42 42 compiler-arguments 43 43 default-standard-bindings default-extended-bindings side-effecting-standard-bindings … … 71 71 membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument 72 72 generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration 73 foreign-argument-conversion foreign-result-conversion }73 foreign-argument-conversion foreign-result-conversion) 74 74 75 75 -
chicken/branches/release/compiler.scm
r5982 r7276 64 64 ; (always-bound {<name>}) 65 65 ; (foreign-declare {<string>}) 66 ; (foreign-parse {<string>})67 66 ; (block) 68 67 ; (separate) 69 68 ; (run-time-macros) 70 69 ; (export {<name>}) 71 ; (compress-literals [<threshold>])72 70 ; (safe-globals) 73 ; (namespace <name> {<symbol})74 71 ; (custom-declare (<tag> <name> <filename> <arg> ...) <string> ...) 75 72 ; (data <tag1> <exp1> ...) … … 252 249 253 250 254 #{compiler251 (private compiler 255 252 compiler-arguments process-command-line explicit-use-flag inline-list not-inline-list 256 253 default-standard-bindings default-extended-bindings side-effecting-standard-bindings … … 270 267 broken-constant-nodes inline-substitutions-enabled loop-lambda-names expand-profile-lambda 271 268 profile-lambda-list profile-lambda-index emit-profile expand-profile-lambda 272 direct-call-ids foreign-type-table first-analysis callback-names namespace-tabledisabled-warnings269 direct-call-ids foreign-type-table first-analysis callback-names disabled-warnings 273 270 initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database! scan-toplevel-assignments 274 271 compiler-warning import-table use-import-table compiler-macro-table compiler-macros-enabled … … 287 284 pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables 288 285 topological-sort print-version print-usage initialize-analysis-database export-list csc-control-file 289 estimate-foreign-result-location-size compressed-literals-initializerunused-variables286 estimate-foreign-result-location-size unused-variables 290 287 expand-foreign-callback-lambda default-optimization-passes default-optimization-passes-when-trying-harder 291 288 units-used-by-default words-per-flonum disable-stack-overflow-checking … … 293 290 membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument 294 291 make-random-name final-foreign-type real-name-table real-name set-real-name! safe-globals-flag 295 location-pointer-map literal-compression-threshold compressed-literals compressable-literal292 location-pointer-map 296 293 lookup-exports-file undefine-shadowed-macros process-lambda-documentation emit-syntax-trace-info 297 294 generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration 298 295 process-custom-declaration do-lambda-lifting file-requirements emit-closure-info export-file-name 299 foreign-argument-conversion foreign-result-conversion foreign-type-convert-argument foreign-type-convert-result} 296 foreign-argument-conversion foreign-result-conversion foreign-type-convert-argument foreign-type-convert-result 297 big-fixnum?) 300 298 301 299 (eval-when (compile eval) … … 332 330 (define-constant real-name-table-size 997) 333 331 (define-constant import-table-size 997) 334 (define-constant default-literal-compression-threshold 50)335 332 (define-constant default-inline-max-size 10) 336 333 … … 362 359 (define source-filename #f) 363 360 (define export-list #f) 364 (define compressed-literals '())365 (define literal-compression-threshold #f)366 (define compressed-literals-initializer #f)367 361 (define safe-globals-flag #f) 368 362 (define explicit-use-flag #f) 369 363 (define disable-stack-overflow-checking #f) 370 (define namespace-table '())371 364 (define require-imports-flag #f) 372 365 (define emit-unsafe-marker #f) … … 483 476 => (lambda (val) (walk (car val) ae me dest)) ] 484 477 [(and inline-table-used (##sys#hash-table-ref inline-table x)) 485 => (lambda (val) (walk val ae me dest)) ] 478 => (lambda (val) 479 (walk val ae me dest)) ] 486 480 [(assq x foreign-variables) 487 481 => (lambda (fv) … … 530 524 (walk xexpanded ae me dest) ] 531 525 [(and inline-table-used (##sys#hash-table-ref inline-table name)) 532 => (lambda (val) (walk (cons val (cdr x)) ae me dest)) ] 526 => (lambda (val) 527 (walk (cons val (cdr x)) ae me dest)) ] 533 528 [else 534 529 (case name … … 544 539 ((quote) 545 540 (##sys#check-syntax 'quote x '(quote _)) 546 (let* ([lit (cadr x)] 547 [cf (and literal-compression-threshold 548 (compressable-literal lit literal-compression-threshold) ) ] ) 549 (if cf 550 (let ([var (gensym 'lf)]) 551 (debugging 'o "compressing literal of size" cf) 552 (set! compressed-literals 553 (alist-cons var (write-to-string lit) compressed-literals) ) 554 (set! always-bound (cons var always-bound)) 555 (set! block-globals (cons var block-globals)) 556 var) 557 x) ) ) 541 x) 558 542 559 543 ((##core#check) … … 1160 1144 (set! block-globals (lset-difference eq? block-globals syms)) 1161 1145 (set! export-list (lset-union eq? syms (or export-list '()))))) 1162 ((compress-literals)1163 (set! literal-compression-threshold1164 (or (and (pair? (cdr spec)) (number? (cadr spec)) (cadr spec))1165 default-literal-compression-threshold) )1166 (when (and (list? spec) (= 3 (length spec)))1167 (set! compressed-literals-initializer (third spec)) ) )1168 1146 ((emit-exports) 1169 1147 (cond ((null? (cdr spec)) … … 1185 1163 n 1186 1164 (quit "invalid argument to `inline-limit' declaration" spec) ) ) ) ) 1187 ((namespace)1188 (check-decl spec 2)1189 (let* ([syms (cdr spec)]1190 [ns (car syms)] )1191 (if (every symbol? syms)1192 (let ([oldsyms (or (and-let* ([a (assq ns namespace-table)]) (cdr a)) '())])1193 (set! namespace-table1194 (alist-update! ns (lset-union eq? oldsyms (cdr syms)) namespace-table eq?) ) )1195 (quit "invalid arguments to `namespace' declaration: ~S" spec) ) ) )1196 1165 ((constant) 1197 1166 (let ((syms (cdr spec))) … … 2090 2059 (define (prepare-for-code-generation node db) 2091 2060 (let ([literals '()] 2061 [lambda-info-literals '()] 2092 2062 [lambdas '()] 2093 2063 [temporaries 0] … … 2281 2251 ((quote) 2282 2252 (let ((c (first params))) 2283 (cond (( fixnum? c)2253 (cond ((and (fixnum? c) (not (big-fixnum? c))) 2284 2254 (immediate-literal c) ) 2285 2255 ((number? c) 2286 2256 (cond ((eq? 'fixnum number-type) 2287 (cond (( integer? c)2257 (cond ((and (integer? c) (not (big-fixnum? c))) 2288 2258 (compiler-warning 2289 2259 'type … … 2303 2273 (cond [(immediate? x) (immediate-literal x)] 2304 2274 [(and (number? x) (inexact? x) 2305 (list-index (lambda (y) (and (number? y) (inexact? y) (= x y))) literals) ) 2275 (list-index (lambda (y) (and (number? y) (inexact? y) (= x y))) 2276 literals) ) 2306 2277 => values] 2307 [(posq x literals) => values] 2278 ((##core#inline "C_lambdainfop" x) 2279 (let ((i (length lambda-info-literals))) 2280 (set! lambda-info-literals 2281 (append lambda-info-literals (list x))) ;*** see below 2282 (vector i) ) ) 2283 [(posq x literals) => identity] 2308 2284 [else (new-literal x)] ) ) 2309 2285 2310 2286 (define (new-literal x) 2311 2287 (let ([i (length literals)]) 2312 (set! literals (append literals (list x))) ; couldbe optimized2288 (set! literals (append literals (list x))) ;*** could (should) be optimized 2313 2289 i) ) 2314 2290 … … 2336 2312 (debugging 'o "fast global references" fastrefs) 2337 2313 (debugging 'o "fast global assignments" fastsets) 2338 (values node2 literals lambda s) ) ) )2314 (values node2 literals lambda-info-literals lambdas) ) ) ) -
chicken/branches/release/csc.scm
r6577 r7276 51 51 #endif 52 52 53 #ifndef C_TARGET_LDFLAGS 54 # define C_TARGET_LDFLAGS C_INSTALL_LDFLAGS 55 #endif 56 53 57 #ifndef C_TARGET_BIN_HOME 54 58 # define C_TARGET_BIN_HOME C_INSTALL_BIN_HOME … … 87 91 (define-foreign-variable TARGET_CFLAGS c-string "C_TARGET_CFLAGS") 88 92 (define-foreign-variable INSTALL_CFLAGS c-string "C_INSTALL_CFLAGS") 93 (define-foreign-variable TARGET_LDFLAGS c-string "C_TARGET_LDFLAGS") 94 (define-foreign-variable INSTALL_LDFLAGS c-string "C_INSTALL_LDFLAGS") 89 95 (define-foreign-variable INSTALL_MORE_LIBS c-string "C_INSTALL_MORE_LIBS") 90 96 (define-foreign-variable INSTALL_MORE_STATIC_LIBS c-string "C_INSTALL_MORE_STATIC_LIBS") … … 118 124 (define arguments (command-line-arguments)) 119 125 (define host-mode (member "-host" arguments)) 126 (define cross-chicken (##sys#fudge 39)) 120 127 121 128 (define (prefix str dir default) … … 130 137 131 138 (define home 132 (or (getenv "CHICKEN_HOME") 133 (quotewrap 134 (prefix "" "share" (if host-mode INSTALL_SHARE_HOME TARGET_SHARE_HOME))))) 139 (quotewrap 140 (prefix "" "share" (if host-mode INSTALL_SHARE_HOME TARGET_SHARE_HOME)))) 135 141 136 142 (define translator … … 159 165 (lambda (s) (quotewrap s)) ; allow filenames w/ whitespace 160 166 (lambda (s) s))) 167 161 168 (define default-compilation-optimization-options (string-split (if host-mode INSTALL_CFLAGS TARGET_CFLAGS))) 162 169 (define best-compilation-optimization-options default-compilation-optimization-options) 163 (define default-linking-optimization-options '())164 (define best-linking-optimization-options '())170 (define default-linking-optimization-options (string-split (if host-mode INSTALL_LDFLAGS TARGET_LDFLAGS))) 171 (define best-linking-optimization-options default-linking-optimization-options) 165 172 166 173 (define-constant simple-options … … 177 184 -inline-limit -profile-name -disable-warning -import -require-static-extension 178 185 -feature -debug-level -heap-growth -heap-shrinkage -heap-initial-size -emit-exports 179 -compress-literals) ) 186 -compress-literals) ) ; DEPRECATED 180 187 181 188 (define-constant shortcuts … … 331 338 332 339 -i -case-insensitive don't preserve case of read symbols 333 -K -keyword-style STYLE allow alternative keyword syntax (prefix or suffix)340 -K -keyword-style STYLE allow alternative keyword syntax (prefix, suffix or none) 334 341 -run-time-macros macros are made available at run-time 335 342 … … 437 444 -debug MODES display debugging output for the given modes 438 445 -compiler PATHNAME use other compiler than default `chicken' 439 -compress-literals NUMBER compile literals above threshold as strings440 446 -disable-c-syntax-checks disable syntax checks of C code fragments 441 447 -raw do not generate implicit init- and exit code … … 566 572 (set! verbose #t) 567 573 (t-options "-verbose") 568 (set! compile-options (cons "-v-Q" compile-options))574 (set! compile-options (cons* "-v" "-Q" compile-options)) 569 575 (set! link-options (cons "-v" link-options)) ] 570 576 [(|-A| -analyze-only) … … 588 594 (set! gui #t) 589 595 (when mingw 590 (set! link-options (cons* "kernel32.lib" "user32.lib" "gdi32.lib" link-options)) 596 (set! link-options 597 (cons* "-lkernel32" "-luser32.lib" "-lgdi32" "-mwindows" 598 link-options)) 591 599 (set! compile-options (cons "-DC_WINDOWS_GUI" compile-options))) ] 592 600 [(-framework) … … 809 817 810 818 (define (run-linking) 811 (let ( [files (map cleanup-filename819 (let ((files (map cleanup-filename 812 820 (append object-files 813 (nth-value 0 (static-extension-info)) ) ) ] ) 821 (nth-value 0 (static-extension-info)) ) ) ) 822 (target (cleanup-filename target-filename))) 814 823 (unless (zero? 815 824 ($system … … 819 828 (append 820 829 files 821 (list (string-append link-output-flag (cleanup-filename target-filename))830 (list (string-append link-output-flag target) 822 831 (linker-options) 823 832 (linker-libraries #f) ) ) ) ) ) ) 824 833 (exit last-exit-code) ) 834 (when (and osx (or (not cross-chicken) host-mode)) 835 (unless (zero? ($system 836 (string-append 837 "install_name_tool -change libchicken.dylib " 838 (quotewrap 839 (make-pathname 840 (prefix "" "lib" 841 (if host-mode 842 INSTALL_LIB_HOME 843 TARGET_RUN_LIB_HOME)) 844 "libchicken.dylib") ) 845 " " 846 target) ) ) 847 (exit last-exit-code) ) ) 825 848 (unless keep-files (for-each $delete-file generated-object-files)) ) ) 826 849 -
chicken/branches/release/csi.1
r6226 r7276 75 75 pathnames separated by 76 76 .B \; . 77 The environment variable78 .B CHICKEN_HOME79 is also considered as a search path.80 77 81 78 .TP … … 141 138 142 139 .TP 143 .B CHICKEN_HOME 144 Should contain the pathname of a directory where interpreter 145 support-files can be found. This path is also added to the list of 146 pathnames where include-filesd are searched. 140 .B CHICKEN_PREFIX 141 Is used as a prefix directory for support files, include-files and libraries. 147 142 148 143 .TP -
chicken/branches/release/csi.scm
r6175 r7276 53 53 (include "banner") 54 54 55 56 #{csi 55 (private csi 57 56 print-usage print-banner 58 57 run hexdump del … … 61 60 deldups tty-input? 62 61 history-list history-count history-add history-ref 63 trace-indent trace-indent-level traced-procedure-entry traced-procedure-exit }62 trace-indent trace-indent-level traced-procedure-entry traced-procedure-exit) 64 63 65 64 (declare … … 67 66 ##sys#windows-platform) 68 67 (hide parse-option-string bytevector-data member* canonicalize-args do-trace do-untrace 69 traced-procedures describer-table 68 traced-procedures describer-table dirseparator? 70 69 findall trace-indent command-table do-break do-unbreak broken-procedures) ) 71 70 … … 131 130 ;;; Chop terminating separator from pathname: 132 131 132 (define (dirseparator? c) 133 (or (char=? c #\\) (char=? c #\/))) 134 133 135 (define chop-separator 134 (let ([pds ##sys#pathname-directory-separator] 135 [substring substring] ) 136 (let ([substring substring] ) 136 137 (lambda (str) 137 (let ([len (sub1 (##sys#size str))]) 138 (if (and (fx> len 0) (char=? (string-ref str len) pds)) 138 (let* ((len (sub1 (##sys#size str))) 139 (c (string-ref str len))) 140 (if (and (fx> len 0) (dirseparator? c)) 139 141 (substring str 0 len) 140 142 str) ) ) ) ) … … 162 164 (let ([path (getenv "PATH")]) 163 165 (and (> (##sys#size name) 0) 164 (cond [( char=? ##sys#pathname-directory-separator(string-ref name 0)) (addext name)]165 [(string-index (lambda (c) (char=? c ##sys#pathname-directory-separator))name)166 (cond [(dirseparator? (string-ref name 0)) (addext name)] 167 [(string-index dirseparator? name) 166 168 (and-let* ([p (_getcwd buf 256)]) 167 (addext (string-append (chop-separator p) (string ##sys#pathname-directory-separator)name)) ) ]169 (addext (string-append (chop-separator p) "/" name)) ) ] 168 170 [(addext name)] 169 171 [else 170 (let ([name2 (string-append (string ##sys#pathname-directory-separator)name)])172 (let ([name2 (string-append "/" name)]) 171 173 (let loop ([ps (string-split path ";")]) 172 174 (and (pair? ps) … … 849 851 (let* ([eval? (member* '("-e" "-eval") args)] 850 852 [batch (or script (member* '("-b" "-batch") args) eval?)] 851 [quiet (or script (member* '("-q" "-quiet") args) eval?)] 853 [quietflag (member* '("-q" "-quiet") args)] 854 [quiet (or script quietflag eval?)] 852 855 [ipath (map chop-separator (string-split (or (getenv "CHICKEN_INCLUDE_PATH") "") ";"))] ) 853 856 (define (collect-options opt) … … 864 867 (load fn) 865 868 (let* ([prefix (chop-separator (or (getenv "HOME") "."))] 866 [fn (string-append prefix (string ##sys#pathname-directory-separator)init-file)] )869 [fn (string-append prefix "/" init-file)] ) 867 870 (when (file-exists? fn) 868 871 (load fn) ) ) ) ) ) 872 (when quietflag (set! ##sys#eval-debug-level 0)) 869 873 (when (member* '("-h" "-help" "--help") args) 870 874 (print-usage) -
chicken/branches/release/debian/changelog
r5897 r7276 1 chicken (2.732-0.1) unstable; urgency=low 2 3 * New upstream version. 4 5 -- Ivan Raikov <raikov@oist.jp> Sat, 01 Dec 2007 14:30:55 +0900 6 1 7 chicken (2.703-0.1) unstable; urgency=low 2 8 … … 155 161 156 162 -- zhaoway <zw@debian.org> Mon, 21 Jan 2002 20:40:17 +0800 163 -
chicken/branches/release/debian/rules
r5884 r7276 16 16 MAKE:=$(MAKE) PLATFORM=linux 17 17 PREFIX=/usr 18 BINARYVERSION= 118 BINARYVERSION=3 19 19 20 20 build: build-stamp … … 22 22 dh_testdir 23 23 # CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 24 $(MAKE) MAKEINFO_PROGRAM_OPTIONS="" CFLAGS="$(CFLAGS)" PREFIX="$(PREFIX)" MANDIR="$(PREFIX)/share/man" INFODIR="$(PREFIX)/share/info" SHAREDIR="$(PREFIX)/share /chicken" EGGDIR="/var/lib/chicken/$(BINARYVERSION)"24 $(MAKE) MAKEINFO_PROGRAM_OPTIONS="" CFLAGS="$(CFLAGS)" PREFIX="$(PREFIX)" MANDIR="$(PREFIX)/share/man" INFODIR="$(PREFIX)/share/info" SHAREDIR="$(PREFIX)/share" EGGDIR="/var/lib/chicken/$(BINARYVERSION)" MAKEINFO_PROGRAM_OPTIONS= HOSTNAME=debian 25 25 touch build-stamp 26 26 … … 44 44 dh_clean -k 45 45 dh_installdirs 46 $(MAKE) install PREFIX="$(CURDIR)/debian/tmp/usr" MANDIR="$(CURDIR)/debian/tmp/usr/share/man" INFODIR="$(CURDIR)/debian/tmp/usr/share/info" SHAREDIR="$(CURDIR)/debian/tmp/usr/share/chicken" EGGDIR="$(CURDIR)/debian/tmp/var/lib/chicken/$(BINARYVERSION)" 46 # The directories here have to be prefixed by $(CURDIR)/debian/tmp 47 # because that is the location where the binary package files are 48 # placed by dpkg-buildpackage. If absolute files are specified, 49 # i.e. /var/lib/chicken, then those files will be installed on the 50 # build system, but will not end up in the package. 51 $(MAKE) install PREFIX="$(CURDIR)/debian/tmp/usr" MANDIR="$(CURDIR)/debian/tmp/usr/share/man" INFODIR="$(CURDIR)/debian/tmp/usr/share/info" SHAREDIR="$(CURDIR)/debian/tmp/usr/share" EGGDIR="$(CURDIR)/debian/tmp/var/lib/chicken/$(BINARYVERSION)" MAKEINFO_PROGRAM_OPTIONS= HOSTNAME=debian 47 52 48 53 binary-common: … … 52 57 dh_installdocs 53 58 dh_installman 54 dh_installinfo chicken.info 59 # The asterisk in chicken.info* is necessary, because Debian makeinfo 60 # is very different from the standard makeinfo, and it is incredibly 61 # difficult to convince it to produce standalone Texinfo files. 62 dh_installinfo chicken.info* 55 63 dh_installchangelogs ChangeLog.20070807 56 64 dh_link -
chicken/branches/release/defaults.make
r6577 r7276 39 39 NURSERY ?= (128*1024) 40 40 STACKDIRECTION ?= 1 41 CROSS_CHICKEN ?= 0 41 42 42 43 # directories 43 44 45 DESTDIR = 44 46 ifeq ($(PLATFORM),mingw) 45 47 PREFIX ?= c:/devtools … … 47 49 PREFIX ?= /usr/local 48 50 endif 49 DESTDIR = $(PREFIX) 50 BINDIR = $( DESTDIR)/bin51 LIBDIR = $( DESTDIR)/lib52 SHAREDIR = $( DESTDIR)/share51 52 BINDIR = $(PREFIX)/bin 53 LIBDIR = $(PREFIX)/lib 54 SHAREDIR = $(PREFIX)/share 53 55 DATADIR = $(SHAREDIR)/chicken 54 MANDIR = $(SHAREDIR)/man/man1 56 TOPMANDIR = $(SHAREDIR)/man 57 MANDIR = $(TOPMANDIR)/man1 55 58 INFODIR = $(SHAREDIR)/info 56 INCDIR = $( DESTDIR)/include59 INCDIR = $(PREFIX)/include 57 60 DOCDIR = $(DATADIR)/doc 58 EGGDIR = $(DESTDIR)/lib/chicken/$(BINARYVERSION) 61 CHICKENLIBDIR = $(LIBDIR)/chicken 62 EGGDIR = $(CHICKENLIBDIR)/$(BINARYVERSION) 63 64 ifeq ($(PLATFORM),mingw) 65 BINDIR = $(PREFIX)\\bin 66 LIBDIR = $(PREFIX)\\lib 67 SHAREDIR = $(PREFIX)\\share 68 DATADIR = $(SHAREDIR)\\chicken 69 TOPMANDIR = $(SHAREDIR)\\man 70 MANDIR = $(TOPMANDIR)\\man1 71 INFODIR = $(SHAREDIR)\\info 72 INCDIR = $(PREFIX)\\include 73 DOCDIR = $(DATADIR)\\doc 74 CHICKENLIBDIR = $(LIBDIR)\\chicken 75 EGGDIR = $(CHICKENLIBDIR)\\$(BINARYVERSION) 76 else 77 IBINDIR = $(BINDIR) 78 ILIBDIR = $(LIBDIR) 79 ISHAREDIR = $(SHAREDIR) 80 IDATADIR = $(DATADIR) 81 ITOPMANDIR = $(TOPMANDIR) 82 IMANDIR = $(MANDIR) 83 IINFODIR = $(INFODIR) 84 IINCDIR = $(INCDIR) 85 IDOCDIR = $(DOCDIR) 86 ICHICKENLIBDIR = $(CHICKENLIBDIR) 87 IEGGDIR = $(EGGDIR) 88 endif 59 89 60 90 # commands 61 91 62 ifdef HOST 63 C_COMPILER ?= $(HOST )-gcc64 CXX_COMPILER ?= $(HOST )-g++65 LIBRARIAN ?= $(HOST )-ar92 ifdef HOSTSYSTEM 93 C_COMPILER ?= $(HOSTSYSTEM)-gcc 94 CXX_COMPILER ?= $(HOSTSYSTEM)-g++ 95 LIBRARIAN ?= $(HOSTSYSTEM)-ar 66 96 else 67 97 C_COMPILER ?= gcc … … 77 107 ASSEMBLER ?= $(C_COMPILER) 78 108 MAKEINFO_PROGRAM ?= -makeinfo 109 ifeq ($(PLATFORM),mingw) 110 INSTALL_PROGRAM ?= copy 111 MAKEDIR_COMMAND ?= -mkdir 112 else 113 INSTALL_PROGRAM ?= install 79 114 MAKEDIR_COMMAND ?= mkdir 80 INSTALL_PROGRAM ?= install 115 endif 81 116 POSTINSTALL_STATIC_LIBRARY ?= true 82 117 POSTINSTALL_PROGRAM ?= true … … 86 121 # target variables 87 122 88 ifdef TARGET 89 TARGET_C_COMPILER ?= $(TARGET )-$(C_COMPILER)90 TARGET_CXX_COMPILER ?= $(TARGET )-$(CXX_COMPILER)123 ifdef TARGETSYSTEM 124 TARGET_C_COMPILER ?= $(TARGETSYSTEM)-$(C_COMPILER) 125 TARGET_CXX_COMPILER ?= $(TARGETSYSTEM)-$(CXX_COMPILER) 91 126 else 92 127 TARGET_C_COMPILER ?= $(C_COMPILER) … … 97 132 TARGET_C_COMPILER_OPTIMIZATION_OPTIONS ?= $(C_COMPILER_OPTIMIZATION_OPTIONS) 98 133 TARGET_PREFIX ?= $(PREFIX) 134 TARGET_RUN_PREFIX ?= $(TARGET_PREFIX) 99 135 TARGET_LIBRARIES ?= $(LIBRARIES) 100 101 ifneq ($(TARGET_C_COMPILER),$(HOST_C_COMPILER)) 136 TARGET_LINKER_OPTIONS ?= $(LINKER_OPTIONS) 137 138 ifneq ($(TARGET_C_COMPILER),$(C_COMPILER)) 102 139 CROSS_CHICKEN = 1 103 140 else … … 122 159 C_COMPILER_PCRE_OPTIONS ?= -DPCRE_STATIC 123 160 C_COMPILER_SHARED_OPTIONS ?= -fPIC -DPIC 124 LINKER_ OPTIONS ?= -L.125 LINKER_STATIC_OPTIONS ?= $(LINKER FLAGS)161 LINKER_EXECUTABLE_OPTIONS ?= -L. 162 LINKER_STATIC_OPTIONS ?= $(LINKER_EXECUTABLE_OPTIONS) 126 163 LINKER_OUTPUT_OPTION ?= -o 127 164 LINKER_LIBRARY_OPTION ?= -l … … 132 169 REMOVE_COMMAND_OPTIONS ?= /f /q 133 170 REMOVE_COMMAND_RECURSIVE_OPTIONS ?= /f /s /q 171 MAKE_WRITABLE_COMMAND ?= rem 134 172 else 135 173 REMOVE_COMMAND_OPTIONS ?= -f 136 174 REMOVE_COMMAND_RECURSIVE_OPTIONS ?= -fr 175 MAKE_WRITABLE_COMMAND ?= chmod a+rw 137 176 endif 138 177 MAKEINFO_PROGRAM_OPTIONS ?= --no-split 178 ifneq ($(PLATFORM),mingw) 139 179 INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS ?= -m755 140 180 INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS ?= -m644 … … 142 182 INSTALL_PROGRAM_FILE_OPTIONS ?= -m644 143 183 MAKEDIR_COMMAND_OPTIONS ?= -p 184 endif 144 185 ASSEMBLER_OPTIONS ?= $(C_COMPILER_OPTIONS) 145 186 ASSEMBLER_OUTPUT_OPTION ?= -o 146 187 ASSEMBLER_COMPILE_OPTION ?= -c 188 ifdef STATICBUILD 189 PRIMARY_LIBCHICKEN ?= libchicken$(A) 190 else 191 ifeq ($(PLATFORM),cygwin) 192 PRIMARY_LIBCHICKEN = cygchicken-0.dll 193 LIBCHICKEN_SO_FILE = cygchicken-0.dll 194 LIBUCHICKEN_SO_FILE = cyguchicken-0.dll 195 else 147 196 PRIMARY_LIBCHICKEN ?= libchicken$(SO) 197 LIBCHICKEN_SO_FILE ?= libchicken$(SO) 198 LIBUCHICKEN_SO_FILE ?= libuchicken$(SO) 199 endif 200 endif 148 201 UNINSTALLINFO_PROGRAM_OPTIONS ?= --delete 149 202 LIBCHICKEN_SO_LIBRARIES ?= $(LIBRARIES) … … 163 216 BUILD_TAG ?= compiled $(BUILD_TIME) on $(HOSTNAME) ($(UNAME_SYS)) 164 217 218 ifdef LOCKTOSPACE 219 C_COMPILER_BUILD_RUNTIME_OPTIONS += -DC_LOCK_TOSPACE 220 endif 221 165 222 # file extensions 166 223 … … 190 247 CHICKEN_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -explicit-use 191 248 CHICKEN_PROGRAM_OPTIONS = $(CHICKEN_OPTIONS) -no-lambda-info 249 CHICKEN_COMPILER_OPTIONS = $(CHICKEN_PROGRAM_OPTIONS) -extend private-namespace.scm 192 250 CHICKEN_UNSAFE_OPTIONS = -unsafe -no-lambda-info 193 251 … … 206 264 CHICKEN_SHARED_EXECUTABLE = $(CHICKEN_PROGRAM)-shared$(EXE) 207 265 CSI_SHARED_EXECUTABLE = $(CSI_PROGRAM)-shared$(EXE) 208 TARGETS ?= libchicken$(A) libuchicken$(A) $(CHICKEN_STATIC_EXECUTABLE) \ 266 TARGETLIBS ?= libchicken$(A) libuchicken$(A) 267 TARGETS ?= $(TARGETLIBS) $(CHICKEN_STATIC_EXECUTABLE) \ 209 268 $(CSI_STATIC_EXECUTABLE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \ 210 269 $(CSC_PROGRAM)$(EXE) \ … … 215 274 CHICKEN_SHARED_EXECUTABLE = $(CHICKEN_PROGRAM)$(EXE) 216 275 CSI_SHARED_EXECUTABLE = $(CSI_PROGRAM)$(EXE) 217 TARGETS ?= libchicken$(A) libuchicken$(A) $(CHICKEN_SHARED_EXECUTABLE) \ 276 TARGETLIBS ?= libchicken$(A) libuchicken$(A) \ 277 $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) 278 TARGETS ?= $(TARGETLIBS) $(CHICKEN_SHARED_EXECUTABLE) \ 218 279 $(CSI_SHARED_EXECUTABLE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \ 219 $(CSC_PROGRAM)$(EXE) libchicken$(SO) \ 220 libuchicken$(SO) $(CHICKEN_SETUP_PROGRAM)$(EXE) chicken.info \ 280 $(CSC_PROGRAM)$(EXE) $(CHICKEN_SETUP_PROGRAM)$(EXE) chicken.info \ 221 281 $(CHICKEN_BUG_PROGRAM)$(EXE) 222 282 endif … … 243 303 echo "# define C_INSTALL_CFLAGS \"$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@ 244 304 echo "#endif" >>$@ 305 echo "#ifndef C_INSTALL_LDFLAGS" >>$@ 306 echo "# define C_INSTALL_LDFLAGS \"$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)\"" >>$@ 307 echo "#endif" >>$@ 245 308 echo "#ifndef C_INSTALL_SHARE_HOME" >>$@ 246 309 echo "# define C_INSTALL_SHARE_HOME \"$(DATADIR)\"" >>$@ … … 288 351 echo "# define C_TARGET_CFLAGS \"$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@ 289 352 echo "#endif" >>$@ 353 echo "#ifndef C_TARGET_LDFLAGS" >>$@ 354 echo "# define C_TARGET_LDFLAGS \"$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)\"" >>$@ 355 echo "#endif" >>$@ 290 356 echo "#ifndef C_CROSS_CHICKEN" >>$@ 291 357 echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@ … … 295 361 echo "#endif" >>$@ 296 362 echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@ 297 echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_ PREFIX)/lib\"" >>$@363 echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_RUN_PREFIX)/lib\"" >>$@ 298 364 echo "#endif" >>$@ 299 365 echo "#ifndef C_TARGET_SHARE_HOME" >>$@ … … 325 391 echo "#endif" >>$@ 326 392 endif 393 # -
chicken/branches/release/distribution/manifest
r6580 r7276 202 202 tests/fixnum-tests.scm 203 203 tests/path-tests.scm 204 tests/r4rstest.out 204 205 tweaks.scm 205 206 utils.scm … … 254 255 rules.make 255 256 defaults.make 257 private-namespace.scm 258 misc/makedist.scm -
chicken/branches/release/eval.scm
r6428 r7276 112 112 (define-foreign-variable installation-home c-string "C_INSTALL_SHARE_HOME") 113 113 114 (define pds ##sys#pathname-directory-separator)115 (define pdss (string ##sys#pathname-directory-separator))116 117 114 (define ##sys#core-library-modules 118 115 '(extras lolevel utils tcp regex regex-extras posix match srfi-1 srfi-4 srfi-13 srfi-14 srfi-18)) … … 147 144 (let ([getenv getenv]) 148 145 (lambda () 149 (or (getenv "CHICKEN_HOME") 150 (and-let* ((p (getenv "CHICKEN_PREFIX"))) 146 (or (and-let* ((p (getenv "CHICKEN_PREFIX"))) 151 147 (##sys#string-append 152 148 p 153 (if ( char=? (string-ref p (fx- (##sys#size p) 1)) ##sys#pathname-directory-separator)149 (if (memq (string-ref p (fx- (##sys#size p) 1)) '(#\\ #\/)) 154 150 "share" 155 151 "/share") ) ) … … 1120 1116 (let loop ([i (fx- (##sys#size str) 1)]) 1121 1117 (and (not (zero? i)) 1122 (if ( char=? pds (##core#inline "C_subchar" str i))1118 (if (memq (##core#inline "C_subchar" str i) '(#\\ #\/)) 1123 1119 i 1124 1120 (loop (fx- i 1)) ) ) ) ) … … 1156 1152 (or (##sys#dload (##sys#make-c-string fname) topentry #t) 1157 1153 (and (not (has-sep? fname)) 1158 (##sys#dload (##sys#make-c-string ( string-append "." pdssfname)) topentry #t) ) ) )1154 (##sys#dload (##sys#make-c-string (##sys#string-append "./" fname)) topentry #t) ) ) ) 1159 1155 (call-with-current-continuation 1160 1156 (lambda (abrt) … … 1193 1189 (set! load 1194 1190 (lambda (filename . evaluator) 1195 (fluid-let ([##sys#current-namespace ##sys#current-namespace]) 1196 (##sys#load filename (:optional evaluator #f) #f) ) ) ) 1191 (##sys#load filename (:optional evaluator #f) #f) ) ) 1197 1192 (set! load-relative 1198 1193 (lambda (filename . evaluator) 1199 (fluid-let ([##sys#current-namespace ##sys#current-namespace]) 1200 (##sys#load 1201 (if (char=? pds (string-ref filename 0)) 1202 filename 1203 (##sys#string-append ##sys#current-load-path filename) ) 1204 (:optional evaluator #f) #f) ) ) ) 1194 (##sys#load 1195 (if (memq (string-ref filename 0) '(#\\ #\/)) 1196 filename 1197 (##sys#string-append ##sys#current-load-path filename) ) 1198 (:optional evaluator #f) #f) ) ) 1205 1199 (set! load-noisily 1206 1200 (lambda (filename #!key (evaluator #f) (time #f) (printer #f)) 1207 (fluid-let ([##sys#current-namespace ##sys#current-namespace]) 1208 (##sys#load filename evaluator #t time printer) ) ) ) ) 1201 (##sys#load filename evaluator #t time printer) ) ) ) 1209 1202 1210 1203 (define ##sys#load-library-extension ; this is crude... … … 1284 1277 (lambda (id loc) 1285 1278 (define (err) (##sys#error loc "invalid extension path" id)) 1279 (define (sep? c) (or (char=? #\\ c) (char=? #\/ c))) 1286 1280 (let ([p (cond [(string? id) id] 1287 1281 [(symbol? id) (##sys#symbol->string id)] … … 1297 1291 (if (null? (##sys#slot id 1)) 1298 1292 "" 1299 pdss)1293 "/") 1300 1294 (loop (##sys#slot id 1)) ) ) ) ] ) ] ) 1301 1295 (let check ([p p]) 1302 1296 (let ([n (##sys#size p)]) 1303 1297 (cond [(fx= 0 n) (err)] 1304 [( char=? pds(string-ref p 0))1298 [(sep? (string-ref p 0)) 1305 1299 (check (##sys#substring p 1 n)) ] 1306 [( char=? pds(string-ref p (fx- n 1)))1300 [(sep? (string-ref p (fx- n 1))) 1307 1301 (check (##sys#substring p 0 (fx- n 1))) ] 1308 1302 [else p] ) ) ) ) ) ) ) … … 1311 1305 (make-parameter 1312 1306 (or (getenv repository-environment-variable) 1313 (getenv "CHICKEN_HOME")1314 1307 install-egg-home) ) ) 1315 1308 … … 1321 1314 (lambda (p inc?) 1322 1315 (define (check path) 1323 (let ([p0 (string-append path pdssp)])1316 (let ([p0 (string-append path "/" p)]) 1324 1317 (and (or (file-exists? (##sys#string-append p0 ##sys#load-dynamic-extension)) 1325 1318 (file-exists? (##sys#string-append p0 source-file-extension)) ) … … 1383 1376 (lambda (id loc) 1384 1377 (let* ((p (##sys#canonicalize-extension-path id loc)) 1385 (rpath (string-append (##sys#repository-path) pdssp ".")) )1378 (rpath (string-append (##sys#repository-path) "/" p ".")) ) 1386 1379 (cond ((file-exists? (string-append rpath setup-file-extension)) 1387 1380 => (cut with-input-from-file <> read) ) … … 1390 1383 (define (extension-information ext) 1391 1384 (##sys#extension-information ext 'extension-information) ) 1392 1393 (define extension-info extension-information) ; DEPRECATED1394 1385 1395 1386 (define ##sys#lookup-runtime-requirements … … 1689 1680 (cond ((eq? paths '()) fname) 1690 1681 ((test (string-append (##sys#slot paths 0) 1691 pdss1682 "/" 1692 1683 fname) ) ) 1693 1684 (else (loop (##sys#slot paths 1))) ) ) ) ) ) ) … … 2121 2112 (lambda () 2122 2113 (set! ##sys#read-error-with-line-number #f) 2123 (set! ##sys#default-namespace-prefix #f)2124 2114 (set! ##sys#enable-qualifiers #t) 2125 (set! ##sys#current-namespace #f)2126 2115 (resetports) 2127 2116 (c #f) ) ) ) ) -
chicken/branches/release/extras.scm
r6363 r7276 68 68 ##sys#gcd ##sys#lcm ##sys#fudge ##sys#check-list ##sys#user-read-hook) ) ] ) 69 69 70 #{extras 71 reverse-string-append generic-write hashtab-default-size hashtab-threshold hashtab-rehash hashtab-primes-table} 70 (private 71 extras 72 reverse-string-append generic-write hashtab-default-size hashtab-threshold hashtab-rehash hashtab-primes-table) 72 73 73 74 (declare -
chicken/branches/release/library.scm
r6577 r7276 160 160 161 161 162 (define-constant namespace-size 997)163 162 (define-constant namespace-max-id-len 31) 164 163 (define-constant char-name-table-size 37) … … 2016 2015 (define ##sys#default-read-info-hook #f) 2017 2016 (define ##sys#read-error-with-line-number #f) 2018 (define ##sys#current-namespace #f)2019 (define ##sys#default-namespace-prefix #f)2020 2017 (define ##sys#enable-qualifiers #t) 2021 2018 (define (##sys#read-prompt-hook) #f) ; just here so that srfi-18 works without eval … … 2356 2353 (loop i) ) ) ) ) ) ) 2357 2354 2358 (define (r-namespace)2359 (set! ##sys#current-namespace (##sys#make-vector namespace-size '()))2360 (let* ([ns (r-next-token)]2361 [nslen (##sys#size ns)]2362 [p (##sys#make-string 1)] )2363 (when (fx> nslen namespace-max-id-len)2364 (set! ns (##sys#substring ns 0 namespace-max-id-len))2365 (set! nslen namespace-max-id-len) )2366 (##sys#setbyte p 0 (##sys#size ns))2367 (let ([prefix (##sys#string-append p ns)])2368 (let loop ([toks '()])2369 (r-spaces)2370 (cond [(memq (##sys#peek-char-0 port) '(#\} #\$)) ;*** change this to (char=? #\$ (##sys#peek-char-0 port)) later2371 (##sys#read-char-0 port)2372 (for-each2373 (lambda (tok)2374 (let ([i (##core#inline2375 "C_fixnum_modulo"2376 (##core#inline "C_hash_string" tok) namespace-size)])2377 (##sys#setslot2378 ##sys#current-namespace i2379 (cons (cons tok (##sys#intern-symbol (##sys#string-append prefix tok)))2380 (##sys#slot ##sys#current-namespace i) ) ) ) )2381 toks) ]2382 [else (loop (cons (r-next-token) toks))] ) ) ) ) )2383 2384 2355 (define (r-ext-symbol) 2385 2356 (let* ([p (##sys#make-string 1)] … … 2408 2379 (##sys#substring tok 0 (fx- len 1)) ) ) ) 2409 2380 => build-keyword] ; ugh 2410 [(not ##sys#current-namespace) (build-symbol tok)] 2411 [else 2412 (let ([i (##core#inline "C_fixnum_modulo" (##core#inline "C_hash_string" tok) namespace-size)]) 2413 (let loop ([bucket (##sys#slot ##sys#current-namespace i)]) 2414 (if (null? bucket) 2415 (build-symbol tok) 2416 (let ([e (##sys#slot bucket 0)]) 2417 (if (string=? tok (##sys#slot e 0)) 2418 (##sys#slot e 1) 2419 (loop (##sys#slot bucket 1)) ) ) ) ) ) ] ) ) ) 2381 [else (build-symbol tok)]))) 2420 2382 2421 2383 (define (build-symbol tok) 2422 (##sys#intern-symbol 2423 (if ##sys#default-namespace-prefix 2424 (##sys#string-append ##sys#default-namespace-prefix tok) 2425 tok) ) ) 2384 (##sys#intern-symbol tok) ) 2426 2385 2427 2386 (define (build-keyword tok) … … 2484 2443 (##sys#read-char-0 port) 2485 2444 (r-comment) (readrec) ) 2486 ((#\{)2487 (##sys#read-char-0 port)2488 (r-namespace) (readrec) )2489 2445 ((#\#) 2490 2446 (##sys#read-char-0 port) … … 2529 2485 (else (##sys#user-read-hook dchar port)) ) ) ) ) ) ) 2530 2486 ((#\() (r-list #\( #\))) 2487 ((#\{) (r-list #\{ #\})) 2531 2488 ((#\[) 2532 2489 (r-list #\[ #\]) ) 2533 ((#\) #\] )2490 ((#\) #\] #\}) 2534 2491 (##sys#read-char-0 port) 2535 2492 (container c) ) 2536 ((#\{ #\})2537 (##sys#read-char-0 port)2538 (##sys#read-error port "illegal character" c))2539 2493 ((#\") (r-string #\")) 2540 2494 ((#\.) (r-number #f)) … … 2876 2830 ((##core#inline "C_portp" x) 2877 2831 (if (##sys#slot x 1) 2878 (outstr port "#<input port ")2879 (outstr port "#<output port ") )2832 (outstr port "#<input port \"") 2833 (outstr port "#<output port \"") ) 2880 2834 (outstr port (##sys#slot x 3)) 2881 (out chr port #\>) )2835 (outstr port "\">") ) 2882 2836 ((##core#inline "C_vectorp" x) 2883 2837 (let ((n (##core#inline "C_block_size" x))) … … 3181 3135 (if (##sys#fudge 32) " gchooks" "") 3182 3136 (if (##sys#fudge 35) " applyhook" "") 3137 (if (##sys#fudge 22) " lockts" "") 3183 3138 (if (##sys#fudge 39) " cross" "") ) ) ) 3184 3139 (string-append … … 3191 3146 +build-version+) ) 3192 3147 3193 (define ##sys#pathname-directory-separator 3194 (if ##sys#windows-platform #\\ #\/) ) 3148 (define ##sys#pathname-directory-separator #\/) ; DEPRECATED 3195 3149 3196 3150 … … 3258 3212 3259 3213 (define feature? ##sys#feature?) 3260 (define test-feature? ##sys#feature?) ; DEPRECATED3261 3214 3262 3215 … … 3313 3266 3314 3267 (define get-call-chain ##sys#get-call-chain) 3315 (define print-backtrace print-call-chain) ; DEPRECATED3316 3268 3317 3269 3318 3270 ;;; Interrupt handling: 3319 3320 (let ([count 0]) ; DEPRECATED3321 (set! ##sys#enable-interrupts3322 (lambda val3323 (set! count (fx+ count (if (pair? val) (car val) 1)))3324 (when (eq? count 0) (##core#inline "C_enable_interrupts")) ) )3325 (set! ##sys#disable-interrupts3326 (lambda ()3327 (when (eq? count 0) (##core#inline "C_disable_interrupts"))3328 (set! count (fx- count 1)) ) ) )3329 3330 (define enable-interrupts ##sys#enable-interrupts) ; DEPRECATED3331 (define disable-interrupts ##sys#disable-interrupts) ; DEPRECATED3332 3271 3333 3272 (define (##sys#user-interrupt-hook) … … 4238 4177 4239 4178 4240 ;;; andmap + ormap: 4179 ;;; andmap + ormap: DEPRECATED 4241 4180 4242 4181 (define andmap … … 4258 4197 (define ormap 4259 4198 (lambda (f first . rest) 4260 (if (null? first) 4261 (or) 4262 (let ([lists (cons first rest)]) 4263 (or (apply f (map (lambda (x) (car x)) lists)) 4264 (apply ormap f (map (lambda (x) (cdr x)) lists)) ) ) ) ) ) 4199 (and (pair? first) 4200 (let ([lists (cons first rest)]) 4201 (or (apply f (map (lambda (x) (car x)) lists)) 4202 (apply ormap f (map (lambda (x) (cdr x)) lists)) ) ) ) ) ) 4265 4203 4266 4204 -
chicken/branches/release/lolevel.scm
r6257 r7276 687 687 (ipc-hook-0 ##sys#last-invalid-procedure args) ) ) ) 688 688 689 (define invalid-procedure-call-handler set-invalid-procedure-call-handler!) ; DEPRECATED690 691 689 (define (unbound-variable-value . val) 692 690 (set! ##sys#unbound-variable-value-hook -
chicken/branches/release/manual/Accessing external objects
r5945 r7276 203 203 (some-struct-ycoord-set! C-POINTER NUMBER) 204 204 </enscript> 205 206 205 207 === define-foreign-enum 206 208 207 [syntax] (define-foreign-enum TYPE NAME ITEM...)209 [syntax] (define-foreign-enum TYPESPEC [USE-ALIASES] ENUMSPEC ...) 208 210 209 211 Defines a foreign type (as with {{define-foreign-type}}) that maps the elements … … 211 213 symbols. 212 214 213 {{TYPE NAME}} specifies a foreign type that converts a symbol argument from the214 set {{ ITEM...}} into the appropriate enum value when passed as an argument to215 {{TYPESPEC}} specifies a foreign type that converts a symbol argument from the 216 set {{ENUMSPEC ...}} into the appropriate enum value when passed as an argument to 215 217 a foreign function. 216 218 … … 220 222 supported in this case). 221 223 222 {{TYPE NAME}} maybe a symbol or a list of the form {{(SCHEMENAME REALTYPE223 [DEFAULT-SCHEME-VALUE])}}, where {{REALTYPE}} designates the native type used. 224 The default native type is {{"TYPENAME"}}. The {{DEFAULT-SCHEME-VALUE}} 225 overrides the default result of mapping from the native type; i.e. when no such 226 mapping exists. When supplied the form is used unquoted, otherwise the result 227 is {{'()}}.228 229 {{ ITEM}} is asymbol or a list of the form {{(SCHEMENAME REALTYPE224 {{TYPESPEC}} maybe a TYPENAME symbol or a list of the form {{(SCHEMENAME 225 REALTYPE [DEFAULT-SCHEME-VALUE])}}, where {{REALTYPE}} designates the native 226 type used. The default type specification is {{(TYPENAME TYPENAME)}}. The 227 {{DEFAULT-SCHEME-VALUE}} overrides the default result of mapping from the 228 native type; i.e. when no such mapping exists. When supplied the form is used 229 unquoted, otherwise the result is {{'()}}. 230 231 {{ENUMSPEC}} is a TYPENAME symbol or a list of the form {{(SCHEMENAME REALTYPE 230 232 [SCHEME-VALUE])}}, where {{REALTYPE}} designates the native type used. The 231 default native type is {{"ITEM"}}. The {{SCHEME-VALUE}} overrides the result of 232 mapping from the native type. When supplied the form is used unquoted, 233 otherwise the {{SCHEMENAME}} symbol is returned. 233 default enum specification is {{(TYPENAME TYPENAME)}}. The {{SCHEME-VALUE}} 234 overrides the result of mapping from the native type. When supplied the form is 235 used unquoted, otherwise the {{SCHEMENAME}} symbol is returned. 236 237 {{USE-ALIASES}} is an optional boolean flag that determines whether an alias or 238 the {{SCHEMENAME}} is used as the defined foreign variable name. The default 239 is {{#t}}. 234 240 235 241 Additionally two procedures are defined named {{SCHEMENAME->number}} and … … 238 244 takes one argument and converts a numeric value into its scheme value. 239 245 240 Note that the specification of a scheme value override means the mapping may241 not be closed! {{(number->SCHEMENAME (SCHEMENAME->number SCHEMENAME))}} may not 242 equal {{SCHEMENAME}}.246 Note that the specification of a scheme value override ({{SCHEME-VALUE}}) means 247 the mapping may not be closed! {{(number->SCHEMENAME (SCHEMENAME->number 248 SCHEMENAME))}} may not equal {{SCHEMENAME}}. 243 249 244 250 Here a heavily contrived example: -
chicken/branches/release/manual/Acknowledgements
r5945 r7276 8 8 T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence Brannon, Roy 9 9 Bryant, Adam Buchbinder, Hans Bulfone, Category 5, Taylor Campbell, 10 Esteban U. Caamano Castro, Franklin Chen, Thomas Chust, Gian Paolo 11 Ciceri, John Cowan, Grzegorz Chrupała, James Crippen, Tollef Fog 12 Heen, Alejandro Forero Cuervo, Linh Dang, Brian Denheyer, dgym, Chris 13 Double, Jarod Eells, Petter Egesund, Steve Elkins, Daniel B. Faken, 14 Will Farr, Graham Fawcett, Marc Feeley, Fizzie, Kimura Fuyuki, Tony 15 Garnock-Jones, Martin Gasbichler, Joey Gibson, Stephen C. Gilardi, 16 Joshua Griffith, Johannes Groedem, Damian Gryski, Mario Domenech 17 Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro itojun Hagino, 18 Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William P. Heinemann, 19 Bill Hoffman, Bruce Hoult, Hans Huebner, Markus Huelsmann, Goetz 20 Isenmann, Paulo Jabardo, David Janssens, Christian Jaeger, Dale 21 Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller, Brad Kind, Ron 22 Kneusel, Matthias Koeppe, Krysztof Kowałczyk, Andre Kuehne, Todd 23 R. Kueny Sr, Goran Krampe, David Krentzlin, Ben Kurtz, Micky 24 Latowicki, John Lenz, Kirill Lisovsky, Kon Lovett, Dennis Marti, 25 Charles Martin, Bob McIsaac, Alain Mellan, Eric Merrit, Perry Metzger, 26 Scott G. Miller, Mikael, Bruce Mitchener, Chris Moline, Eric E. Moore, 27 Julian Morrison, Dan Muresan, Lars Nilsson, Ian Oversby, o.t., Gene 28 Pavlovsky, Levi Pearson, Nicolas Pelletier, Carlos Pita, Robin Lee 29 Powell, Pupeno, Davide Puricelli, Doug Quale, Eric Raible, Ivan 30 Raikov, Joel Reymont, Andreas Rottman, David Rush, Lars Rustemeier, 31 Daniel Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald 32 Schroeder, Spencer Schumann, Alex Shinn, Ivan Shmakov, Shmul, Tony 33 Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato, 34 Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford 35 Stein, Sunnan, Zbigniew Szadkowski, Mike Thomas, Minh Thu, Christian 36 Tismer, Andre van Tonder, John Tobey, Henrik Tramberend, Vladimir 37 Tsichevsky, Neil van Dyke, Sander Vesik, Panagiotis Vossos, Shawn 38 Wagner, Peter Wang, Ed Watkeys, Thomas Weidner, Goeran Weinholt, 39 Matthew Welland, Joerg Wittenberger, Peter Wright, Mark Wutka, Richard 40 Zidlicky and Houman Zolfaghari for bug-fixes, tips and suggestions. 10 Naruto Canada, Esteban U. Caamano Castro, Franklin Chen, Thomas Chust, 11 Gian Paolo Ciceri, John Cowan, Grzegorz Chrupała, James Crippen, 12 Tollef Fog Heen, Alejandro Forero Cuervo, Linh Dang, Brian Denheyer, 13 dgym, Don, Chris Double, Jarod Eells, Petter Egesund, Steve Elkins, 14 Daniel B. Faken, Will Farr, Graham Fawcett, Marc Feeley, Fizzie, 15 Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey Gibson, 16 Stephen C. Gilardi, Joshua Griffith, Johannes Groedem, Damian Gryski, 17 Mario Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro 18 itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William 19 P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus 20 Huelsmann, Goetz Isenmann, Paulo Jabardo, David Janssens, Christian 21 Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller, 22 Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowałczyk, 23 Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben 24 Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Kon Lovett, Dennis 25 Marti, Charles Martin, Bob McIsaac, Alain Mellan, Eric Merrit, Perry 26 Metzger, Scott G. Miller, Mikael, Bruce Mitchener, Chris Moline, Eric 27 E. Moore, Julian Morrison, Dan Muresan, Lars Nilsson, Ian Oversby, 28 o.t., Gene Pavlovsky, Levi Pearson, Nicolas Pelletier, Carlos Pita, 29 Robin Lee Powell, Pupeno, Davide Puricelli, Doug Quale, Eric Raible, 30 Ivan Raikov, Joel Reymont, Eric Rochester, Andreas Rottman, David 31 Rush, Lars Rustemeier, Daniel Sadilek, Oskar Schirmer, Burton 32 Samograd, Reed Sheridan, Ronald Schroeder, Spencer Schumann, Alex 33 Shinn, Ivan Shmakov, Shmul, Tony Sidaway, Jeffrey B. Siegal, Andrey 34 Sidorenko, Michele Simionato, Volker Stolz, Jon Strait, Dorai Sitaram, 35 Robert Skeels, Jason Songhurst, Clifford Stein, Sunnan, Zbigniew 36 Szadkowski, Rick Taube, Mike Thomas, Minh Thu, Christian Tismer, Andre 37 van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil 38 van Dyke, Sander Vesik, Panagiotis Vossos, Shawn Wagner, Peter Wang, 39 Ed Watkeys, Thomas Weidner, Goeran Weinholt, Matthew Welland, Joerg 40 Wittenberger, Peter Wright, Mark Wutka, Richard Zidlicky and Houman 41 Zolfaghari for bug-fixes, tips and suggestions. 41 42 42 43 CHICKEN uses the PCRE regular expression package ([[http://www.pcre.org]]), 43 44 which is written by Philip Hazel. 44 45 45 Special thanks to Brandon van Every for contributing the 46 [[http://www.cmake.org|CMake]] support and for helping 47 with Windowsbuild issues.46 Special thanks to Brandon van Every for contributing the (now defunct) 47 [[http://www.cmake.org|CMake]] support and for helping with Windows 48 build issues. 48 49 49 50 Also special thanks to Benedikt Rosenau for his constant encouragement. … … 59 60 ; Andrew Wilcox : queues. 60 61 ; Andrew Wright : pattern matcher. 62 ; [[Alex Shinn]] : {{scheme-complete.el}} emacs tab-completion 61 63 62 64 Previous: [[FAQ]] -
chicken/branches/release/manual/C interface
r5945 r7276 283 283 284 284 285 === C_pre_gc_hook 286 287 [C Variable] void (*C_pre_gc_hook)(int mode) 288 289 If not {{NULL}}, the function pointed to by this variable will be 290 called before each garbage collection with a flag indicating what kind 291 of collection was performed (either {{0}} for a minor collection or 292 {{2}} for a resizing collection). A "resizing" collection means a 293 secondary collection that moves all live data into a enlarged (or 294 shrinked) heap-space. Minor collections happen very frequently, so the 295 hook function should not consume too much time. The hook function may 296 not invoke Scheme callbacks. 297 298 Note that resizing collections may be nested in normal major collections. 299 285 300 === C_post_gc_hook 286 301 287 [C Variable] void (*C_post_gc_hook)(int mode) 288 289 If not {{NULL}}, the function pointed to by this variable will be called 290 after each garbage collection with a flag indicating what kind of collection 291 was performed (either {{0}} for a minor collection or {{1}} for a major 292 collection). Minor collections happen very frequently, so the hook function 293 should not consume too much time. The hook function may not invoke Scheme 294 callbacks. 295 296 297 298 An example: 302 [C Variable] void (*C_post_gc_hook)(int mode, long ms) 303 304 If not {{NULL}}, the function pointed to by this variable will be 305 called after each garbage collection with a flag indicating what kind 306 of collection was performed (either {{0}} for a minor collection, 307 {{1}} for a major collection or {{2}} for a resizing 308 collection). Minor collections happen very frequently, so the hook 309 function should not consume too much time. The hook function may not 310 invoke Scheme callbacks. The {{ms}} argument records the number of 311 milliseconds required for the garbage collection, if the collection 312 was a major one. For minor collections the value of the {{ms}} argument 313 is undefined. 314 315 316 317 === An example for simple calls to foreign code involving callbacks 299 318 300 319 % cat foo.scm … … 335 354 336 355 337 '''Notes:''' 356 === Notes: 338 357 339 358 Scheme procedures can call C functions, and C functions can call -
chicken/branches/release/manual/Callbacks
r5945 r7276 75 75 stack with the {{C_save}} macro. 76 76 77 === C_callback_adjust_stack _limits77 === C_callback_adjust_stack 78 78 79 [C function] void C_callback_adjust_stack _limits (C_word *ptr)79 [C function] void C_callback_adjust_stack (C_word *ptr, int size) 80 80 81 81 The runtime-system uses the stack as a special allocation area and 82 internally holds pointers to estimated limits to distinguish between Scheme 83 data objects inside the stack from objects outside of it. 84 If you invoke callbacks at wildly differing stack-levels, 85 these limits may shift from invocation to invocation. Callbacks defined 86 with {{define-external}} will perform appropriate adjustments automatically, 87 but if you invoke {{C_callback}} manually, you should perform a 88 {{C_callback_adjust_stack_limits}} to make sure the internal limits are 89 set properly. {{ptr}} should point to some data object on the stack. The 90 call will make sure the limits are adjusted so that the value pointed to 91 by {{ptr}} is located in the stack. 82 internally holds pointers to estimated limits to distinguish between 83 Scheme data objects inside the stack from objects outside of it. If 84 you invoke callbacks at wildly differing stack-levels, these limits 85 may shift from invocation to invocation. Callbacks defined with 86 {{define-external}} will perform appropriate adjustments 87 automatically, but if you invoke {{C_callback}} manually, you should 88 perform a {{C_callback_adjust_stack}} to make sure the internal limits 89 are set properly. {{ptr}} should point to some data object on the 90 stack and {{size}} is the number of words contained in the data object 91 (or some estimate). The call will make sure the limits are adjusted so 92 that the value pointed to by {{ptr}} is located in the stack. 92 93 93 94 Previous: [[Embedding]] -
chicken/branches/release/manual/Data representation
r5945 r7276 31 31 C_SCHEME_END_OF_FILE}} 32 32 33 Collectively, bits 1 and 2 are known as the ''immediate mark bits''. When bit 1 is set, the object is a fixnum, as described above . When bit 2 is set, it is an immediate object other than a fixnum. If neither is set, the object is non-immediate, as described below. (By definition, bits 1 and 2 may not both be set.)33 Collectively, bits 1 and 2 are known as the ''immediate mark bits''. When bit 1 is set, the object is a fixnum, as described above, and bit 2 is part of its value. When bit 1 is clear but bit 2 is set, it is an immediate object other than a fixnum. If neither bit 1 nor bit 2 is set, the object is non-immediate, as described below. 34 34 35 35 === Non-immediate objects -
chicken/branches/release/manual/Declarations
r5945 r7276 71 71 72 72 73 === compress-literals74 75 [declaration specifier] (compress-literals [THRESHOLD [INITIALIZER]])76 77 The same as the {{-compress-literals}} compiler option.78 The threshold argument defaults to 50. If the optional argument {{INITIALIZER}}79 is given, then the literals will not be created at module startup,80 but when the procedure with this name will be called.81 82 73 === constant 83 74 -
chicken/branches/release/manual/Deviations from the standard
r5945 r7276 3 3 == Deviations from the standard 4 4 5 * Identifiers are by default case-sensitive (see [[http://galinha.ucpel.tche.br:8080/Using%20the%20compiler#Compiler%20command%20line%20format|Compiler command line format]]). 5 Identifiers are by default case-sensitive (see 6 [[http://galinha.ucpel.tche.br:8080/Using%20the%20compiler#Compiler%20command%20line%20format|Compiler 7 command line format]]). 6 8 7 * [4.1.3] The maximal number of arguments that may be passed to a compiled procedure or macro is 120. A macro-definition that has a single rest-parameter can have any number of arguments. If the {{libffi}} library is available on this platform, and if it is installed, then CHICKEN can take advantage of this. See the [[http://chicken.wiki.br/chicken/README|README]] file for more details. 9 [4.1.3] The maximal number of arguments that may be passed to a 10 compiled procedure or macro is 120. A macro-definition that has a 11 single rest-parameter can have any number of arguments. If the 12 {{libffi}} library is available on this platform, and if it is 13 installed, then CHICKEN can take advantage of this. See the 14 [[http://chicken.wiki.br/chicken/README|README]] file for more 15 details. 8 16 9 * [4.2.2] {{letrec}} does evaluate the initial values for the bound variables sequentially and not in parallel, that is: 17 [4.2.2] {{letrec}} does evaluate the initial values for the bound 18 variables sequentially and not in parallel, that is: 10 19 11 20 (letrec ((x 1) (y 2)) (cons x y)) … … 26 35 (cons x y) ) ) 27 36 28 * [4.3] {{syntax-rules}} macros are not provided but available separately. 37 [4.3] {{syntax-rules}} macros are not provided but available 38 separately. 29 39 30 * [6.1] {{equal?}} compares all structured data recursively, while R5RS specifies that {{eqv?}} is used for data other than pairs, strings and vectors. 40 [6.1] {{equal?}} compares all structured data recursively, while R5RS 41 specifies that {{eqv?}} is used for data other than pairs, strings and 42 vectors. 31 43 32 * [6.2.4] The runtime system uses the numerical string-conversion routines of the underlying C library and so does only understand standard (C-library) syntax for floating-point constants. 44 [6.2.4] The runtime system uses the numerical string-conversion 45 routines of the underlying C library and so does only understand 46 standard (C-library) syntax for floating-point constants. 33 47 34 * [6.2.5] There is no built-in support for rationals, complex numbers or extended-precision integers (bignums). The routines {{complex?}}, {{real?}} and {{rational?}} are identical to the standard procedure {{number?}}. The procedures {{numerator}}, {{denominator}}, {{rationalize}}, {{make-rectangular}} and {{make-polar}} are not implemented. Fixnums are limited to ±2<nowiki><sup>30</sup></nowiki> (or ±2<nowiki><sup>62</sup></nowiki> on 64-bit hardware). Support for extended numbers is available as a separate package, provided the GNU multiprecision library is installed. 48 [6.2.5] There is no built-in support for rationals, complex numbers or 49 extended-precision integers (bignums). The routines {{complex?}}, 50 {{real?}} and {{rational?}} are identical to the standard procedure 51 {{number?}}. The procedures {{numerator}}, {{denominator}}, 52 {{rationalize}}, {{make-rectangular}} and {{make-polar}} are not 53 implemented. Fixnums are limited to ±2<nowiki><sup>30</sup></nowiki> 54 (or ±2<nowiki><sup>62</sup></nowiki> on 64-bit hardware). Support for 55 extended numbers is available as a separate package, provided the GNU 56 multiprecision library is installed. 35 57 36 * [6.2.6] The procedure {{string->number}} does not obey read/write invariance on inexact numbers. 58 [6.2.6] The procedure {{string->number}} does not obey read/write 59 invariance on inexact numbers. 37 60 38 * [6.4] The maximum number of values that can be passed to continuations captured using {{call-with-current-continuation}} is 120. 61 [6.4] The maximum number of values that can be passed to continuations 62 captured using {{call-with-current-continuation}} is 120. 39 63 40 * [6.5] Code evaluated in {{scheme-report-environment}} or {{null-environment}} still sees non-standard syntax. 64 [6.5] Code evaluated in {{scheme-report-environment}} or 65 {{null-environment}} still sees non-standard syntax. 41 66 42 * [6.6.2] The procedure {{char-ready?}} always returns {{#t}} for terminal ports. The procedure {{read}} does not obey read/write invariance on inexact numbers. 67 [6.6.2] The procedure {{char-ready?}} always returns {{#t}} for 68 terminal ports. The procedure {{read}} does not obey read/write 69 invariance on inexact numbers. 43 70 44 * [6.6.3] The procedures {{write}} and {{display}} do not obey read/write invariance to inexact numbers. 71 [6.6.3] The procedures {{write}} and {{display}} do not obey 72 read/write invariance to inexact numbers. 45 73 46 * [6.6.4] The {{transcript-on}} and {{transcript-off}} procedures are not implemented. 74 [6.6.4] The {{transcript-on}} and {{transcript-off}} procedures are 75 not implemented. 47 76 48 77 Previous: [[Supported language]] -
chicken/branches/release/manual/Extensions to the standard
r5945 r7276 6 6 {{| ... |}}. 7 7 8 [2.3] The brackets {{[ ... ]}} a re provided as an alternative syntax9 for {{( ... )}}. A number of reader extensions is provided. See 10 [[Non-standard read syntax]].8 [2.3] The brackets {{[ ... ]}} and the braces {{ { ... } }} are 9 provided as an alternative syntax for {{( ... )}}. A number of reader 10 extensions is provided. See [[Non-standard read syntax]]. 11 11 12 12 [4] Numerous non-standard macros are provided. See … … 31 31 * Required-parameters are bound to successive arguments starting with the first argument. It shall be an error if there are fewer arguments than required-parameters. 32 32 * Next, the optional-parameters are bound with the remaining arguments. If there are fewer arguments than optional-parameters, then the remaining optional-parameters are bound to the result of the evaluation of their corresponding <initializer>, if one was specified, otherwise {{#f}}. The corresponding <initializer> is evaluated in an environment in which all previous parameters have been bound. 33 * If there is a rest-parameter, then it is bound to a list containing all the remaining arguments left over after the argument bindings with required-parameters and optional-parameters have been made. These remaining arguments are also eligible to be bound to keyword-parameters, in which case the argument will be a member of both the rest-parameter list and the keyword-parameter. If there is no rest-parameter and there are no matching keyword-parameters, then it shall be an error for there to be any remaining arguments left unbound. 34 * If {{#!key}} was specified in the parameter-list, there shall be an even number of remaining arguments. These are interpreted as a series of pairs, where the first member of each pair is a keyword specifying the parameter name, and the second member is the corresponding value. It shall be an error if the first member of an argument pair is not a keyword, unless there is a rest-parameter. If the same keyword occurs more than once in the list of arguments, then the corresponding value of the first keyword is the binding value. If there is no argument for a particular keyword-parameter, then the variable is bound to the result of evaluating <initializer>, if one was specified, otherwise {{#f}}. The corresponding <initializer> is evaluated in an environment in which all previous parameters have been bound. 33 * If there is a rest-parameter, then it is bound to a list containing all the remaining arguments left over after the argument bindings with required-parameters and optional-parameters have been made. 34 * If {{#!key}} was specified in the parameter-list, there should be an even number of remaining arguments. These are interpreted as a series of pairs, where the first member of each pair is a keyword specifying the parameter name, and the second member is the corresponding value. If the same keyword occurs more than once in the list of arguments, then the corresponding value of the first keyword is the binding value. If there is no argument for a particular keyword-parameter, then the variable is bound to the result of evaluating <initializer>, if one was specified, otherwise {{#f}}. The corresponding <initializer> is evaluated in an environment in which all previous parameters have been bound. 35 36 Needing a special mention is the close relationship between the rest-parameter and possible keyword-parameters. Declaring a rest-parameter binds up all remaining arguments in a list, as described above. These same remaining arguments are also used for attempted matches with declared keyword-parameters, as described above, in which case a matching keyword-parameter binds to the corresponding value argument at the same time that both the keyword and value arguments are added to the rest parameter list. 37 Note that for efficiency reasons, the keyword-parameter matching does nothing more than simply attempt to match with pairs that may exist in the remaining arguments. Extra arguments that don't match are simply unused and forgotten if no rest-parameter has been declared. Because of this, the caller of a procedure containing one or more keyword-parameters cannot rely on any kind of system error to report wrong keywords being passed in. 35 38 36 39 It shall be an error for an {{<ident>}} to appear more than once in a parameter-list. 37 40 38 Keyword arguments are internally handled as rest-parameters with subsequent processing 39 of the argument list. Extra arguments (for example by specifying keyword arguments 40 but no rest argument) are not checked and simply ignored. 41 If there is no rest-parameter and no keyword-parameters in the parameter-list, then it shall be an error for any extra arguments to be passed to the procedure. 42 41 43 42 44 Example: … … 155 157 {{#:append}}. 156 158 159 [6.7] The {{exit}} procedure exits a program right away and does ''not'' invoke pending {{dynamic-wind}} thunks. 160 157 161 Previous: [[Deviations from the standard]] 158 162 -
chicken/branches/release/manual/Foreign type specifiers
r5945 r7276 12 12 13 13 As argument: any value ({{#f}} is false, anything else is true). 14 As result: anything different from 0 and the {{NULL}}-pointer 15 is {{#t}}.14 15 As result: anything different from 0 and the {{NULL}} pointer is {{#t}}. 16 16 17 17 === byte unsigned-byte … … 48 48 === number 49 49 50 A floating-point number. Similar to {{double}}, but when used as a result 51 t ype, then either an exact integer or a floating-point number is returned, depending50 A floating-point number. Similar to {{double}}, but when used as a result type, 51 then either an exact integer or a floating-point number is returned, depending 52 52 on whether the result fits into an exact integer or not. 53 53 … … 55 55 56 56 A symbol, which will be passed to foreign code as a zero-terminated string. 57 57 58 When declared as the result of foreign code, the result should be a string and 58 59 a symbol with the same name will be interned in the symbol table (and returned … … 61 62 === scheme-pointer 62 63 63 An untyped pointer to the contents of a non-immediate Scheme object 64 (not allowed as return type). The value {{#f}} is also allowed 65 and is passed as a {{NULL}} pointer. 66 Don't confuse this type with {{(pointer ...)}} which means something 64 An untyped pointer to the contents of a non-immediate Scheme object (not 65 allowed as return type). The value {{#f}} is also allowed and is passed as a 66 {{NULL}} pointer. 67 68 Don't confuse this type with {{(c-pointer ...)}} which means something 67 69 different (a machine-pointer object). 68 70 69 71 === nonnull-scheme-pointer 70 72 71 As {{pointer}}, but guaranteed not to be {{#f}}. 72 Don't confuse this type with {{(nonnull-pointer ...)}} which means something 73 As {{scheme-pointer}}, but guaranteed not to be {{#f}}. 74 75 Don't confuse this type with {{(nonnull-c-pointer ...)}} which means something 73 76 different (a machine-pointer object). 74 77 75 78 === c-pointer 76 79 77 An untyped operating-system pointer or a locative. 78 allowed and is passed as a {{NULL}} pointer. 80 An untyped operating-system pointer or a locative. The value {{#f}} is also 81 allowed and is passed as a {{NULL}} pointer. If uses as the type of 79 82 a return value, a {{NULL}} pointer will be returned as {{#f}}. 80 83 … … 83 86 As {{c-pointer}}, but guaranteed not to be {{#f/NULL}}. 84 87 85 === [nonnull-] blob 86 87 A blob object, passed as a pointer to its contents. Arguments 88 of type {{blob}} may optionally be {{#f}}, which is 89 passed as a NULL pointer. This is not allowed as a return type. 90 91 === [nonnull-] u8vector [nonnull-] u16vector [nonnull-] u32vector [nonnull-] s8vector [nonnull-] s16vector [nonnull-] s32vector [nonnull-] f32vector [nonnull-] f64vector 92 93 A SRFI-4 number-vector object, passed as a pointer to its 94 contents. These type specifiers are not allowed 95 as return types. 88 === blob 89 90 A blob object, passed as a pointer to its contents. Arguments of type {{blob}} 91 may optionally be {{#f}}, which is passed as a NULL pointer. 92 93 This is not allowed as a return type. 94 95 === nonnull-blob 96 97 As {{blob}}, but guaranteed not to be {{#f}}. 98 99 === u8vector u16vector u32vector s8vector s16vector s32vector f32vector f64vector 100 101 A SRFI-4 number-vector object, passed as a pointer to its contents. 102 103 These type specifiers are not allowed as return types. 104 105 === nonnull-u8vector nonnull-u16vector nonnull-u32vector nonnull-s8vector nonnull-s16vector nonnull-s32vector nonnull-f32vector nonnull-f64vector 106 107 As {{u8vector ...}}, but guaranteed not to be {{#f}}. 96 108 97 109 === c-string 98 110 99 A C string (zero-terminated). The value {{#f}} 100 is also allowed and is passed as a {{NULL}} pointer. If uses as 101 the type of a return value, a {{NULL}} pointer will be returned as 102 {{#f}}. Note that the string is copied (with a zero-byte appended) 103 when passed as an argument to a foreign function. Also a return value 111 A C string (zero-terminated). The value {{#f}} is also allowed and is passed as 112 a {{NULL}} pointer. If uses as the type of a return value, a {{NULL}} pointer 113 will be returned as {{#f}}. Note that the string is copied (with a zero-byte 114 appended) when passed as an argument to a foreign function. Also a return value 104 115 of this type is copied into garbage collected memory. 105 116 … … 110 121 === [nonnull-] c-string* 111 122 112 Similar to {{[nonnull-]c-string}}, but if used as a result-type, 113 the pointer returned by the foreign code will be freed (using the 114 C-libraries {{free(1)}}) 115 after copying. This type specifier is not valid as a result type 116 for callbacks defined with {{define-external}}. 123 Similar to {{[nonnull-] c-string}}, but if used as a result-type, the pointer 124 returned by the foreign code will be freed (using the C-libraries {{free(1)}}) 125 after copying. This type specifier is not valid as a result type for callbacks 126 defined with {{define-external}}. 117 127 118 128 === [nonnull-] unsigned-c-string[*] … … 122 132 === c-string-list 123 133 124 Expects a pointer to a list of C strings teminated by a {{NULL}} pointer 125 and returns a list of strings. Only valid as a result type of non-callback 126 functions. 134 Expects a pointer to a list of C strings teminated by a {{NULL}} pointer and 135 returns a list of strings. 136 137 Only valid as a result type of non-callback functions. 127 138 128 139 === c-string-list* … … 133 144 === void 134 145 135 Specifies an undefined return value. Not allowed as argument type. 146 Specifies an undefined return value. 147 148 Not allowed as argument type. 136 149 137 150 === (const TYPE) … … 143 156 An enumeration type. Handled internally as an {{integer}}. 144 157 145 === ( pointer TYPE) (c-pointer TYPE)158 === (c-pointer TYPE) 146 159 147 160 An operating-system pointer or a locative to an object of {{TYPE}}. 148 161 149 === (nonnull- pointer TYPE) (nonnull-c-pointer TYPE)150 151 As {{( pointer TYPE)}}, but guaranteed not to be {{#f/NULL}}.162 === (nonnull-c-pointer TYPE) 163 164 As {{(c-pointer TYPE)}}, but guaranteed not to be {{#f/NULL}}. 152 165 153 166 === (ref TYPE) … … 158 171 === (struct NAME) 159 172 160 A struct of the name {{NAME}}, which should be a string. Structs 161 can not be directly passed as arguments to foreign function, neither 173 A struct of the name {{NAME}}, which should be a string. 174 175 Structs cannot be directly passed as arguments to foreign function, neither 162 176 can they be result values. Pointers to structs are allowed, though. 163 177 164 178 === (template TYPE ARGTYPE ...) 165 179 166 A C++ template type. For example {{vector<int>}} would be specified 167 as {{(template "vector" int)}}. Template types can not be directly passed 168 as arguments or returned as results. 180 A C++ template type. For example {{vector<int>}} would be specified as 181 {{(template "vector" int)}}. 182 183 Template types cannot be directly passed as arguments or returned as results. 169 184 170 185 === (union NAME) 171 186 172 A union of the name {{NAME}}, which should be a string. Unions can 173 not be directly passed as arguments to foreign function, neither can 187 A union of the name {{NAME}}, which should be a string. 188 189 Unions cannot be directly passed as arguments to foreign function, neither can 174 190 they be result values. Pointers to unions are allowed, though. 175 191 176 192 === (instance CNAME SCHEMECLASS) 177 193 178 A pointer to a C++ class instance. {{CNAME}} should designate 179 the name of the C++ class, and {{SCHEMECLASS}} should be the class 180 that wraps the instance pointer. Normally {{SCHEMECLASS}} 181 should be a subclass of {{<c++-object>}}. 194 A pointer to a C++ class instance. {{CNAME}} should designate the name of the 195 C++ class, and {{SCHEMECLASS}} should be the class that wraps the instance 196 pointer. Normally {{SCHEMECLASS}} should be a subclass of {{<c++-object>}}. 182 197 183 198 === (instance-ref CNAME SCHEMECLASS) … … 187 202 === (function RESULTTYPE (ARGUMENTTYPE1 ... [...]) [CALLCONV]) 188 203 189 A function pointer. {{CALLCONV}} specifies an optional calling 190 convention and should be a string. The meaning of this string is entirely 191 platform dependent. The value {{#f}} is also allowed and is passed 192 as a {{NULL}} pointer. 204 A function pointer. {{CALLCONV}} specifies an optional calling convention and 205 should be a string. The meaning of this string is entirely platform dependent. 206 The value {{#f}} is also allowed and is passed as a {{NULL}} pointer. 193 207 194 208 === Mappings … … 215 229 </td></tr><tr><td>number</td><td> 216 230 double 217 </td></tr><tr><td>[nonnull-]pointer</td><td>218 void *219 231 </td></tr><tr><td>[nonnull-]c-pointer</td><td> 220 232 void * … … 247 259 </td></tr><tr><td>void</td><td> 248 260 void 249 </td></tr><tr><td>([nonnull-] pointer TYPE)</td><td>261 </td></tr><tr><td>([nonnull-]c-pointer TYPE)</td><td> 250 262 TYPE * 251 263 </td></tr><tr><td>(enum NAME)</td><td> -
chicken/branches/release/manual/Locations
r5945 r7276 50 50 <enscript highlight=scheme> 51 51 (define-external foo int) 52 ((foreign-lambda* void ((( pointer int) ip)) "*ip = 123;")52 ((foreign-lambda* void (((c-pointer int) ip)) "*ip = 123;") 53 53 (location foo)) 54 54 foo ==> 123 … … 64 64 65 65 (define modf 66 (foreign-lambda double "modf" double ( pointer double)) )66 (foreign-lambda double "modf" double (c-pointer double)) ) 67 67 68 68 (let-location ([i double]) -
chicken/branches/release/manual/Non-standard macros and special forms
r5945 r7276 5 5 == Non-standard macros and special forms 6 6 7 === Making extra libraries and extensions available e7 === Making extra libraries and extensions available 8 8 9 9 ==== require-extension … … 12 12 [syntax] (use ID ...) 13 13 14 This form does all necessary steps to make the libraries or extensions given15 in {{ID ...}} available. It loads syntactic extension , if needed and generates14 This form does all the necessary steps to make the libraries or extensions given 15 in {{ID ...}} available. It loads syntactic extensions, if needed and generates 16 16 code for loading/linking with core library modules or separately installed 17 17 extensions. {{use}} is just a shorter alias for {{require-extension}}. 18 This implementation of {{require-extension}} is compliant to[[http://srfi.schemers.org/srfi-55/srfi-55.html|SRFI-55]]18 This implementation of {{require-extension}} is compliant with [[http://srfi.schemers.org/srfi-55/srfi-55.html|SRFI-55]] 19 19 (see the [[http://srfi.schemers.org/srfi-55/srfi-55.html|SRFI-55]] document for more information). 20 20 … … 24 24 * If {{ID}} names a built-in feature {{chicken srfi-0 srfi-2 srfi-6 srfi-8 srfi-9 srfi-10 srfi-17 srfi-23 srfi-30 srfi-39 srfi-55}}, then nothing is done. 25 25 * If {{ID}} names one of the syntactic extensions {{chicken-more-macros chicken-ffi-macros}}, then this extension will be loaded. 26 * {{ID}} names one of the core library units shipped with CHICKEN, then a {{(load-library 'ID)}} will be performed.27 * {{ID}} names an installed extension with the {{syntax}} or {{require-at-runtime}} attribute, then the equivalent of {{(require-for-syntax 'ID)}} is performed, probably followed by {{(require ...)}} for any run-time requirements.28 * Otherwise {{(require-extension ID)}} is equivalent to {{(require 'ID)}}.29 30 During compilation one of the following happens instead:26 * If {{ID}} names one of the core library units shipped with CHICKEN, then a {{(load-library 'ID)}} will be performed. 27 * If {{ID}} names an installed extension with the {{syntax}} or {{require-at-runtime}} attribute, then the equivalent of {{(require-for-syntax 'ID)}} is performed, probably followed by {{(require ...)}} for any run-time requirements. 28 * Otherwise, {{(require-extension ID)}} is equivalent to {{(require 'ID)}}. 29 30 During compilation, one of the following happens instead: 31 31 32 32 * If {{ID}} names a built-in feature {{chicken srfi-0 srfi-2 srfi-6 srfi-8 srfi-9 srfi-10 srfi-17 srfi-23 srfi-30 srfi-39 srfi-55}}, then nothing is done. 33 33 * If {{ID}} names one of the syntactic extensions {{chicken-more-macros chicken-ffi-macros}}, then this extension will be loaded at compile-time, making the syntactic extensions available in compiled code. 34 * If {{ID}} names one of the core library units shipped with CHICKEN, or if the option {{-uses ID}} has been passed to the compiler then a {{(declare (uses ID))}} is generated.34 * If {{ID}} names one of the core library units shipped with CHICKEN, or if the option {{-uses ID}} has been passed to the compiler, then a {{(declare (uses ID))}} is generated. 35 35 * If {{ID}} names an installed extension with the {{syntax}} or {{require-at-runtime}} attribute, then the equivalent of {{(require-for-syntax 'ID)}} is performed, and code is emitted to {{(require ...)}} any needed run-time requirements. 36 36 * Otherwise {{(require-extension ID)}} is equivalent to {{(require 'ID)}}. … … 483 483 The following feature-identifiers are available in all situations: {{(machine-byte-order)}}, {{(machine-type)}}, {{(software-type)}}, {{(software-version)}}, where the actual feature-identifier is platform dependent. 484 484 485 In addition the following feature-identifiers may exist: {{applyhook}}, {{extraslot}}, {{ptables}}, {{dload}} , {{libffi}}.485 In addition the following feature-identifiers may exist: {{applyhook}}, {{extraslot}}, {{ptables}}, {{dload}}. 486 486 487 487 For further information, see the documentation for [[http://srfi.schemers.org/srfi-0/srfi-0.html|SRFI-0]]. -
chicken/branches/release/manual/The User's Manual
r5945 r7276 3 3 == The User's Manual 4 4 5 ''(This document describes version 2.7 02)''5 ''(This document describes version 2.739)'' 6 6 7 7 '''CHICKEN is a compiler that translates Scheme source files into C''', which in -
chicken/branches/release/manual/Unit eval
r5945 r7276 166 166 ; [parameter] repository-path : 167 167 Contains a string naming the path to the extension repository, which defaults to 168 either the value of the environment variable {{CHICKEN_REPOSITORY}} , the value169 o f the environment variable {{CHICKEN_HOME}} or the default library path168 either the value of the environment variable {{CHICKEN_REPOSITORY}} 169 or the default library path 170 170 (usually {{/usr/local/lib/chicken}} on UNIX systems). 171 171 … … 205 205 from one of the following locations: 206 206 207 * the current include path, which defaults to the pathnames given in {{CHICKEN_INCLUDE_PATH}} and {{CHICKEN_HOME}}.207 * the current include path, which defaults to the pathnames given in {{CHICKEN_INCLUDE_PATH}}. 208 208 * the current directory 209 209 … … 249 249 250 250 Returns a string given the installation directory (usually {{/usr/local/share/chicken}} on UNIX-like systems). 251 If the environment variable {{CHICKEN_HOME}} is set, then its value will be returned.As a last option,251 As a last option, 252 252 if the environment variable {{CHICKEN_PREFIX}} is set, then {{chicken-home}} will return 253 253 {{$CHICKEN_PREFIX/share}}. -
chicken/branches/release/manual/Unit extras
r5945 r7276 177 177 178 178 [procedure] (fprintf PORT FORMATSTRING ARG ...) 179 [procedure] (printf FORMATSTRING ARG )179 [procedure] (printf FORMATSTRING ARG ...) 180 180 [procedure] (sprintf FORMATSTRING ARG ...) 181 181 182 182 Simple formatted output to a given port ({{fprintf}}), the 183 value of {{(current-output-port)}} ({{printf}}) or a string183 value of {{(current-output-port)}} ({{printf}}), or a string 184 184 ({{sprintf}}). The {{FORMATSTRING}} can contain any sequence 185 of characters. The character `~' prefixes special formatting directives:185 of characters. There must be at least as many {{ARG}} arguments given as there are format directives that require an argument in {{FORMATSTRING}}. Extra {{ARG}} arguments are ignored. The character `~' prefixes special formatting directives: 186 186 187 187 <table> … … 476 476 Line-input and -output. {{PORT}} defaults to the value of 477 477 {{(current-input-port)}} and {{(current-output-port)}}, 478 respectively. if the optional argument {{LIMIT}} is given and478 respectively. If the optional argument {{LIMIT}} is given and 479 479 not {{#f}}, then {{read-line}} reads at most {{LIMIT}} 480 characters per line. 480 characters per line. {{read-line}} returns a string without the terminating newline and {{write-line}} adds a terminating newline before outputting. 481 481 482 482 -
chicken/branches/release/manual/Unit library
r5945 r7276 4 4 == Unit library 5 5 6 This unit contains basic Scheme definitions. This unit is used by default, unless the program7 is compiled with the {{-explicit-use}} option.6 This unit contains basic Scheme definitions. This unit is used by default, 7 unless the program is compiled with the {{-explicit-use}} option. 8 8 9 9 === Arithmetic … … 19 19 ==== Binary integer operations 20 20 21 Binary integer operations. {{arithmetic-shift}} shifts the argument 22 {{N 1}} by {{N2}} bits to the left. If {{N2}} is negative, than {{N1}}23 is shifted to the right. These operations only accept exact integers 24 or inexact integers in word range (32 bit signed on 32-bit platforms, 25 or 64 bit signed on 64-bitplatforms).21 Binary integer operations. {{arithmetic-shift}} shifts the argument {{N1}} by 22 {{N2}} bits to the left. If {{N2}} is negative, than {{N1}} is shifted to the 23 right. These operations only accept exact integers or inexact integers in word 24 range (32 bit signed on 32-bit platforms, or 64 bit signed on 64-bit 25 platforms). 26 26 27 27 ; [procedure] (bitwise-and N1 ...) … … 35 35 [procedure] (bit-set? N INDEX) 36 36 37 Returns {{#t}} if the bit at the position {{INDEX}} in the integer {{N}} is set,38 or {{#f}} otherwise. The rightmost/least-significant bit is bit 0.37 Returns {{#t}} if the bit at the position {{INDEX}} in the integer {{N}} is 38 set, or {{#f}} otherwise. The rightmost/least-significant bit is bit 0. 39 39 40 40 … … 47 47 ==== Arithmetic fixnum operations 48 48 49 These procedures do not check their arguments, so non-fixnum 50 parameters will result in incorrect results. {{fxneg}} negates its 51 argument. 49 These procedures do not check their arguments, so non-fixnum parameters will 50 result in incorrect results. {{fxneg}} negates its argument. 52 51 53 52 On division by zero, {{fx/}} and {{fxmod}} signal a condition of kind … … 81 80 82 81 In safe mode, these procedures throw a type error with non-float 83 arguments (except {{flonum?}}, which returns {{#f}}). 84 these procedures do not check their arguments. 82 arguments (except {{flonum?}}, which returns {{#f}}). In unsafe mode, 83 these procedures do not check their arguments. A non-flonum argument 85 84 in unsafe mode can crash the system. 86 85 … … 104 103 [procedure] (signum N) 105 104 106 Returns {{1}} if {{N}} is positive, {{-1}} if {{N}} 105 Returns {{1}} if {{N}} is positive, {{-1}} if {{N}} 107 106 is negative or {{0}} if {{N}} is zero. {{signum}} is exactness preserving. 108 107 … … 122 121 [procedure] (current-output-port [PORT]) 123 122 124 Returns default output port. If {{PORT}} is given, then that port is selected as the new current output port. 125 126 Note that the default output port is not buffered. 127 Use [[Unit posix#Setting the file buffering mode|{{set-buffering-mode!}}]] if you need a different behaviour. 123 Returns default output port. If {{PORT}} is given, then that port is selected 124 as the new current output port. 125 126 Note that the default output port is not buffered. Use [[Unit posix#Setting the 127 file buffering mode|{{set-buffering-mode!}}]] if you need a different behavior. 128 128 129 129 ==== current-error-port … … 131 131 [procedure] (current-error-port [PORT]) 132 132 133 Returns default error output port. If {{PORT}} is given, then that 134 port is selected as the new current error output port. 135 136 Note that the default error output port is not buffered. 137 Use [[Unit posix#Setting the file buffering mode|{{set-buffering-mode!}}]] if you need a different behaviour. 133 Returns default error output port. If {{PORT}} is given, then that port is 134 selected as the new current error output port. 135 136 Note that the default error output port is not buffered. Use [[Unit 137 posix#Setting the file buffering mode|{{set-buffering-mode!}}]] if you need a 138 different behavior. 138 139 139 140 ==== flush-output … … 149 150 [procedure] (port-name [PORT]) 150 151 151 Fetch filename from {{PORT}}. This returns the filename that was 152 used to open this file. Returns a special tag string, enclosed into 153 parentheses fornon-file ports. {{PORT}} defaults to the value of {{(current-input-port)}}.152 Fetch filename from {{PORT}}. This returns the filename that was used to open 153 this file. Returns a special tag string, enclosed into parentheses for 154 non-file ports. {{PORT}} defaults to the value of {{(current-input-port)}}. 154 155 155 156 … … 158 159 [procedure] (port-position [PORT]) 159 160 160 Returns the current position of {{PORT}} as two values: row and 161 column number. If the port does not support such an operation an error 162 is signaled. This procedure is currently only available for input ports. 163 {{PORT}} defaults to thevalue of {{(current-input-port)}}.161 Returns the current position of {{PORT}} as two values: row and column number. 162 If the port does not support such an operation an error is signaled. This 163 procedure is currently only available for input ports. {{PORT}} defaults to the 164 value of {{(current-input-port)}}. 164 165 165 166 … … 172 173 173 174 174 175 176 175 === Files 177 178 179 180 176 181 177 ==== delete-file … … 203 199 204 200 205 206 207 201 === String ports 208 209 210 211 202 212 203 ==== get-output-string … … 239 230 240 231 CHICKEN maintains a global list of ''features'' naming functionality available 241 in tthe current system. Additionally the {{cond-expand}} form accesses this232 in the current system. Additionally the {{cond-expand}} form accesses this 242 233 feature list to infer what features are provided. Predefined features are 243 234 {{chicken}}, and the SRFIs (Scheme Request For Implementation) provided by the … … 288 279 289 280 Keywords are special symbols prefixed with {{#:}} that evaluate 290 to themselves. 291 parameters in addition to normal required parameters. 281 to themselves. Procedures can use keywords to accept optional named 282 parameters in addition to normal required parameters. Assignment to 292 283 and bindings of keyword symbols is not allowed. 293 284 The parameter {{keyword-style}} and the compiler/interpreter option … … 302 293 303 294 Returns the argument from {{ARGLIST}} specified under the keyword 304 {{KEYWORD}}. 295 {{KEYWORD}}. If the keyword is not found, then the zero-argument 305 296 procedure {{THUNK}} is invoked and the result value is returned. If 306 297 {{THUNK}} is not given, {{#f}} is returned. … … 344 335 345 336 346 CHICKEN implements the (currently withdrawn) [[http://srfi.schemers.org/srfi-12/srfi-12.html|SRFI-12]] 347 exception system. For more information, see the [[http://srfi.schemers.org/srfi-12/srfi-12.html|SRFI-12]] 348 document. 337 CHICKEN implements the (currently withdrawn) 338 [[http://srfi.schemers.org/srfi-12/srfi-12.html|SRFI-12]] exception system. For 339 more information, see the 340 [[http://srfi.schemers.org/srfi-12/srfi-12.html|SRFI-12]] document. 349 341 350 342 … … 361 353 </enscript> 362 354 363 If provided, {{VARIABLE}} will be bound to the signal led exception355 If provided, {{VARIABLE}} will be bound to the signaled exception 364 356 object. {{BODY ...}} is executed when the exception is a property- 365 357 or composite condition with the kinds given {{KIND ...}} (unevaluated). 366 If no clause applies, the exception is re-signal led in the same dynamic358 If no clause applies, the exception is re-signaled in the same dynamic 367 359 context as the {{condition-case}} form. 368 360 … … 388 380 [procedure] (breakpoint [NAME]) 389 381 390 Programmatically triggers a breakpoint (similar to the {{,br}} top-level csi command). 391 392 393 394 All error-conditions signalled by the system are of kind {{exn}}. 382 Programmatically triggers a breakpoint (similar to the {{,br}} top-level csi 383 command). 384 385 All error-conditions signaled by the system are of kind {{exn}}. 395 386 The following composite conditions are additionally defined: 396 387 … … 399 390 <tr><td> (exn arity) 400 391 401 Signal led when a procedure is called with the wrong number of arguments.392 Signaled when a procedure is called with the wrong number of arguments. 402 393 403 394 </td></tr><tr><td> (exn type) 404 395 405 Signal led on type-mismatch errors, for example when an argument of the wrong406 type is passed to a built in procedure.396 Signaled on type-mismatch errors, for example when an argument of the wrong 397 type is passed to a built-in procedure. 407 398 408 399 </td></tr><tr><td> (exn arithmetic) 409 400 410 Signal led on arithmetic errors, like division by zero.401 Signaled on arithmetic errors, like division by zero. 411 402 412 403 </td></tr><tr><td> (exn i/o) 413 404 414 Signal led on input/output errors.405 Signaled on input/output errors. 415 406 416 407 </td></tr><tr><td> (exn i/o file) 417 408 418 Signal led on file-related errors.409 Signaled on file-related errors. 419 410 420 411 </td></tr><tr><td> (exn i/o net) 421 412 422 Signal led on network errors.413 Signaled on network errors. 423 414 424 415 </td></tr><tr><td> (exn bounds) 425 416 426 Signal led on errors caused by accessing non-existent elements of a collection.417 Signaled on errors caused by accessing non-existent elements of a collection. 427 418 428 419 </td></tr><tr><td> (exn runtime) 429 420 430 Signal led on low-level runtime-system error-situations.421 Signaled on low-level runtime-system error-situations. 431 422 432 423 </td></tr><tr><td> (exn runtime limit) 433 424 434 Signal led when an internal limit is exceeded (like running out of memory).425 Signaled when an internal limit is exceeded (like running out of memory). 435 426 436 427 </td></tr><tr><td> (exn match) 437 428 438 Signal led on errors raised by failed matches (see the section on {{match}}).429 Signaled on errors raised by failed matches (see the section on {{match}}). 439 430 440 431 </td></tr><tr><td> (exn syntax) 441 432 442 Signal led on syntax errors.433 Signaled on syntax errors. 443 434 444 435 </td></tr><tr><td> (exn breakpoint) 445 436 446 Signal led when a breakpoint is reached.437 Signaled when a breakpoint is reached. 447 438 448 439 </td></tr> … … 454 445 * All error-exceptions (of the kind {{exn}}) are non-continuable. 455 446 456 * Error-exceptions of the {{exn}} kind have additional {{arguments}} and {{location}} properties that contain the arguments passed to the exception-handler and the name of the procedure where the error occurred (if available). 457 458 * When the {{posix}} unit is available and used, then a user-interrupt ({{signal/int}}) signals an exception of the kind {{user-interrupt}}. 459 460 * the procedure {{condition-property-accessor}} accepts an optional third argument. If the condition does not have a value for the desired property and if the optional argument is given, no error is signalled and the accessor returns the third argument. 461 462 * In composite conditionss all properties are currently collected in a single property-list, so in the case that to conditions have the same named property, only one will be visible. 447 * Error-exceptions of the {{exn}} kind have additional {{arguments}} and 448 {{location}} properties that contain the arguments passed to the 449 exception-handler and the name of the procedure where the error occurred (if 450 available). 451 452 * When the {{posix}} unit is available and used, then a user-interrupt 453 ({{signal/int}}) signals an exception of the kind {{user-interrupt}}. 454 455 * the procedure {{condition-property-accessor}} accepts an optional third 456 argument. If the condition does not have a value for the desired property and 457 if the optional argument is given, no error is signaled and the accessor 458 returns the third argument. 459 460 * In composite conditions all properties are currently collected in a single 461 property-list, so in the case that to conditions have the same named property, 462 only one will be visible. 463 463 464 464 … … 475 475 the list is a string containing the name of the executing program. The 476 476 other items are the arguments passed to the application. This list is 477 freshly created on every invocation of {{(argv)}}. 477 freshly created on every invocation of {{(argv)}}. It depends on 478 478 the host-shell whether arguments are expanded ('globbed') or not. 479 479 … … 486 486 (Invokes {{exit-handler}}). 487 487 488 488 Note that pending {{dynamic-wind}} thunks are ''not'' invoked when exiting your program in this way. 489 489 ==== build-platform 490 490 … … 530 530 [procedure] (machine-byte-order) 531 531 532 Returns the symbol {{little-endian}} or {{big-endian}}, depending on the machine's byte-order. 532 Returns the symbol {{little-endian}} or {{big-endian}}, depending on the 533 machine's byte-order. 533 534 534 535 … … 557 558 [procedure] (on-exit THUNK) 558 559 559 Schedules the zero-argument proce xdures {{THUNK}} to be executed before560 the process exits, either explicitly via {{exit}} or implicitly after exec tion561 of the last top level form. Note that finalizers for unreferenced finalized560 Schedules the zero-argument procedures {{THUNK}} to be executed before 561 the process exits, either explicitly via {{exit}} or implicitly after execution 562 of the last top-level form. Note that finalizers for unreferenced finalized 562 563 data are run before exit procedures. 563 564 … … 600 601 [procedure] (c-runtime) 601 602 602 Returns a symbol that designates what kind of C runtime library has been linked with this version of the Chicken 603 libraries. Possible return values are {{static}}, {{dynamic}} or {{unknown}}. On systems not compiled 604 with the Microsoft C compiler, {{c-runtime}} always returns {{unknown}}. 603 Returns a symbol that designates what kind of C runtime library has been linked 604 with this version of the Chicken libraries. Possible return values are 605 {{static}}, {{dynamic}} or {{unknown}}. On systems not compiled with the 606 Microsoft C compiler, {{c-runtime}} always returns {{unknown}}. 605 607 606 608 … … 676 678 Prints error message, writes all extra arguments to the 677 679 value of {{(current-error-port)}} and invokes the 678 current exception-handler. 680 current exception-handler. This conforms to 679 681 [[http://srfi.schemers.org/srfi-23/srfi-23.html|SRFI-23]]. 680 682 If {{LOCATION}} is given and a symbol, it specifies the ''location'' (the name … … 690 692 is only generated in code compiled without {{-no-trace}} and evaluated code. 691 693 If the optional argument {{START}} is given, the backtrace starts 692 at this offset, i.e. when {{START}} is 1, the next to last trace-entry 694 at this offset, i.e. when {{START}} is 1, the next to last trace-entry 693 695 is printed, and so on. If the optional argument {{THREAD}} is given, then 694 696 the call-chain will only be constructed for calls performed by this thread. … … 755 757 [procedure] (gc [FLAG]) 756 758 757 Invokes a garbage-collection and returns the number of free bytes 758 in the heap. The flag specifies whether a minor ({{#f}}) or 759 major ({{#t}}) GC is to be triggered. If no argument is given, 760 {{#t}} is assumed. An explicit {{#t}} argument will cause all pending finalizers to be executed. 759 Invokes a garbage-collection and returns the number of free bytes in the heap. 760 The flag specifies whether a minor ({{#f}}) or major ({{#t}}) GC is to be 761 triggered. If no argument is given, {{#t}} is assumed. An explicit {{#t}} 762 argument will cause all pending finalizers to be executed. 763 761 764 ==== memory-statistics 762 765 763 766 [procedure] (memory-statistics) 764 767 765 Performs a major garbage collection and returns a three element vector 768 Performs a major garbage collection and returns a three element vector 766 769 containing the total heap size in bytes, the number of bytes currently 767 770 used and the size of the nursery (the first heap generation). Note … … 776 779 Registers a procedure of one argument {{PROC}}, that will be 777 780 called as soon as the non-immediate data object {{X}} is about to 778 be garbage-collected (with that object as its argument). 781 be garbage-collected (with that object as its argument). Note that 779 782 the finalizer will '''not''' be called while interrupts are disabled. 780 783 This procedure returns {{X}}. … … 798 801 799 802 800 ==== andmap801 802 [procedure] (andmap PROC LIST1 ...)803 804 Repeatedly calls {{PROC}} with arguments taken from {{LIST1 ...}}.805 If any invocation should return {{#f}}, the result of806 {{andmap}} is {{#f}}. If all invocations return a true result,807 then the result of {{andmap}} is {{#t}}.808 809 810 ==== ormap811 812 [procedure] (ormap PROC LIST1 ...)813 814 Repeatedly calls {{PROC}} with arguments taken from {{LIST1 ...}}.815 If any invocation should return a value different from816 {{#f}}, then this value is returned as the result of817 {{ormap}}. If all invocations return '''#f''',818 then the result of {{ormap}} is {{#f}}.819 820 821 803 ==== promise? 822 804 … … 835 817 [procedure] (reverse-list->string LIST) 836 818 837 Returns a string with the characters in {{LIST}} in reverse order. This is equivalent to838 {{(list->string (reverse LIST))}}, but much more efficient.819 Returns a string with the characters in {{LIST}} in reverse order. This is 820 equivalent to {{(list->string (reverse LIST))}}, but much more efficient. 839 821 840 822 841 823 842 824 === Generating uninterned symbols 843 844 845 825 846 826 ==== gensym … … 860 840 861 841 862 863 864 842 === Standard Input/Output 865 843 … … 878 856 Outputs the optional arguments {{EXP1 ...}} using {{display}} and 879 857 writes a newline character to the port that is the value of 880 {{(current-output-port)}}. Returns its first argument, or 881 {{(void)}} when no supplied arguments. 858 {{(current-output-port)}}. Returns {{(void)}}. 882 859 883 860 … … 887 864 888 865 Similar to {{print}}, but does not output a terminating newline 889 character and performs a {{flush-out out}} after writing its arguments.866 character and performs a {{flush-output}} after writing its arguments. 890 867 891 868 … … 893 870 894 871 === User-defined named characters 895 896 897 872 898 873 ==== char-name … … 904 879 If {{SYMBOL-OR-CHAR}} is a symbol, then {{char-name}} returns 905 880 the character with this name, or {{#f}} if no character is defined 906 under this name. 881 under this name. If {{SYMBOL-OR-CHAR}} is a character, then the 907 882 name of the character is returned as a symbol, or {{#f}} if the 908 883 character has no associated name. … … 910 885 If the optional argument {{CHAR}} is provided, then 911 886 {{SYMBOL-OR-CHAR}} should be a symbol that will be the new name of 912 the given character. 887 the given character. If multiple names designate the same character, 913 888 then the {{write}} will use the character name that was defined last. 914 889 … … 925 900 926 901 927 928 929 902 === Blobs 930 903 … … 936 909 [procedure] (make-blob SIZE) 937 910 938 Returns a blob object of {{SIZE}} bytes, 939 aligned on an 8-byte boundry, 940 un-initialized. 911 Returns a blob object of {{SIZE}} bytes, aligned on an 8-byte boundary, 912 uninitialized. 941 913 942 914 ==== blob? … … 967 939 968 940 969 970 971 941 === Vectors 972 973 974 942 975 943 ==== vector-copy! … … 989 957 [procedure] (vector-resize VECTOR N [INIT]) 990 958 991 Creates and returns a new vector with the contents of {{VECTOR}} and length {{N}}.992 If {{N}} is greater than the original length of {{VECTOR}}, then all additional993 items are initialized to {{INIT}}. If {{INIT}} is not specified, the959 Creates and returns a new vector with the contents of {{VECTOR}} and length 960 {{N}}. If {{N}} is greater than the original length of {{VECTOR}}, then all 961 additional items are initialized to {{INIT}}. If {{INIT}} is not specified, the 994 962 contents are initialized to some unspecified value. 995 963 996 964 997 965 998 999 1000 966 === The unspecified value 1001 967 1002 1003 1004 968 ==== void 1005 969 … … 1010 974 1011 975 1012 1013 1014 976 === Continuations 1015 977 1016 1017 1018 978 ==== call/cc 1019 979 … … 1027 987 [procedure] (continuation-capture PROCEDURE) 1028 988 1029 Creates a continuation object representing the current continuation and tail-calls1030 {{PROCEDURE}} with this continuation as the single argument.989 Creates a continuation object representing the current continuation and 990 tail-calls {{PROCEDURE}} with this continuation as the single argument. 1031 991 1032 992 More information about this continuation API can be found in the paper 1033 [[http://repository.readscheme.org/ftp/papers/sw2001/feeley.pdf]] ''A Better API for first class1034 Continuations'' by Marc Feeley.993 [[http://repository.readscheme.org/ftp/papers/sw2001/feeley.pdf]] ''A Better 994 API for first class Continuations'' by Marc Feeley. 1035 995 1036 996 … … 1039 999 [procedure] (continuation? X) 1040 1000 1041 Returns {{#t}} if {{X}} is a continuation object, or {{#f}} otherwise. 1001 Returns {{#t}} if {{X}} is a continuation object, or {{#f}} otherwise. Please 1002 note that this applies only to continuations created by the Continuation API, 1003 but not by call/cc, i.e.: {{(call-with-current-continuation continuation?)}} 1004 returns {{#f}}, whereas {{(continuation-capture continuation?)}} returns 1005 {{#t}}. 1042 1006 1043 1007 … … 1068 1032 === Setters 1069 1033 1070 SRFI-17 is fully implemented. For more information see: [[http://srfi.schemers.org/srfi-17/srfi-17.html|SRFI-17]]. 1034 SRFI-17 is fully implemented. For more information see: 1035 [[http://srfi.schemers.org/srfi-17/srfi-17.html|SRFI-17]]. 1071 1036 1072 1037 ==== setter … … 1074 1039 [procedure] (setter PROCEDURE) 1075 1040 1076 Returns the setter-procedure of {{PROCEDURE}}, or signals an error if {{PROCEDURE}}1077 has no associated setter-procedure.1078 1079 Note that {{(set! (setter PROC) ...)}} for a procedure that has no associated setter procedure1080 yet is a very slow operation (the old procedure is replaced by a modified copy, which involves a 1081 garbage collection).1041 Returns the setter-procedure of {{PROCEDURE}}, or signals an error if 1042 {{PROCEDURE}} has no associated setter-procedure. 1043 1044 Note that {{(set! (setter PROC) ...)}} for a procedure that has no associated 1045 setter procedure yet is a very slow operation (the old procedure is replaced by 1046 a modified copy, which involves a garbage collection). 1082 1047 1083 1048 … … 1086 1051 [procedure] (getter-with-setter GETTER SETTER) 1087 1052 1088 Returns a copy of the procedure {{GETTER}} with the associated setter procedure {{SETTER}}. 1089 Contrary to the SRFI specification, the setter of the returned procedure may be changed. 1053 Returns a copy of the procedure {{GETTER}} with the associated setter procedure 1054 {{SETTER}}. Contrary to the SRFI specification, the setter of the returned 1055 procedure may be changed. 1056 1090 1057 1091 1058 1092 1059 === Reader extensions 1093 1094 1095 1060 1096 1061 ==== define-reader-ctor … … 1106 1071 [procedure] (set-read-syntax! CHAR-OR-SYMBOL PROC) 1107 1072 1108 When the reader is encountingthe non-whitespace character {{CHAR}} while reading1073 When the reader encounters the non-whitespace character {{CHAR}} while reading 1109 1074 an expression from a given port, then the procedure {{PROC}} will be called with 1110 1075 that port as its argument. The procedure should return a value that will be returned … … 1166 1131 1167 1132 1133 === Property lists 1134 1135 As in other Lisp dialects, CHICKEN supports "property lists" associated with symbols. 1136 Properties are accessible via a key that can be any kind of value but which will 1137 be compared using {{eq?}}. 1138 1139 ==== get 1140 1141 [procedure] (get SYMBOL PROPERTY [DEFAULT]) 1142 1143 Returns the value stored under the key {{PROPERTY}} in the property 1144 list of {{SYMBOL}}. If no such property is stored, returns 1145 {{DEFAULT}}. The {{DEFAULT}} is optional and defaults to {{#f}}. 1146 1147 ==== put! 1148 1149 [procedure] (put! SYMBOL PROPERTY VALUE) 1150 [setter] (set! (get SYMBOL PROPERTY) VALUE) 1151 1152 Stores {{VALUE}} under the key {{PROPERTY}} in the property list of 1153 {{SYMBOL}} replacing any previously stored value. 1154 1155 ==== remprop! 1156 1157 [procedure] (remprop! SYMBOL PROPERTY) 1158 1159 Deletes the first property matching the key {{PROPERTY}} in the property list 1160 of {{SYMBOL}}. Returns {{#t}} when a deletion performed, and {{#f}} otherwise. 1161 1162 ==== symbol-plist 1163 1164 [procedure] (symbol-plist SYMBOL) 1165 [setter] (set! (symbol-plist SYMBOL) LST) 1166 1167 Returns the property list of {{SYMBOL}} or sets it. 1168 1169 ==== get-properties 1170 1171 [procedure] (get-properties SYMBOL PROPERTIES) 1172 1173 Searches the property list of {{SYMBOL}} for the first property with a key in 1174 the list {{PROPERTIES}}. Returns 3 values: the matching property key, value, 1175 and the tail of property list after the matching property. When no match found 1176 all values are {{#f}}. 1177 1178 {{PROPERTIES}} may also be an atom, in which case it is treated as a list of 1179 one element. 1180 1168 1181 1169 1182 Previous: [[Parameters]] -
chicken/branches/release/manual/Unit posix
r5945 r7276 12 12 All errors related to failing file-operations will signal a condition 13 13 of kind {{(exn i/o file)}}. 14 15 16 === Constants 17 18 ==== File-control Commands 19 20 ===== fcntl/dupfd 21 ===== fcntl/getfd 22 ===== fcntl/setfd 23 ===== fcntl/getfl 24 ===== fcntl/setfl 25 26 ==== Standard I/O file-descriptors 27 28 ===== fileno/stdin 29 ===== fileno/stdout 30 ===== fileno/stderr 31 32 ==== Open flags 33 34 ===== open/rdonly 35 ===== open/wronly 36 ===== open/rdwr 37 ===== open/read 38 ===== open/write 39 ===== open/creat 40 ===== open/append 41 ===== open/excl 42 ===== open/noctty 43 ===== open/nonblock 44 ===== open/trunc 45 ===== open/sync 46 ===== open/fsync 47 ===== open/binary 48 ===== open/text 49 50 ==== Permission bits 51 52 ===== perm/irusr 53 ===== perm/iwusr 54 ===== perm/ixusr 55 ===== perm/irgrp 56 ===== perm/iwgrp 57 ===== perm/ixgrp 58 ===== perm/iroth 59 ===== perm/iwoth 60 ===== perm/ixoth 61 ===== perm/irwxu 62 ===== perm/irwxg 63 ===== perm/irwxo 64 ===== perm/isvtx 65 ===== perm/isuid 66 ===== perm/isgid 67 14 68 15 69 === Directories … … 141 195 142 196 <enscript highlight=scheme> 143 (with-output-to-pipe 197 (with-output-to-pipe 144 198 "gs -dNOPAUSE -sDEVICE=jpeg -dBATCH -sOutputFile=signballs.jpg -g600x600 -q -" 145 199 (lambda () … … 207 261 together). The optional {{MODE}} should be a bitmask composed of one 208 262 or more permission values like {{perm/irusr}} and is only relevant 209 when a new file is created. The default mode is 263 when a new file is created. The default mode is 210 264 {{perm/irwxu | perm/irgrp | perm/iroth}}. 211 265 … … 268 322 ==== file-control 269 323 270 [procedure] (file-control FILENO COMMAND 324 [procedure] (file-control FILENO COMMAND [ARGUMENT]) 271 325 272 326 Performs the fcntl operation {{COMMAND}} with the given 273 327 {{FILENO}} and optional {{ARGUMENT}}. The return value is 274 328 meaningful depending on the {{COMMAND}}. 275 276 ==== fcntl/dupfd277 ==== fcntl/getfd278 ==== fcntl/setfd279 ==== fcntl/getfl280 ==== fcntl/setfl281 282 These variables contain commands for {{file-control}}.283 284 ==== fileno/stdin285 ==== fileno/stdout286 ==== fileno/stderr287 288 These variables contain file-descriptors for the standard I/O files.289 290 ==== open/rdonly291 ==== open/wronly292 ==== open/rdwr293 ==== open/read294 ==== open/write295 ==== open/creat296 ==== open/append297 ==== open/excl298 ==== open/noctty299 ==== open/nonblock300 ==== open/trunc301 ==== open/sync302 ==== open/fsync303 ==== open/binary304 ==== open/text305 306 Flags for use with {{file-open}}.307 329 308 330 ==== open-input-file* … … 354 376 not {{#f}}, then the file-statistics vector will be resolved for 355 377 symbolic links (otherwise symbolic links are not resolved). 378 Note that for very large files, the {{file-size}} value may be an 379 inexact integer. 356 380 357 381 ==== file-position … … 368 392 Returns the size of the file designated by {{FILE}}. {{FILE}} 369 393 may be a filename or a file-descriptor. If the file does not exist, 370 an error is signaled. 394 an error is signaled. Note that for very large files, {{file-size}} may 395 return an inexact integer. 371 396 372 397 ==== regular-file? … … 375 400 376 401 Returns true, if {{FILENAME}} names a regular file (not a directory or symbolic link). 402 403 ==== file-owner 404 405 [procedure] (file-owner FILE) 406 407 Returns the user-id of {{FILE}}. {{FILE}} may be a filename 408 or a file-descriptor. 409 410 ==== file-permissions 411 412 [procedure] (file-permissions FILE) 413 414 Returns the permission bits for {{FILE}}. You can test this value 415 by performing bitwise operations on the result and the {{perm/...}} 416 values. {{FILE}} may be a filename or a file-descriptor. 417 418 ==== file-read-access? 419 ==== file-write-access? 420 ==== file-execute-access? 421 422 [procedure] (file-read-access? FILENAME) 423 [procedure] (file-write-access? FILENAME) 424 [procedure] (file-execute-access? FILENAME) 425 426 These procedures return {{#t}} if the current user has read, 427 write or execute permissions on the file named {{FILENAME}}. 377 428 378 429 … … 402 453 Exceptions: {{(exn bounds)}}, {{(exn i/o file)}} 403 454 455 ==== change-file-mode 456 457 [procedure] (change-file-mode FILENAME MODE) 458 459 Changes the current file mode of the file named {{FILENAME}} 460 to {{MODE}} using the {{chmod()}} system call. The 461 {{perm/...}} variables contain the various permission bits and can 462 be combinded with the {{bitwise-ior}} procedure. 463 464 ==== change-file-owner 465 466 [procedure] (change-file-owner FILENAME UID GID) 467 468 Changes the owner information of the file named {{FILENAME}} to 469 the user- and group-ids {{UID}} and {{GID}} (which should be 470 exact integers) using the {{chown()}} system call. 471 404 472 405 473 === Processes … … 416 484 417 485 Returns the process ID of the parent of the current process. 486 487 ==== process-group-id 488 489 [procedure] (process-group-id PID) 490 491 Returns the process group ID of the process specified by {{PID}}. 418 492 419 493 ==== process-execute … … 512 586 if a signal occurred. 513 587 588 ==== create-session 589 590 [procedure] (create-session) 591 592 Creates a new session if the calling process is not a process group leader and returns 593 the session ID. 594 514 595 515 596 === Hard and symbolic links … … 541 622 542 623 543 === Permissions 544 545 ==== file-owner 546 547 [procedure] (file-owner FILE) 548 549 Returns the user-id of {{FILE}}. {{FILE}} may be a filename 550 or a file-descriptor. 551 552 ==== file-permissions 553 554 [procedure] (file-permissions FILE) 555 556 Returns the permission bits for {{FILE}}. You can test this value 557 by performing bitwise operations on the result and the {{perm/...}} 558 values. {{FILE}} may be a filename or a file-descriptor. 559 560 ==== file-read-access? 561 ==== file-write-access? 562 ==== file-execute-access? 563 564 [procedure] (file-read-access? FILENAME) 565 [procedure] (file-write-access? FILENAME) 566 [procedure] (file-execute-access? FILENAME) 567 568 These procedures return {{#t}} if the current user has read, 569 write or execute permissions on the file named {{FILENAME}}. 570 571 ==== change-file-mode 572 573 [procedure] (change-file-mode FILENAME MODE) 574 575 Changes the current file mode of the file named {{FILENAME}} 576 to {{MODE}} using the {{chmod()}} system call. The 577 {{perm/...}} variables contain the various permission bits and can 578 be combinded with the {{bitwise-ior}} procedure. 579 580 ==== change-file-owner 581 582 [procedure] (change-file-owner FILENAME UID GID) 583 584 Changes the owner information of the file named {{FILENAME}} to 585 the user- and group-ids {{UID}} and {{GID}} (which should be 586 exact integers) using the {{chown()}} system call. 624 === Retrieving user & group information 587 625 588 626 ==== current-user-id 589 ==== current-group-id590 ==== current-effective-user-id591 ==== current-effective-group-id592 627 593 628 [procedure] (current-user-id) 594 629 [setter] (set! (current-user-id) UID) 630 631 Get or set the real user-id of the current process. 632 633 ==== current-effective-user-id 634 635 [procedure] (current-effective-user-id) 636 [setter] (set! (current-effective-user-id) UID) 637 638 Get or set the effective user-id of the current process. 639 640 ==== user-information 641 642 [procedure] (user-information USER [AS-VECTOR]) 643 644 If {{USER}} specifes a valid username (as a string) or user ID, then the user 645 database is consulted and a list of 7 values are returned: the user-name, the 646 encrypted password, the user ID, the group ID, a user-specific string, the home 647 directory and the default shell. When {{AS-VECTOR}} is {{#t}} a vector of 7 648 elements is returned instead of a list. If no user with this name or id then 649 {{#f}} is returned. 650 651 ==== current-group-id 652 595 653 [procedure] (current-group-id) 596 654 [setter] (set! (current-group-id) GID) 597 [procedure] (current-effective-user-id) 598 [setter] (set! (current-effective-user-id) UID) 655 656 Get or set the real group-id of the current process. 657 658 ==== current-effective-group-id 659 599 660 [procedure] (current-effective-group-id) 600 661 [setter] (set! (current-effective-group-id) GID) 601 662 602 Get or set the real/effective user- and group-ids of the current process. 603 604 ==== process-group-id 605 606 [procedure] (process-group-id PID) 607 608 Returns the process group ID of the process specified by {{PID}}. 663 Get or set the effective group-id of the current process. 664 ID can be found, then {{#f}} is returned. 609 665 610 666 ==== group-information … … 623 679 Returns a list with the supplementary group IDs of the current user. 624 680 681 682 === Changing user & group information 683 625 684 ==== set-groups! 626 685 … … 635 694 [procedure] (initialize-groups USERNAME BASEGID) 636 695 637 Sets the supplementrary group IDs of the current user to the IDs from the user with name {{USERNAME}} 696 Sets the supplementrary group IDs of the current user to the IDs from the user with name {{USERNAME}} 638 697 (a string), including {{BASEGID}}. 639 698 640 699 Only the superuser may invoke this procedure. 641 642 ==== perm/irusr643 ==== perm/iwusr644 ==== perm/ixusr645 ==== perm/irgrp646 ==== perm/iwgrp647 ==== perm/ixgrp648 ==== perm/iroth649 ==== perm/iwoth650 ==== perm/ixoth651 ==== perm/irwxu652 ==== perm/irwxg653 ==== perm/irwxo654 ==== perm/isvtx655 ==== perm/isuid656 ==== perm/isgid657 658 These variables contain permission bits as used in {{change-file-mode}}.659 700 660 701 ==== set-process-group-id! … … 664 705 665 706 Sets the process group ID of the process specifed by {{PID}} to {{PGID}}. 666 667 ==== user-information668 669 [procedure] (user-information USER)670 671 If {{USER}} specifes a valid username (as a string) or user ID, then672 the user database is consulted and a list of 7 values are returned: the user-name,673 the encrypted password, the user ID, the group ID, a user-specific string,674 the home directory and the default shell. If no user with this name or675 ID can be found, then {{#f}} is returned.676 677 ==== create-session678 679 [procedure] (create-session)680 681 Creates a new session if the calling process is not a process group leader and returns682 the session ID.683 707 684 708 … … 813 837 814 838 Returns a association list of the environment variables and their 815 current values. 839 current values. 816 840 817 841 ==== setenv … … 989 1013 Recursively traverses the contents of {{DIRECTORY}} (which should 990 1014 be a string) and invokes the procedure {{ACTION}} for all files 991 forwhich the procedure {{PREDICATE}} is true. {{PREDICATE}}1015 in which the procedure {{PREDICATE}} is true. {{PREDICATE}} 992 1016 may me a procedure of one argument or a regular-expression string. 993 1017 {{ACTION}} should be a procedure of two arguments: the currently … … 995 1019 {{ACTION}}, or, if this is the first invocation, the value 996 1020 of {{IDENTITY}}. {{ACTION}} defaults to {{cons}}, 997 {{IDENTITY}} defaults to {{()}}. {{LIMIT}} should a1021 {{IDENTITY}} defaults to {{()}}. {{LIMIT}} should be a 998 1022 procedure of one argument that is called for each nested directory 999 1023 and which should return true, if that directory is to be traversed 1000 1024 recursively. {{LIMIT}} may also be an exact integer that 1001 gives the maximum recursion depth. A depth of {{0}} means the 1002 files in the specified directory are traversed but not any nested 1003 directories. {{LIMIT}} may also be {{#f}} (the default), 1025 gives the maximum recursion depth. For example, a depth of {{0}} means that only files in the top-level, specified directory are to be traversed. In this case, all nested directories are ignored. {{LIMIT}} may also be {{#f}} (the default), 1004 1026 which is equivalent to {{(constantly #t)}}. 1005 1027 … … 1257 1279 process-group-id set-process-group-id! 1258 1280 create-symbolic-link read-symbolic-link 1259 file-truncate 1281 file-truncate 1260 1282 file-lock file-lock/blocking file-unlock file-test-lock 1261 1283 create-fifo fifo? … … 1266 1288 terminal-port? terminal-name 1267 1289 process-fork process-signal 1268 parent-process-id 1290 parent-process-id 1269 1291 set-root-directory! 1270 1292 utc-time->seconds … … 1285 1307 1286 1308 These variables contains special flags that specify the exact semantics of {{process-spawn}}: 1287 {{spawn/overlay}} replaces the current process with the new one. 1288 {{spawn/wait}} suspends execution of the current process until the spawned process returns. 1309 {{spawn/overlay}} replaces the current process with the new one. 1310 {{spawn/wait}} suspends execution of the current process until the spawned process returns. 1289 1311 {{spawn/nowait}} does the opposite ({{spawn/nowaito}} is identical, according to the Microsoft 1290 1312 documentation) and runs the process asynchronously. -
chicken/branches/release/manual/Unit regex
r5945 r7276 71 71 72 72 73 === regexp* 74 75 [procedure] (regexp* STRING [OPTIONS [TABLES]]) 76 77 Returns a precompiled regular expression object for {{string}}. The optional 78 argument {{OPTIONS}} must be a list of option symbols. The optional argument 79 {{TABLES}} must be a character definitions table (not defined here). 80 81 82 Option Symbols: 83 84 ; caseless : Character case insensitive match 85 ; multiline : Equivalent to Perl's /m option 86 ; dotall : Equivalent to Perl's /s option 87 ; extended : Ignore whitespace 88 ; anchored : Anchor pattern match 89 ; dollar-endonly : `$' metacharacter in the pattern matches only at the end of the subject string 90 ; extra : Currently of very little use 91 ; notbol : First character of the string is not the beginning of a line 92 ; noteol : End of the string is not the end of a line 93 ; ungreedy : Inverts the "greediness" of the quantifiers so that they are not greedy by default 94 ; notempty : The empty string is not considered to be a valid match 95 ; utf8 : UTF-8 encoded characters 96 ; no-auto-capture : Disables the use of numbered capturing parentheses 97 ; no-utf8-check : Skip valid UTF-8 sequence check 98 ; auto-callout : Automatically inserts callout items (not defined here) 99 ; partial : Partial match ok 100 ; firstline : An unanchored pattern is required to match before or at the first newline 101 ; dupnames : Names used to identify capturing subpatterns need not be unique 102 ; newline-cr : Newline definition is `\r' 103 ; newline-lf : Newline definition is `\n' 104 ; newline-crlf : Newline definition is `\r\n' 105 ; newline-anycrlf : Newline definition is any of `\r', `\n', or `\r\n' 106 ; newline-any : ewline definition is any Unicode newline sequence 107 ; bsr-anycrlf : `\R' escape sequence matches only CR, LF, or CRLF 108 ; bsr-unicode : `\R' escape sequence matches only Unicode newline sequence 109 110 ; dfa-shortest : Currently unused 111 ; dfa-restart : Currently unused 112 113 73 114 === regexp? 74 115 … … 77 118 Returns {{#t}} if {{X}} is a precompiled regular expression, 78 119 or {{#f}} otherwise. 120 121 122 === regexp-optimize 123 124 [procedure] (regexp-optimize RX) 125 126 Perform available optimizations for the precompiled regular expression {{RX}}. 127 Returns {{#t}} when optimization performed, and {{#f}} otherwise. 79 128 80 129 … … 134 183 => ("this" "is" "a" "string" "1," "2," "3,") 135 184 136 (string-split-fields "," s #:suffix) )185 (string-split-fields "," s #:suffix) 137 186 138 187 => ("this is a string 1" " 2" " 3") … … 175 224 <enscript highlight=scheme> 176 225 (string-substitute* "<h1>Hello, world!</h1>" 177 '(("<[/A-Za-z0-9]+>" . ""))) )226 '(("<[/A-Za-z0-9]+>" . ""))) 178 227 179 228 => "Hello, world!" … … 194 243 195 244 245 === make-anchored-pattern 246 247 [procedure] (make-anchored-pattern REGEXP [WITHOUT-BOL [WITHOUT-EOL]]) 248 249 Makes an anchored pattern from {{REGEXP}} (a string or a precompiled regular 250 expression) and returns the updated pattern. When {{WITHOUT-BOL}} is {{#t}} the 251 beginning-of-line anchor is not added. When {{WITHOUT-EOL}} is {{#t}} the 252 end-of-line anchor is not added. 253 254 The {{WITHOUT-BOL}} and {WITHOUT-EOL}} arguments are ignored for a precompiled regular 255 expression. 256 257 196 258 Previous: [[Unit match]] 197 259 -
chicken/branches/release/manual/Unit srfi-18
r5945 r7276 70 70 Readies the suspended thread {{THREAD}}. 71 71 72 === thread-wait-for-i/o! 73 74 [procedure] (thread-wait-for-i/o! FD [MODE]) 75 76 Suspends the current thread until input ({{MODE}} is {{#:input}}), output ({{MODE}} is {{#:output}}) 77 or both ({{MODE}} is {{#:all}}) is available. {{FD}} should be a file-descriptor (not a port!) open 78 for input or output, respectively. 79 72 80 === time->milliseconds 73 81 -
chicken/branches/release/manual/Unit utils
r5945 r7276 143 143 144 144 Calls {{PROCEDURE}} for each line read from {{PORT}} (which defaults to the 145 value of {{(current-input-port)}}. The argument passed to {{P ORCEDURE}}145 value of {{(current-input-port)}}. The argument passed to {{PROCEDURE}} 146 146 is a string with the contents of the line, excluding any line-terminators. 147 147 When all input has been read from the port, {{for-each-line}} returns some unspecified value. … … 230 230 === Miscellaneous handy things 231 231 232 ==== shift! 232 ==== shift! DEPRECATED 233 233 234 234 [procedure] (shift! LIST [DEFAULT]) … … 245 245 The list must contain at least 2 elements. 246 246 247 ==== unshift! 247 ==== unshift! DEPRECATED 248 248 249 249 [procedure] (unshift! X PAIR) -
chicken/branches/release/manual/Using the compiler
r5945 r7276 36 36 37 37 ; -check-syntax : Aborts compilation process after macro-expansion and syntax checks. 38 39 ; -compress-literals THRESHOLD : Compiles quoted literals that exceed the size {{THRESHOLD}} as strings and parse the strings at run-time. This reduces the size of the code and speeds up compile-times of the host C compiler, but has a small run-time performance penalty. The size of a literal is computed by counting recursively the objects in the literal, so a vector counts as 1 plus the count of the elements, a pair counts as the counts of the car and the cdr, respectively. All other objects count 1.40 38 41 39 ; -debug MODES : Enables one or more compiler debugging modes. {{MODES}} is a string of characters that select debugging information about the compiler that will be printed to standard output. … … 124 122 ; -import FILENAME : Read exports from linked or loaded libraries from given file. See also {{-check-imports}}. This is equivalent to declaring {{(declare (import FILENAME))}}. Implies {{-check-imports}}. 125 123 126 ; -include-path PATHNAME : Specifies an additional search path for files included via the {{include}} special form. This option may be given multiple times. If the environment variable {{CHICKEN_INCLUDE_PATH}} is set, it should contain a list of alternative include pathnames separated by {{;}}. The environment variable {{CHICKEN_HOME}} is also considered as a search path.124 ; -include-path PATHNAME : Specifies an additional search path for files included via the {{include}} special form. This option may be given multiple times. If the environment variable {{CHICKEN_INCLUDE_PATH}} is set, it should contain a list of alternative include pathnames separated by {{;}}. 127 125 128 126 ; -inline : Enable procedure inlining for known procedures of a size below the threshold (which can be set through the {{-inline-limit}} option). 129 127 130 ; -inline-limit THRESHOLD : Sets the maximum size of a potentially inlinable procedure. Th is option is only effective when inlining has been enabled with the {{-inline}} option. The default threshold is {{10}}.128 ; -inline-limit THRESHOLD : Sets the maximum size of a potentially inlinable procedure. The default threshold is {{10}}. 131 129 132 130 ; -keyword-style STYLE : Enables alternative keyword syntax, where {{STYLE}} may be either {{prefix}} (as in Common Lisp), {{suffix}} (as in DSSSL) or {{none}}. Any other value is ignored. The default is {{suffix}}. … … 397 395 Linux or FreeBSD: 398 396 399 Let's take a simple "Hello, world!":397 Let's take a simple example. 400 398 401 399 <enscript highlight=scheme> … … 405 403 </enscript> 406 404 405 % chicken hello.scm -optimize-level 3 -output-file hello.c 406 407 407 Compiled to C, we get {{hello.c}}. We need the files {{chicken.h}} and 408 {{runtime.c}}, which contain the basic runtime system, plus the three basic library 409 files {{library.c}}, {{eval.c}} and {{extras.c}} which contain the same functionality as the 410 library linked into a plain CHICKEN-compiled application, or which is available by default in the 408 {{runtime.c}}, which contain the basic runtime system, plus the three 409 basic library files {{library.c}}, {{eval.c}} and {{extras.c}} which 410 contain the same functionality as the library linked into a plain 411 CHICKEN-compiled application, or which is available by default in the 411 412 interpreter, {{csi}}: 412 413 413 % csc hello.scm -O2 -d1 414 415 A simple makefile is needed as well: 416 417 <enscript highlight=makefile> 418 # Makefile for UNIX systems 419 420 hello: hello.o runtime.o library.o eval.o extras.o 421 $(CC) -o hello hello.o runtime.o library.o eval.o extras.o -lm 422 423 hello.o: chicken.h 424 runtime.o: chicken.h 425 library.o: chicken.h 426 eval.o: chicken.h 427 extras.o: chicken.h 428 </enscript> 414 % cd /tmp 415 %echo '(print "Hello World.")' > hello.scm 416 % cp $CHICKEN_BUILD/runtime.c . 417 % cp $CHICKEN_BUILD/library.c . 418 % cp $CHICKEN_BUILD/eval.c . 419 % cp $CHICKEN_BUILD/extras.c . 420 % gcc -static -Os -fomit-frame-pointer runtime.c library.c eval.c \ 421 extras.c hello.c -o hello -lm 429 422 430 423 Now we have all files together, and can create an tarball containing all the files: … … 433 426 % gzip hello.tar 434 427 435 This is ofnaturally rather simplistic. Things like enabling dynamic loading, estimating428 This is naturally rather simplistic. Things like enabling dynamic loading, estimating 436 429 the optimal stack-size and selecting supported features of the host system would need 437 430 more configuration- and build-time support. All this can be addressed using more -
chicken/branches/release/manual/Using the interpreter
r5945 r7276 32 32 ; -h -help : Write a summary of the available command line options to standard output and exit. 33 33 34 ; -I -include-path PATHNAME : Specifies an alternative search-path for files included via the {{include}} special form. This option may be given multiple times. If the environment variable {{CHICKEN_INCLUDE_PATH}} is set, it should contain a list of alternative include pathnames separated by {{;}}. The environment variable {{CHICKEN_HOME}} is also considered as a search path.34 ; -I -include-path PATHNAME : Specifies an alternative search-path for files included via the {{include}} special form. This option may be given multiple times. If the environment variable {{CHICKEN_INCLUDE_PATH}} is set, it should contain a list of alternative include pathnames separated by {{;}}. 35 35 36 36 ; -k -keyword-style STYLE : Enables alternative keyword syntax, where {{STYLE}} may be either {{prefix}} (as in Common Lisp) or {{suffix}} (as in DSSSL). Any other value is ignored. … … 40 40 ; -w -no-warnings : Disables any warnings that might be issued by the reader or evaluated code. 41 41 42 ; -q -quiet : Do not print a startup message. 42 ; -q -quiet : Do not print a startup message. Also disables generation of call-trace information for interpreted code. 43 43 44 44 ; -s -script PATHNAME : This is equivalent to {{-batch -quiet -no-init PATHNAME}}. Arguments following {{PATHNAME}} are available by using {{command-line-arguments}} and are not processed as interpreter options. Extra options in the environment variable {{CSI_OPTIONS}} are ignored. … … 155 155 #;5> (fac 3) ==> 6 156 156 </enscript> 157 k 157 158 158 159 ; ,utr SYMBOL ... : Disables tracing of the given toplevel procedures. … … 203 204 204 205 #;1> (define-record point x y) 205 #;2> (set-describer! 'point (lambda (pt o) (print "a point with x=" (point-x pt) " and y=" (point-y pt)))) 206 #;2> (set-describer! 'point 207 (lambda (pt o) 208 (print "a point with x=" (point-x pt) " and y=" (point-y pt)))) 206 209 #;3> ,d (make-point 1 2) 207 210 a point with x=1 and y=2 … … 220 223 (use readline regex) 221 224 (current-input-port (make-gnu-readline-port)) 222 (gnu-history-install-file-manager (string-append (or (getenv "HOME") ".") "/.csi.history")) 225 (gnu-history-install-file-manager 226 (string-append (or (getenv "HOME") ".") "/.csi.history")) 223 227 224 228 More details are available in [[http://www.call-with-current-continuation.org/eggs/readline.html|the egg's documentation]]. -
chicken/branches/release/manual/chicken-setup
r5945 r7276 81 81 82 82 The optional argument {{INFOLIST}} should be an association list that 83 maps symbols to values, this list will be stored as {{ID.setup }} at the same83 maps symbols to values, this list will be stored as {{ID.setup-info}} at the same 84 84 location as the extension code. Currently the following properties are used: 85 85 … … 118 118 119 119 Copies the given files into the examples directory, which is usually 120 {{$prefix/share/chicken/examples}} (equivalent to {{$CHICKEN_HOME/examples}}120 {{$prefix/share/chicken/examples}} 121 121 or {{(make-pathname (chicken-home) "examples")}}). 122 122 … … 270 270 271 271 Holds the path where executables are installed and defaults to either {{$CHICKEN_PREFIX/bin}}, 272 if the environment variable {{CHICKEN_PREFIX}} is set , {{$CHICKEN_HOME}}or the272 if the environment variable {{CHICKEN_PREFIX}} is set or the 273 273 path where the CHICKEN binaries ({{chicken}}, {{csi}}, etc.) are installed. 274 274 … … 325 325 [procedure] (cross-chicken) 326 326 327 Ret rusn{{#t}} if this system is configured for cross-compilation or {{#f}}327 Returns {{#t}} if this system is configured for cross-compilation or {{#f}} 328 328 otherwise. 329 330 331 ==== host-extension 332 333 [parameter] host-extension 334 335 For a cross-compiling CHICKEN, when compiling an extension, then it 336 should be built for the host environment (as opposed to the target 337 environment). This parameter is controlled by the {{-host-extension}} command-line 338 option. A setup script should perform the proper steps of compiling any 339 code by passing {{-host}} when invoking {{csc}} or using the {{compile}} 340 macro. 329 341 330 342 … … 515 527 ; {{-r -run FILENAME}} : Load and execute given file. 516 528 ; {{-s -script FILENAME}} :Executes the given Scheme source file with all remaining arguments and exit. The ''she-bang'' shell script header is recognized, so you can write Scheme scripts that use {{chicken-setup}} just as with {{csi}}. 517 ; {{-e -eval EXPRESSION}} : Evaluates the given expression(s) .518 ; {{-v -verbose}} : Display additional debug information .519 ; {{-k -keep}} : Keep temporary files and directories .520 ; {{-c -csc-option OPTION}} : Passes {{OPTION}} as an extra argument to invocations of the compiler-driver ({{csc}}) . This works only if {{csc}} is invoked as {{(run (csc ...))}}.521 ; {{-d -dont-ask}} : Do not ask the user before trying to download required extensions .522 ; {{-n -no-install}} : Do not install generated binaries and/or support files . Any invocations of {{install-program}}, {{install-extension}} or {{install-script}} will be be no-ops.523 ; {{-i -docindex}} : Displays the path to the index-page of any installed extension-documentation . If the index page does not exist, it is created.529 ; {{-e -eval EXPRESSION}} : Evaluates the given expression(s) 530 ; {{-v -verbose}} : Display additional debug information 531 ; {{-k -keep}} : Keep temporary files and directories 532 ; {{-c -csc-option OPTION}} : Passes {{OPTION}} as an extra argument to invocations of the compiler-driver ({{csc}}); this works only if {{csc}} is invoked as {{(run (csc ...))}} 533 ; {{-d -dont-ask}} : Do not ask the user before trying to download required extensions 534 ; {{-n -no-install}} : Do not install generated binaries and/or support files; any invocations of {{install-program}}, {{install-extension}} or {{install-script}} will be be no-ops 535 ; {{-i -docindex}} : Displays the path to the index-page of any installed extension-documentation; if the index page does not exist, it is created 524 536 ; {{-t -test EXTENSION ...}} : return success if all given extensions are installed 525 537 ; {{-ls EXTENSION}} : List installed files for extension 526 538 ; {{-fetch-tree}} : Download and print the repository catalog 527 ; {{-t -test}} : If the extension sources contain a directory named {{tests}} and this directory includes a file named {{run.scm}} then this file is executed (with {{tests}} being the current working directory). 539 ; {{-create-tree DIRECTORY}} : Create a fresh, minimal repository catalog and writes it to stdout 540 ; {{-t -test}} : If the extension sources contain a directory named {{tests}} and this directory includes a file named {{run.scm}} then this file is executed (with {{tests}} being the current working directory) 528 541 ; {{-tree FILENAME}} : Download and show the repository catalog 529 542 ; {{-svn URL}} : Fetch extension from [[http://subversion.tigris.org|Subversion]] repository … … 531 544 ; {{-local PATHNAME}} : Fetch extension from local file 532 545 ; {{-destdir PATHNAME}} : Specify alternative installation prefix (for packaging) 533 ; {{--}} : Ignore all following arguments. 546 ; {{-host-extension}} : Compile extension in "host" mode (sets the parameter {{host-extension}} to {{#f}}) 547 ; {{--}} : Ignore all following arguments 534 548 535 549 Note that the options are processed exactly in the order in which they appear in the command-line. … … 543 557 {{chicken-setup -fetch}}) and extract its contents with a separate 544 558 program (like {{winzip}}). the {{CHICKEN_REPOSITORY}} environment 545 variable has to be set (in addition to {{CHICKEN_HOME}})to a559 variable has to be set to a 546 560 directory where your compiled extensions should be located. 547 561 -
chicken/branches/release/manual/faq
r5945 r7276 95 95 96 96 There is an extension based on the GNU Multiprecision Package that implements most of the full 97 numeric tower, see http://www.call-with-current-continuation.org/eggs/numbers.html.97 numeric tower, see [[numbers]]. 98 98 99 99 … … 488 488 489 489 Under CHICKENs implementation policy, tail recursion is achieved simply by avoiding 490 to return from a function call. Since the programs isCPS converted, a continuous490 to return from a function call. Since the programs are CPS converted, a continuous 491 491 sequence of nested procedure calls is performed. At some stage the stack-space has 492 492 to run out and the current procedure and its parameters (including the current … … 535 535 536 536 <enscript highlight=scheme> 537 ; The regex egg is required for ##csi#name-of-symbols-starting-with 538 (require 'readline) 537 (require-extension readline) 539 538 (current-input-port (make-gnu-readline-port)) 540 539 (gnu-history-install-file-manager (string-append (or (getenv "HOME") ".") "/.csi.history")) -
chicken/branches/release/match.scm
r1213 r7276 123 123 (run-time-macros) 124 124 (disable-interrupts) 125 (usual-integrations) ) 125 (usual-integrations) 126 (hide every)) 126 127 127 128 (cond-expand … … 133 134 134 135 136 (define (every fn lst) 137 (or (null? lst) 138 (and (fn (car lst)) (every fn (cdr lst))))) 139 140 135 141 ;;; Macros 136 142