Changeset 7273 in project


Ignore:
Timestamp:
01/05/08 19:43:49 (12 years ago)
Author:
felix winkelmann
Message:

updates

Files:
1 added
1 deleted
17 edited
6 copied

Legend:

Unmodified
Added
Removed
  • modules/tags/0.8/modules-base.scm

    r7272 r7273  
    136136                      (file-exists? (##sys#resolve-include-filename (string-append file ".scm") #t #f)) ) ) )
    137137           (let ((forms (read-file f)))
    138              `(map expand forms) ) ) )
     138             `(begin ,@(map expand forms) ) ) ) )
    139139        (x x) ) )
    140140    (map expand body) ) )
  • modules/tags/0.8/modules.setup

    r7272 r7273  
    44 'modules
    55 '("modules.scm" "modules-base.so")
    6  '((version 0.6)
     6 '((version 0.8)
    77   (syntax)
    88   (documentation "modules.html")))
  • modules/trunk/modules-base.scm

    r7232 r7273  
    136136                      (file-exists? (##sys#resolve-include-filename (string-append file ".scm") #t #f)) ) ) )
    137137           (let ((forms (read-file f)))
    138              `(map expand forms) ) ) )
     138             `(begin ,@(map expand forms) ) ) ) )
    139139        (x x) ) )
    140140    (map expand body) ) )
  • modules/trunk/modules.setup

    r7125 r7273  
    44 'modules
    55 '("modules.scm" "modules-base.so")
    6  '((version 0.6)
     6 '((version 0.8)
    77   (syntax)
    88   (documentation "modules.html")))
  • sbky/bky.scm

    r7185 r7273  
    3535(define (read1 f)
    3636  (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) ) )
    3741
    3842(define (write-to f str)
     
    135139
    136140(set! bky-diff
    137   (lambda (id1 id2 style)               ; pass #f for id1 to diff HEAD
     141  (lambda (id1 id2)                     ; pass #f for id1 to diff HEAD
    138142    (let ((difforg ".")                 ; pass #t for id2 for parent
    139143          (diffdest (conc *repo* "/" (commit))) )
     
    150154                (else
    151155                 (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)) ) ) )
    168164
    169165(set! bky-commit
     
    254250(set! bky-push
    255251  (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") ) ) ) ) )
    265266
    266267(set! bky-pull
    267268  (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") ) ) ) ) )
    277283
    278284(set! bky-export
  • sbky/sbky.scm

    r7185 r7273  
    3232  sbky init [ -b NAME | -m MSG ] ...
    3333  sbky commit [ -b NAME | -m MSG | -n | FILE1 ... ]
    34   sbky revert -A | ID
    35   sbky diff [ -l | -s ] [ ID | -p ID | ID ID ]
     34  sbky checkout -A | ID
     35  sbky diff [ ID | -p ID | ID ID ]
    3636  sbky status
    3737  sbky log [ -l NUM | ID ]
     
    7272      (help) )
    7373
    74     (defcmd revert
    75       (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")) ) )
    7979
    8080    (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 ]")) ) )
    9587
    9688    (defcmd status
     
    137129
    138130    (defalias ci commit)
    139     (defalias checkout update)
    140131
    141132    (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"))
    22       ("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))
    44       ("bky-static.o" ("bky.scm")
    55        (compile -c bky.scm -o bky-static.o -O2 -d0 -unit bky -X runcmd) )
     
    99  "all")
    1010
    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
    1219 'sbky
    1320 "sbky"
    14  '((version 0.1.1)))
     21 '((version 0.1.2)))
  • srfi-89/srfi-89.setup

    r7231 r7273  
    11;;;; srfi-89.setup -*- Scheme -*-
    22
    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)
    55
    66(install-extension
    77 'srfi-89
    8  '("srfi-89.scm" "srfi-89-support.so")
     8 '("srfi-89.scm" "srfi-89-support.so" "srfi-89.o")
    99 '((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")
    1213   (syntax)
    1314   (require-at-runtime srfi-89-support) ) )
  • wiki/C interface

    r5243 r7273  
    283283
    284284
     285=== C_pre_gc_hook
     286
     287 [C Variable] void (*C_pre_gc_hook)(int mode)
     288
     289If not {{NULL}}, the function pointed to by this variable will be
     290called before each garbage collection with a flag indicating what kind
     291of collection was performed (either {{0}} for a minor collection or
     292{{2}} for a resizing collection). A "resizing" collection means a
     293secondary collection that moves all live data into a enlarged (or
     294shrinked) heap-space. Minor collections happen very frequently, so the
     295hook function should not consume too much time. The hook function may
     296not invoke Scheme callbacks.
     297
     298Note that resizing collections may be nested in normal major collections.
     299
    285300=== C_post_gc_hook
    286301
    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
     304If not {{NULL}}, the function pointed to by this variable will be
     305called after each garbage collection with a flag indicating what kind
     306of collection was performed (either {{0}} for a minor collection,
     307{{1}} for a major collection or {{2}} for a resizing
     308collection). Minor collections happen very frequently, so the hook
     309function should not consume too much time. The hook function may not
     310invoke Scheme callbacks. The {{ms}} argument records the number of
     311milliseconds required for the garbage collection, if the collection
     312was a major one. For minor collections the value of the {{ms}} argument
     313is undefined.
     314
     315
     316
     317=== An example for simple calls to foreign code involving callbacks
    299318
    300319 % cat foo.scm
     
    335354
    336355
    337 '''Notes:'''
     356=== Notes:
    338357
    339358Scheme procedures can call C functions, and C functions can call
  • wiki/Callbacks

    r1582 r7273  
    7575stack with the {{C_save}} macro.
    7676
    77 === C_callback_adjust_stack_limits
     77=== C_callback_adjust_stack
    7878
    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)
    8080
    8181The 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.
     82internally holds pointers to estimated limits to distinguish between
     83Scheme data objects inside the stack from objects outside of it.  If
     84you invoke callbacks at wildly differing stack-levels, these limits
     85may shift from invocation to invocation. Callbacks defined with
     86{{define-external}} will perform appropriate adjustments
     87automatically, but if you invoke {{C_callback}} manually, you should
     88perform a {{C_callback_adjust_stack}} to make sure the internal limits
     89are set properly. {{ptr}} should point to some data object on the
     90stack 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
     92that the value pointed to by {{ptr}} is located in the stack.
    9293
    9394Previous: [[Embedding]]
  • wiki/Declarations

    r4006 r7273  
    7171
    7272
    73 === compress-literals
    74 
    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 
    8273=== constant
    8374
  • wiki/The User's Manual

    r6669 r7273  
    33== The User's Manual
    44
    5 ''(This document describes version 2.733)''
     5''(This document describes version 2.739)''
    66
    77'''CHICKEN is a compiler that translates Scheme source files into C''', which in
  • wiki/Unit eval

    r4060 r7273  
    166166; [parameter] repository-path :
    167167Contains a string naming the path to the extension repository, which defaults to
    168 either the value of the environment variable {{CHICKEN_REPOSITORY}}, the value
    169 of the environment variable {{CHICKEN_HOME}} or the default library path
     168either the value of the environment variable {{CHICKEN_REPOSITORY}}
     169or the default library path
    170170(usually {{/usr/local/lib/chicken}} on UNIX systems).
    171171
     
    205205from one of the following locations:
    206206
    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}}.
    208208* the current directory
    209209
     
    249249
    250250Returns 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,
     251As a last option,
    252252if the environment variable {{CHICKEN_PREFIX}} is set, then {{chicken-home}} will return
    253253{{$CHICKEN_PREFIX/share}}.
  • wiki/Unit srfi-18

    r3671 r7273  
    7070Readies the suspended thread {{THREAD}}.
    7171
     72=== thread-wait-for-i/o!
     73
     74 [procedure] (thread-wait-for-i/o! FD [MODE])
     75
     76Suspends the current thread until input ({{MODE}} is {{#:input}}), output ({{MODE}} is {{#:output}})
     77or both ({{MODE}} is {{#:all}}) is available. {{FD}} should be a file-descriptor (not a port!) open
     78for input or output, respectively.
     79
    7280=== time->milliseconds
    7381
  • wiki/Using the compiler

    r6671 r7273  
    3636
    3737; -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.
    4038
    4139; -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.
     
    124122; -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}}.
    125123
    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 {{;}}.
    127125
    128126; -inline : Enable procedure inlining for known procedures of a size below the threshold (which can be set through the {{-inline-limit}} option).
     
    420418  % cp $CHICKEN_BUILD/eval.c    .
    421419  % cp $CHICKEN_BUILD/extras.c  .
    422   % gcc -static -O3 -fomit-frame-pointer runtime.c library.c eval.c \
     420  % gcc -static -Os -fomit-frame-pointer runtime.c library.c eval.c \
    423421    extras.c hello.c -o hello -lm
    424422
  • wiki/Using the interpreter

    r6671 r7273  
    3232; -h  -help : Write a summary of the available command line options to standard output and exit.
    3333
    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 {{;}}.
    3535
    3636; -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.
     
    4040; -w  -no-warnings : Disables any warnings that might be issued by the reader or evaluated code.
    4141
    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.
    4343
    4444; -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  
    118118
    119119Copies 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}}
    121121or {{(make-pathname (chicken-home) "examples")}}).
    122122
     
    270270
    271271Holds 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 the
     272if the environment variable {{CHICKEN_PREFIX}} is set or the
    273273path where the CHICKEN binaries ({{chicken}}, {{csi}}, etc.) are installed.
    274274
     
    557557{{chicken-setup -fetch}}) and extract its contents with a separate
    558558program (like {{winzip}}). the {{CHICKEN_REPOSITORY}} environment
    559 variable has to be set (in addition to {{CHICKEN_HOME}}) to a
     559variable has to be set to a
    560560directory where your compiled extensions should be located.
    561561
  • wiki/modules

    r7232 r7273  
    118118== Version History
    119119
     120; 0.8 : fixed buggy handling of {{include}}
    120121; 0.7 : added srfi-89 support
    121122; 0.6 : supports curried {{define}} syntax
  • wiki/srfi-89

    r7231 r7273  
    2020== Version
    2121
     22; 1.1 : .exports file was missing, static lib was not installed
    2223; 1.0 : Initial version
    2324
Note: See TracChangeset for help on using the changeset viewer.