Changeset 5220 in project


Ignore:
Timestamp:
07/26/07 17:03:23 (13 years ago)
Author:
felix winkelmann
Message:

doc updates, small fixes

Files:
1 deleted
68 edited

Legend:

Unmodified
Added
Removed
  • chicken/CMakeLists.txt

    r4845 r5220  
    11071107SET(C_TARGET_MORE_LIBS ${C_INSTALL_MORE_LIBS})
    11081108SET(C_TARGET_MORE_STATIC_LIBS ${C_INSTALL_MORE_LIBS})
    1109 SET(C_TARGET_DLL_EXTENSION "NULL")
    11101109SET(C_CROSS_CHICKEN 0)
    11111110
     
    12811280# convenience, so that the user doesn't have to type -lpcre when linking.  Also, we don't want the
    12821281# user linking against a system PCRE library, as we may have our own bugfixes and customizations.
    1283 
     1282#
     1283# PCRE is compiled statically for both our shared and static libraries.   pcre.h needs these definitions
     1284# so that dll imports are correct, and for UTF8 and UCP support.
     1285
     1286ADD_DEFINITIONS(-DPCRE_STATIC)
    12841287SET(PCRE_HEADER ${Chicken_SOURCE_DIR}/pcre/pcre.h)
    12851288SET(PCRE_ROOTS
     
    19661969
    19671970IF(WIN32 AND NOT CYGWIN)
    1968   INSTALL(PROGRAMS chicken-gzip chicken-tar DESTINATION ${BIN_HOME})
     1971  INSTALL(PROGRAMS chicken-gzip.exe chicken-tar.exe DESTINATION ${BIN_HOME})
    19691972ENDIF(WIN32 AND NOT CYGWIN)
    19701973
  • chicken/Makefile.am

    r4845 r5220  
    289289        pcre/pcre_exec.c pcre/pcre_maketables.c pcre/pcre_tables.c pcre/pcre_xclass.c \
    290290        pcre/pcre_fullinfo.c pcre/pcre_ord2utf8.c pcre/pcre_try_flipped.c pcre/chartables.c
    291 pcreoptions = -Ipcre
     291pcreoptions = -Ipcre -DPCRE_STATIC
    292292
    293293libchicken_la_SOURCES = $(commonlibsources) $(chickenlibsources) $(pcresources)
  • chicken/README

    r4845 r5220  
    33  (c)2000-2007 Felix L. Winkelmann
    44
    5   Version 2.627
     5  Version 2.632
    66
    77
  • chicken/benchmarks/nqueens.scm

    r1016 r5220  
    2828  (try (dec-to n) '() '()))
    2929
    30 (time (do ((i 1000 (- 1 1))) ((zero? i)) (nqueens 8)))
     30(time (do ((i 1000 (- 1 1))) ((zero? i)) (nqueens 10)))
  • chicken/build.scm

    r4845 r5220  
    377377(define (true? x)
    378378  (and x (not (member x '("no" "false" "off" "0" "")))))
     379
     380(define (simple-args #!optional (args (command-line-arguments)) (error error))
     381  (define (assign var val)
     382    (##sys#setslot
     383     (string->symbol (string-append "*" var "*"))
     384     0
     385     (if (string? val)
     386         (or (string->number val) val)
     387         val)))
     388  (let loop ((args args) (vals '()))
     389    (cond ((null? args) (reverse vals))
     390          ((string-match "(-{1,2})?([-_A-Za-z0-9]+)(=)?\\s*(.+)?" (car args))
     391           =>
     392           (lambda (m)
     393             (let*-values (((next) (cdr args))
     394                           ((var val)
     395                            (match m
     396                              ((_ _ opt "=" val)
     397                               (cond (val (values opt val))
     398                                     (else
     399                                      (when (null? next)
     400                                        (error "missing argument for option" (car args)) )
     401                                      (set! next (cdr next))
     402                                      (values opt (car next)) ) ) )
     403                              ((_ (? string?) opt #f #f) (values opt #t))
     404                              (_ (values #f #f)) ) ) )
     405               (cond (var
     406                      (assign var val)
     407                      (loop next vals) )
     408                     (else (loop next (cons (car args) vals)))))))
     409          (else (loop (cdr args) (cons (car args) vals))))))
     410
     411(define (yes-or-no? str . default)
     412  (let ((def (:optional default #f)))
     413    (let loop ()
     414      (printf "~%~A (yes/no) " str)
     415      (when def (printf "[~A] " def))
     416      (flush-output)
     417      (let ((ln (read-line)))
     418        (cond ((eof-object? ln) (set! ln "abort"))
     419              ((and def (string=? "" ln)) (set! ln def)) )
     420        (cond ((string-ci=? "yes" ln) #t)
     421              ((string-ci=? "no" ln) #f)
     422              (else
     423               (printf "~%Please enter \"yes\" or \"no\".~%")
     424               (loop) ) ) ) ) ) )
  • chicken/buildversion

    r4845 r5220  
    1 2.627
     12.632
  • chicken/c-platform.scm

    r4845 r5220  
    158158    open-output-file call-with-input-file call-with-output-file close-input-port close-output-port
    159159    values call-with-values vector procedure? memq memv member assq assv assoc list-tail
    160     list-ref abs char-ready? peek-char) )
     160    list-ref abs char-ready? peek-char list->string string->list) )
    161161
    162162(define default-extended-bindings
     
    175175    blob->s16vector/shared blob->u32vector/shared blob->s32vector/shared
    176176    blob->f32vector/shared blob->f64vector/shared
    177     block-ref block-set! number-of-slots
    178     hash-table-ref any?
     177    block-ref block-set! number-of-slots substring-index substring-index-ci
     178    hash-table-ref any? read-string substring=? substring-ci=?
    179179    first second third fourth make-record-instance
    180180    u8vector-length s8vector-length u16vector-length s16vector-length u32vector-length s32vector-length
     
    211211
    212212(define non-foldable-standard-bindings
    213   '(vector cons list string make-vector make-string string->symbol values current-input-port current-output-port) )
     213  '(vector cons list string make-vector make-string string->symbol values current-input-port current-output-port
     214           read-char write-char) )
    214215
    215216(define foldable-standard-bindings
     
    224225    u8vector->blob/shared s8vector->blob/shared u16vector->blob/shared s16vector->blob/shared u32vector->blob/shared
    225226    f32vector->blob/shared f64vector->blob/shared
    226     s32vector->blob/shared
     227    s32vector->blob/shared read-string read-string!
    227228    ##sys#make-structure print* ##sys#make-vector ##sys#apply ##sys#setislot ##sys#block-ref
    228229    ##sys#byte ##sys#setbyte
     
    244245    cons tan atan expt sqrt asin acos number->string char-upcase char-downcase string-append string
    245246    string->list list->string vector->list list->vector read-char substring make-string make-vector
    246     open-input-file open-output-file vector) )
     247    open-input-file open-output-file vector write-char) )
    247248
    248249(define side-effect-free-standard-bindings-that-never-return-false
     
    749750(rewrite 'substring 11 3 '##sys#substring #f)
    750751(rewrite 'string-append 11 2 '##sys#string-append #f)
     752(rewrite 'string->list 11 1 '##sys#string->list #t)
     753(rewrite 'list->string 11 1 '##sys#list->string #t)
    751754
    752755(rewrite 'vector-set! 11 3 '##sys#setslot #f)
     
    10881091                (list (if (eq? number-type 'fixnum) "C_u_i_bit_setp" "C_i_bit_setp"))
    10891092                callargs) ) ) ) ) )
     1093
     1094(rewrite 'read-char 23 0 '##sys#read-char/port '##sys#standard-input)
     1095(rewrite 'write-char 23 0 '##sys#write-char/port '##sys#standard-output)
     1096(rewrite 'read-string 23 1 '##sys#read-string/port '##sys#standard-input)
     1097
     1098(rewrite 'substring=? 24 2 '##sys#substring=? 0 0 #f)
     1099(rewrite 'substring-ci=? 24 2 '##sys#substring-ci=? 0 0 #f)
     1100(rewrite 'substring-index 24 2 '##sys#substring-index 0)
     1101(rewrite 'substring-index-ci 24 2 '##sys#substring-index-ci 0)
  • chicken/chicken-defaults.h.in

    r3839 r5220  
    7272# define C_TARGET_STATIC_LIB_HOME @C_TARGET_STATIC_LIB_HOME@
    7373#endif
    74 #ifndef C_TARGET_DLL_EXTENSION
    75 # define C_TARGET_DLL_EXTENSION @C_TARGET_DLL_EXTENSION@
    76 #endif
  • chicken/chicken-profile.scm

    r4232 r5220  
    110110  (let ([c1 (second x)]
    111111        [c2 (second y)] )
    112     (if (= c1 c2)
     112    (if (eqv? c1 c2)
    113113        (> (third x) (third y))
    114         (> c1 c2) ) ) )
     114        (if c1 (if c2 (> c1 c2) #t) #t) ) ) )
    115115
    116116(define (sort-by-time x y)
     
    124124  (let ([c1 (cadddr x)]
    125125        [c2 (cadddr y)] )
    126     (if (= c1 c2)
     126    (if (eqv? c1 c2)
    127127        (> (third x) (third y))
    128128        (> c1 c2) ) ) )
     
    151151    (do ((line (read) (read)))
    152152        ((eof-object? line))
    153       (hash-table-set! hash (first line)
    154                        (map + (hash-table-ref/default hash (first line) '(0 0)) (cdr line))))
     153      (hash-table-set!
     154       hash (first line)
     155       (map (lambda (x y) (and x y (+ x y)))
     156            (hash-table-ref/default hash (first line) '(0 0))
     157            (cdr line))))
    155158    (hash-table->alist hash)))
    156159
     
    183186                      (lambda (t) (append t (let ((c (second t))
    184187                                                  (t (third t)))
    185                                               (list (or (and (> c 0) (/ t c))
     188                                              (list (or (and c (> c 0) (/ t c))
    186189                                                        0)
    187190                                                    (or (and (> max-t 0) (* (/ t max-t) 100))
     
    198201                            [p (list-ref entry 4)] )
    199202                        (list (##sys#symbol->qualified-string (first entry))
    200                               (number->string c)
     203                              (if (not c) "overflow" (number->string c))
    201204                              (format-real (/ t 1000) seconds-digits)
    202205                              (format-real (/ a 1000) average-digits)
    203206                              (format-real p percent-digits))))
    204                     (filter (lambda (entry) (not (and (zero? (second entry)) no-unused)))
     207                    (remove (lambda (entry)
     208                              (if (second entry)
     209                                  (and (zero? (second entry)) no-unused)
     210                                  #f) )
    205211                            data)))
    206212    (let* ([headers (list "procedure" "calls" "seconds" "average" "percent")]
  • chicken/chicken-setup.scm

    r4845 r5220  
    115115(register-feature! 'chicken-setup)
    116116
    117 (define *copy-command* (if *windows-shell* 'copy "cp -r"))
    118 (define *remove-command* (if *windows-shell* "del /Q /S" "rm -fr"))
    119 (define *move-command* (if *windows-shell* 'move 'mv))
    120 (define *gzip-program* (if *windows-shell* 'chicken-gzip 'gzip))
    121 (define *tar-program* (if *windows-shell* 'chicken-tar 'tar))
    122 
     117(define program-path (make-parameter *install-bin-path*))
    123118(define (cross-chicken) (##sys#fudge 39))
    124119
     
    152147(define setup-verbose-flag (make-parameter #f))
    153148(define setup-install-flag (make-parameter #t))
     149
     150(define *copy-command* (if *windows-shell* 'copy "cp -r"))
     151(define *remove-command* (if *windows-shell* "del /Q /S" "rm -fr"))
     152(define *move-command* (if *windows-shell* 'move 'mv))
     153
     154(define *gzip-program*
     155  (if *windows-shell*
     156      (quotewrap (make-pathname (program-path) "chicken-gzip"))
     157      'gzip))
     158
     159(define *tar-program*
     160  (if *windows-shell*
     161      (quotewrap (make-pathname (program-path) "chicken-tar"))
     162      'tar))
    154163
    155164(define *fetch-only* #f)
     
    427436  (make-pathname rpath fn setup-file-extension) )
    428437
    429 (define program-path (make-parameter *install-bin-path*))
    430 
    431438(define installation-prefix
    432439  (make-parameter
     
    580587
    581588(define (install-extension id files #!optional (info '()))
    582   (define (soify f) (translate-extension f))
    583589  (when (setup-install-flag)
    584590    (let* ((files (check-filelist (if (list? files) files (list files))))
    585591           (rpath (repo-path))
    586592           (rpathd (repo-path #t))
    587            (files (if *windows*
    588                       (map (lambda (f)
    589                              (if (pair? f)
    590                                  (list (soify (car f)) (soify (cadr f)))
    591                                  (soify f)))
    592                            files)
    593                       files) )
    594593           (dests (map (lambda (f)
    595594                         (let ((from (if (pair? f) (car f) f))
     
    600599                           (copy-file from to)
    601600                           (unless *windows-shell*
    602                                    (run (chmod a+r ,to)))
     601                             (run (chmod a+r ,to)))
    603602                           (and-let* ((static (assq 'static info)))
    604603                             (when (and (eq? (software-version) 'macosx)
     
    11711170        (("-fetch" . more)
    11721171         (set! *fetch-only* #t)
     1172         (set! *keep-stuff* #t)
    11731173         (loop more) )
    11741174        (("-host" host . more)
     
    12641264           (when (setup-verbose-flag) (printf "Rebuilding documentation index...\n"))
    12651265           (build-doc-index) )
    1266          (for-each
    1267           (lambda (f)
    1268             (run (,*remove-command* ,(quotewrap f))) )
    1269           *fetched-eggs*)
     1266         (unless *keep-stuff*
     1267             (for-each
     1268              (lambda (f)
     1269                (run (,*remove-command* ,(quotewrap f))) )
     1270              *fetched-eggs*))
    12701271         #f) ) ) ) )
    12711272
  • chicken/configure.in

    r4845 r5220  
    285285AC_SUBST(TARGET_MORE_STATIC_LIBS)
    286286
    287 if test "$TARGET_DLL_EXTENSION" = ""; then
    288   TARGET_DLL_EXTENSION="NULL"
    289 fi
    290 
    291 AC_SUBST(TARGET_DLL_EXTENSION)
    292 
    293287dnl Checking for generating "...-static" executables.
    294288AM_CONDITIONAL(NO_STATIC_EXECUTABLES, [test "${enable_shared}" = "no" -o "${enable_static}" = "no"])
  • chicken/csc.scm

    r4845 r5220  
    7474# define C_TARGET_RUN_LIB_HOME    C_TARGET_LIB_HOME
    7575#endif
    76 
    77 #ifndef C_TARGET_DLL_EXTENSION
    78 # define C_TARGET_DLL_EXTENSION    NULL
    79 #endif
    8076<#
    8177
     
    10197(define-foreign-variable TARGET_STATIC_LIB_HOME c-string "C_TARGET_STATIC_LIB_HOME")
    10298(define-foreign-variable TARGET_RUN_LIB_HOME c-string "C_TARGET_RUN_LIB_HOME")
    103 (define-foreign-variable TARGET_DLL_EXTENSION c-string "C_TARGET_DLL_EXTENSION")
    10499
    105100
     
    107102
    108103(define win (eq? (build-platform) 'msvc))
    109 (define cygwin (eq? (build-platform) 'cygwin))
    110104(define mingw (eq? (build-platform) 'mingw32))
    111105(define osx (eq? (software-version) 'macosx))
     
    163157      (define compile-output-flag "/Fo")
    164158      (define executable-extension "exe")
    165       (define shared-library-extension "dll")
    166159      (define nonstatic-compilation-options '("/DPIC")) )
    167160    (begin
     
    175168      (define executable-extension "")
    176169      (define compile-output-flag "-o ")
    177       (define nonstatic-compilation-options '())
    178       (define shared-library-extension
    179         (let ()
    180           (define (getext)
    181             (cond ((or cygwin mingw) "dll")
    182                   ;;((hpux) "sl")
    183                   (else ##sys#load-dynamic-extension) ) )
    184           (if host-mode
    185               (or TARGET_DLL_EXTENSION (getext))
    186               (getext))))))
    187 
     170      (define nonstatic-compilation-options '()) ) )
     171
     172(define shared-library-extension ##sys#load-dynamic-extension)
    188173(define default-translation-optimization-options '())
    189174
     
    783768               [(-)
    784769                (set! target-filename (make-pathname #f "a" executable-extension))
    785                 (set! scheme-files (cons "-" scheme-files))]
     770                (set! scheme-files (append scheme-files '("-")))]
    786771               [else
    787772                (when (memq s '(-unsafe -benchmark-mode))
     
    832817                      [(file-exists? arg)
    833818                       (let-values ([(dirs name ext) (decompose-pathname arg)])
    834                          (cond [(not ext) (set! scheme-files (cons arg scheme-files))]
     819                         (cond [(not ext) (set! scheme-files (append scheme-files (list arg)))]
    835820                               [(member ext '("h" "c"))
    836                                 (set! c-files (cons arg c-files)) ]
     821                                (set! c-files (append c-files (list arg))) ]
    837822                               [(member ext '("cpp" "C" "cc" "cxx" "hpp"))
    838823                                (when osx (set! compile-options (cons "-no-cpp-precomp" compile-options)))
    839824                                (set! cpp-mode #t)
    840                                 (set! c-files (cons arg c-files)) ]
     825                                (set! c-files (append c-files (list arg))) ]
    841826                               [(member ext '("m" "M" "mm"))
    842827                                (set! objc-mode #t)
    843                                 (set! c-files (cons arg c-files)) ]
     828                                (set! c-files (append c-files (list arg))) ]
    844829                               [(or (string=? ext object-extension)
    845830                                    (string=? ext library-extension) )
    846                                 (set! object-files (cons arg object-files)) ]
    847                                [else (set! scheme-files (cons arg scheme-files))] ) ) ]
     831                                (set! object-files (append object-files (list arg))) ]
     832                               [else (set! scheme-files (append scheme-files (list arg)))] ) ) ]
    848833                      [else
    849834                       (let ([f2 (string-append arg ".scm")])
     
    902887                (read-file) ) ) )
    903888           ($delete-file cscf) ) ) ) )
    904    (reverse scheme-files) )
     889   scheme-files)
    905890  (unless keep-files (for-each $delete-file generated-scheme-files)) )
    906891
     
    909894
    910895(define (run-compilation)
    911   (for-each
    912    (lambda (f)
    913      (let ([fo (pathname-replace-extension f object-extension)])
    914        (unless (zero?
    915                 ($system
    916                  (string-intersperse
    917                   (list (cond (cpp-mode c++-compiler)
    918                               (else compiler) )
    919                         (cleanup-filename f)
    920                         (string-append compile-output-flag (cleanup-filename fo))
    921                         compile-only-flag
    922                         (compiler-options) ) ) ) )
    923          (exit last-exit-code) )
    924        (set! generated-object-files (cons fo generated-object-files))
    925        (set! object-files (cons fo object-files)) ) )
    926    (reverse c-files) )
    927   (unless keep-files (for-each $delete-file generated-c-files)) )
     896  (let ((ofiles '()))
     897    (for-each
     898     (lambda (f)
     899       (let ([fo (pathname-replace-extension f object-extension)])
     900         (unless (zero?
     901                  ($system
     902                   (string-intersperse
     903                    (list (cond (cpp-mode c++-compiler)
     904                                (else compiler) )
     905                          (cleanup-filename f)
     906                          (string-append compile-output-flag (cleanup-filename fo))
     907                          compile-only-flag
     908                          (compiler-options) ) ) ) )
     909           (exit last-exit-code) )
     910         (set! generated-object-files (cons fo generated-object-files))
     911         (set! ofiles (cons fo ofiles))))
     912     c-files)
     913    (set! object-files (append (reverse ofiles) object-files)) ; put generated object files first
     914    (unless keep-files (for-each $delete-file generated-c-files)) ) )
    928915
    929916(define (compiler-options)
     
    940927(define (run-linking)
    941928  (let ([files (map cleanup-filename
    942                     (append (reverse object-files)
     929                    (append object-files
    943930                            (nth-value 0 (static-extension-info))
    944931                            (if (or static static-libs)
  • chicken/cscbench.scm

    r3839 r5220  
    3636
    3737(define (display-f-4.3 n)
    38   (let* ([m (string-match "([-.+e0-9]*)(\\.([0-9]*))?" (number->string n))]
     38  (let* ([m (string-match "([-+e0-9]*)(\\.([0-9]*))?" (number->string n))]
    3939         [is (second m)]
    40          [fs (or (fourth m) "0")] )
     40         [fs (fourth m)] )
    4141    (display-r is 4 #\space)
    4242    (display #\.)
     
    5555                 (/ (+ (run) (run) (run)) 3) ) ) ] )
    5656    (display #\space)
    57     (if time
    58         (display-f-4.3 time)
    59         (display "FAILED") ) ) )
     57    (cond (time
     58            (display-f-4.3 time)
     59            time)
     60          (else
     61            (display "FAILED")
     62            9999.9))))
    6063
    6164(define (dflush x)
     
    8487  (dflush "\nCFLAGS:\n")
    8588  (system* "echo `../csc -cflags`")
    86   (display "\n                    base      unsafe        max\n")
     89  (display "\n                  base       unsafe     max\n")
     90  (let ((sum-base 0.0)
     91        (sum-unsafe 0.0)
     92        (sum-max 0.0))
    8793  (for-each
    8894   (lambda (file)
     
    94100       (display-l name 16 #\space)
    95101       (flush-output)
    96        (compile-and-run file extras "-debug-level 0 -optimize-level 1 -lambda-lift" options "" #f)
     102       (set! sum-base (+ sum-base (compile-and-run file extras "-debug-level 0 -optimize-level 1 -lambda-lift" options "" #f)))
    97103       (dflush "  ")
    98        (compile-and-run
    99         file extras
    100         "-debug-level 0 -optimize-level 3 -block -disable-interrupts -lambda-lift"
    101         options "" #t)
     104       (set! sum-unsafe (+ sum-unsafe (compile-and-run file extras "-debug-level 0 -optimize-level 3 -block -disable-interrupts -lambda-lift" options "" #t)))
    102105       (dflush "  ")
    103        (when (not (member name flonum-files))
    104          (compile-and-run file extras "-benchmark-mode" options "" #t) )
     106       (unless (member name flonum-files)
     107         (set! sum-max (+ sum-max (compile-and-run file extras "-benchmark-mode" options "" #t) )))
    105108       (newline)
    106109       (flush-output) ) )
    107110   (lset-difference string=? (sort (glob "*.scm") string<?) '("plists.scm")))
    108  0)
     111  (display "\nTOTAL            ")
     112  (display-f-4.3 sum-base)
     113  (display "   ")
     114  (display-f-4.3 sum-unsafe)
     115  (display "   ")
     116  (display-f-4.3 sum-max)
     117  (newline)
     118 0))
    109119
    110120(main (command-line-arguments))
  • chicken/dist.cmake

    r2926 r5220  
    3232  chicken-setup.1
    3333  chicken-setup.scm
     34  chicken-tar.exe
     35  chicken-gzip.exe
    3436  chicken.1
    3537  chicken.h
  • chicken/eval.scm

    r4520 r5220  
    12141214        [else default-load-library-extension] ) )
    12151215
    1216 (define ##sys#load-dynamic-extension    ; this also...
    1217   (cond [(eq? (software-version) 'macosx) default-load-library-extension]
    1218         [(and (eq? (software-version) 'hpux)
    1219               (eq? (machine-type) 'hppa)) default-load-library-extension]
    1220         [else ##sys#load-library-extension] ) )
     1216(define ##sys#load-dynamic-extension default-load-library-extension)
    12211217
    12221218(define ##sys#default-dynamic-load-libraries
     
    20472043(define ##sys#repl-read-hook #f)
    20482044
     2045(define (##sys#repl-print-hook x port)
     2046  (##sys#with-print-length-limit ##sys#repl-print-length-limit (cut ##sys#print x #t port))
     2047  (##sys#write-char-0 #\newline port) )
     2048
    20492049(define repl-prompt (make-parameter (lambda () "#;> ")))
    20502050
     
    20672067    (lambda ()
    20682068
    2069       (define (write-one x port)
    2070         (##sys#with-print-length-limit ##sys#repl-print-length-limit (cut ##sys#print x #t port))
    2071         (##sys#write-char-0 #\newline port) )
    2072 
    20732069      (define (write-err xs)
    2074         (for-each (cut write-one <> ##sys#standard-error) xs) )
     2070        (for-each (cut ##sys#repl-print-hook <> ##sys#standard-error) xs) )
    20752071
    20762072      (define (write-results xs)
    20772073        (unless (or (null? xs) (eq? (##core#undefined) (car xs)))
    2078           (for-each (cut write-one <> ##sys#standard-output) xs) ) )
     2074          (for-each (cut ##sys#repl-print-hook <> ##sys#standard-output) xs) ) )
    20792075
    20802076      (let ((stdin ##sys#standard-input)
  • chicken/extras.scm

    r4845 r5220  
    421421              (doread port) ) ) ) ) ) )
    422422
     423
     424;;; Extended I/O
     425
    423426(define (##sys#read-string! n dest port start)
    424427  (cond ((eq? n 0) 0)
     
    452455  (##sys#read-string! n dest port start) )
    453456
    454 (define read-string
     457(define ##sys#read-string/port
    455458  (let ((open-output-string open-output-string)
    456459        (get-output-string get-output-string) )
    457     (lambda (#!optional n (p ##sys#standard-input))
     460    (lambda (n p)
    458461      (##sys#check-port p 'read-string)
    459462      (cond (n (##sys#check-exact n 'read-string)
     
    471474                           (get-output-string str)
    472475                           (begin
    473                              (##sys#write-char c str)
     476                             (##sys#write-char/port c str)
    474477                             (loop (and n (fx- n 1))) ) ) ) ) ) ) ) ) ) ) )
     478
     479(define (read-string #!optional n (port ##sys#standard-input))
     480  (##sys#read-string/port n port) )
    475481
    476482(define read-token
     
    513519        (display str p)
    514520        (newline p) ) ) ) )
     521
     522
     523;;; Binary I/O
     524
     525(define (read-byte #!optional (port ##sys#standard-input))
     526  (##sys#check-port port 'read-byte)
     527  (let ((x (##sys#read-char-0 port)))
     528    (if (eof-object? x)
     529        x
     530        (char->integer x) ) ) )
     531
     532(define (write-byte byte #!optional (port ##sys#standard-output))
     533  (##sys#check-exact byte 'write-byte)
     534  (##sys#check-port port 'write-byte)
     535  (##sys#write-char-0 (integer->char byte) port) )
    515536
    516537
     
    9811002               (loop (fx+ istart 1)
    9821003                     (fx+ iend 1) ) ] ) ) ) )
    983   (set! substring-index
    984     (lambda (which where . start)
     1004  (set! ##sys#substring-index
     1005    (lambda (which where start)
    9851006      (traverse
    986        which where (if (pair? start) (car start) 0)
     1007       which where start
    9871008       (lambda (i l) (##core#inline "C_substring_compare" which where 0 i l))
    9881009       'substring-index) ) )
    989   (set! substring-index-ci
    990     (lambda (which where . start)
     1010  (set! ##sys#substring-index-ci
     1011    (lambda (which where start)
    9911012      (traverse
    992        which where (if (pair? start) (car start) 0)
     1013       which where start
    9931014       (lambda (i l) (##core#inline "C_substring_compare_case_insensitive" which where 0 i l))
    9941015       'substring-index-ci) ) ) )
     1016
     1017(define (substring-index which where #!optional (start 0))
     1018  (##sys#substring-index which where start) )
     1019
     1020(define (substring-index-ci which where #!optional (start 0))
     1021  (##sys#substring-index-ci which where start) )
    9951022
    9961023
     
    10221049;;; Substring comparison:
    10231050
    1024 (define (substring=? s1 s2 . start)
     1051(define (##sys#substring=? s1 s2 start1 start2 n)
    10251052  (##sys#check-string s1 'substring=?)
    10261053  (##sys#check-string s2 'substring=?)
    1027   (let* ([n (length start)]
    1028          [start1 (if (fx>= n 1) (car start) 0)]
    1029          [start2 (if (fx>= n 2) (cadr start) 0)]
    1030          [len (if (fx> n 2)
    1031                   (caddr start)
    1032                   (fxmin (fx- (##sys#size s1) start1)
    1033                          (fx- (##sys#size s2) start2) ) ) ] )
     1054  (let ((len (or n
     1055                 (fxmin (fx- (##sys#size s1) start1)
     1056                        (fx- (##sys#size s2) start2) ) ) ) )
    10341057    (##sys#check-exact start1 'substring=?)
    10351058    (##sys#check-exact start2 'substring=?)
    10361059    (##core#inline "C_substring_compare" s1 s2 start1 start2 len) ) )
    10371060
    1038 (define (substring-ci=? s1 s2 . start)
     1061(define (substring=? s1 s2 #!optional (start1 0) (start2 0) len)
     1062  (##sys#substring=? s1 s2 start1 start2 len) )
     1063
     1064(define (##sys#substring-ci=? s1 s2 start1 start2 n)
    10391065  (##sys#check-string s1 'substring-ci=?)
    10401066  (##sys#check-string s2 'substring-ci=?)
    1041   (let* ([n (length start)]
    1042          [start1 (if (fx>= n 1) (car start) 0)]
    1043          [start2 (if (fx>= n 2) (cadr start) 0)]
    1044          [len (if (fx> n 2)
    1045                   (caddr start)
    1046                   (fxmin (fx- (##sys#size s1) start1)
    1047                          (fx- (##sys#size s2) start2) ) ) ] )
     1067  (let ((len (or n
     1068                 (fxmin (fx- (##sys#size s1) start1)
     1069                        (fx- (##sys#size s2) start2) ) ) ) )
    10481070    (##sys#check-exact start1 'substring-ci=?)
    10491071    (##sys#check-exact start2 'substring-ci=?)
    10501072    (##core#inline "C_substring_compare_case_insensitive"
    10511073                   s1 s2 start1 start2 len) ) )
     1074
     1075(define (substring-ci=? s1 s2 #!optional (start1 0) (start2 0) len)
     1076  (##sys#substring-ci=? s1 s2 start1 start2 len) )
    10521077
    10531078
  • chicken/library.scm

    r4845 r5220  
    4242        ##sys#grow-vector ##sys#default-parameter-vector
    4343        print-length-limit current-print-length setter-tag read-marks
    44         ##sys#fetch-and-check-port-arg ##sys#print-exit)
     44        ##sys#print-exit
     45        ##sys#format-here-doc-warning)
    4546  (foreign-declare #<<EOF
    4647#include <string.h>
     
    114115    (no-procedure-checks-for-usual-bindings)
    115116    (bound-to-procedure
    116      ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-string ##sys#substring ##sys#check-port-mode
     117     ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-port* ##sys#check-string ##sys#substring ##sys#check-port-mode
    117118     ##sys#for-each ##sys#map ##sys#setslot ##sys#allocate-vector ##sys#check-pair
    118119     ##sys#not-a-proper-list-error ##sys#error ##sys#warn ##sys#signal-hook
    119120     ##sys#check-symbol ##sys#check-vector ##sys#floor ##sys#ceiling ##sys#truncate ##sys#round
    120121     ##sys#check-number ##sys#cons-flonum ##sys#check-integer ##sys#check-special
    121      ##sys#flonum-fraction ##sys#make-port ##sys#fetch-and-check-port-arg ##sys#print
     122     ##sys#flonum-fraction ##sys#make-port ##sys#print
    122123     ##sys#check-structure ##sys#make-structure ##sys#procedure->string
    123124     ##sys#gcd ##sys#lcm ##sys#ensure-heap-reserve ##sys#check-list
     
    129130     ##sys#reset-handler ##sys#exit-handler ##sys#dynamic-wind ##sys#port-line
    130131     ##sys#grow-vector ##sys#run-pending-finalizers ##sys#peek-char-0 ##sys#read-char-0
     132     ##sys#read-char/port ##sys#write-char/port
    131133     ##sys#schedule ##sys#make-thread ##sys#print-to-string ##sys#scan-buffer-line
    132134     ##sys#update-thread-state-buffer ##sys#restore-thread-state-buffer ##sys#user-print-hook
     
    145147     call-with-current-continuation ##sys#string->number ##sys#inexact->exact ##sys#exact->inexact
    146148     ##sys#reverse-list->string reverse ##sys#inexact? list? string ##sys#char->utf8-string
    147      ##sys#unicode-surrogate? ##sys#surrogates->codepoint
     149     ##sys#unicode-surrogate? ##sys#surrogates->codepoint ##sys#write-char/port
    148150     ##sys#update-errno ##sys#file-info close-output-port close-input-port ##sys#peek-unsigned-integer
    149151     continuation-graft char-downcase string-copy remainder floor ##sys#exact? list->string
     
    324326    (define-macro (##sys#check-exact . _) '(##core#undefined))
    325327    (define-macro (##sys#check-port . _) '(##core#undefined))
     328    (define-macro (##sys#check-port* . _) '(##core#undefined))
    326329    (define-macro (##sys#check-port-mode . _) '(##core#undefined))
    327330    (define-macro (##sys#check-number . _) '(##core#undefined))
     
    484487         (begin (##sys#check-char c 'make-string) c) ) ) ) )
    485488
    486 (define string->list
     489(define ##sys#string->list
    487490  (lambda (s)
    488491    (##sys#check-string s 'string->list)
     
    494497                  (loop (fx+ i 1)) ) ) ) ) ) )
    495498
    496 (define (list->string lst0)
     499(define string->list ##sys#string->list)
     500
     501(define (##sys#list->string lst0)
    497502  (cond-expand
    498503    [unsafe
     
    516521    ))
    517522
     523(define list->string ##sys#list->string)
    518524
    519525(define (string-fill! s c)
     
    16531659       (if mode "port is not an input port" "port is not an output-port") ) ) ) )
    16541660
    1655 (define (##sys#fetch-and-check-port-arg parg default)
    1656   (let ((p (if (eq? parg '())
    1657                default
    1658                (##sys#slot parg 0) ) ) )
    1659     (##sys#check-port p)
    1660     (when (##sys#slot p 8)
    1661       (##sys#signal-hook #:file-error "port already closed" p) )
    1662     p) )
     1661(define (##sys#check-port* p loc)
     1662  (##sys#check-port p)
     1663  (when (##sys#slot p 8)
     1664    (##sys#signal-hook #:file-error loc "port already closed" p) )
     1665  p)
    16631666
    16641667(define (current-input-port . arg)
     
    18261829  (##core#undefined) )
    18271830
    1828 (define (flush-output . port)
    1829   (let ([port (##sys#fetch-and-check-port-arg port ##sys#standard-output)])
    1830     (##sys#check-port-mode port #f 'flush-output)
    1831     (##sys#flush-output port) ) )
     1831(define (flush-output #!optional (port ##sys#standard-output))
     1832  (##sys#check-port* port 'flush-output)
     1833  (##sys#check-port-mode port #f 'flush-output)
     1834  (##sys#flush-output port) )
    18321835
    18331836(define port-name
    1834   (lambda (port)
     1837  (lambda (#!optional (port ##sys#standard-input))
    18351838    (##sys#check-port port 'port-name)
    18361839    (##sys#slot port 3) ) )
     
    18461849
    18471850(define port-position
    1848   (lambda (#!optional port ##sys#standard-input)
     1851  (lambda (#!optional (port ##sys#standard-input))
    18491852    (##sys#check-port port 'port-position)
    18501853    (if (##sys#slot port 1)
     
    19161919(define (eof-object? x) (##core#inline "C_eofp" x))
    19171920
    1918 (define (char-ready? . port)
    1919   (let ([port (##sys#fetch-and-check-port-arg port ##sys#standard-input)])
    1920     (##sys#check-port-mode port #t 'char-ready?)
    1921     ((##sys#slot (##sys#slot port 2) 6) port) ) ) ; char-ready?
    1922 
    1923 (define (read-char . port)
    1924   (let ([p (##sys#fetch-and-check-port-arg port ##sys#standard-input)])
    1925     (##sys#check-port-mode p #t 'read-char)
    1926     (##sys#read-char-0 p) ) )
     1921(define (char-ready? #!optional (port ##sys#standard-input))
     1922  (##sys#check-port* port 'char-ready?)
     1923  (##sys#check-port-mode port #t 'char-ready?)
     1924  ((##sys#slot (##sys#slot port 2) 6) port) ) ; char-ready?
     1925
     1926(define (read-char #!optional (port ##sys#standard-input))
     1927  (##sys#read-char/port port) )
     1928
     1929(define (##sys#read-char/port port)
     1930  (##sys#check-port* port 'read-char)
     1931  (##sys#check-port-mode port #t 'read-char)
     1932  (##sys#read-char-0 port) )
    19271933
    19281934(define (##sys#read-char-0 p)
     
    19391945    c) )
    19401946
    1941 (define (peek-char . port)
    1942   (let ([p (##sys#fetch-and-check-port-arg port ##sys#standard-input)])
    1943     (##sys#check-port-mode p #t 'peek-char)
    1944     (##sys#peek-char-0 p) ) )
     1947(define (peek-char #!optional (port ##sys#standard-input))
     1948  (##sys#check-port* port 'peek-char)
     1949  (##sys#check-port-mode port #t 'peek-char)
     1950  (##sys#peek-char-0 port) )
    19451951
    19461952(define (##sys#peek-char-0 p)
     
    19521958        c) ) )
    19531959
    1954 (define (read . port)
    1955   (let ([port (##sys#fetch-and-check-port-arg port ##sys#standard-input)])
    1956     (##sys#check-port-mode port #t 'read)
    1957     (##sys#read port ##sys#default-read-info-hook) ) )
     1960(define (read #!optional (port ##sys#standard-input))
     1961  (##sys#check-port* port 'read)
     1962  (##sys#check-port-mode port #t 'read)
     1963  (##sys#read port ##sys#default-read-info-hook) )
    19581964
    19591965(define ##sys#default-read-info-hook #f)
     
    20982104                            (##sys#read-warning
    20992105                             port
    2100                              "undefined escape sequence in string - probably forgot backslash ?"
     2106                             "undefined escape sequence in string - probably forgot backslash"
    21012107                             c)
    21022108                            (loop (##sys#read-char-0 port) (cons c lst))) ) )
     
    21972203                     (cond [(eof-object? c2) (##sys#read-error port "unexpected end of numeric literal")]
    21982204                           [(char=? c2 #\x) (r-number 16)]
     2205                           [(char=? c2 #\d) (r-number 10)]
    21992206                           [(char=? c2 #\o) (r-number 8)]
    22002207                           [(char=? c2 #\b) (r-number 2)]
     
    24062413                               (case (char-downcase dchar)
    24072414                                 ((#\x) (##sys#read-char-0 port) (r-number-with-exactness 16))
     2415                                 ((#\d) (##sys#read-char-0 port) (r-number-with-exactness 10))
    24082416                                 ((#\o) (##sys#read-char-0 port) (r-number-with-exactness 8))
    24092417                                 ((#\b) (##sys#read-char-0 port) (r-number-with-exactness 2))
     
    26042612  ((##sys#slot (##sys#slot p 2) 2) p c) )
    26052613
    2606 (define (##sys#write-char c . port)
     2614(define (##sys#write-char/port c port)
     2615  (##sys#check-port* port 'write-char)
    26072616  (##sys#check-char c 'write-char)
    2608   (let ([p (##sys#fetch-and-check-port-arg port ##sys#standard-output)])
    2609     (##sys#check-port-mode p #f 'write-char)
    2610     (##sys#write-char-0 c p) ) )
    2611 
    2612 (define write-char ##sys#write-char)
    2613 (define (newline . port) (apply ##sys#write-char #\newline port))
    2614 
    2615 (define (write x . port)
    2616   (##sys#print x #t (##sys#fetch-and-check-port-arg port ##sys#standard-output)) )
    2617 
    2618 (define (display x . port)
    2619   (##sys#print x #f (##sys#fetch-and-check-port-arg port ##sys#standard-output)) )
     2617  (##sys#write-char-0 c port) )
     2618
     2619(define (write-char c #!optional (port ##sys#standard-output))
     2620  (##sys#check-char c 'write-char)
     2621  (##sys#check-port* port 'write-char)
     2622  (##sys#check-port-mode port #f 'write-char)
     2623  (##sys#write-char-0 c port) )
     2624
     2625(define (newline #!optional (port ##sys#standard-output))
     2626  (##sys#write-char/port #\newline port) )
     2627
     2628(define (write x #!optional (port ##sys#standard-output))
     2629  (##sys#check-port* port 'write)
     2630  (##sys#print x #t port) )
     2631
     2632(define (display x #!optional (port ##sys#standard-output))
     2633  (##sys#check-port* port 'display)
     2634  (##sys#print x #f port) )
    26202635
    26212636(define print
     
    31553170  (check (software-version))
    31563171  (check (build-style))
     3172  (check (build-platform))
    31573173  (check (machine-type))
    31583174  (check (machine-byte-order)) )
     
    39183934
    39193935
     3936;;; Format error string for unterminated here-docs
     3937(define (##sys#format-here-doc-warning end)
     3938  (##sys#print-to-string `("unterminated here-doc string literal `" ,end "'")))
     3939
    39203940;;; Special string quoting syntax:
    39213941
     
    39553975                      [end (readln port)]
    39563976                      [f #f] )
     3977                  (let ((endlen (string-length end)))
     3978                    (cond
     3979                     ((fx= endlen 0)
     3980                      (##sys#read-warning
     3981                       port "Missing tag after #<< here-doc token"))
     3982                     ((or (char=? (string-ref end (fx- endlen 1)) #\space)
     3983                          (char=? (string-ref end (fx- endlen 1)) #\tab))
     3984                      (##sys#read-warning
     3985                       port "Whitespace after #<< here-doc tag"))
     3986                     ))                     
    39573987                  (do ([ln (readln port) (readln port)])
    39583988                      ((or (eof-object? ln) (string=? end ln))
    39593989                       (when (eof-object? ln)
    3960                          (##sys#read-warning port "unterminated `here' string literal") )
     3990                         (##sys#read-warning port
     3991                          (##sys#format-here-doc-warning end)))
    39613992                       (get-output-string str) )
    39623993                    (if f
     
    39724003                      (set! str (open-output-string))
    39734004                      s))
     4005
     4006                  (let ((endlen (string-length end)))
     4007                    (cond
     4008                     ((fx= endlen 0)
     4009                      (##sys#read-warning
     4010                       port "Missing tag after #<# here-doc token"))
     4011                     ((or (char=? (string-ref end (fx- endlen 1)) #\space)
     4012                          (char=? (string-ref end (fx- endlen 1)) #\tab))
     4013                      (##sys#read-warning
     4014                       port "Whitespace after #<# here-doc tag"))
     4015                     ))
     4016
    39744017                  (let loop [(lst '())]
    39754018                    (let ([c (##sys#read-char-0 port)])
     
    39794022                           (cond [(or (eof-object? c) (string=? end s))
    39804023                                  (when (eof-object? c)
    3981                                     (##sys#read-warning port "unterminated `here' string literal") )
     4024                                    (##sys#read-warning
     4025                                     port (##sys#format-here-doc-warning end))
     4026                                     )
    39824027                                  `(##sys#print-to-string
    39834028                                    ;;Can't just use `(list ,@lst) because of 126 argument apply limit
  • chicken/misc/makedoc

    r3839 r5220  
    44|#
    55
    6 ;;; usage: misc/makedoc [-pdf] [PAGE]
    7 
    8 (use html-stream stream-ext srfi-40 stream-wiki utils srfi-13 url posix)
     6
     7(use syntax-case)
     8(use srfi-40)
     9(use html-stream stream-ext stream-wiki utils srfi-13 url posix regex)
     10(use matchable)
     11
     12(define (simple-args #!optional (args (command-line-arguments)) (error error))
     13  (define (assign var val)
     14    (##sys#setslot
     15     (string->symbol (string-append "*" var "*"))
     16     0
     17     (if (string? val)
     18         (or (string->number val) val)
     19         val)))
     20  (let loop ((args args) (vals '()))
     21    (cond ((null? args) (reverse vals))
     22          ((string-match "(-{1,2})?([-_A-Za-z0-9]+)(=)?\\s*(.+)?" (car args))
     23           =>
     24           (lambda (m)
     25             (let*-values (((next) (cdr args))
     26                           ((var val)
     27                            (match m
     28                              ((_ _ opt "=" val)
     29                               (cond (val (values opt val))
     30                                     (else
     31                                      (when (null? next)
     32                                        (error "missing argument for option" (car args)) )
     33                                      (set! next (cdr next))
     34                                      (values opt (car next)) ) ) )
     35                              ((_ (? string?) opt #f #f) (values opt #t))
     36                              (_ (values #f #f)) ) ) )
     37               (cond (var
     38                      (assign var val)
     39                      (loop next vals) )
     40                     (else (loop next (cons (car args) vals)))))))
     41          (else (loop (cdr args) (cons (car args) vals))))))
    942
    1043(define-constant +outpath+ "html")
    11 (define-constant +extension-path+ "wiki-extensions")
    1244(define-constant +index-page+ "The User's Manual")
    1345
    14 (define (but-options args)
    15   (filter (lambda (f)
    16             (not (string-prefix? "-" f)))
    17           args))
    18 
     46(define *pdf* #f)
     47(define *extension-path* #f)
    1948(define *pages* (directory "wiki"))
    20 (define *only* (:optional (but-options (command-line-arguments)) #f))
    21 (define *generate-pdf* (member "-pdf" (command-line-arguments)))
     49(define *page* #f)
    2250
    2351(define (hyphen s)
     
    130158(define *loaded-extensions* (make-hash-table))
    131159
    132 (for-each
    133  (cut load-extensions-from-file *loaded-extensions* <>)
    134  (glob (conc +extension-path+ "/*")) )
    135 
    136160(define (wiki-files->html)
    137161  (for-each
     
    161185   (if *only* (list *only*) *pages*) ) )
    162186
    163 
    164 
    165 ;;; Check for help command line options
    166 (let ((args (command-line-arguments)))
    167   (when (and (not (null? args)) (member (car args) '("-h" "-help" "--help" "-?")))
    168     (print "Usage: misc/makedoc [-h | --help | -?]\n"
    169            "       misc/makedoc [-pdf] [PAGE]")
    170     (exit)))
    171 
    172 ;;; Here come the conversions         
    173 (when *generate-pdf*
    174   (chapters-sanity-check))
    175 
    176 (wiki-files->html)
    177 
    178 (when *generate-pdf*
    179   (html-files->pdf))
     187(define (usage code)
     188  (print "makedoc --extension-path=EXTPATH [--pdf] [--page=PAGENAME]")
     189  (exit code) )
     190
     191(tool-main
     192 (command-line-arguments)
     193 (lambda (args)
     194   (unless *extension-path* (usage 1))
     195   (system* "mkdir -p html")
     196   (for-each
     197    (lambda (f)
     198      (unless (string-suffix? ".svn" f)
     199        (load-extensions-from-file *loaded-extensions* f)))
     200    (glob (conc *extension-path* "/*")) )
     201   (when *pdf*
     202     (chapters-sanity-check))
     203   (wiki-files->html)
     204   (when *pdf*
     205     (html-files->pdf)) ) )
  • chicken/optimizer.scm

    r2776 r5220  
    12181218                        callargs) ) ) ) ) ) )
    12191219
     1220    ;; (<op> <arg1> ... <argN> <specialarg>) ->
     1221    ;;   (<primitiveop> <arg1> ... <argN> <specialarg>)
     1222    ;; (<op> <arg1> ... <argN>) ->
     1223    ;;   (<primitiveop> <arg1> ... <argN> <defaultvar>)
     1224    ((23) ; classargs = (<N> <primitiveop> <defaultvar>)
     1225     (let ((argc (first classargs))
     1226           (rargc (length callargs)))
     1227       (and inline-substitutions-enabled
     1228            (<= argc rargc (add1 argc))
     1229            (or (test name 'standard-binding) (test name 'extended-binding))
     1230            (make-node
     1231             '##core#call '(#t)
     1232             (append
     1233              (list (varnode (second classargs)) cont)
     1234              callargs
     1235              (if (= rargc argc)
     1236                  (list (varnode (third classargs)))
     1237                  '() ) ) ) ) ) )
     1238
     1239    ;; (<op> <arg1> ... <argN>) -> (<primitiveop> ...)
     1240    ;; (<op> <arg1> ... <argN-I> <literalN-I>) -> (<primitiveop> ...)
     1241    ((24) ; classargs = (<argc> <primitiveop> <literal1> ...)
     1242     (and inline-substitutions-enabled
     1243          (or (test name 'standard-binding) (test name 'extended-binding))
     1244          (let ([argc (first classargs)])
     1245            (and (>= (length callargs) (first classargs))
     1246                 (make-node
     1247                  '##core#call (list #t (second classargs))
     1248                  (cons*
     1249                   (varnode (second classargs))
     1250                   cont
     1251                   (let-values (((req opt) (split-at callargs argc)))
     1252                     (append
     1253                      req
     1254                      (let loop ((ca opt)
     1255                                 (da (cddr classargs)) )
     1256                        (cond ((null? ca)
     1257                               (if (null? da)
     1258                                   '()
     1259                                   (cons (qnode (car da)) (loop '() (cdr da))) ) )
     1260                              ((null? da) '())
     1261                              (else (cons (car ca) (loop (cdr ca) (cdr da))))))))))))))
     1262
    12201263    (else (bomb "bad type (optimize)")) ) )
    12211264
  • chicken/pcre/config.h

    r4845 r5220  
    8787#define SUPPORT_UTF8
    8888#define SUPPORT_UCP
    89 #define PCRE_STATIC
    9089
    9190/* End */
  • chicken/profiler.scm

    r2776 r5220  
    8888;;; Entry and exit into/out of profiled lambda:
    8989
    90 (define (##sys#profile-entry index vec)
    91   (let* ([i (* index profile-info-entry-size)]
    92          [ic (add1 i)]
    93          [it0 (+ i 2)]
    94          [ip (+ i 4)]
    95          [ipc (##sys#slot vec ip)] )
    96     (##sys#setislot vec ic (add1 (##sys#slot vec ic)))
    97     (when (zero? ipc)
    98       (##sys#setislot vec it0 (##sys#fudge 6)) )
    99     (##sys#setislot vec ip (add1 ipc)) ) )
     90(define ##sys#profile-entry
     91  (let ((maxfix (##sys#fudge 21)))
     92    (lambda (index vec)
     93      (let* ([i (* index profile-info-entry-size)]
     94             [ic (add1 i)]
     95             [count (##sys#slot vec ic)]
     96             [it0 (+ i 2)]
     97             [ip (+ i 4)]
     98             [ipc (##sys#slot vec ip)] )
     99        (##sys#setislot
     100         vec ic
     101         (cond ((not count) #f)
     102               ((eq? maxfix count) #f)
     103               (else (add1 count))))
     104        (when (zero? ipc)
     105          (##sys#setislot vec it0 (##sys#fudge 6)) )
     106        (##sys#setislot vec ip (add1 ipc)) ) ) ) )
    100107
    101108(define (##sys#profile-exit index vec)
     
    118125        [write write] )
    119126    (lambda ()
     127      (when (##sys#fudge 13)
     128        (##sys#print "[debug] writing profile...\n" #f ##sys#standard-output) )
    120129      (apply
    121130       with-output-to-file ##sys#profile-name
  • chicken/runtime.c

    r4845 r5220  
    88598859/* fixnum arithmetic with overflow detection (from "Hacker's Delight" by Hank Warren) */
    88608860
    8861 C_regparm C_word C_i_o_fixnum_plus(C_word n1, C_word n2)
     8861C_regparm C_word C_fcall C_i_o_fixnum_plus(C_word n1, C_word n2)
    88628862{
    88638863  C_word x1, x2, s;
     
    88748874
    88758875
    8876 C_regparm C_word C_i_o_fixnum_difference(C_word n1, C_word n2)
     8876C_regparm C_word C_fcall C_i_o_fixnum_difference(C_word n1, C_word n2)
    88778877{
    88788878  C_word x1, x2, s;
  • chicken/site/index.html

    r4845 r5220  
    151151
    152152Latest development snapshot: <a
    153 href="http://www.call-with-current-continuation.org/chicken-2.613.tar.gz">chicken-2.613.tar.gz</a>
     153href="http://www.call-with-current-continuation.org/chicken-2.631.tar.gz">chicken-2.631.tar.gz</a>
    154154and <a href="http://www.call-with-current-continuation.org/ChangeLog.txt">(Change log)</a>
    155155
  • chicken/srfi-4.scm

    r4845 r5220  
    706706                         (wrap s n) )
    707707                       (begin
    708                          (##sys#write-char c str)
     708                         (##sys#write-char/port c str)
    709709                         (loop)))))))))))
    710710
  • chicken/support.scm

    r4845 r5220  
    7676  foreign-argument-conversion foreign-result-conversion final-foreign-type debugging export-list block-globals
    7777  lookup-exports-file constant-declarations process-lambda-documentation
    78   compiler-macro-table register-compiler-macro
     78  compiler-macro-table register-compiler-macro export-dump-hook export-import-hook
    7979  make-random-name foreign-type-convert-result foreign-type-convert-argument process-custom-declaration}
    8080
     
    769769;;; Some safety checks and database dumping:
    770770
     771(define (export-dump-hook db file) (void))
     772
    771773(define (dump-exported-globals db file)
    772774  (unless block-compilation
     
    788790           (sort exports
    789791                 (lambda (s1 s2)
    790                    (string<? (##sys#slot s1 1) (##sys#slot s2 1)))) ) ) ) ) ) )
     792                   (string<? (##sys#slot s1 1) (##sys#slot s2 1)))) )
     793          (export-dump-hook db file) ) ) ) ) )
    791794
    792795(define (dump-undefined-globals db)
     
    824827   db) )
    825828
     829(define (export-import-hook x id) (void))
     830
    826831(define (lookup-exports-file id)
    827832  (and-let* ((xfile (##sys#resolve-include-filename
     
    831836    (when verbose-mode
    832837      (printf "loading exports file ~a ...~%" xfile) )
    833     (for-each (cut ##sys#hash-table-set! import-table <> id) (read-file xfile)) ) )
     838    (for-each
     839     (lambda (exp)
     840       (if (symbol? exp)
     841           (##sys#hash-table-set! import-table exp id)
     842           (export-import-hook exp id) ) )
     843     (read-file xfile)) ) )
    834844
    835845
  • chicken/wiki/Accessing external objects

    r2777 r5220  
    273273to return a result from the foreign lambda body as some cleanup code has to be run before execution
    274274commences in the calling code.
     275
    275276=== foreign-safe-lambda
    276277
  • chicken/wiki/Acknowledgements

    r3839 r5220  
    2626Oversby, o.t., Gene Pavlovsky, Levi Pearson, Nicolas Pelletier, Carlos
    2727Pita, Robin Lee Powell, Pupeno, Davide Puricelli, Doug Quale, Eric
    28 Raible, Joel Reymont, Andreas Rottman, David Rush, Lars Rustemeier,
    29 Daniel Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald
    30 Schröder, Spencer Schumann, Alex Shinn, Shmul, Tony Sidaway, Jeffrey
    31 B. Siegal, Andrey Sidorenko, Michele Simionato, Volker Stolz, Dorai
    32 Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein, Sunnan,
    33 Zbigniew Szadkowski, Mike Thomas, Minh Thu, Christian Tismer, Andre
    34 van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil
    35 van Dyke, Sander Vesik, Panagiotis Vossos, Shawn Wagner, Peter Wang,
    36 Ed Watkeys, Thomas Weidner, Goeran Weinholt, Matthew Welland, Joerg
    37 Wittenberger, Peter Wright, Mark Wutka, Richard Zidlicky and Houman
    38 Zolfaghari for bug-fixes, tips and suggestions.
     28Raible, Ivan Raikov, Joel Reymont, Andreas Rottman, David Rush, Lars
     29Rustemeier, Daniel Sadilek, Oskar Schirmer, Burton Samograd, Reed
     30Sheridan, Ronald Schröder, Spencer Schumann, Alex Shinn, Ivan Shmakov,
     31Shmul, Tony Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele
     32Simionato, Volker Stolz, Dorai Sitaram, Robert Skeels, Jason
     33Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski, Mike Thomas,
     34Minh Thu, Christian Tismer, Andre van Tonder, John Tobey, Henrik
     35Tramberend, Vladimir Tsichevsky, Neil van Dyke, Sander Vesik,
     36Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed Watkeys, Thomas
     37Weidner, Goeran Weinholt, Matthew Welland, Joerg Wittenberger, Peter
     38Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for
     39bug-fixes, tips and suggestions.
    3940
    4041CHICKEN uses the PCRE regular expression package ([[http://www.pcre.org]]),
  • chicken/wiki/Basic mode of operation

    r2488 r5220  
    4545
    4646Macro definitions are only available when processed
    47 by {{include}}. Macro definitions in separate units are not available, since
     47by {{include}} or {{require-for-syntax}}. Macro definitions in separate units are not available, since
    4848they are defined at compile time, i.e the time when that other unit
    4949was compiled (macros can optionally be
    5050available at runtime, see {{define-macro}} in [[Non standard macros and special forms|Substitution forms and macros]]).
    5151
    52 On platforms that support dynamic loading of compiled code (like Windows and most ELF based
    53 systems like Linux or BSD) code can be compiled into a shared object ({{.so}}) and loaded
     52On platforms that support dynamic loading of compiled code ( Windows, most ELF based
     53systems like Linux or BSD, MacOS X, and others) code can be compiled into a shared object {{.dll}}, {{.so}}, {{.dylib}}) and loaded
    5454dynamically into a running application.
    5555
  • chicken/wiki/Data representation

    r2488 r5220  
    77
    88There exist two different kinds of data objects in the CHICKEN system:
    9 immediate and non-immediate objects. Immediate objects are represented
    10 by a single machine word, which is usually of 32 bits length, or 64 bits
     9immediate and non-immediate objects.
     10
     11=== Immediate objects
     12
     13Immediate objects are represented by a single machine word, which is usually of 32 bits length, or 64 bits
    1114on 64-bit architectures.   The immediate objects
    1215come in four different flavors:
     
    2225is one for #t and zero for #f.
    2326
    24 other values: the empty list, the value of unbound identifiers,
     27'''other values''': the empty list, the value of unbound identifiers,
    2528the undefined value (void), and end-of-file.  Bits 1-4 are equal to {{C_SPECIAL_BITS}}; bits 5 to 8 contain an identifying
    2629number for this type of object.  The following constants are
     
    2831C_SCHEME_END_OF_FILE}}
    2932
     33Collectively, 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.)
     34
     35=== Non-immediate objects
     36
    3037Non-immediate objects are blocks of data represented by a pointer into
    31 the heap. The first word of the data block contains a header, which gives
     38the heap.  The pointer's immediate mark bits (bits 1 and 2) must be zero to indicate the object is non-immediate;
     39this guarantees the data block is aligned on a 4-byte boundary, at minimum.  Alignment of data words
     40is required on modern architectures anyway, so we get the ability to distinguish between immediate and non-immediate objects for free.
     41
     42The first word of the data block contains a header, which gives
    3243information about the type of the object. The header has the size of a
    3344machine word, usually 32 bits (64 bits on 64 bit architectures).
    3445
    35 bits 1 to 24 contain the length of the data object, which is either
     46Bits 1 to 24 contain the length of the data object, which is either
    3647the number of bytes in a string (or byte-vector) or the the number
    3748of elements for a vector or for a structure type.
    3849
    39 bits 25 to 28 contain the type code of the object.
     50Bits 25 to 28 contain the type code of the object.
    4051
    41 bits 29 to 32 contain miscellaneous flags used for garbage
     52Bits 29 to 32 contain miscellaneous flags used for garbage
    4253collection or internal data type dispatching.
    4354These flags are:
     
    5566boundary. Scheme data objects map to blocks in the following manner:
    5667
    57 pairs: vector-like object (type bits {{C_PAIR_TYPE}}),
     68'''pairs''': vector-like object (type bits {{C_PAIR_TYPE}}),
    5869where the car and the cdr are contained in the first and second slots,
    5970respectively.
    6071
    61 vectors: vector object (type bits {{C_VECTOR_TYPE}}).
     72'''vectors''': vector object (type bits {{C_VECTOR_TYPE}}).
    6273
    63 strings: byte-vector object (type bits {{C_STRING_TYPE}}).
     74'''strings''': byte-vector object (type bits {{C_STRING_TYPE}}).
    6475
    65 procedures: special vector object (type bits
     76'''procedures''': special vector object (type bits
    6677{{C_CLOSURE_TYPE}}). The first slot contains a pointer to a
    6778compiled C function. Any extra slots contain the free variables (since
    6879a flat closure representation is used).
    6980
    70 flonum: a byte-vector object (type bits
     81'''flonums''': a byte-vector object (type bits
    7182{{C_FLONUM_BITS}}). Slots one and two (or a single slot on
    728364 bit architectures) contain a 64-bit floating-point number, in the
    7384representation used by the host systems C compiler.
    7485
    75 symbol: a vector object (type bits {{C_SYMBOL_TYPE}}). Slots
     86'''symbols''': a vector object (type bits {{C_SYMBOL_TYPE}}). Slots
    7687one and two contain the toplevel variable value and the print-name
    7788(a string) of the symbol, respectively.
    7889
    79 port: a special vector object (type bits
     90'''ports''': a special vector object (type bits
    8091{{C_PORT_TYPE}}). The first slot contains a pointer to a file-
    8192stream, if this is a file-pointer, or NULL if not. The other slots
    8293contain housekeeping data used for this port.
    8394
    84 structure: a vector object (type bits
     95'''structures''': a vector object (type bits
    8596{{C_STRUCTURE_TYPE}}). The first slot contains a symbol that
    8697specifies the kind of structure this record is an instance of. The other
    8798slots contain the actual record items.
    8899
    89 pointer: a special vector object (type bits
     100'''pointers''': a special vector object (type bits
    90101{{C_POINTER_TYPE}}). The single slot contains a machine pointer.
    91102
    92 tagged pointer: similar to a pointer (type bits
     103'''tagged pointers''': similar to a pointer (type bits
    93104{{C_TAGGED_POINTER_TYPE}}), but the object contains an additional
    94105slot with a tag (an arbitrary data object) that identifies the type
  • chicken/wiki/Declarations

    r2488 r5220  
    258258 [declaration specifier] (not extended-bindings SYMBOL ...)
    259259
    260 Declares that all given non-standard and CHICKEN-specific procedures
    261  [declaration specifier] (or all if no symbols are specified) are never globally redefined.
     260Declares that all given non-standard and CHICKEN-specific procedures (or all if no symbols are specified) are never globally redefined.
    262261If {{not}} is specified, then all but the given extended bindings
    263262are assumed to be never redefined.
     
    294293 (declare (no-bound-checks) (no-procedure-checks) (no-argc-checks))
    295294
     295
     296=== unused
     297
     298 [declaration specifier] (unused SYMBOL ...)
     299
     300Disables any warnings when the global variable {{SYMBOL}} is not defined but used,
     301or defined but never used and not exported.
    296302
    297303
  • chicken/wiki/Deviations from the standard

    r3241 r5220  
    2828* [4.3] {{syntax-rules}} macros are not provided but available separately.
    2929
     30* [6.1] {{equal?}} compares all structured data recursively, while R5RS specifies that {{eqv?}} is used for data other than pairs, strings and vectors.
     31
    3032* [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.
    3133
    32 * [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. Support for extended numbers is available as a separate package, provided the GNU multiprecision library is installed.
     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.
    3335
    3436* [6.2.6] The procedure {{string->number}} does not obey read/write invariance on inexact numbers.
  • chicken/wiki/Extensions to the standard

    r2488 r5220  
    8181
    8282[5.2] {{define}} with a single argument is allowed and initializes the toplevel or local binding
    83 to an unspecified value. CHICKEN supports ''curried'' definitions, where the the variable name
     83to an unspecified value. CHICKEN supports ''curried'' definitions, where the variable name
    8484may also be a list specifying a name and a nested lambda list. So
    8585
  • chicken/wiki/Foreign type specifiers

    r2488 r5220  
    9090Not allowed as a result type.
    9191
    92 === [nonnull-] byte-vector
    93 
    94 A byte-vector object, passed as a pointer to its contents. Arguments
    95 of type {{byte-vector}} may optionally be {{#f}}, which is
     92=== [nonnull-] blob
     93
     94A blob object, passed as a pointer to its contents. Arguments
     95of type {{blob}} may optionally be {{#f}}, which is
    9696passed as a NULL pointer.  This is not allowed as a return type.
    9797
     
    9999
    100100A SRFI-4 number-vector object, passed as a pointer to its
    101 contents. Arguments of type {{byte-vector}} may optionally be
    102 {{#f}}, which is passed as a NULL pointer.  These are not allowed
     101contents. These type specifiers are not allowed
    103102as return types.
    104103
     
    120119Similar to {{[nonnull-]c-string}}, but if used as a result-type,
    121120the pointer returned by the foreign code will be freed (using the
    122 C-libraries {{free()}})
     121C-libraries {{free(1)}})
    123122after copying. This type specifier is not valid as a result type
    124123for callbacks defined with {{define-external}}.
     124
     125=== [nonnull-] unsigned-c-string[*]
     126
     127Same as {{c-string}}, but maps to the {{unsigned char *}} C type.
     128
     129=== c-string-list
     130
     131Expects a pointer to a list of C strings teminated by a {{NULL}} pointer
     132and returns a list of strings. Only valid as a result type of non-callback
     133functions.
     134
     135=== c-string-list*
     136
     137Similar to {{c-string-list}} but releases the storage of each string and
     138the pointer array using {{free(1)}}.
    125139
    126140=== void
     
    212226</td></tr><tr><td>[nonnull-]c-pointer</td><td>
    213227void *
    214 </td></tr><tr><td>[nonnull-]byte-vector</td><td>
     228</td></tr><tr><td>[nonnull-]blob</td><td>
    215229unsigned char *
    216230</td></tr><tr><td>[nonnull-]u8vector</td><td>
     
    232246</td></tr><tr><td>[nonnull-]c-string</td><td>
    233247char *
    234 </td></tr><tr><td>symbol</td><td>
     248</td></tr><tr><td>[nonnull-]unsigned-c-string</td><td>
     249unsigned char *
     250</td></tr>
     251<tr><td>c-string-list</td><td>char **</td></tr>
     252<tr><td>symbol</td><td>
    235253char *
    236254</td></tr><tr><td>void</td><td>
  • chicken/wiki/Non standard macros and special forms

    r2926 r5220  
    2222following:
    2323
    24 * If {{ID}} names a built in features {{chicken srfi-23 srfi-30 srfi-39 srfi-8 srfi-6 srfi-2 srfi-0 srfi-10 srfi-9 srfi-17 srfi-55}}, then nothing is done.
    25 * If {{ID}} names one of syntactic extensions {{chicken-more-macros chicken-ffi-macros}}, then this extension will be loaded.
     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* If {{ID}} names one of the syntactic extensions {{chicken-more-macros chicken-ffi-macros}}, then this extension will be loaded.
    2626* {{ID}} names one of the core library units shipped with CHICKEN, then a {{(load-library 'ID)}} will be performed.
    2727* {{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.
     
    3030During compilation one of the following happens instead:
    3131
    32 * If {{ID}} names a built in features {{chicken srfi-23 srfi-30 srfi-39 srfi-8 srfi-6 srfi-2 srfi-0 srfi-10 srfi-9 srfi-17 srfi-55}}, then nothing is done.
    33 * If {{ID}} names one of 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.
     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* 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.
    3434* 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.
    3535* 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.
     
    4848
    4949See also: {{set-extension-specifier!}}
     50
     51When syntax extensions are loaded that redefine the global toplevel macro-expander (for example the
     52[[http://www.call-with-current-continuation.org/eggs/syntax-case.html|syntax-case]] extension), then
     53all remaining expression ''in the same toplevel form'' are still expanded with the old toplevel
     54macro-expander.
    5055
    5156==== define-extension
     
    6469are inserted into the output as a {{begin}} form.
    6570
    66 If compiled statically (specifically if the feature {{chicken-compiled-shared}} has not been given), then
     71If compiled statically (specifically if the feature {{chicken-compile-shared}} has not been given), then
    6772this form expands into the following:
    6873
     
    99104=== Binding forms for optional arguments
    100105
    101 ==== :optional
    102 
    103  [syntax] (:optional ARGS DEFAULT)
     106==== optional
     107
     108 [syntax] (optional ARGS DEFAULT)
    104109
    105110Use this form for procedures that take a single optional argument. If
     
    109114
    110115<enscript highlight=scheme>
    111 (define (incr x . i) (+ x (:optional i 1)))
     116(define (incr x . i) (+ x (optional i 1)))
    112117(incr 10)                                   ==> 11
    113118(incr 12 5)                                 ==> 17
    114119</enscript>
    115 
    116120==== case-lambda
    117121
     
    262266Binds the parameters {{PARAMETER1 ...}} dynamically to the values
    263267{{X1 ...}} during execution of {{BODY ...}}.  (see also:
    264 {{make-parameter}} in @ref{Parameters}). Note that {{PARAMETER}} may be any
     268{{make-parameter}} in [[Parameters]]). Note that {{PARAMETER}} may be any
    265269expression that evaluates to a parameter procedure.
    266270
     
    442446==== define-record-type
    443447
    444  [syntax] (define-record-type NAME (CONSTRUCTOR TAG ...) PREDICATE (FIELD ACCESSOR [MODIFIER]) ...)
     448 [syntax] (define-record-type NAME
     449                              (CONSTRUCTOR TAG ...)
     450                              PREDICATE
     451                              (FIELD ACCESSOR [MODIFIER]) ...)
    445452
    446453SRFI-9 record types. For more information see the documentation for
  • chicken/wiki/Parameters

    r2488 r5220  
    9797
    9898
     99=== program-name
     100The name of the currently executing program. This is equivalent to
     101{{(car (argv))}} for compiled programs or the filename following the
     102{{-script}} option in interpreted scripts.
     103
     104
    99105=== repl-prompt
    100106A procedure that should evaluate to a string that will be printed before reading
  • chicken/wiki/The User's Manual

    r3241 r5220  
    33== Introduction
    44
    5 ''(This document describes version 2.6)''
     5''(This document describes version 2.630)''
    66
    77'''CHICKEN is a compiler that translates Scheme source files into C''', which in
  • chicken/wiki/Unit eval

    r2777 r5220  
    6161argument, which should be a one-argument procedure.
    6262
     63See also the [[http://chicken.wiki.br/Parameters#load-verbose|load-verbose]] parameter.
    6364==== load-library
    6465
  • chicken/wiki/Unit extras

    r2926 r5220  
    133133
    134134
    135 
    136 
    137135=== String-port extensions
    138 
    139136
    140137
     
    172169
    173170
    174 
    175 
    176171=== Formatted output
    177172
    178173
    179 
    180 
    181174==== printf
     175==== fprintf
     176==== sprintf
    182177
    183178 [procedure] (fprintf PORT FORMATSTRING ARG ...)
    184179 [procedure] (printf FORMATSTRING ARG)
    185180 [procedure] (sprintf FORMATSTRING ARG ...)
    186  [procedure] (format FORMATSTRING ARG ...)
    187181
    188182Simple formatted output to a given port ({{fprintf}}), the
    189 value of {{(current-output-port) }} ({{printf}}) or a string
    190 ({{sprintf}}/{{format}}).  The {{FORMATSTRING}} can contain any sequence
     183value of {{(current-output-port)}} ({{printf}}) or a string
     184({{sprintf}}).  The {{FORMATSTRING}} can contain any sequence
    191185of characters. The character `~' prefixes special formatting directives:
    192186
     
    217211invoke formatted output routine recursively with the next two arguments as format-string and list of parameters
    218212</td></tr></table>
    219  
    220 
    221 
     213
     214
     215==== format
     216
     217 [procedure] (format [DESTINATION] FORMATSTRING ARG ...)
     218
     219The parameters  {{FORMATSTRING}} and {{ARG ...}} are as for
     220({{printf}}/{{sprintf}}/{{fprintf}}).
     221
     222The optional {{DESTINATION}}, when supplied, performs
     223a ({{sprintf}}) for a  {{#f}},
     224a ({{printf}}) for a {{#t}},
     225and a ({{fprintf}}) for an output-port.
     226When missing a ({{sprintf}}) is performed.
    222227
    223228
     
    243248the new value (after applying the update procedure).
    244249
     250==== hash-table-remove!
     251
     252 [procedure] (hash-table-remove! HASHTABLE PROC)
     253
     254Calls {{PROC}} for all entries in {{HASHTABLE}} with the key and value of each
     255entry. If {{PROC}} returns true, then that entry is removed.
     256
     257
    245258
    246259=== Queues
    247 
    248 
    249260
    250261
     
    337348
    338349
    339 
    340350=== Sorting
    341 
    342351
    343352
     
    370379
    371380
    372 
    373 
    374381=== Random numbers
    375 
    376 
    377382
    378383
     
    394399
    395400
    396 
    397 
    398401=== Input/Output extensions
    399 
    400402
    401403
     
    443445wrap will occur.
    444446
     447==== read-byte
     448==== write-byte
     449
     450 [procedure] (read-byte [PORT])
     451 [procedure] (write-byte BYTE [PORT])
     452
     453Read/write a byte to the port given in {{PORT}}, which default to the values
     454of {{(current-input-port)}} and {{(current-output-port)}}, respectively.
     455
    445456==== read-file
    446457
     
    532543
    533544
    534 
    535545=== Strings
    536546
     
    649659(string-translate*
    650660  "<h1>this is a \"string\"</h1>"
    651   '(("<" . "&lt:") (">" . "&gt;") ("\"" . "&quot;")) )
     661  '(("<" . "&lt;") (">" . "&gt;") ("\"" . "&quot;")) )
    652662=>  "&lt;h1&gt;this is a &quot;string&quot;&lt;/ht&gt;"
    653663</enscript>
     
    678688
    679689
    680 
    681 
    682690=== Combinators
    683691
     
    687695 [procedure] (any? X)
    688696
    689 Ignores it's argument and always returns {{#t}}. This is actually useful sometimes.
     697Ignores its argument and always returns {{#t}}. This is actually useful sometimes.
    690698
    691699
  • chicken/wiki/Unit library

    r3241 r5220  
    146146 [procedure] (finite? N)
    147147
    148 Returns {{#f}} if {{N}} is negative or positive infinity, and {{#f}} otherwise.
     148Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise.
    149149
    150150
     
    412412
    413413(condition-case some-unbound-variable
    414   [(exn file) (print "ignored)] )      ; -> signals error
     414  [(exn file) (print "ignored")] )      ; -> signals error
    415415
    416416</enscript>
     
    535535 watcom
    536536 unknown
     537
     538
     539==== build-style
     540
     541  [procedure] (build-style)
     542
     543Returns a symbol indicating the build system used to create the CHICKEN
     544instance running this program. Possible values are:
     545
     546  cmake
     547  autotools
     548  diy
     549  custom
    537550
    538551
     
    645658
    646659Execute shell command. The functionality offered by this procedure
    647 depends on the capabilities of the host shell.
    648 
     660depends on the capabilities of the host shell. If the forking of a subprocess
     661failed, an exception is raised. Otherwise the return status of the
     662subprocess is returned unaltered.
    649663
    650664
     
    700714If called with no arguments, this procedure returns {{#t}} if warnings are
    701715currently enabled, or {{#f}} otherwise. Note that this is not a parameter.
    702 The current state (wether warnings are enabled or disabled) is global and not
     716The current state (whether warnings are enabled or disabled) is global and not
    703717thread-local.
    704718
     
    814828called as soon as the non-immediate data object {{X}} is about to
    815829be garbage-collected (with that object as its argument).  Note that
    816 the finalizer will '''not''' be called when interrupts are disabled.
     830the finalizer will '''not''' be called while interrupts are disabled.
    817831This procedure returns {{X}}.
    818832
     
    11051119to the reader:
    11061120
     1121<enscript highlight=scheme>
    11071122 ; A simple RGB color syntax:
    11081123
     
    11151130 (with-input-from-string "(1 2 %f0f0f0 3)" read)
    11161131 ; ==> (1 2 #(240 240 240) 3)
     1132</enscript>
    11171133
    11181134If {{CHAR-OR-SYMBOL}} is a symbol, then a so-called ''read-mark'' handler is defined.
     
    11271143(if the syntax was previously defined via {{set-read-syntax!}}).
    11281144
    1129 Note that all of CHICKEN's special non-standard read-syntax is handled directly by the reader
    1130 to disable built-in read-syntax, define a handler that triggers an error (for example).
     1145Note that all of CHICKEN's special non-standard read-syntax is handled directly by the reader.
     1146To disable built-in read-syntax, define a handler that triggers an error (for example).
    11311147
    11321148
  • chicken/wiki/Unit lolevel

    r2488 r5220  
    324324</enscript>
    325325
    326 === Bytevectors
    327 
    328 
    329 
    330 ==== byte-vector
    331 
    332  [procedure] (byte-vector FIXNUM ...)
    333 
    334 Returns a freshly allocated byte-vector with {{FIXNUM ...}} as its
    335 initial contents.
    336 
    337 
    338 ==== byte-vector?
    339 
    340  [procedure] (byte-vector? X)
    341 
    342 Returns {{#t}} if {{X}} is a byte-vector object, or
     326=== Blobs
     327
     328"blobs" are collections of unstructured bytes. You can't do much
     329with them, but allow conversion to and from SRFI-4 number vectors.
     330
     331
     332==== blob?
     333
     334 [procedure] (blob? X)
     335
     336Returns {{#t}} if {{X}} is a blob object, or
    343337{{#f}} otherwise.
    344338
    345339
    346 ==== byte-vector-fill!
    347 
    348  [procedure] (byte-vector-fill! BYTE-VECTOR N)
    349 
    350 Sets each element of {{BYTE-VECTOR}} to {{N}}, which should
    351 be an exact integer.
    352 
    353 
    354 ==== byte-vector->list
    355 
    356  [procedure] (byte-vector->list BYTE-VECTOR)
    357 
    358 Returns a list with elements taken from {{BYTE-VECTOR}}.
    359 
    360 
    361 ==== byte-vector->string
    362 
    363  [procedure] (byte-vector->string BYTE-VECTOR)
    364 
    365 Returns a string with the contents of {{BYTE-VECTOR}}.
    366 
    367 
    368 ==== byte-vector-length
    369 
    370  [procedure] (byte-vector-length BYTE-VECTOR)
    371 
    372 Returns the number of elements in {{BYTE-VECTOR}}.
    373 
    374 
    375 ==== byte-vector-ref
    376 
    377  [procedure] (byte-vector-ref BYTE-VECTOR INDEX)
    378 
    379 Returns the byte at the {{INDEX}}th position of {{BYTE-VECTOR}}.
    380 
    381 
    382 ==== byte-vector-set!
    383 
    384  [procedure] (byte-vector-set! BYTE-VECTOR INDEX N)
    385  [procedure] (set! (byte-vector-ref BYTE-VECTOR INDEX) N)
    386 
    387 Sets the byte at the {{INDEX}}th position of {{BYTE-VECTOR}}
    388 to the value of the exact integer {{n}}.
    389 
    390 
    391 ==== list->byte-vector
    392 
    393  [procedure] (list->byte-vector LIST)
    394 
    395 Returns a byte-vector with elements taken from {{LIST}}, where the
    396 elements of {{LIST}} should be exact integers.
    397 
    398 
    399 ==== make-byte-vector
    400 
    401  [procedure] (make-byte-vector SIZE [INIT])
    402 
    403 Creates a new byte-vector of size {{SIZE}}. If {{INIT}} is
    404 given, then it should be an exact integer with which every element of
    405 the byte-vector is initialized.
    406 
    407 
    408 ==== make-static-byte-vector
    409 
    410  [procedure] (make-static-byte-vector SIZE [INIT])
    411 
    412 As {{make-byte-vector}}, but allocates the byte-vector in storage
    413 that is not subject to garbage collection.  To free the allocated memory,
    414 one has to call {{object-release}} explicitly.
    415 
    416 Exceptions: {{(exn bounds)}}, {{(exn runtime)}}
    417 
    418 
    419 ==== static-byte-vector->pointer
    420 
    421  [procedure] (static-byte-vector->pointer PBYTE-VECTOR)
    422 
    423 Returns a pointer object pointing to the data in the statically allocated
    424 byte-vector {{PBYTE-VECTOR}}.
    425 
    426 
    427 ==== string->byte-vector
    428 
    429  [procedure] (string->byte-vector STRING)
    430 
    431 Returns a byte-vector with the contents of {{STRING}}.
    432 
    433 
     340==== blob-size
     341
     342 [procedure] (blob-size BLOB)
     343
     344Returns the number of bytes in {{BLOB}}.
     345
     346
     347==== blob->string
     348
     349 [procedure] (blob->string BLOB)
     350
     351Returns a string with the contents of {{BLOB}}.
     352
     353
     354==== string->blob
     355
     356 [procedure] (string->blob STRING)
     357
     358Returns a blob with the contents of {{STRING}}.
    434359
    435360
     
    684609==== move-memory!
    685610
    686  [procedure] (move-memory! FROM TO [BYTES])
     611 [procedure] (move-memory! FROM TO [BYTES [FROM-OFFSET [TO-OFFSET]])
    687612
    688613Copies {{BYTES}} bytes of memory from {{FROM}} to {{TO}}.
     
    696621or pairs.
    697622
     623The additional fourth and fifth argument specify starting offsets
     624(in bytes) for the source and destination arguments.
     625
    698626
    699627==== number-of-bytes
     
    796724
    797725
     726==== mutate-procedure
     727
     728 [procedure] (mutate-procedure OLD PROC)
     729
     730Replaces the procedure {{OLD}} with the result of calling the one-argument
     731procedure {{PROC}}. {{PROC}} will receive a copy of {{OLD}} that will
     732be identical in behaviour to the result of {{PROC}}:
     733
     734<enscript highlight=scheme>
     735;;; Replace arbitrary procedure with tracing one:
     736
     737(mutate-procedure my-proc
     738  (lambda (new)
     739    (lambda args
     740      (printf "~s called with arguments: ~s~%" new args)
     741      (apply new args) ) ) )
     742</enscript>
     743
    798744
    799745Previous: [[Unit tcp]]
  • chicken/wiki/Unit match

    r2488 r5220  
    33== Unit match
    44
    5 The runtime-support code for the Pattern Matching extensions. Note that to use the macros in
    6 normal compiled code it is not required to declare this unit as used. Only
    7 if forms containing these macros are to be expanded at runtime, this
    8 is needed.
     5The runtime-support code for the [[http://chicken.wiki.br/Pattern%20matching|Pattern Matching]] extensions. Note that to use the macros in normal compiled code it is not required to declare this unit as used. It is only necessary to do so if forms containing these macros are to be expanded at runtime.
    96
    107Previous: [[Unit srfi-14]]
  • chicken/wiki/Unit posix

    r3241 r5220  
    4646
    4747Returns a list with all files that are contained in the directory with the name {{PATHNAME}}
    48 (which defaults to the value of {{(current-directory)}}). If {{SHOW-DOTFILES?}} is given
    49 and not {{#f}}, then files beginning with ''.'' are not included in the directory listing.
     48(which defaults to the value of {{(current-directory)}}).
     49Files beginning with {{.}} are included only if {{SHOW-DOTFILES?}} is given and not {{#f}}.
    5050
    5151==== directory?
     
    430430of the {{PATH}} environment variable while {{execve(3)}} does not.
    431431
    432 On native Windows, {{process-execute}} ignores the {{ENVIRONMENT-LIST}} arguments.
    433 
    434432==== process-fork
    435433
     
    443441==== process-run
    444442
    445  [procedure] (process-run PATHNAME [LIST])
    446 
    447 Creates a new child process using the UNIX system call {{fork()}}
    448 that executes the program given by the string {{PATHNAME}} using
    449 the UNIX system call {{execv()}}.  The PID of the new process is
    450 returned. If {{LIST}} is not specified, then {{PATHNAME}}
    451 is passed to a program named by the environment variable {{SHELL}}
    452 (or {{/bin/sh}}, if the variable is not defined), so usual argument
    453 expansion can take place.
     443 [procedure] (process-run COMMANDLINE])
     444 [procedure] (process-run COMMAND ARGUMENT-LIST)
     445
     446Creates a new child process. The PID of the new process is returned.
     447
     448* The single parameter version passes the {{COMMANDLINE}} to the system shell, so usual
     449argument expansion can take place.
     450* The multiple parameter version directly invokes the {{COMMAND}} with the {{ARGUMENT-LIST}}.
    454451
    455452==== process-signal
     
    472469returns three values:
    473470
    474 * {{PID}} or 0, if {{NOHANG}} is true and the child process has not terminated yet
    475 * {{#t}} if the process exited normally or {{#f}} otherwise
     471* {{PID}} or 0, if {{NOHANG}} is true and the child process has not terminated yet.
     472* {{#t}} if the process exited normally or {{#f}} otherwise.
    476473* either the exit status, if the process terminated normally or the signal number that terminated/stopped the process.
    477474
    478475==== process
    479476
    480  [procedure] (process COMMANDLINE [ARGUMENTLIST [ENVIRONMENT]])
    481 
    482 Passes the string {{COMMANDLINE}} to the host-system's shell that
    483 is invoked as a subprocess and returns three values: an input port from
     477 [procedure] (process COMMANDLINE)
     478 [procedure] (process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])
     479
     480Creates a subprocess and returns three values: an input port from
    484481which data written by the sub-process can be read, an output port from
    485482which any data written to will be received as input in the sub-process
     
    488485thread, not other threads executing concurrently.
    489486
    490 If {{ARGUMENTLIST}} is given, then the invocation of the subprocess
    491 is not done via the shell, but directly. The arguments are directly
    492 passed to {{process-execute}} (as is {{ENVIRONMENT}}).
     487* The single parameter version passes the string {{COMMANDLINE}} to the host-system's shell that
     488is invoked as a subprocess.
     489* The multiple parameter version directly invokes the {{COMMAND}} as a subprocess. The {{ARGUMENT-LIST}}
     490is directly passed, as is {{ENVIRONMENT-LIST}}.
     491
    493492Not using the shell may be preferrable for security reasons.
    494493
    495 On native Windows the {{ARGUMENTLIST}} and {{ENVIRONMENT}} arguments are ignored.
    496 
    497494==== process*
    498495
    499  [procedure] (process* COMMANDLINE [ARGUMENTLIST [ENVIRONMENT]])
     496 [procedure] (process* COMMANDLINE)
     497 [procedure] (process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST])
    500498
    501499Like {{process}} but returns 4 values: an input port from
     
    593591
    594592 [procedure] (current-user-id)
     593 [setter] (set! (current-user-id) UID)
    595594 [procedure] (current-group-id)
     595 [setter] (set! (current-group-id) GID)
    596596 [procedure] (current-effective-user-id)
     597 [setter] (set! (current-effective-user-id) UID)
    597598 [procedure] (current-effective-group-id)
    598 
    599 Return the user- and group-ids of the current process.
     599 [setter] (set! (current-effective-group-id) GID)
     600
     601Get or set the real/effective user- and group-ids of the current process.
    600602
    601603==== process-group-id
     
    654656
    655657These variables contain permission bits as used in {{change-file-mode}}.
    656 
    657 ==== set-user-id!
    658 
    659  [procedure] (set-user-id! UID)
    660  [setter] (set! (current-user-id) UID)
    661 
    662 Sets the effective user id of the current process to {{UID}},
    663 which should be a positive integer.
    664 
    665 ==== set-group-id!
    666 
    667  [procedure] (set-group-id! GID)
    668  [setter] (set! (current-group-id) GID)
    669 
    670 Sets the effective group id of the current process to {{GID}},
    671 which should be a positive integer.
    672658
    673659==== set-process-group-id!
     
    920906==== local-timezone-abbreviation
    921907
    922  [procedure] (local-timezone-abbrevtiation)
     908 [procedure] (local-timezone-abbreviation)
    923909
    924910Returns the abbreviation for the local timezone as a string.
     
    12261212=== Windows specific notes
    12271213
     1214Use of UTF8 encoded strings is for pathnames is not supported. Windows uses a
     121516-bit UNICODE encoding with special system calls for wide-character support.
     1216Only single-byte string encoding can be used.
     1217
     1218==== Procedure Changes
     1219
     1220Exceptions to the above procedure definitions.
     1221
     1222 [procedure] (create-pipe [MODE])
     1223
     1224The optional parameter {{MODE}}, default {{open/binary | open/noinherit}}. This can be {{open/binary}} or
     1225{{open/text}}, optionally or'ed with {{open/noinherit}}.
     1226
     1227 [procedure] (process-wait [PID [NOHANG]])
     1228
     1229{{process-wait}} always returns {{#t}} for a terminated process and only the exit
     1230status is available. (Windows does not provide signals as an interprocess
     1231communication method.)
     1232
     1233 [procedure] (process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])
     1234 [procedure] (process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
     1235 [procedure] (process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
     1236
     1237The optional parameter {{EXACT-FLAG}}, default {{#f}}. When {{#f}} any argument string with
     1238embedded whitespace will be wrapped in quotes. When {{#t}} no such wrapping occurs.
     1239
     1240==== Unsupported Definitions
     1241
    12281242The following definitions are not supported for native Windows builds (compiled with the
    1229 Microsoft tools or with MingW):
     1243Microsoft tools or with MinGW):
    12301244
    12311245 open/noctty  open/nonblock  open/fsync  open/sync
     
    12531267 parent-process-id
    12541268 set-root-directory!
    1255  utc-time->seconds local-timezone-abbreviation
    1256 
    1257 Additionally, the following definitions are only available for Windows:
    1258 
    1259 ==== spawn/overlay
    1260 ==== spawn/wait
    1261 ==== spawn/nowait
    1262 ==== spawn/nowaito
    1263 ==== spawn/detach
     1269 utc-time->seconds
     1270
     1271==== Additional Definitions
     1272
     1273Only available for Windows
     1274
     1275* open/noinherit
     1276
     1277This variable is a mode value for {{create-pipe}}. Useful when spawning a child process.
     1278
     1279* spawn/overlay
     1280* spawn/wait
     1281* spawn/nowait
     1282* spawn/nowaito
     1283* spawn/detach
     1284
    12641285These variables contains special flags that specify the exact semantics of {{process-spawn}}:
    12651286{{spawn/overlay}} replaces the current process with the new one.
     
    12711292==== process-spawn
    12721293
    1273  [procedure] (process-spawn MODE FILENAME ARGUMENT ...)
    1274 
    1275 Creates and runs a new process with the given filename and command-line arguments. {{MODE}} specifies
    1276 how exactly the process should be executed and must be one or more of the {{spawn/...}} flags defined
    1277 above.
     1294 [procedure] (process-spawn MODE COMMAND [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])
     1295
     1296Creates and runs a new process with the given {{COMMAND}} filename and the optional
     1297{{ARGUMENT-LIST}} and {{ENVIRONMENT-LIST}}. {{MODE}} specifies how exactly the process
     1298should be executed and must be one or more of the {{spawn/...}} flags defined above.
     1299
     1300The {{EXACT-FLAG}}, default {{#f}}, controls quote-wrapping of argument strings. When {{#t}}
     1301quote-wrapping is not performed.
     1302
     1303Returns:
     1304* the exit status when synchronous
     1305* the PID when asynchronous
     1306* -1 when failure
    12781307
    12791308
  • chicken/wiki/Unit regex

    r3241 r5220  
    88written by Philip Hazel. See [[http://www.pcre.org]] for information about
    99the particular regexp flavor and extensions provided by this library.
     10
     11To test that PCRE support has been built into Chicken properly, try:
     12
     13<enscript highlight=scheme>
     14(require 'regex)
     15(test-feature? 'pcre) => t
     16</enscript>
    1017
    1118
     
    4148 [-C...]
    4249 ?
     50
     51
     52=== glob?
     53
     54 [procedure] (glob? STRING)
     55
     56Does the {{STRING}} have any "glob" wildcards?
     57
     58A string without any "glob" wildcards does not meet the criteria,
     59even though it technically is a valid "glob" file-pattern.
    4360
    4461
     
    8198Note also that {{string-match}} is implemented by calling
    8299{{string-search}} with the regular expression wrapped in {{^ ... $}}.
     100If invoked with a precompiled regular expression argument (by using
     101{{regexp}}), {{string-match}} is identical to {{string-search}}.
    83102
    84103
  • chicken/wiki/Unit srfi-18

    r2926 r5220  
    7777the number of milliseconds since process startup.
    7878
    79 === time->milliseconds
    80 
    81  [procedure] (time->milliseconds TIME)
    82 
    83 Converts a time object (as created via {{current-time}}) into an exact integer representing
    84 the number of milliseconds since process startup.
    85 
    8679
    8780Previous: [[Unit regex]]
  • chicken/wiki/Unit srfi-4

    r2777 r5220  
    2525Additionally, the following procedures are provided:
    2626
    27 === u8vector->byte-vector
    28 === s8vector->byte-vector
    29 === u16vector->byte-vector
    30 === s16vector->byte-vector
    31 === u32vector->byte-vector
    32 === s32vector->byte-vector
    33 === f32vector->byte-vector
    34 === f64vector->byte-vector
     27=== u8vector->blob
     28=== s8vector->blob
     29=== u16vector->blob
     30=== s16vector->blob
     31=== u32vector->blob
     32=== s32vector->blob
     33=== f32vector->blob
     34=== f64vector->blob
     35=== u8vector->blob/shared
     36=== s8vector->blob/shared
     37=== u16vector->blob/shared
     38=== s16vector->blob/shared
     39=== u32vector->blob/shared
     40=== s32vector->blob/shared
     41=== f32vector->blob/shared
     42=== f64vector->blob/shared
    3543
    36  [procedure] (u8vector->byte-vector U8VECTOR)
    37  [procedure] (s8vector->byte-vector S8VECTOR)
    38  [procedure] (u16vector->byte-vector U16VECTOR)
    39  [procedure] (s16vector->byte-vector S16VECTOR)
    40  [procedure] (u32vector->byte-vector U32VECTOR)
    41  [procedure] (s32vector->byte-vector S32VECTOR)
    42  [procedure] (f32vector->byte-vector F32VECTOR)
    43  [procedure] (f64vector->byte-vector F64VECTOR)
     44 [procedure] (u8vector->blob U8VECTOR)
     45 [procedure] (s8vector->blob S8VECTOR)
     46 [procedure] (u16vector->blob U16VECTOR)
     47 [procedure] (s16vector->blob S16VECTOR)
     48 [procedure] (u32vector->blob U32VECTOR)
     49 [procedure] (s32vector->blob S32VECTOR)
     50 [procedure] (f32vector->blob F32VECTOR)
     51 [procedure] (f64vector->blob F64VECTOR)
     52 [procedure] (u8vector->blob/shared U8VECTOR)
     53 [procedure] (s8vector->blob/shared S8VECTOR)
     54 [procedure] (u16vector->blob/shared U16VECTOR)
     55 [procedure] (s16vector->blob/shared S16VECTOR)
     56 [procedure] (u32vector->blob/shared U32VECTOR)
     57 [procedure] (s32vector->blob/shared S32VECTOR)
     58 [procedure] (f32vector->blob/shared F32VECTOR)
     59 [procedure] (f64vector->blob/shared F64VECTOR)
    4460
    4561Each of these procedures return the contents of the given vector as a
    46 'packed' byte-vector. The byte order in that vector is platform-dependent
    47 (for example little-endian on an '''Intel''' processor). The returned
    48 byte-vector shares memory with the contents of the vector.
     62'packed' blob. The byte order in that vector is platform-dependent
     63(for example little-endian on an '''Intel''' processor). The {{/shared}}
     64variants return a blob that shares memory with the contents of the vector.
    4965
    5066
    51 === byte-vector->u8vector
    52 === byte-vector->s8vector
    53 === byte-vector->u16vector
    54 === byte-vector->s16vector
    55 === byte-vector->u32vector
    56 === byte-vector->s32vector
    57 === byte-vector->f32vector
    58 === byte-vector->f64vector
     67=== blob->u8vector
     68=== blob->s8vector
     69=== blob->u16vector
     70=== blob->s16vector
     71=== blob->u32vector
     72=== blob->s32vector
     73=== blob->f32vector
     74=== blob->f64vector
     75=== blob->u8vector/shared
     76=== blob->s8vector/shared
     77=== blob->u16vector/shared
     78=== blob->s16vector/shared
     79=== blob->u32vector/shared
     80=== blob->s32vector/shared
     81=== blob->f32vector/shared
     82=== blob->f64vector/shared
    5983
    60  [procedure] (byte-vector->u8vector BYTE-VECTOR)
    61  [procedure] (byte-vector->s8vector BYTE-VECTOR)
    62  [procedure] (byte-vector->u16vector BYTE-VECTOR)
    63  [procedure] (byte-vector->s16vector BYTE-VECTOR)
    64  [procedure] (byte-vector->u32vector BYTE-VECTOR)
    65  [procedure] (byte-vector->s32vector BYTE-VECTOR)
    66  [procedure] (byte-vector->f32vector BYTE-VECTOR)
    67  [procedure] (byte-vector->f64vector BYTE-VECTOR)
     84 [procedure] (blob->u8vector BLOB)
     85 [procedure] (blob->s8vector BLOB)
     86 [procedure] (blob->u16vector BLOB)
     87 [procedure] (blob->s16vector BLOB)
     88 [procedure] (blob->u32vector BLOB)
     89 [procedure] (blob->s32vector BLOB)
     90 [procedure] (blob->f32vector BLOB)
     91 [procedure] (blob->f64vector BLOB)
     92 [procedure] (blob->u8vector/shared BLOB)
     93 [procedure] (blob->s8vector/shared BLOB)
     94 [procedure] (blob->u16vector/shared BLOB)
     95 [procedure] (blob->s16vector/shared BLOB)
     96 [procedure] (blob->u32vector/shared BLOB)
     97 [procedure] (blob->s32vector/shared BLOB)
     98 [procedure] (blob->f32vector/shared BLOB)
     99 [procedure] (blob->f64vector/shared BLOB)
    68100
    69101Each of these procedures return a vector where the argument
    70 {{BYTE-VECTOR}} is taken as a 'packed' representation of the contents
    71 of the vector. The argument-byte-vector shares memory with the contents
    72 of the vector.
     102{{BLOB}} is taken as a 'packed' representation of the contents
     103of the vector. The {{/shared}} variants return a vector that
     104shares memory with the contents of the blob.
    73105
    74106
  • chicken/wiki/Unit utils

    r2777 r5220  
    1515==== apropos
    1616
    17  [procedure] (apropos SYMBOL-PATTERN [ENVIRONMENT])
    18 
    19 Displays symbols matching {{SYMBOL-PATTERN}} in the {{ENVIRONMENT}} on the {{(current-output-port)}}.
     17 [procedure] (apropos SYMBOL-PATTERN [ENVIRONMENT] [#:MACROS?])
     18
     19Displays symbols & type matching {{SYMBOL-PATTERN}} in the {{ENVIRONMENT} on the {{(current-output-port)}}.
    2020
    2121; {{SYMBOL-PATTERN}} : A symbol, string, or regex. When symbol or string substring matching is performed.
    22 
    2322; {{ENVIRONMENT}} : An environment. When missing the {{(interaction-environment)}} is assumed.
     23; {{#:MACROS?}} : Keyword argument. A boolean. Include macro symbols? When missing {{#f}} is assumed.
    2424
    2525==== apropos-list
    2626
    27  [procedure] (apropos-list SYMBOL-PATTERN [ENVIRONMENT])
     27 [procedure] (apropos-list SYMBOL-PATTERN [ENVIRONMENT] [#:MACROS?])
    2828
    2929Like {{apropos}} but returns a list of matching symbols.
     
    104104stripped.
    105105
     106==== directory-null?
     107
     108 [procedure] (directory-null? DIRECTORY)
     109
     110Does the {{DIRECTORY}} consist only of path separators and the period?
     111
     112{{DIRECTORY}} may be a string or a list of strings.
     113
    106114
    107115=== Temporary files
     
    143151 [procedure] (for-each-argv-line PROCEDURE)
    144152
    145  Opens each file listed on the command line in order, passing one line
     153Opens each file listed on the command line in order, passing one line
    146154at a time into {{PROCEDURE}}.  The filename {{-}} is interpreted as
    147155{{(current-input-port)}}.  If no arguments are given on the command line
     
    170178until it returns {{#!eof}}, returning a list of the collected results.
    171179
     180==== port-fold
     181
     182 [procedure] (port-map FN ACC THUNK)
     183
     184Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}},
     185passing the {{ACC}} value as the second argument. The {{FN}} result becomes the new
     186{{ACC}} value. When {{THUNK}} returns {{#!eof}}, the last {{FN}} result is returned.
    172187
    173188=== Executing shell commands with formatstring and error checking
     
    194209
    195210
     211=== Funky ports
     212
     213==== make-broadcast-port
     214
     215 [procedure] (make-broadcast-port PORT ...)
     216
     217Returns a custom output port that emits everything written into it to
     218the ports given as {{PORT ...}}. Closing the broadcast port does not close
     219any of the argument ports.
     220
     221==== make-concatenated-port
     222
     223 [procedure] (make-concatenated-port PORT1 PORT2 ...)
     224
     225Returns a custom input port that reads its input from {{PORT1}}, until it
     226is empty, then from {{PORT2}} and so on. Closing the concatenated port
     227does not close any of the argument ports.
     228
     229
    196230===  Miscellaneous handy things
    197231
     
    209243</enscript>
    210244
    211 The list must at least contain 2 elements.
     245The list must contain at least 2 elements.
    212246
    213247==== unshift!
  • chicken/wiki/Using the compiler

    r3241 r5220  
    7878; -disable-interrupts : Equivalent to the {{(disable-interrupts)}} declaration. No interrupt-checks are generated for compiled programs.
    7979
     80; -disable-compiler-macros : disable expansion of compiler macros.
     81
    8082; -disable-stack-overflow-checks : Disables detection of stack overflows. This is equivalent to running the compiled executable with the {{-:o}} runtime option.
    8183
     
    106108; -extension : Mostly equivalent to {{-prelude '(define-extension <NAME>)'}}, where {{<NAME>}} is the basename of the currently compiled file. Note that if you want to compile a file as a normal (dynamically loadable) extension library, you should also pass the {{-shared}} option.
    107109
    108 ; -feature SYMBOL : Registers {{SYMBOL}} to be a valid feature identifier for {{cond-expand}}.
     110; -feature SYMBOL : Registers {{SYMBOL}} to be a valid feature identifier for {{cond-expand}}. Multiple symbols may be given, if comma-separated.
    109111
    110112; -fixnum-arithmetic : Equivalent to {{(fixnum-arithmetic)}} declaration. Assume all mathematical operations use small integer arguments.
     
    169171; -raw : Disables the generation of any implicit code that uses the Scheme libraries (that is all runtime system files besides {{runtime.c}} and {{chicken.h}}).
    170172
    171 ; -require-extension NAME : Loads the extension {{NAME}} before the compilation process commences. This is identical to adding {{(require-extension NAME)}} at the start of the compiled program. If {{-uses NAME}} is also given on the command line, then any occurrences of {{-require-extension NAME}} are replaced with {{(declare (uses NAME))}}.
     173; -require-extension NAME : Loads the extension {{NAME}} before the compilation process commences. This is identical to adding {{(require-extension NAME)}} at the start of the compiled program. If {{-uses NAME}} is also given on the command line, then any occurrences of {{-require-extension NAME}} are replaced with {{(declare (uses NAME))}}. Multiple names may be given and should be separated by {{,}}.
    172174
    173175; -run-time-macros : Makes macros also available at run-time. By default macros are not available at run-time.
     
    181183; -unsafe-libraries : Marks the generated file for being linked with the unsafe runtime system. This should be used when generating shared object files that are to be loaded dynamically. If the marker is present, any attempt to load code compiled with this option will signal an error.
    182184
    183 ; -uses NAME : Use definitions from the library unit {{NAME}}. This is equivalent to {{-prelude "(declare (uses NAME))"}}
     185; -uses NAME : Use definitions from the library unit {{NAME}}. This is equivalent to {{-prelude "(declare (uses NAME))"}}. Multiple arguments may be given, separated by {{,}}.
    184186
    185187; -no-usual-integrations : Specifies that standard procedures and certain internal procedures may be redefined, and can not be inlined. This is equivalent to declaring {{(not usual-integrations)}}.
     
    291293object files together with the runtime system.
    292294
    293 Lets consider an example where your program consists of multiple source files.
     295Let's consider an example where your program consists of multiple source files.
    294296
    295297==== Writing your source files
     
    370372; [parameter] user-pass-2 : Holds a procedure of three arguments, which is called with the canonicalized node-graph as its sole argument. The result is ignored, so this pass has to mutate the node-structure to cause any effect.
    371373
    372 ; [parameter] user-post-analysis-pass : Holds a procedure that will be called after the last performed program analysis. The procedure (when defined) will be called with three arguments: the program database, a getter and a setter-procedure which can be used to access and manipulate the program database, which holds various information about the compiled program. The getter procedure should be called with two arguments: a symbol representing the binding for which information should be retrieved, and a symbol that specifies the database-entry. The current value of the database entry will be returned or {{#f}}, if no such entry is available. The setter procedure is called with three arguments: the symbol and key and the new value. For information about the contents of the program database contact the author.
     374; [parameter] user-post-analysis-pass : Holds a procedure that will be called after every performed program analysis pass. The procedure (when defined) will be called with five arguments: a symbol indicating the analysis pass, the program database, the current node graph, a getter and a setter-procedure which can be used to access and manipulate the program database, which holds various information about the compiled program. The getter procedure should be called with two arguments: a symbol representing the binding for which information should be retrieved, and a symbol that specifies the database-entry. The current value of the database entry will be returned or {{#f}}, if no such entry is available. The setter procedure is called with three arguments: the symbol and key and the new value. For information about the contents of the program database contact the author.
    373375
    374376Loaded code (via the {{-extend}} option) has access to the library
  • chicken/wiki/Using the interpreter

    r2777 r5220  
    203203
    204204 #;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))))
     205 #;2> (set-describer! 'point (lambda (pt o) (print "a point with x=" (point-x pt) " and y=" (point-y pt))))
    206206 #;3> ,d (make-point 1 2)
    207207 a point with x=1 and y=2
     
    242242 (man:help "case-lambda")
    243243
     244Note: Currently the documentation provided by the {{man}} extension corresponds to Chicken's 2.429, one of the last releases whose documentation was in the texinfo format (the format the {{man}} extension parses).
     245
    244246----
    245247
  • chicken/wiki/chicken-setup

    r3241 r5220  
    525525; {{-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.
    526526; {{-i  -docindex}} : Displays the path to the index-page of any installed extension-documentation. If the index page does not exist, it is created.
    527 ; {{-C  -check}} : Downloads the repository-index and lists locally installed extensions for which a newer release is available for download.
    528527; {{-t  -test EXTENSION ...}} : return success if all given extensions are installed
    529528; {{-ls EXTENSION}} : List installed files for extension
    530529; {{-fetch-tree}} : Download and print the repository catalog
     530; {{-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).
    531531; {{-tree FILENAME}} : Download and show the repository catalog
    532532; {{-svn URL}} : Fetch extension from [[http://subversion.tigris.org|Subversion]] repository
  • chicken/wiki/faq

    r3241 r5220  
    2929=== What should I do if I find a bug?
    3030
    31 Send e-mail to {{felix@@call-with-current-continuation.org}}
     31Send e-mail to felix@call-with-current-continuation.org
    3232with some hints about the problem, like
    3333version/build of the compiler, platform, system configuration, code that
     
    163163environment variable.
    164164
    165 
     165=== On Windows source and/or output filenames with embedded whitespace are not found.
     166
     167There is no current workaround. Do not use filenames with embedded whitespace for code. However, command
     168names with embedded whitespace will work correctly.
    166169== Customization
    167170
     
    219222
    220223
    221 == Macros
    222 
    223 === Why doesn't my fancy macro work in compiled code?
     224== Compiled macros
     225
     226=== Why is {{define-macro}} complaining about unbound variables?
    224227
    225228Macro bodies that are defined and used in a compiled source-file are
    226 evaluated during compilation and so have no access to definitions in the
    227 compiled file. Note also that during compile-time macros are only available in
    228 the same source file in which they are defined. Files included via {{include}}
    229 are considered part of the containing file.
     229evaluated during compilation and so have no access to anything created with {{define}}. Use {{define-for-syntax}} instead.
     230
     231=== Why isn't {{load}} properly loading my library of macros?
     232
     233During compile-time, macros are only available in the source file in which they are defined. Files included via {{include}} are considered part of the containing file.
     234
     235=== Why is {{include}} unable to load my hygienic macros?
     236
     237It is not sufficient for the included file to require the {{syntax-case}} extension. Call {{(require-extension syntax-case)}} ''before'' calling {{include}}.
    230238
    231239=== Why are macros not visible outside of the compilation unit in which they are defined?
     
    427435{{fp=}} {{fp>}} {{fp>=}} {{fpneg}} {{fpmax}} {{fpmin}}
    428436{{arithmetic-shift}} {{signum}} {{flush-output}} {{thread-specific}} {{thread-specific-set!}}
    429 {{not-pair?}} {{null-list?}} {{print}} {{print*}} {{u8vector->bytevector}}
    430 {{s8vector->bytevector}} {{u16vector->bytevector}} {{s16vector->bytevector}}
    431 {{u32vector->bytevector}}
    432 {{s32vector->bytevector}} {{f32vector->bytevector}} {{f64vector->bytevector}} {{block-ref}}
    433 {{byte-vector-length}}
     437{{not-pair?}} {{null-list?}} {{print}} {{print*}} {{u8vector->blob/shared}}
     438{{s8vector->blob/shared}} {{u16vector->blob/shared}} {{s16vector->blob/shared}}
     439{{u32vector->blob/shared}}
     440{{s32vector->blob/shared}} {{f32vector->blob/shared}} {{f64vector->blob/shared}} {{block-ref}}
     441{{blob-size}}
    434442{{u8vector-length}}
    435443{{s8vector-length}}
     
    461469{{cpu-time}} {{error}} {{call/cc}} {{any?}}
    462470
     471=== Can I load compiled code at runtime?
     472
     473Yes.
     474You can load compiled at code at runtime with {{load}} just as
     475well as you can load Scheme source code.
     476Compiled code will, of course, run faster.
     477
     478To do this, pass to {{load}} a path for a shared object.
     479Use a form such as {{(load "foo.so")}} and run
     480{{csc -shared foo.scm}} to produce {{foo.so}} from {{foo.scm}} (at
     481which point {{foo.scm}} will no longer be required).
     482
    463483== Garbage collection
    464484
     
    517537</enscript>
    518538
     539Users of *nix-like systems (including Cygwin), may also want to check out [[http://utopia.knoware.nl/~hlub/rlwrap/|rlwrap]].  This program lets you "wrap" another process (e.g. {{rlwrap csi}}) with the readline library, giving you history, autocompletion, and the ability to set the keystroke set. Vi fans can get vi keystrokes by adding "set editing-mode vi" to their {{.inputrc}} file.
     540
     541=== Does code loaded with {{load}} run compiled or interpreted?
     542
     543If you compile a file with a call to {{load}}, the code will be loaded at
     544runtime and, if the file loaded is a Scheme source code file
     545(instead of a shared object), it will be
     546interpreted (even if the caller program is compiled).
     547
    519548== Extensions ==
    520549
  • egg-post-commit.scm

    r4845 r5220  
    5757    (macros "Macros and meta-syntax")
    5858    (misc "Miscellaneous")
     59    (hell "Concurrency and parallelism")
    5960    (obsolete "Unsupported or redundant") ) )
    6061
     
    253254
    254255(define (make-html-from-wiki egg-dir egg)
    255   ; Load these extensions here so admins not using the wiki/streams can still
    256   ; upload regular eggs (so the dependency is optional, only required in order
    257   ; to upload eggs that use the wiki):
    258256  (with-output-to-file (make-pathname egg-dir egg "html")
    259257    (lambda ()
  • ftl/ftl.setup

    r4840 r5220  
    66 'ftl
    77 '("ftl.so" "ftl-static.o")
    8  '((version 0.2)
     8 '((version 0.3)
    99   (documentation "ftl.html")
    1010   (static "ftl-static.o")))
  • futures/futures.meta

    r5 r5220  
    33 (synopsis "Concurrent evaluation of expressions")
    44 (license "BSD")
    5  (category lang-exts)
     5 (category hell)
    66 (files "futures.scm" "futures-base.scm" "futures.html" "futures.setup")
    77 (author "<a href=\"mailto:felix@call-with-current-continuation.org\">felix</a>"))
  • mailbox/mailbox.meta

    r5076 r5220  
    33 (license "BSD")
    44 (egg "mailbox.egg")
    5  (category data)
     5 (category hell)
    66 (author "felix winkelmann and kon lovett")
    77 (files
  • numbers/numbers-base.scm

    r5002 r5220  
    280280  (if (null? args)
    281281      0
    282       (let loop ([args (##sys#slot args 1)] [x (##sys#slot args 0)])
    283         (if (null? args)
    284             x
    285             (loop (##sys#slot args 1) (%+ x (##sys#slot args 0))) ) ) ) )
     282      (let ((x (##sys#slot args 0))
     283            (rest (##sys#slot args 1)))
     284        (cond ((null? rest)
     285               (assert-number x '+)
     286               x)
     287              (else
     288               (let loop ((args rest) (x x))
     289                 (if (null? args)
     290                     x
     291                     (loop (##sys#slot args 1) (%+ x (##sys#slot args 0))) ) ) ) ) ) ) )
    286292
    287293(define (%+ x y)
     
    398404  (if (null? args)
    399405      1
    400       (let loop ([args (##sys#slot args 1)] [x (##sys#slot args 0)])
    401         (if (null? args)
    402             x
    403             (loop (##sys#slot args 1) (%* x (##sys#slot args 0))) ) ) ) )
     406      (let ((x (##sys#slot args 0))
     407            (rest (##sys#slot args 1)))
     408        (cond ((null? rest)
     409               (assert-number x '+)
     410               x)
     411              (else
     412               (let loop ((args rest) (x x))
     413                 (if (null? args)
     414                     x
     415                     (loop (##sys#slot args 1) (%* x (##sys#slot args 0))) ) ) ) ) ) ) )
    404416
    405417(define (%* x y)
  • numbers/numbers.html

    r5003 r5220  
    4848<h3>Version:</h3>
    4949<ul>
     50<li>1.8
     51Single-argument <tt>+</tt> and <tt>*</tt> didn't check argument type [Thanks to Stephen Gilardi]
    5052<li>1.701
    5153Bugfix for compiler macros, undefined symbol [Kon Lovett]
  • numbers/numbers.setup

    r5003 r5220  
    1313  `((syntax)
    1414    (documentation "numbers.html")
    15     (version "1.701")
     15    (version "1.8")
    1616    ,@(if has-exports? `((exports "numbers.exports")) '())
    1717    (require-at-runtime numbers-base)) )
  • object-apply/doc.scm

    r628 r5220  
    2727  `((eggdoc:begin
    2828     (name "object-apply")
    29      (description (p "Cal arbitrary values as functions"))
     29     (description (p "Call arbitrary values as functions"))
    3030     
    3131     (author "Felix L. Winkelmann")
     
    4040      (p "This extension allows user-defined behaviour of calling non-procedural data."
    4141         " When a procedure-call is evaluated with a datum in operator position that is not"
    42          " a procedure, then the following generic function is called:")
     42         " a procedure, then the following TinyCLOS generic function is called:")
    4343
    4444      (generic "(object-apply OPERATOR ARGUMENTS)"
  • suspension/doc.scm

    r1226 r5220  
    8787     (requires
    8888      (url "s11n.html" "s11n")
    89       "CHICKEN must be configure with support for procedure tables")
     89      "CHICKEN must be configured with support for procedure tables")
    9090
    9191     (usage)
  • synch/synch.meta

    r1716 r5220  
    22
    33((synopsis "Synchronization Forms")
    4  (category lang-exts)
     4 (category hell)
    55 (author "Kon Lovett")
    66 (egg "synch.egg")
  • wiki/Metafile reference

    r4980 r5220  
    5757      misc        Miscellaneous
    5858      macros      Macros and meta-syntax
     59      hell        Concurrency and parallelism
    5960
    6061 (needs EXTENSION-ID ...)
  • wiki/The User's Manual

    r5159 r5220  
    33== Introduction
    44
    5 ''(This document describes version 2.630)''
     5''(This document describes version 2.632)''
    66
    77'''CHICKEN is a compiler that translates Scheme source files into C''', which in
  • wiki/Unit library

    r4902 r5220  
    181181==== port-name
    182182
    183  [procedure] (port-name PORT)
     183 [procedure] (port-name [PORT])
    184184
    185185Fetch filename from {{PORT}}. This returns the filename that was
    186186used to open this file.  Returns a special tag string, enclosed into
    187 parentheses for non-file ports.
     187parentheses for non-file ports. {{PORT}} defaults to the value of {{(current-input-port)}}.
    188188
    189189
    190190==== port-position
    191191
    192  [procedure] (port-position PORT)
     192 [procedure] (port-position [PORT])
    193193
    194194Returns the current position of {{PORT}} as two values: row and
    195195column number.  If the port does not support such an operation an error
    196196is signaled. This procedure is currently only available for input ports.
     197{{PORT}} defaults to the value of {{(current-input-port)}}.
    197198
    198199
  • wiki/Unit lolevel

    r4264 r5220  
    1 [[tags: manual]]
     1[[tags: manual internals]]
    22[[toc:]]
    33
  • wiki/chicken-setup

    r4256 r5220  
    346346
    347347;; compile the code into a dynamically loadable shared object
    348 ;; (will generate hello.so or hello.dll on Windows)
     348;; (will generate hello.so)
    349349(compile -s hello.scm)
    350350
     
    352352(install-extension 'hello "hello.so")
    353353</enscript>
    354 
    355 (Note: {{install-extension}} will recognized the {{.so}} extension and automatically
    356 do the right thing on Windows)
    357354
    358355After entering
  • wiki/eggs tutorial

    r5195 r5220  
    8080    (documentation "mpeg3.html")))</enscript>
    8181
    82 Note that the first line will cause {{mpeg3.scm}} to be compiled into {{mpeg3.so}}, which is installed by {{install-extension}}. On Windows, chicken-setup will automatically recognize the {{.so}} extension and
    83 convert it to {{.dll}}.
     82Note that the first line will cause {{mpeg3.scm}} to be compiled into
     83{{mpeg3.so}}, which is installed by {{install-extension}}.
    8484
    8585If your extension includes syntax it should:
  • wiki/faq

    r4444 r5220  
    410410and compiler settings:
    411411
    412  + * - / quotient eq? eqv? equal? apply c...r values call-with-values
    413  list-ref null? length not char? string? symbol? vector? pair? procedure?
    414  boolean? number? complex? rational? real? exact? inexact? list? eof-object?
    415  string-ref string-set! vector-ref vector-set! char=? char<? char>? char<=? char>=?
    416  char-numeric? char-alphabetic? char-whitespace? char-upper-case?
    417  char-lower-case? char-upcae char-downcase list-tail assv memv memq assoc
    418  member set-car! set-cdr! abs exp sin cos tan log asin acos atan sqrt
    419  zero? positive? negative? vector-length string-length char->integer
    420  integer->char inexact->exact = > < >= <= for-each map substring
    421  string-append gcd lcm list exact->inexact string->number number->string
    422  even? odd? remainder floor ceiling truncate round cons vector string
    423  string=? string-ci=? make-vector call-with-current-continuation
     412 {{+}} {{*}} {{-}} {{/}} {{quotient}} {{eq?}} {{eqv?}} {{equal?}} {{apply}} {{c...r}} {{values}} {{call-with-values}}
     413 {{list-ref}} {{null?}} {{length}} {{not}} {{char?}} {{string?}} {{symbol?}} {{vector?}} {{pair?}} {{procedure?}}
     414 {{boolean?}} {{number?}} {{complex?}} {{rational?}} {{real?}} {{exact?}} {{inexact?}} {{list?}} {{eof-object?}}
     415 {{string-ref}} {{string-set!}} {{vector-ref}} {{vector-set!}} {{char=?}} {{char<?}} {{char>?}} {{char<=?}} {{char>=?}}
     416 {{char-numeric?}} {{char-alphabetic?}} {{char-whitespace?}} {{char-upper-case?}}
     417 {{char-lower-case?}} {{char-upcae}} {{char-downcase}} {{list-tail}} {{assv}} {{memv}} {{memq}} {{assoc}}
     418 {{member}} {{set-car!}} {{set-cdr!}} {{abs}} {{exp}} {{sin}} {{cos}} {{tan}} {{log}} {{asin}} {{acos}} {{atan}} {{sqrt}}
     419 {{zero?}} {{positive?}} {{negative?}} {{vector-length}} {{string-length}} {{char->integer}}
     420 {{integer->char}} {{inexact->exact}} {{=}} {{>}} {{<}} {{>=}} {{<=}} {{for-each}} {{map}} {{substring}}
     421 {{string-append}} {{gcd}} {{lcm}} {{list}} {{exact->inexact}} {{string->number}} {{number->string}}
     422 {{even?}} {{odd?}} {{remainder}} {{floor}} {{ceiling}} {{truncate}} {{round}} {{cons}} {{vector}} {{string}}
     423 {{string=?}} {{string-ci=?}} {{make-vector}} {{call-with-current-continuation}}
     424 {{write-char}} {{read-string}}
    424425
    425426The following extended bindings are handled specially:
     
    468469{{locative-ref}} {{locative-set!}} {{locative?}} {{locative->object}} {{identity}}
    469470{{cpu-time}} {{error}} {{call/cc}} {{any?}}
     471{{substring=?}} {{substring-ci=?}} {{substring-index}} {{substring-index-ci}}
    470472
    471473=== Can I load compiled code at runtime?
  • wiki/ftl

    r4961 r5220  
    877877== Version history
    878878
     879; 0.3 : bugfixes in {{v=string}} and {{v=vector}} by Thomas Chust
    879880; 0.2 : added {{o=string}} and {{a=string}} [by Thomas Chust]
    880881; 0.1 : initial release, based on Sergei Egorov's implementation
Note: See TracChangeset for help on using the changeset viewer.