Changeset 7273 in project
- Timestamp:
- 01/05/08 19:43:49 (13 years ago)
- Files:
-
- 1 added
- 1 deleted
- 17 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
modules/tags/0.8/modules-base.scm
r7272 r7273 136 136 (file-exists? (##sys#resolve-include-filename (string-append file ".scm") #t #f)) ) ) ) 137 137 (let ((forms (read-file f))) 138 `( map expand forms) ) ) )138 `(begin ,@(map expand forms) ) ) ) ) 139 139 (x x) ) ) 140 140 (map expand body) ) ) -
modules/tags/0.8/modules.setup
r7272 r7273 4 4 'modules 5 5 '("modules.scm" "modules-base.so") 6 '((version 0. 6)6 '((version 0.8) 7 7 (syntax) 8 8 (documentation "modules.html"))) -
modules/trunk/modules-base.scm
r7232 r7273 136 136 (file-exists? (##sys#resolve-include-filename (string-append file ".scm") #t #f)) ) ) ) 137 137 (let ((forms (read-file f))) 138 `( map expand forms) ) ) )138 `(begin ,@(map expand forms) ) ) ) ) 139 139 (x x) ) ) 140 140 (map expand body) ) ) -
modules/trunk/modules.setup
r7125 r7273 4 4 'modules 5 5 '("modules.scm" "modules-base.so") 6 '((version 0. 6)6 '((version 0.8) 7 7 (syntax) 8 8 (documentation "modules.html"))) -
sbky/bky.scm
r7185 r7273 35 35 (define (read1 f) 36 36 (with-input-from-file f read) ) 37 38 (define (read-reponame f) 39 (and (file-exists? f) 40 (with-input-from-file f read-line) ) ) 37 41 38 42 (define (write-to f str) … … 135 139 136 140 (set! bky-diff 137 (lambda (id1 id2 style); pass #f for id1 to diff HEAD141 (lambda (id1 id2) ; pass #f for id1 to diff HEAD 138 142 (let ((difforg ".") ; pass #t for id2 for parent 139 143 (diffdest (conc *repo* "/" (commit))) ) … … 150 154 (else 151 155 (set! difforg (conc *repo* "/" id2 "/")) ) ) ) ) 152 (let ((tmpfile (and style (run < (mktemp /tmp/bkydiff.XXXXXX))))) 153 (for-each 154 (lambda (f) 155 (let ((ddest (conc diffdest "/" f)) 156 (dorg (conc difforg "/" f)) ) 157 (when (and (not (directory? ddest)) (not (directory? dorg))) 158 (run (diff -uN ',ddest ',dorg 2>/dev/null "|" 159 sed -e "\"s|^--- .bky/[^/]*/*|--- ./| ; s|^+++ .bky/[^/]*/*|+++ ./|\"" 160 ,(if style (conc ">>" tmpfile) "") ) ) ) ) ) 161 (do-list-changes difforg diffdest)) 162 (when style 163 (case style 164 ((list) (run (diffstat -l ,tmpfile))) 165 ((histo) (run (diffstat ,tmpfile))) 166 (else (error 'bky-diff "invalid diff style" style))) 167 (run (rm -f ,tmpfile)))))) ) 156 (for-each 157 (lambda (f) 158 (let ((ddest (conc diffdest "/" f)) 159 (dorg (conc difforg "/" f)) ) 160 (when (and (not (directory? ddest)) (not (directory? dorg))) 161 (run (diff -uN ',ddest ',dorg 2>/dev/null "|" 162 sed -e "\"s|^--- .bky/[^/]*/*|--- ./| ; s|^+++ .bky/[^/]*/*|+++ ./|\""))))) 163 (do-list-changes difforg diffdest)) ) ) ) 168 164 169 165 (set! bky-commit … … 254 250 (set! bky-push 255 251 (lambda (remote . dry) ; pass #f to use .bkyremote 256 (print "pushing to " remote " ...") 257 (let ((dry (optional dry (dry-run)))) 258 (wet 259 (lambda () 260 (run (rsync -azHC 261 ,(cond (dry "-vn") 262 ((run-verbose) "-v") 263 (else "")) 264 --exclude=.bkyremote --delete "." ,remote)) ) ) ) ) ) 252 (let ((remote (or remote (read-reponame ".bkyremote")))) 253 (cond (remote 254 (print "pushing to " remote " ...") 255 (with-output-to-file ".bkyremote" (cut print remote)) 256 (let ((dry (optional dry (dry-run)))) 257 (wet 258 (lambda () 259 (run (rsync -azHC 260 ,(cond (dry "-vn") 261 ((run-verbose) "-v") 262 (else "")) 263 --exclude=.bkyremote --delete "." ,remote)) ) ) ) ) 264 (else 265 (print "no remote repository given and no previous remote destination available") ) ) ) ) ) 265 266 266 267 (set! bky-pull 267 268 (lambda (remote . dry) ; pass #f to use .bkyremote 268 (print "pulling from " remote " ...") 269 (let ((dry (optional dry (dry-run)))) 270 (wet 271 (lambda () 272 (run (rsync -azHC 273 ,(cond (dry "-vn") 274 ((run-verbose) "-v") 275 (else "")) 276 --exclude=.bkyremote --delete ,(conc remote "/") ".")))) ) ) ) 269 (let ((remote (or remote (read-reponame ".bkyremote")))) 270 (cond (remote 271 (print "pulling from " remote " ...") 272 (with-output-to-file ".bkyremote" (cut print remote)) 273 (let ((dry (optional dry (dry-run)))) 274 (wet 275 (lambda () 276 (run (rsync -azHC 277 ,(cond (dry "-vn") 278 ((run-verbose) "-v") 279 (else "")) 280 --exclude=.bkyremote --delete ,(conc remote "/") ".")))) ) ) 281 (else 282 (print "no remote repository given and no previous remote destination available") ) ) ) ) ) 277 283 278 284 (set! bky-export -
sbky/sbky.scm
r7185 r7273 32 32 sbky init [ -b NAME | -m MSG ] ... 33 33 sbky commit [ -b NAME | -m MSG | -n | FILE1 ... ] 34 sbky revert -A | ID35 sbky diff [ -l | -s ] [ID | -p ID | ID ID ]34 sbky checkout -A | ID 35 sbky diff [ ID | -p ID | ID ID ] 36 36 sbky status 37 37 sbky log [ -l NUM | ID ] … … 72 72 (help) ) 73 73 74 (defcmd revert75 (match-lambda* 76 (("-A") (bky- revert #f))77 ((id) (bky- revert id))78 (_ (usage " revert -A | ID")) ) )74 (defcmd checkout 75 (match-lambda* 76 (("-A") (bky-checkout #f)) 77 ((id) (bky-checkout id)) 78 (_ (usage "checkout -A | ID")) ) ) 79 79 80 80 (defcmd (diff . args) 81 (let ((style #f)) 82 (let loop ((args args)) 83 (match args 84 (() (bky-diff #f #f style)) 85 (("-l" . more) 86 (set! style 'list) 87 (loop more) ) 88 (("-s" . more) 89 (set! style 'histo) 90 (loop more) ) 91 (("-p" id) (bky-diff id #t style)) 92 ((id1 id2) (bky-diff id1 id2 style)) 93 ((id) (bky-diff id #f style)) 94 (_ (usage "diff [ -l | -s ] [ ID | -p ID | ID ID ]")) ) ) ) ) 81 (match args 82 (() (bky-diff #f #f)) 83 (("-p" id) (bky-diff id #t)) 84 ((id1 id2) (bky-diff id1 id2)) 85 ((id) (bky-diff id #f)) 86 (_ (usage "diff [ ID | -p ID | ID ID ]")) ) ) 95 87 96 88 (defcmd status … … 137 129 138 130 (defalias ci commit) 139 (defalias checkout update)140 131 141 132 (defcmd tag -
sbky/sbky.setup
r7127 r7273 1 (make (("all" ( "bky.so" "bky-static.o" "sbky"))1 (make (("all" (#;"bky.so" "bky-static.o" "sbky")) 2 2 ("bky.so" ("bky.scm") 3 (compile -s bky.scm -O2 -d1 -R alexpander -R runcmd ))3 (compile -s bky.scm -O2 -d1 -R alexpander -R runcmd -emit-exports bky.exports)) 4 4 ("bky-static.o" ("bky.scm") 5 5 (compile -c bky.scm -o bky-static.o -O2 -d0 -unit bky -X runcmd) ) … … 9 9 "all") 10 10 11 (install-program 11 #;(install-extension 12 'bky 13 '("bky.so") 14 '((version 0.1.2) 15 (documentation "bky.html") 16 (exports "bky.exports"))) 17 18 (install-program 12 19 'sbky 13 20 "sbky" 14 '((version 0.1. 1)))21 '((version 0.1.2))) -
srfi-89/srfi-89.setup
r7231 r7273 1 1 ;;;; srfi-89.setup -*- Scheme -*- 2 2 3 (compile -s -O2 -d0 srfi-89-support.scm )4 (compile -c -O2 -d0 srfi-89-support.scm -o srfi-89.o )3 (compile -s -O2 -d0 srfi-89-support.scm -emit-exports srfi-89.exports) 4 (compile -c -O2 -d0 srfi-89-support.scm -o srfi-89.o -unit srfi-89) 5 5 6 6 (install-extension 7 7 'srfi-89 8 '("srfi-89.scm" "srfi-89-support.so" )8 '("srfi-89.scm" "srfi-89-support.so" "srfi-89.o") 9 9 '((documentation "srfi-89.html") 10 (version 1.0) 11 (static srfi-89.o) 10 (version 1.1) 11 (exports "srfi-89.exports") 12 (static "srfi-89.o") 12 13 (syntax) 13 14 (require-at-runtime srfi-89-support) ) ) -
wiki/C interface
r5243 r7273 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 -
wiki/Callbacks
r1582 r7273 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]] -
wiki/Declarations
r4006 r7273 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 -
wiki/The User's Manual
r6669 r7273 3 3 == The User's Manual 4 4 5 ''(This document describes version 2.73 3)''5 ''(This document describes version 2.739)'' 6 6 7 7 '''CHICKEN is a compiler that translates Scheme source files into C''', which in -
wiki/Unit eval
r4060 r7273 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}}. -
wiki/Unit srfi-18
r3671 r7273 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 -
wiki/Using the compiler
r6671 r7273 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). … … 420 418 % cp $CHICKEN_BUILD/eval.c . 421 419 % cp $CHICKEN_BUILD/extras.c . 422 % gcc -static -O 3-fomit-frame-pointer runtime.c library.c eval.c \420 % gcc -static -Os -fomit-frame-pointer runtime.c library.c eval.c \ 423 421 extras.c hello.c -o hello -lm 424 422 -
wiki/Using the interpreter
r6671 r7273 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. -
wiki/chicken-setup
r6669 r7273 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 … … 557 557 {{chicken-setup -fetch}}) and extract its contents with a separate 558 558 program (like {{winzip}}). the {{CHICKEN_REPOSITORY}} environment 559 variable has to be set (in addition to {{CHICKEN_HOME}})to a559 variable has to be set to a 560 560 directory where your compiled extensions should be located. 561 561 -
wiki/modules
r7232 r7273 118 118 == Version History 119 119 120 ; 0.8 : fixed buggy handling of {{include}} 120 121 ; 0.7 : added srfi-89 support 121 122 ; 0.6 : supports curried {{define}} syntax -
wiki/srfi-89
r7231 r7273 20 20 == Version 21 21 22 ; 1.1 : .exports file was missing, static lib was not installed 22 23 ; 1.0 : Initial version 23 24
Note: See TracChangeset
for help on using the changeset viewer.