Changeset 16012 in project


Ignore:
Timestamp:
09/21/09 11:17:29 (10 years ago)
Author:
Ivan Raikov
Message:

merged release with prerelease

Location:
chicken/branches/release
Files:
52 edited
1 copied

Legend:

Unmodified
Added
Removed
  • chicken/branches/release

  • chicken/branches/release/NEWS

    r15303 r16012  
     14.2.0
     2
     3- added compiler option `-emit-all-import-libraries'
     4- added `reexport'
     5- added compiler and interpreter option `-setup-mode'
     6- various minor performance improvements
     7- fix for 'create-directory' when parents wanted
     8- `for-each-line' and `for-each-argv-line' have been deprecated
     9- chicken-install tries alternative servers if server responds with error
     10- fixed load bug (ticket #72)
     11- new library procedure `get-condition-property'
     12- many mingw build fixes (thanks tp Fadi Moukayed)
     13- setup-api: deprecated `cross-chicken' (use `cond-expand' or
     14  `feature?' instead)
     15- added topological-sort to data-structures unit; chicken-install
     16  sorts dependencies before installing them
     17- "-optimize-level 2" enables inlining by default
     18- disable executable stack in assembly code modules (patch by
     19  Zbigniew, reported by Marijn Schouten)
     20- csc now always exits with a status code of 1 on errors (patch by Zbigniew)
     21
     22
    1234.1.0
    224
     
    931- Added command-line option "-r5rs-syntax" to disable CHICKEN-specific
    1032  read-syntax
    11 - Added compiler command-line-option "-no-compiler-syntax"
    12 - Deprecated "getenv" (use "get-environment-variable" instead)
    1333- Removed "macro?" and "undefine-macro!"
    1434- Support for Microsoft Visual Studio / MSVC has been dropped
     
    2747  added "socket?", "block-device?" and "character-device?", deprecated
    2848  redundant "stat-..." procedures
    29 - Also in Posix unit: "canonical-path" has been deprecated, "normalize-pathname"
    30   from the "files" unit provides now most of the functionality
    3149- Added "directory-exists?"
    3250- "(for-each (lambda ...) X)" is compiled as a loop
  • chicken/branches/release/README

    r15293 r16012  
    44  (c) 2008-2009, The Chicken Team
    55
    6   version 4.1.0
    7 
     6  version 4.2.0
    87
    98 1. Introduction:
  • chicken/branches/release/TODO

    r15293 r16012  
    5050
    5151** tools
    52 *** chicken-bug: SMTP servers not accessible
    53 
    54 ** build
    55 *** somehow get SONAME to work
    56 *** integrate and build/install chicken-base.scm
    57 
    58 ** tests
    59 *** should run without installation
    60 
    61 ** setting nursery default size doesn't seem to work properly (reported by Zbigniew)
     52*** chicken-bug: SMTP servers not accessible (greylisting)
    6253
    6354
     
    8071*** check phase separation and module access
    8172**** see "expander" above
     73*** consider adding support for unnamed modules
    8274
    8375** compiler
    8476*** (csc) generate object-files in /tmp (or TMPDIR)?
     77*** try to improve inlining (single calls should be inlinable)
     78    Currently only "simple" procedures are inlined, possibly because accessed variables
     79    may not be lexically visible but access to globals should ok, or not?
     80*** option ("-M") to compile file as unnamed module (importing scheme + chicken)
    8581
    8682** setup/install
     
    9692*** Use record-descriptors instead of symbols as 1st slot in structure objects?
    9793**** see Kon's proposal for new record-descriptors in "misc/Chicken Runtime Data Type Proposal"
     94*** Weak locatives can probably be used to implement weak hash-tables
    9895
    9996** syntax-error
     
    116113*** add support for keyword arguments and check even length and available keywords
    117114
     115** libraries
     116*** analyse usage statistics ("-debug v") of all core libraries
     117
    118118
    119119* wiki
    120120
    121121** compatibility page
    122 
    123 
    124 * extensions
    125 
    126 ** check status of `s48-modules'
    127122
    128123
     
    141136*** needs declaration or option, >= -O2
    142137
    143 ** when inlining, consing arg-list with "list" may make get-keyword possible foldable
     138** when inlining, consing arg-list with "list" may make get-keyword possibly foldable
    144139
    145140** compiler-support for get-keyword ?
  • chicken/branches/release/batch-driver.scm

    r15293 r16012  
    3030  (disable-warning var))
    3131
    32 
    33 (private
    34  compiler
    35   compiler-arguments process-command-line dump-nodes dump-undefined-globals
    36   default-standard-bindings default-extended-bindings
    37   foldable-bindings dump-defined-globals
    38   compiler-cleanup-hook disabled-warnings local-definitions inline-output-file
    39   file-io-only undefine-shadowed-macros profiled-procedures
    40   unit-name insert-timer-checks used-units inline-max-size mark-variable inline-locally
    41   debugging perform-lambda-lifting! disable-stack-overflow-checking
    42   foreign-declarations emit-trace-info block-compilation line-number-database-size
    43   target-heap-size target-stack-size target-heap-growth target-heap-shrinkage
    44   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    45   target-initial-heap-size postponed-initforms
    46   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    47   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    48   broken-constant-nodes inline-substitutions-enabled compiler-syntax-statistics
    49   emit-profile profile-lambda-list profile-lambda-index profile-info-vector-name
    50   direct-call-ids foreign-type-table first-analysis emit-closure-info
    51   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database scan-toplevel-assignments
    52   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    53   reorganize-recursive-bindings substitution-table simplify-named-call emit-unsafe-marker
    54   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    55   transform-direct-lambdas! source-filename standalone-executable compiler-syntax-enabled
    56   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    57   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    58   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    59   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    60   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    61   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list external-protos-first
    62   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    63   topological-sort print-version print-usage initialize-analysis-database dump-exported-globals
    64   default-declarations units-used-by-default words-per-flonum default-debugging-declarations
    65   default-profiling-declarations default-optimization-passes
    66   file-requirements import-libraries inline-globally scrutinize do-scrutinize enable-inline-files
    67   foreign-string-result-reserve parameter-limit eq-inline-operator optimizable-rest-argument-operators
    68   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    69   chop-separator chop-extension display-real-name-table display-line-number-database explicit-use-flag
    70   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    71   do-lambda-lifting compiler-warning emit-global-inline-file load-inline-file
    72   foreign-argument-conversion foreign-result-conversion
    73   load-identifier-database load-type-database
    74   no-bound-checks no-argc-checks no-procedure-checks)
    75 
    76 
     32(include "compiler-namespace")
    7733(include "tweaks")
    7834
     
    258214    (when (and dynamic (memq 'unsafe-libraries options))
    259215      (set! emit-unsafe-marker #t) )
     216    (when (memq 'setup-mode options)
     217      (set! ##sys#setup-mode #t))
    260218    (when (memq 'disable-interrupts options) (set! insert-timer-checks #f))
    261219    (when (memq 'fixnum-arithmetic options) (set! number-type 'fixnum))
     
    602560                         (dump-undefined-globals db))
    603561                       (when (memq 'd debugging-chicken)
    604                          (dump-defined-globals db)) )
     562                         (dump-defined-globals db))
     563                       (when (memq 'v debugging-chicken)
     564                         (dump-global-refs db)) )
    605565                     (set! first-analysis #f)
    606566                     (end-time "analysis")
  • chicken/branches/release/benchmarks/cscbench.scm

    r15293 r16012  
    99(define cc "`csc -cc-name`")
    1010(define chicken "chicken")
     11
     12(define +chicken-format+ "~A ~A -quiet -no-warnings -heap-size 16m -output-file tmpfile.c ~A ~A")
     13(define +cc-format+
     14  (cond-expand
     15    (macos      "~a ~a -s -I.. tmpfile.c -o tmpfile ../lib~achicken.a -lm")
     16    (else       "~a ~a -I.. tmpfile.c -o tmpfile ../lib~achicken.a -lm") ) )
    1117
    1218(define (abort-run) #f)
     
    5258
    5359(define (compile-and-run file decls options coptions unsafe)
    54   (system* "~A ~A -quiet -no-warnings -heap-size 16m -output-file tmpfile.c ~A ~A"
    55            chicken file decls options)
    56   (system* "~a ~a -s -I.. tmpfile.c -o tmpfile ../lib~achicken.a -lm"
    57            cc coptions
    58            (if unsafe "u" ""))
     60  (system* +chicken-format+ chicken file decls options)
     61  (system* +cc-format+ cc coptions (if unsafe "u" ""))
    5962  (let ((time (call-with-current-continuation
    6063               (lambda (abort)
  • chicken/branches/release/buildversion

    r15293 r16012  
    1 4.1.0
     14.2.0
     2
  • chicken/branches/release/c-backend.scm

    r15293 r16012  
    2929
    3030
    31 (private compiler
    32   compiler-arguments process-command-line find-early-refs
    33   default-standard-bindings default-extended-bindings
    34   foldable-bindings
    35   installation-home optimization-iterations debugging cleanup
    36   file-io-only
    37   unit-name insert-timer-checks used-units inlining external-variables
    38   foreign-declarations emit-trace-info block-compilation line-number-database-size
    39   target-heap-size target-stack-size target-heap-growth target-heap-shrinkage
    40   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    41   target-initial-heap-size disable-stack-overflow-checking
    42   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants
    43   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    44   encode-literal
    45   broken-constant-nodes inline-substitutions-enabled
    46   direct-call-ids foreign-type-table first-analysis block-variable-literal?
    47   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database
    48   scan-toplevel-assignments
    49   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations
    50   perform-pre-optimization!
    51   reorganize-recursive-bindings substitution-table simplify-named-call find-inlining-candidates perform-inlining!
    52   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub
    53   expand-foreign-lambda*
    54   transform-direct-lambdas! target-include-file emit-unsafe-marker
    55   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    56   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    57   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    58   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    59   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node
    60   expression-has-side-effects? source-info->string
    61   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    62   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables
    63   scan-free-variables external-protos-first emit-closure-info
    64   topological-sort print-version print-usage initialize-analysis-database
    65   generate-external-variables real-name real-name2 unique-id
    66   default-declarations units-used-by-default words-per-flonum big-fixnum?
    67   foreign-string-result-reserve parameter-limit eq-inline-operator optimizable-rest-argument-operators
    68   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    69   default-optimization-iterations generate-foreign-callback-header generate-foreign-callback-stub-prototypes
    70   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    71   foreign-argument-conversion foreign-result-conversion)
    72 
     31(include "compiler-namespace")
    7332(include "tweaks")
    7433
  • chicken/branches/release/c-platform.scm

    r15293 r16012  
    2929
    3030
    31 (private compiler
    32   compiler-arguments process-command-line
    33   default-standard-bindings default-extended-bindings
    34   foldable-bindings non-foldable-bindings
    35   installation-home debugging intrinsic?
    36   dump-nodes unlikely-variables
    37   unit-name insert-timer-checks used-units inlining
    38   foreign-declarations block-compilation line-number-database-size
    39   target-heap-size target-stack-size
    40   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    41   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    42   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    43   broken-constant-nodes inline-substitutions-enabled
    44   direct-call-ids foreign-type-table first-analysis
    45   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database scan-toplevel-assignments
    46   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    47   reorganize-recursive-bindings substitution-table simplify-named-call find-inlining-candidates perform-inlining!
    48   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    49   transform-direct-lambdas! decompose-lambda-list rewrite
    50   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    51   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    52   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    53   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    54   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    55   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    56   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    57   topological-sort print-version print-usage initialize-analysis-database
    58   default-declarations default-debugging-declarations units-used-by-default words-per-flonum
    59   parameter-limit eq-inline-operator optimizable-rest-argument-operators
    60   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    61   target-include-file default-profiling-declarations
    62   default-optimization-passes internal-bindings big-fixnum?
    63   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    64   foreign-argument-conversion foreign-result-conversion)
    65 
    66 
     31(include "compiler-namespace")
    6732(include "tweaks")
    6833
     
    12691    analyze-only dynamic scrutinize no-argc-checks no-procedure-checks
    12792    no-bound-checks no-procedure-checks-for-usual-bindings no-compiler-syntax
    128     no-parentheses-synonyms no-symbol-escape r5rs-syntax) )
     93    no-parentheses-synonyms no-symbol-escape r5rs-syntax emit-all-import-libraries
     94    setup-mode) )
    12995
    13096(define valid-compiler-options-with-argument
     
    574540(rewrite 'number? 2 1 "C_i_numberp" #t #f)
    575541(rewrite 'complex? 2 1 "C_i_numberp" #t #f)
    576 (rewrite 'rational? 2 1 "C_i_numberp" #t #f)
     542(rewrite 'rational? 2 1 "C_i_rationalp" #t #f)
    577543(rewrite 'real? 2 1 "C_i_numberp" #t #f)
    578544(rewrite 'integer? 2 1 "C_i_integerp" #t #f)
  • chicken/branches/release/chicken-install.scm

    r15293 r16012  
    132132          (else #f)))
    133133
     134  (define (meta-dependencies meta)
     135    (append
     136     (deps 'depends meta)
     137     (deps 'needs meta)
     138     (if *run-tests* (deps 'test-depends meta) '())))
     139
    134140  (define (outdated-dependencies meta)
    135     (let ((ds (append
    136                (deps 'depends meta)
    137                (deps 'needs meta)
    138                (if *run-tests* (deps 'test-depends meta) '()))))
     141    (let ((ds (meta-dependencies meta)))
    139142      (let loop ((deps ds) (missing '()) (upgrade '()))
    140143        (if (null? deps)
     
    172175
    173176  (define *eggs+dirs+vers* '())
     177  (define *dependencies* '())
    174178  (define *checked* '())
    175   (define *csi* (shellpath (make-pathname *program-path* "csi")))
    176  
     179  (define *csi* (shellpath (make-pathname *program-path* (foreign-value "C_CSI_PROGRAM" c-string))))
     180
    177181  (define (try-extension name version trans locn)
    178182    (condition-case
     
    190194       (print "HTTP protocol error")
    191195       (values #f "") ]
     196      [e (exn setup-download-error)
     197         (print "Server error:")
     198         (print-error-message e)
     199         (values #f "")]
    192200      [e ()
    193201       (abort e) ] ) )
     
    239247                  (unless dir (error "extension or version not found"))
    240248                  (print " " name " located at " dir)
    241                   (set! *eggs+dirs+vers* (alist-cons name (list dir ver) *eggs+dirs+vers*)) ) ) ] ) )
     249                  (set! *eggs+dirs+vers* (cons (list name dir ver) *eggs+dirs+vers*)) ) ) ] ) )
    242250     eggs)
    243251    (unless *retrieve-only*
     
    251259                      (print "checking dependencies for `" (car e+d+v) "' ...")
    252260                      (let-values ([(missing upgrade) (outdated-dependencies meta)])
     261                        (set! *dependencies*
     262                          (cons
     263                           (cons (car e+d+v) (append missing upgrade))
     264                           *dependencies*))
    253265                        (when (pair? missing)
    254266                          (print " missing: " (string-intersperse missing ", "))
     
    277289    (conc
    278290     *csi*
    279      " -bnq -e \"(require-library setup-api)\" -e \"(import setup-api)\""
     291     " -bnq -setup-mode -e \"(require-library setup-api)\" -e \"(import setup-api)\""
    280292     (sprintf " -e \"(extension-name-and-version '(\\\"~a\\\" \\\"~a\\\"))\"" (car e+d+v) (caddr e+d+v))
    281293     (if (sudo-install) " -e \"(sudo-install #t)\"" "")
     
    289301    (retrieve eggs)
    290302    (unless *retrieve-only*
    291       (for-each ; we assume the order reflects the dependency tree...
    292        (lambda (e+d+v)
    293          (print "installing " (car e+d+v) #\: (caddr e+d+v) " ...")
    294          (print "changing current directory to " (cadr e+d+v))
    295          (parameterize ((current-directory (cadr e+d+v)))
    296            (let ([cmd (make-install-command e+d+v)])
    297              (print "  " cmd)
    298              ($system cmd))
    299            (when (and *run-tests*
    300                       (file-exists? "tests")
    301                       (directory? "tests")
    302                       (file-exists? "tests/run.scm") )
    303              (current-directory "tests")
    304              (let ((cmd (sprintf "~a -s run.scm ~a" *csi* (car e+d+v))))
    305                (print "  " cmd)
    306                ($system cmd)))))
    307        *eggs+dirs+vers*)))
     303      (let ((dag (reverse (topological-sort *dependencies* string=?))))
     304        (print "install order:")
     305        (pp dag)
     306        (for-each
     307         (lambda (e+d+v)
     308           (print "installing " (car e+d+v) #\: (caddr e+d+v) " ...")
     309           (print "changing current directory to " (cadr e+d+v))
     310           (parameterize ((current-directory (cadr e+d+v)))
     311             (let ([cmd (make-install-command e+d+v)])
     312               (print "  " cmd)
     313               ($system cmd))
     314             (when (and *run-tests*
     315                        (file-exists? "tests")
     316                        (directory? "tests")
     317                        (file-exists? "tests/run.scm") )
     318               (current-directory "tests")
     319               (let ((cmd (sprintf "~a -s run.scm ~a" *csi* (car e+d+v))))
     320                 (print "  " cmd)
     321                 ($system cmd)))))
     322         (map (cut assoc <> *eggs+dirs+vers*) dag)))))
    308323
    309324  (define (cleanup)
     
    368383  -l   -location LOCATION       install from given location instead of default
    369384  -t   -transport TRANSPORT     use given transport instead of default
    370   -s   -sudo                    use sudo(1) for installing or removing files
     385  -s   -sudo                    use sudo(1) for filesystem operations
    371386  -r   -retrieve                only retrieve egg into current directory, don't install
    372387  -n   -no-install              do not install, just build (implies `-keep')
  • chicken/branches/release/chicken.h

    r15293 r16012  
    319319#if defined(C_WINDOWS_GUI)
    320320# define C_MICROSOFT_WINDOWS
     321# include <windows.h>
     322# ifndef WINAPI
     323#  define WINAPI
     324# endif
    321325#else
    322326# define C_GENERIC_CONSOLE
     
    15281532C_fctexport C_word C_fcall C_i_stringp(C_word x) C_regparm;
    15291533C_fctexport C_word C_fcall C_i_numberp(C_word x) C_regparm;
     1534C_fctexport C_word C_fcall C_i_rationalp(C_word x) C_regparm;
    15301535C_fctexport C_word C_fcall C_i_integerp(C_word x) C_regparm;
    15311536C_fctexport C_word C_fcall C_i_flonump(C_word x) C_regparm;
  • chicken/branches/release/chicken.scm

    r15293 r16012  
    2929  (uses chicken-syntax srfi-1 srfi-4 utils files support compiler optimizer scrutinizer driver
    3030        platform backend srfi-69)
    31   (run-time-macros) )                   ;*** later: compile-syntax
     31  (compile-syntax) )                   
    3232
    3333
    34 (private compiler
    35   compiler-arguments
    36   default-standard-bindings default-extended-bindings
    37   foldable-bindings
    38   installation-home optimization-iterations process-command-line
    39   file-io-only nonwinding-call/cc debugging
    40   unit-name insert-timer-checks used-units zap-strings-flag
    41   foreign-declarations debugging-executable block-compilation line-number-database-size
    42   target-heap-size target-stack-size
    43   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    44   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    45   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    46   broken-constant-nodes inline-substitutions-enabled compiler-warning
    47   direct-call-ids foreign-type-table first-analysis
    48   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database scan-toplevel-assignments
    49   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    50   reorganize-recursive-bindings substitution-table simplify-named-call
    51   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    52   transform-direct-lambdas!
    53   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    54   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    55   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    56   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    57   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    58   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    59   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    60   topological-sort print-version print-usage initialize-analysis-database
    61   default-declarations units-used-by-default words-per-flonum
    62   foreign-string-result-reserve parameter-limit default-output-filename eq-inline-operator optimizable-rest-argument-operators
    63   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    64   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    65   foreign-argument-conversion foreign-result-conversion)
    66 
    67 
     34(include "compiler-namespace")
    6835(include "tweaks")
    6936
  • chicken/branches/release/compiler.scm

    r15293 r16012  
    259259
    260260
    261 (private compiler
    262   compiler-arguments process-command-line explicit-use-flag
    263   default-standard-bindings default-extended-bindings
    264   foldable-bindings llist-length
    265   installation-home decompose-lambda-list external-to-pointer defconstant-bindings constant-declarations
    266   copy-node! error-is-extended-binding toplevel-scope toplevel-lambda-id
    267   unit-name insert-timer-checks used-units external-variables require-imports-flag
    268   profile-info-vector-name finish-foreign-result pending-canonicalizations
    269   foreign-declarations emit-trace-info block-compilation line-number-database-size
    270   make-block-variable-literal block-variable-literal? block-variable-literal-name
    271   target-heap-size target-stack-size valid-c-identifier? profiled-procedures standalone-executable
    272   target-initial-heap-size internal-bindings source-filename dump-nodes source-info->string
    273   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    274   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    275   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    276   broken-constant-nodes inline-substitutions-enabled loop-lambda-names expand-profile-lambda
    277   profile-lambda-list profile-lambda-index emit-profile expand-profile-lambda
    278   direct-call-ids foreign-type-table first-analysis callback-names disabled-warnings
    279   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database! scan-toplevel-assignments
    280   compiler-warning variable-visible? hide-variable mark-variable inline-locally
    281   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    282   reorganize-recursive-bindings substitution-table simplify-named-call inline-max-size
    283   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub
    284   expand-foreign-lambda* data-declarations emit-control-file-item expand-foreign-primitive
    285   process-declaration external-protos-first basic-literal? rewrite
    286   transform-direct-lambdas! expand-foreign-callback-lambda* debugging emit-unsafe-marker
    287   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    288   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    289   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    290   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    291   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    292   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    293   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    294   topological-sort print-version print-usage initialize-analysis-database csc-control-file
    295   estimate-foreign-result-location-size inline-output-file compiler-syntax-enabled
    296   expand-foreign-callback-lambda default-optimization-passes default-optimization-passes-when-trying-harder
    297   units-used-by-default words-per-flonum disable-stack-overflow-checking
    298   parameter-limit eq-inline-operator optimizable-rest-argument-operators postponed-initforms
    299   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    300   make-random-name final-foreign-type real-name-table real-name set-real-name! safe-globals-flag
    301   location-pointer-map inline-globally enable-inline-files
    302   local-definitions export-variable variable-mark intrinsic? do-scrutinize
    303   undefine-shadowed-macros process-lambda-documentation emit-syntax-trace-info
    304   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    305   do-lambda-lifting file-requirements emit-closure-info
    306   foreign-argument-conversion foreign-result-conversion foreign-type-convert-argument foreign-type-convert-result
    307   big-fixnum? import-libraries unlikely-variables)
    308 
     261(include "compiler-namespace")
    309262
    310263(define (d arg1 . more)
     
    12951248  (define (strip x)                     ; raw symbol
    12961249    (##sys#strip-syntax x se))
     1250  (define stripu ##sys#strip-syntax)
    12971251  (call-with-current-continuation
    12981252   (lambda (return)
     
    13021256     (case (##sys#strip-syntax (car spec)) ; no global aliasing
    13031257       ((uses)
    1304         (let ((us (strip (cdr spec))))
     1258        (let ((us (stripu (cdr spec))))
    13051259          (apply register-feature! us)
    13061260          (when (pair? us)
     
    13131267       ((unit)
    13141268        (check-decl spec 1 1)
    1315         (let* ([u (strip (cadr spec))]
     1269        (let* ([u (stripu (cadr spec))]
    13161270               [un (string->c-identifier (stringify u))] )
    13171271          (when (and unit-name (not (string=? unit-name un)))
     
    20121966                    (cond (assigned
    20131967                           (debugging
    2014                             'i "global inline candidate was assigned and will not be inlined"
     1968                            'i "global inlining candidate was assigned and will not be inlined"
    20151969                            sym)
    20161970                           (mark-variable sym '##compiler#inline-global 'no))
    20171971                          (else
    20181972                           (let ((lparams (node-parameters n)))
    2019                              (put! db (first lparams) 'simple #t)
     1973                             (put! db (first lparams) 'simple #t) ;XXX hack
    20201974                             (quick-put! plist 'inlinable #t)
    20211975                             (quick-put! plist 'local-value n))))))))
  • chicken/branches/release/csc.scm

    r15293 r16012  
    131131    -no-symbol-escape -no-parentheses-synonyms -r5rs-syntax
    132132    -no-argc-checks -no-bound-checks -no-procedure-checks -no-compiler-syntax
     133    -emit-all-import-libraries -setup-mode
    133134    -no-procedure-checks-for-usual-bindings))
    134135
     
    153154    (|-X| "-extend")
    154155    (|-N| "-no-usual-integrations")
     156    (|-J| "-emit-all-import-libraries")
    155157    (-x "-explicit-use")
    156158    (-u "-unsafe")
     
    315317    -j -emit-import-library MODULE write compile-time module information into
    316318                                    separate file
     319    -J -emit-all-import-libraries  emit import-libraries for all defined modules
    317320    -no-compiler-syntax            disable expansion of compiler-macros
    318321
     
    390393                                    (don't generate `main()')
    391394    -W  -windows                   compile as Windows GUI application
    392                                     (MSVC only)
    393395    -R  -require-extension NAME    require extension and import in compiled
    394396                                    code
  • chicken/branches/release/csi.scm

    r15293 r16012  
    2727
    2828(declare
    29   (uses chicken-syntax srfi-69 ports) ; is here because a bootstrap from an older chicken may not make
    30   (usual-integrations)                  ;  this used automatically
     29  (uses chicken-syntax srfi-69 ports extras)
     30  (usual-integrations)
    3131  (disable-interrupts)
    3232  (disable-warning var)
     
    109109        -sx PATHNAME              same as `-s', but print each expression
    110110                                   as it is evaluated
     111        -setup-mode               prefer the current directory when locating extensions
    111112    -R  -require-extension NAME   require extension and import before
    112113                                   executing code
     
    836837  '("-ss" "-sx" "-script" "-version" "-help" "--help" "-feature" "-eval"
    837838    "-case-insensitive" "-keyword-style" "-no-parentheses-synonyms" "-no-symbol-escape"
    838     "-r5rs-syntax"
     839    "-r5rs-syntax" "-setup-mode"
    839840    "-require-extension" "-batch" "-quiet" "-no-warnings" "-no-init"
    840841    "-include-path" "-release" "-print" "-pretty-print" "--") )
     
    865866(define-constant simple-options
    866867  '("--" "-b" "-batch" "-q" "-quiet" "-n" "-no-init" "-w" "-no-warnings" "-i" "-case-insensitive"
    867     "-no-parentheses-synonyms" "-no-symbol-escape" "-r5rs-syntax"
     868    "-no-parentheses-synonyms" "-no-symbol-escape" "-r5rs-syntax" "-setup-mode"
    868869    ; Not "simple" but processed early
    869870    "-ss" "-sx" "-s" "-script") )
     
    927928        (print-banner)
    928929        (exit 0) )
     930      (when (member "-setup-mode" args)
     931        (set! ##sys#setup-mode #t))
    929932      (when (member "-release" args)
    930933        (print (chicken-version))
     
    976979             (repl)
    977980             (##sys#write-char-0 #\newline ##sys#standard-output) ) )
    978         (let* ([arg (car args)]
    979                #;[len (string-length arg)] )
     981        (let* ((arg (car args)))
    980982          (cond ((member arg simple-options) )
    981983                ((member arg complex-options)
  • chicken/branches/release/data-structures.import.scm

    r13240 r16012  
    7575   sort!
    7676   sorted?
     77   topological-sort
    7778   string-chomp
    7879   string-chop
  • chicken/branches/release/data-structures.scm

    r13859 r16012  
    781781
    782782
     783;;;  Simple topological sort:
     784;
     785; Taken from SLIB (slightly adapted): Copyright (C) 1995 Mikael Djurfeldt
     786
     787(define (topological-sort dag pred)
     788  (if (null? dag)
     789      '()
     790      (let* ((adj-table '())
     791             (sorted '()))
     792
     793        (define (insert x y)
     794          (let loop ([at adj-table])
     795            (cond [(null? at) (set! adj-table (cons (cons x y) adj-table))]
     796                  [(pred x (caar at)) (set-cdr! (car at) y)]
     797                  [else (loop (cdr at))] ) ) )
     798       
     799        (define (lookup x)
     800          (let loop ([at adj-table])
     801            (cond [(null? at) #f]
     802                  [(pred x (caar at)) (cdar at)]
     803                  [else (loop (cdr at))] ) ) )
     804       
     805        (define (visit u adj-list)
     806          ;; Color vertex u
     807          (insert u 'colored)
     808          ;; Visit uncolored vertices which u connects to
     809          (for-each (lambda (v)
     810                      (let ((val (lookup v)))
     811                        (if (not (eq? val 'colored))
     812                            (visit v (or val '())))))
     813                    adj-list)
     814          ;; Since all vertices downstream u are visited
     815          ;; by now, we can safely put u on the output list
     816          (set! sorted (cons u sorted)) )
     817       
     818        ;; Hash adjacency lists
     819        (for-each (lambda (def) (insert (car def) (cdr def)))
     820                  (cdr dag))
     821        ;; Visit vertices
     822        (visit (caar dag) (cdar dag))
     823        (for-each (lambda (def)
     824                    (let ((val (lookup (car def))))
     825                      (if (not (eq? val 'colored))
     826                          (visit (car def) (cdr def)))))
     827                  (cdr dag))
     828        sorted) ) )
     829
     830
    783831;;; Binary search:
    784832
  • chicken/branches/release/distribution/manifest

    r15293 r16012  
    258258defaults.make
    259259private-namespace.scm
     260compiler-namespace.scm
    260261scripts/scheme
    261262scripts/tools.scm
  • chicken/branches/release/eval.scm

    r15293 r16012  
    10961096(define repository-path ##sys#repository-path)
    10971097
     1098(define ##sys#setup-mode #f)
     1099
    10981100(define ##sys#find-extension
    10991101  (let ((file-exists? file-exists?)
     
    11101112                 p0) ) )
    11111113          (let loop ((paths (##sys#append
     1114                             (if ##sys#setup-mode '(".") '())
    11121115                             (if rp (list rp) '())
    11131116                             (if inc? ##sys#include-pathnames '())
    1114                              '("."))) )
     1117                             (if ##sys#setup-mode '() '("."))) ))
    11151118            (and (pair? paths)
    11161119                 (let ((pa (##sys#slot paths 0)))
     
    11971200      (define (add-req id syntax?)
    11981201        (when comp?
    1199           (##sys#hash-table-update! ; assumes compiler has extras available - will break in the interpreter
     1202          (##sys#hash-table-update!
    12001203           ##compiler#file-requirements
    12011204           (if syntax? 'dynamic/syntax 'dynamic)
    1202            (cut lset-adjoin eq? <> id) 
     1205           (cut lset-adjoin eq? <> id)  ;XXX assumes compiler has srfi-1 loaded
    12031206           (lambda () (list id)))))
    12041207      (define (impform x id builtin?)
  • chicken/branches/release/library.scm

    r15293 r16012  
    909909(define complex? number?)
    910910(define real? number?)
    911 (define rational? number?)
     911(define (rational? n) (##core#inline "C_i_rationalp" n))
    912912(define ##sys#flonum-fraction (##core#primitive "C_flonum_fraction"))
    913913(define (##sys#integer? x) (##core#inline "C_i_integerp" x))
  • chicken/branches/release/manual

  • chicken/branches/release/manual/Acknowledgements

    r15293 r16012  
    3939Sunnan, Zbigniew Szadkowski, Rick Taube, Nathan Thern, Mike Thomas,
    4040Minh Thu, Christian Tismer, Andre van Tonder, John Tobey, Henrik
    41 Tramberend, Vladimir Tsichevsky, Neil van Dyke, Taylor Venable, Sander
    42 Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed
    43 Watkeys, Brad Watson, Thomas Weidner, Goeran Weinholt, Matthew
    44 Welland, Drake Wilson, Joerg Wittenberger, Peter Wright, Mark Wutka,
    45 Richard Zidlicky and Houman Zolfaghari for bug-fixes, tips and
    46 suggestions.
     41Tramberend, Vladimir Tsichevsky, Neil van Dyke, Sam Varner, Taylor
     42Venable, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn
     43Wagner, Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran
     44Weinholt, Matthew Welland, Drake Wilson, Joerg Wittenberger, Peter
     45Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for
     46bug-fixes, tips and suggestions.
    4747
    4848CHICKEN uses the "irregex" regular expression package written by Alex Shinn.
  • chicken/branches/release/manual/Deviations from the standard

    r15293 r16012  
    11[[tags: manual]]
    22
    3 == Deviations from the standard
     3== Confirmed deviations
    44
    55Identifiers are by default case-sensitive (see
     
    77
    88[4.1.3] The maximal number of arguments that may be passed to a
    9 compiled procedure or macro is 120.  A macro-definition that has a
    10 single rest-parameter can have any number of arguments. 
     9compiled procedure or macro is 120. (However, a macro-definition
     10that has a single rest-parameter can have any number of arguments.)
     11Likewise, [6.4] the maximum number of values that can be passed
     12to continuations captured using {{call-with-current-continuation}}
     13is 120.  This is an implementation restriction that is unlikely
     14to be lifted.
     15
     16[6.2.5] The {{numerator}} and {{denominator}} procedures cannot be
     17applied to inexact numbers, and the procedure {{rationalize}} is not
     18implemented at all.  This will be fixed in a later release.
     19
     20[6.2.4] The runtime system uses the numerical string-conversion
     21routines of the underlying C library and so does only understand
     22standard (C-library) syntax for floating-point constants.  Consequently,
     23the procedures [6.2.6] {{string->number}}, [6.6.2] {{read}},
     24[6.6.3] {{write}}, and [6.6.3] {{display}} do not obey
     25read/write invariance to inexact numbers.
     26
     27[6.5] Code evaluated in {{scheme-report-environment}} or
     28{{null-environment}} still sees non-standard syntax.
     29
     30== Unconfirmed deviations
     31
     32[6.6.2] The procedure {{char-ready?}} always returns {{#t}} for
     33terminal ports.
     34
     35== Doubtful deviations
    1136
    1237[4.2.2] {{letrec}} does evaluate the initial values for the bound
     
    3055      (cons x y) ) )
    3156
     57It is unclear whether R5RS permits this behavior or not; in any case,
     58this only affects letrecs where the bound values are not
     59lambda-expressions.
     60
     61== Non-deviations that might surprise you
     62
    3263[6.1] {{equal?}} compares all structured data recursively, while R5RS
    3364specifies that {{eqv?}} is used for data other than pairs, strings and
    34 vectors.
     65vectors.  However, R5RS does not dictate the treatment of data types
     66that are not specified by R5RS.
    3567
    36 [6.2.4] The runtime system uses the numerical string-conversion
    37 routines of the underlying C library and so does only understand
    38 standard (C-library) syntax for floating-point constants.
    39 
    40 [6.2.5] There is no built-in support for rationals, complex numbers or
    41 extended-precision integers (bignums). The routines {{complex?}},
    42 {{real?}} and {{rational?}} are identical to the standard procedure
    43 {{number?}}. The procedures {{numerator}}, {{denominator}},
    44 {{rationalize}}, {{make-rectangular}} and {{make-polar}} are not
    45 implemented. Fixnums are limited to ±2<nowiki><sup>30</sup></nowiki>
    46 (or ±2<nowiki><sup>62</sup></nowiki> on 64-bit hardware).  Support for
    47 extended numbers is available as a separate package, provided the GNU
    48 multiprecision library is installed.
     68[6.2.5] There is no built-in support for exact rationals, complex
     69numbers or extended-precision integers (bignums). The routines
     70{{complex?}}, {{real?}} and {{rational?}} are identical to
     71the standard procedure {{number?}}. The procedures {{make-rectangular}}
     72and {{make-polar}} are not implemented. Fixnums are limited to
     73±2<nowiki><sup>30</sup></nowiki> (or ±2<nowiki><sup>62</sup></nowiki>
     74on 64-bit hardware).  Support for the full numeric tower is available
     75as a separate package, provided the GNU multiprecision library is installed.
    4976
    5077[6.2.6] The procedure {{string->number}} does not obey read/write
     
    6592
    6693[6.6.4] The {{transcript-on}} and {{transcript-off}} procedures are
    67 not implemented.
     94not implemented.  R5RS does not require them.
    6895
    6996---
  • chicken/branches/release/manual/Modules and macros

    r15293 r16012  
    416416are defined and used:
    417417
    418 ;; hello.scm
    419 
    420 (module test (hello greet)
    421   (import scheme)
    422 
    423   (define-syntax greet
    424     (syntax-rules ()
    425       ((_ whom)
    426        (begin
    427         (display "Hello, ")
    428         (display whom)
    429         (display " !\n") ) ) ) )
    430 
    431   (define (hello)
    432     (greet "world") )  )
     418 ;; hello.scm
     419 
     420 (module test (hello greet)
     421   (import scheme)
     422 
     423   (define-syntax greet
     424     (syntax-rules ()
     425       ((_ whom)
     426        (begin
     427          (display "Hello, ")
     428          (display whom)
     429          (display " !\n") ) ) ) )
     430 
     431   (define (hello)
     432     (greet "world") )  )
    433433
    434434The module {{test}} exports one value ({{hello}}) and one syntax
  • chicken/branches/release/manual/Non-standard macros and special forms

    r13859 r16012  
    189189 [syntax] (let-values (((NAME ...) EXP) ...) BODY ...)
    190190
    191 Binds multiple variables to the result values of {{EXP ...}}.
     191SRFI 11.  Binds multiple variables to the result values of {{EXP ...}}.
    192192All variables are bound simultaneously.
    193193
     
    196196 [syntax] (let*-values (((NAME ...) EXP) ...) BODY ...)
    197197
    198 Binds multiple variables to the result values of {{EXP ...}}.
     198SRFI 11.  Binds multiple variables to the result values of {{EXP ...}}.
    199199The variables are bound sequentially.
    200200
  • chicken/branches/release/manual/Non-standard read syntax

    r13859 r16012  
    3838
    3939 #:SYMBOL
     40 SYMBOL:
     41 :SYMBOL
    4042
    41 Syntax for keywords. Keywords are symbols that evaluate to themselves, and as such don't have to be quoted.
     43Syntax for keywords. Keywords are symbols that evaluate to themselves, and as such don't have to be quoted.  Either {{SYMBOL:}} or {{:SYMBOL}} is accepted, depending on the setting of the {{keyword-style}} parameter, but never both.  {{#:SYMBOL}} is always accepted.
    4244
    4345=== Multiline String Constant
  • chicken/branches/release/manual/Parameters

    r13859 r16012  
    9393=== keyword-style
    9494Enables alternative keyword syntax, where {{STYLE}} may be either
    95 {{#:prefix}} (as in Common Lisp) or {{#:suffix}} (as in DSSSL).
    96 Any other value disables the alternative syntaxes.
     95{{#:prefix}} (as in Common Lisp), which recognizes symbols beginning
     96with a colon as keywords, or {{#:suffix}} (as in DSSSL), which recognizes
     97symbols ending with a colon as keywords.
     98Any other value disables the alternative syntaxes.  In the interpreter
     99the default is {{#:suffix}}.
    97100
    98101
  • chicken/branches/release/manual/Supported language

    r13859 r16012  
    11[[tags: manual]]
    2 [[toc:]]
    32
    43== Supported language
  • chicken/branches/release/manual/The User's Manual

    r15293 r16012  
    77</nowiki>
    88
    9 This is the manual for Chicken Scheme, version 4.1.0
     9This is the manual for Chicken Scheme, version 4.2.0
    1010
    1111; [[Getting started]] : What is CHICKEN and how do I use it?
  • chicken/branches/release/manual/Unit data-structures

    r15293 r16012  
    251251Returns true if the list or vector {{SEQUENCE}} is already sorted.
    252252
     253
     254==== topological-sort
     255
     256 [procedure] (topological-sort DAG PRED)
     257
     258Sorts the directed acyclic graph dag {{DAG}} so that for every edge from vertex
     259u to v, u will come before v in the resulting list of vertices.
     260
     261{{DAG}} is a list of sublists. The car of each sublist is a
     262vertex. The cdr is the adjacency list of that vertex, i.e. a list of
     263all vertices to which there exists an edge from the car vertex.
     264{{pred}} is procedure of two arguments that should compare vertices
     265for equality.
     266
     267Time complexity: O (|V| + |E|)
     268
     269<enscript highlight=scheme>
     270(require 'tsort)
     271(topological-sort
     272       '((shirt tie belt)
     273         (tie jacket)
     274         (belt jacket)
     275         (watch)
     276         (pants shoes belt)
     277         (undershorts pants shoes)
     278         (socks shoes))
     279       eq?)
     280
     281=>
     282
     283(socks undershorts pants shoes watch shirt belt tie jacket)
     284</enscript>
    253285
    254286
     
    569601 [procedure] (noop X ...)
    570602
    571 Ignores it's arguments, does nothing and returns an unspecified value.
     603Ignores its arguments, does nothing and returns an unspecified value.
    572604
    573605
     
    584616 [procedure] (left-section PROC ARG0 ...)
    585617
    586 Returns a procedure that partially applies some of its' arguments starting from the left.
     618Returns a procedure that partially applies some of its arguments starting from the left.
    587619
    588620{{PROC}} a procedure.
     
    595627 [procedure] (right-section PROC ARG0 ...)
    596628
    597 Returns a procedure that partially applies some of its' arguments starting from the right.
     629Returns a procedure that partially applies some of its arguments starting from the right.
    598630
    599631{{PROC}} a procedure.
  • chicken/branches/release/manual/Unit extras

    r13859 r16012  
    9898
    9999
    100 === Input/Output extensions
     100=== Pretty-printing
     101
    101102
    102103==== pretty-print
     
    112113(Parameter) Specifies the maximal line-width for pretty printing, after which line
    113114wrap will occur.
     115
     116
     117=== Input/Output extensions
    114118
    115119==== read-byte
  • chicken/branches/release/manual/Unit library

    r15293 r16012  
    328328The parameter {{keyword-style}} and the compiler/interpreter option
    329329{{-keyword-style}} can be used to allow an additional keyword
    330 syntax, either compatible to Common LISP, or to DSSSL.
    331 
     330syntax, either compatible to Common LISP, or to DSSSL.  As long as this
     331parameter is set to {{#:suffix}}, Chicken conforms to
     332[[http://srfi.schemers.org/srfi-88/srfi-88.html|SRFI-88]].
    332333
    333334
  • chicken/branches/release/manual/Unit posix

    r15293 r16012  
    639639==== read-symbolic-link
    640640
    641 <procedure>(read-symbolic-link FILENAME)</procedure>
     641<procedure>(read-symbolic-link FILENAME [CANONICALIZE])</procedure>
    642642
    643643Returns the filename to which the symbolic link {{FILENAME}} points.
     644If {{CANONICALIZE}} is given and true, then symbolic links are
     645resolved repeatedly until the result is not a link.
    644646
    645647==== file-link
  • chicken/branches/release/manual/Unit utils

    r15293 r16012  
    7777
    7878
    79 ---
     79=== Dynamic compilation
     80
     81==== compile-file
     82
     83 [procedure] (compile-file FILENAME #!key options output-file load)
     84
     85Compiles the Scheme source file {{FILENAME}} into a dynamically
     86loadable library by invoking the {{csc}} compiler driver. If the
     87library can be successfully created and {{load}} is not given or
     88true, the file is loaded into the current
     89Scheme process. {{options}} may be a list of strings which are passed
     90as additional command line options to {{csc}}. If {{output-file}} is
     91not given, then the compiled file is stored in a temporary location
     92and will be deleted when the process exits successfully.
     93When compilation and loading succeeds, the name of the compiled file
     94is returned.
     95
     96Notes:
     97
     98* loading the same compiled file multiple times is only supported on Linux
     99  in the moment and should be considered unreliable. For this reason, a new temporary
     100  file is created for every invocation of {{compile-file}}, unless an explicit
     101  output file name is given.
     102
     103* this procedure is compatible to the {{scheme-compile-file}} command in {{emacs}}' {{scheme-mode}}.
     104
     105==== compile-file-options
     106
     107 [parameter] compile-file-options
     108
     109A parameter that holds a list of default options that should be given
     110to {{csc}} after invocation of the {{compile-file}} procedure.
     111The initial default options are {{-scrutinize -O2 -d2}}.
     112
     113=== Shell argument quoting
     114
     115==== qs
     116
     117 [procedure] (qs STRING [PLATFORM])
     118
     119Escapes {{STRING}} suitably for passing to a shell command on {{PLATFORM}}.
     120{{PLATFORM}} defaults to the value of {{(build-platform)}} and indicates in
     121which style the argument should be quoted. On Windows systems, the string
     122is simply enclosed in double-quote ({{"}}) characters, on UNIXish systems,
     123characters that would have a special meaning to the shell are escaped
     124using backslash ({{\}}).
     125
    80126Previous: [[Unit posix]]
    81127
  • chicken/branches/release/manual/Using the compiler

    r15293 r16012  
    77dependent makefiles, shell-scripts or batch-files should perform
    88any necessary steps before and after invocation of {{chicken}}.
    9 A program named {{csc}} provides a much simpler
     9A program named {{csc}} provides a more convenient and concise
    1010interface to the Scheme- and C-compilers and linker. Enter
    1111
     
    187187; -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 {{,}}.
    188188
     189; -setup-mode : When locating extension, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata.
     190
    189191; -scrutinize : Enable simple flow-analysis to catch common type errors and argument/result mismatches. You can also use the {{scrutinize}} declaration to enable scrutiny.
    190192
     
    458460
    459461---
    460 Previous: [[The User's Manual]]
     462Previous: [[Basic mode of operation]]
    461463
    462464Next: [[Using the interpreter]]
  • chicken/branches/release/manual/Using the interpreter

    r15293 r16012  
    5858; -ss PATHNAME : The same as {{-s PATHNAME}} but invokes the procedure {{main}} with the value of {{(command-line-arguments)}} as its single argument. If the main procedure returns an integer result, then the interpreter is terminated, returning the integer as the status code back to the invoking process. Any other result terminates the interpreter with a zero exit status.
    5959
     60; -setup-mode : When locating extension, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata.
     61
    6062; -R  -require-extension NAME : Equivalent to evaluating {{(require-extension NAME)}}.
    6163
     
    8587to standalone executables (don't forget to declare used library units).
    8688
    87 CHICKEN supports writing shell scripts in Scheme for these platforms as well,
     89CHICKEN supports writing shell scripts in Scheme for other platforms as well,
    8890using a slightly different approach. The first example would look like
    8991this on Windows:
     
    101103accept more than 8 arguments.
    102104
    103 Since it is sometimes useful to run a script into the interpreter without actually running it
     105Since it is sometimes useful to run a script in the interpreter without actually executing it
    104106(for example to test specific parts of it), the option {{-ss}} can be used as an alternative to {{-script}}.
    105107{{-ss PATHNAME}} is equivalent to {{-script PATHNAME}} but invokes {{(main (command-line-arguments))}}
     
    217219 #;1> (define-record-type point (make-point x y) point?
    218220        (x point-x)
    219         (y point-y))
     221        (y point-y))
    220222 #;2> (set-describer! 'point
    221223        (lambda (pt o)
  • chicken/branches/release/optimizer.scm

    r15293 r16012  
    2828(declare (unit optimizer))
    2929
    30 (private compiler
    31   compiler-arguments process-command-line perform-lambda-lifting!
    32   default-standard-bindings default-extended-bindings
    33   foldable-bindings llist-length r-c-s compile-format-string
    34   installation-home decompose-lambda-list external-to-pointer
    35   copy-node! variable-visible? mark-variable intrinsic?
    36   unit-name insert-timer-checks used-units external-variables hide-variable
    37   debug-info-index debug-info-vector-name profile-info-vector-name
    38   foreign-declarations emit-trace-info block-compilation line-number-database-size
    39   make-block-variable-literal block-variable-literal? block-variable-literal-name
    40   target-heap-size target-stack-size constant-declarations variable-mark
    41   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    42   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    43   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    44   broken-constant-nodes inline-substitutions-enabled loop-lambda-names expand-profile-lambda
    45   profile-lambda-list profile-lambda-index emit-profile expand-profile-lambda
    46   direct-call-ids foreign-type-table first-analysis expand-debug-lambda expand-debug-assignment expand-debug-call
    47   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database! scan-toplevel-assignments
    48   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    49   reorganize-recursive-bindings substitution-table simplify-named-call compiler-warning
    50   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    51   transform-direct-lambdas! expand-foreign-callback-lambda* debug-lambda-list debug-variable-list debugging
    52   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    53   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    54   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    55   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    56   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    57   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    58   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    59   topological-sort print-version print-usage initialize-analysis-database
    60   expand-foreign-callback-lambda default-optimization-passes default-optimization-passes-when-trying-harder
    61   units-used-by-default words-per-flonum rewrite inline-locally compiler-syntax-statistics
    62   parameter-limit eq-inline-operator optimizable-rest-argument-operators
    63   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    64   make-random-name final-foreign-type inline-max-size simplified-ops
    65   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    66   foreign-argument-conversion foreign-result-conversion foreign-type-convert-argument foreign-type-convert-result)
    67 
    68 
     30
     31(include "compiler-namespace")
    6932(include "tweaks")
    7033
     
    236199          ((let)
    237200           (let ([var (first params)])
    238              (cond [(or (test var 'replacable)
     201             (cond [(or ;(test var 'replacable)
    239202                        (test var 'removable)
    240203                        (and (test var 'contractable) (not (test var 'replacing))) )
  • chicken/branches/release/posixunix.scm

    r15293 r16012  
    15341534  (let ([substring substring]
    15351535        [buf (make-string (fx+ _filename_max 1))] )
    1536     (lambda (fname)
     1536    (lambda (fname #!optional canonicalize)
    15371537      (##sys#check-string fname 'read-symbolic-link)
    15381538      (let ([len (##core#inline "C_readlink" (##sys#make-c-string (##sys#expand-home-path fname)) buf)])
    15391539      (when (fx< len 0)
    15401540        (posix-error #:file-error 'read-symbolic-link "cannot read symbolic link" fname) )
    1541       (substring buf 0 len) ) ) ) )
     1541      (let ((pathname (substring buf 0 len)))
     1542        (if (and canonicalize (symbolic-link? pathname))
     1543            (read-symbolic-link pathname 'canonicalize)
     1544            pathname ) ) ) ) ) )
    15421545
    15431546(define file-link
  • chicken/branches/release/rules.make

    r15293 r16012  
    838838          $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    839839          $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
    840           $(CHICKEN_STATUS_PROGRAM)$(EXE) \
     840          $(CHICKEN_STATUS_PROGRAM)$(EXE) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
    841841          $(IMPORT_LIBRARIES:%=%.so) $(IMPORT_LIBRARIES:%=%.import.so)
    842842        $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
     
    11451145          -ignore-repository -output-file $@
    11461146
    1147 chicken.c: $(SRCDIR)chicken.scm $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1147chicken.c: $(SRCDIR)chicken.scm $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)compiler-namespace.scm \
     1148          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11481149        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1149 support.c: $(SRCDIR)support.scm $(SRCDIR)banner.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1150support.c: $(SRCDIR)support.scm $(SRCDIR)banner.scm $(SRCDIR)compiler-namespace.scm \
     1151          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11501152        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1151 compiler.c: $(SRCDIR)compiler.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1153compiler.c: $(SRCDIR)compiler.scm $(SRCDIR)compiler-namespace.scm \
     1154          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11521155        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1153 optimizer.c: $(SRCDIR)optimizer.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1156optimizer.c: $(SRCDIR)optimizer.scm $(SRCDIR)compiler-namespace.scm \
     1157          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11541158        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1155 scrutinizer.c: $(SRCDIR)scrutinizer.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1159scrutinizer.c: $(SRCDIR)scrutinizer.scm $(SRCDIR)compiler-namespace.scm \
     1160          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11561161        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1157 batch-driver.c: $(SRCDIR)batch-driver.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1162batch-driver.c: $(SRCDIR)batch-driver.scm $(SRCDIR)compiler-namespace.scm \
     1163          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11581164        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1159 c-platform.c: $(SRCDIR)c-platform.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1165c-platform.c: $(SRCDIR)c-platform.scm $(SRCDIR)compiler-namespace.scm \
     1166          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11601167        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1161 c-backend.c: $(SRCDIR)c-backend.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
     1168c-backend.c: $(SRCDIR)c-backend.scm $(SRCDIR)compiler-namespace.scm \
     1169          $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    11621170        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    11631171
  • chicken/branches/release/runtime.c

    r15293 r16012  
    33943394C_regparm void C_fcall update_locative_table(int mode)
    33953395{
    3396   int i, hi = 0;
     3396  int i, hi = 0, invalidated = 0;
    33973397  C_header h;
    33983398  C_word loc, obj, obj2, offset, loc2, ptr;
    33993399  C_uword ptr2;
    3400 
    3401   /*C_printf("major: %d, %d locs in %d\n", major, locative_table_count, locative_table_size); */
    34023400
    34033401  for(i = 0; i < locative_table_count; ++i) {
     
    34163414          locative_table[ i ] = C_SCHEME_UNDEFINED;
    34173415          C_set_block_item(loc, 0, 0);
     3416          ++invalidated;
    34183417          break;
    34193418        }
     
    34433442          locative_table[ i ] = C_SCHEME_UNDEFINED;
    34443443          C_set_block_item(loc, 0, 0);
     3444          ++invalidated;
    34453445          break;
    34463446        }
     
    34713471          locative_table[ i ] = C_SCHEME_UNDEFINED; /* pointed-at object is dead */
    34723472          C_set_block_item(loc, 0, 0);
     3473          ++invalidated;
    34733474        }
    34743475       
     
    34853486    }
    34863487  }
     3488
     3489  if(gc_report_flag && invalidated > 0)
     3490    C_printf(C_text("[GC] locative-table entries reclaimed: %d\n"), invalidated);
    34873491
    34883492  if(mode != GC_REALLOC) locative_table_count = hi;
     
    38723876    int n = C_header_size(msg);
    38733877
     3878    if (n >= sizeof(buffer))
     3879      n = sizeof(buffer) - 1;
    38743880    C_strncpy(buffer, (C_char *)C_data_pointer(msg), n);
    38753881    buffer[ n ] = '\0';
     
    39013907  int n = C_header_size(msg);
    39023908
     3909  if (n >= sizeof(buffer))
     3910    n = sizeof(buffer) - 1;
    39033911  C_strncpy(buffer, (C_char *)((C_SCHEME_BLOCK *)msg)->data, n);
    39043912  buffer[ n ] = '\0';
     
    46964704
    46974705
     4706C_regparm C_word C_fcall C_i_rationalp(C_word x)
     4707{
     4708  if((x & C_FIXNUM_BIT) != 0) return C_SCHEME_TRUE;
     4709
     4710  if((!C_immediatep(x) && C_block_header(x) == C_FLONUM_TAG)) {
     4711    double n = C_flonum_magnitude(x);
     4712
     4713    if(C_isinf(n) || C_isnan(n)) return C_SCHEME_FALSE;
     4714  }
     4715
     4716  return C_SCHEME_TRUE;
     4717}
     4718
     4719
    46984720C_regparm C_word C_fcall C_i_integerp(C_word x)
    46994721{
     
    53835405C_regparm C_word C_fcall C_a_i_abs(C_word **a, int c, C_word x)
    53845406{
    5385   if(x & C_FIXNUM_BIT) return C_fix(abs(C_unfix(x)));
     5407  if(x & C_FIXNUM_BIT) return C_fix(labs(C_unfix(x)));
    53865408
    53875409  if(C_immediatep(x) || C_block_header(x) != C_FLONUM_TAG)
     
    72997321    buf[ n ] = '\0';
    73007322    n = C_header_size(mode);
     7323    if (n >= sizeof(fmode)) n = sizeof(fmode) - 1;
    73017324    C_strncpy(fmode, C_c_string(mode), n);
    73027325    fmode[ n ] = '\0';
     
    79968019      t, f1, f2, f3;
    79978020  int len = C_header_size(name);
     8021  char *buffer2;
    79988022
    79998023#ifdef _MSC_VER
     
    80028026  struct stat buf;
    80038027#endif
    8004   C_strncpy(buffer, C_c_string(name), len);
    8005   buffer[ len ] = '\0';
     8028
     8029  buffer2 = buffer;
     8030  if(len >= sizeof(buffer)) {
     8031    if((buffer2 = (char *)C_malloc(len + 1)) == NULL)
     8032      barf(C_OUT_OF_MEMORY_ERROR, "stat");
     8033  }
     8034  C_strncpy(buffer2, C_c_string(name), len);
     8035  buffer2[ len ] = '\0';
    80068036
    80078037#ifdef _MSC_VER
    8008   if(_stat(buffer, &buf) != 0) v = C_SCHEME_FALSE;
     8038  if(_stat(buffer2, &buf) != 0) v = C_SCHEME_FALSE;
    80098039#else
    8010   if(stat(buffer, &buf) != 0) v = C_SCHEME_FALSE;
     8040  if(stat(buffer2, &buf) != 0) v = C_SCHEME_FALSE;
    80118041#endif
    80128042  else {
     
    80288058                 C_fix(buf.st_size), C_fix(t), C_fix(buf.st_mode), C_fix(buf.st_uid) );
    80298059  }
     8060
     8061  if (buffer2 != buffer)
     8062    free(buffer2);
    80308063
    80318064  C_kontinue(k, v);
  • chicken/branches/release/scripts/scheme

    r13240 r16012  
    88
    99dbgoption=
    10 cache=$HOME/.cache
     10cache=$HOME/.schemecache
    1111uname=`uname`
    1212wd=`pwd`
  • chicken/branches/release/scripts/test-dist.sh

    r15293 r16012  
    55
    66set -e
    7 set -x
    87
    98pwdopts=
    109bootstrap=
    1110
    12 if test "$1" == "-bootstrap"; then
     11if test "$1" = "-bootstrap"; then
    1312    bootstrap=1
    1413    shift
     
    3837# bootstrap, if desired
    3938prefix=`pwd $pwdopts`/tmp-test-dist
     39
     40if test \! -x "$prefix/bin/csi"; then
     41    echo "no csi at ${prefix} - please build and install chicken first"
     42    exit 1
     43fi
     44
     45for ext in htmlprag matchable; do
     46    if test `$prefix/bin/csi -p "(extension-information '${ext})"` = "#f"; then
     47        $prefix/bin/chicken-install $ext
     48    fi
     49done
    4050
    4151if test -n "$bootstrap"; then
  • chicken/branches/release/scrutinizer.scm

    r15293 r16012  
    2727(declare (unit scrutinizer))
    2828
    29 (private compiler
    30   compiler-arguments process-command-line perform-lambda-lifting!
    31   default-standard-bindings default-extended-bindings
    32   foldable-bindings llist-length
    33   installation-home decompose-lambda-list external-to-pointer
    34   copy-node! variable-visible? mark-variable intrinsic?
    35   unit-name insert-timer-checks used-units external-variables hide-variable
    36   debug-info-index debug-info-vector-name profile-info-vector-name
    37   foreign-declarations emit-trace-info block-compilation line-number-database-size
    38   make-block-variable-literal block-variable-literal? block-variable-literal-name
    39   target-heap-size target-stack-size constant-declarations variable-mark
    40   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    41   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    42   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    43   broken-constant-nodes inline-substitutions-enabled loop-lambda-names expand-profile-lambda
    44   profile-lambda-list profile-lambda-index emit-profile expand-profile-lambda
    45   direct-call-ids foreign-type-table first-analysis expand-debug-lambda expand-debug-assignment expand-debug-call
    46   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database! scan-toplevel-assignments
    47   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    48   reorganize-recursive-bindings substitution-table simplify-named-call compiler-warning real-name
    49   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    50   transform-direct-lambdas! expand-foreign-callback-lambda* debug-lambda-list debug-variable-list debugging
    51   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    52   string->c-identifier c-ify-string words check-and-open-input-file close-checked-input-file fold-inner constant?
    53   collapsable-literal? immediate? canonicalize-begin-body extract-mutable-constants string->expr get get-all
    54   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    55   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    56   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    57   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    58   topological-sort print-version print-usage initialize-analysis-database
    59   expand-foreign-callback-lambda default-optimization-passes default-optimization-passes-when-trying-harder
    60   units-used-by-default words-per-flonum rewrite inline-locally
    61   parameter-limit eq-inline-operator optimizable-rest-argument-operators
    62   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    63   make-random-name final-foreign-type inline-max-size simplified-ops
    64   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    65   foreign-argument-conversion foreign-result-conversion foreign-type-convert-argument foreign-type-convert-result
    66   scrutinize load-type-database source-info->line)
    67 
    68 
     29
     30(include "compiler-namespace")
    6931(include "tweaks")
    7032
  • chicken/branches/release/setup-api.scm

    r15293 r16012  
    132132(define *chmod-command*)
    133133(define *ranlib-command*)
     134(define *mkdir-command*)
    134135
    135136(define (windows-user-install-setup)
     
    145146  (set! *move-command*        'mv)
    146147  (set! *chmod-command*       "chmod")
    147   (set! *ranlib-command*      "ranlib") )
     148  (set! *ranlib-command*      "ranlib")
     149  (set! *mkdir-command*       "mkdir") )
    148150
    149151(define (windows-sudo-install-setup)
     
    156158  (set! *move-command*        "sudo mv")
    157159  (set! *chmod-command*       "sudo chmod")
    158   (set! *ranlib-command*      "sudo ranlib") )
     160  (set! *ranlib-command*      "sudo ranlib")
     161  (set! *mkdir-command*       "sudo mkdir") )
    159162
    160163(define (user-install-setup)
     
    242245                   *chicken-bin-path*
    243246                   (cdr (assoc prg *installed-executables*))))
    244                  "-feature" "compiling-extension"
     247                 "-feature" "compiling-extension" "-setup-mode"
    245248                 (if (keep-intermediates) "-k" "")
    246249                 (if (host-extension) "-host" "")
     
    438441  (make-parameter (or (get-environment-variable "CHICKEN_INSTALL_PREFIX") #f)))
    439442
     443(define create-directory/parents
     444  (let ()
     445    (define (verb dir)
     446      (when (setup-verbose-mode) (printf "  creating directory `~a'~%~!" dir)) )
     447    (if *windows*
     448        (lambda (dir)
     449          (verb dir)
     450          (create-directory dir #t) )
     451        (lambda (dir)
     452          (verb dir)
     453          (run (,*mkdir-command* -p ,(shellpath dir)) ) ) ) ) )
     454
    440455(define (write-info id files info)
    441456  (let ((info `((files ,@files)
  • chicken/branches/release/setup-download.scm

    r15293 r16012  
    241241        (let ([name (read in)])
    242242          (cond [(and (pair? name) (eq? 'error (car name)))
    243                  (apply error (string-append "[Server] " (cadr name)) (cddr name)) ]
     243                 (throw-server-error (cadr name) (cddr name))]
    244244                [(or (eof-object? name) (not name))
    245245                 (close-input-port in)
     
    261261                 (get-files (cons name files)) ] ) ) ) ) )
    262262
     263  (define (throw-server-error msg args)
     264    (abort
     265     (make-composite-condition
     266      (make-property-condition
     267       'exn
     268       'message (string-append "[Server] " msg)
     269       'arguments args)
     270      (make-property-condition 'setup-download-error))))
     271
    263272  (define (read-chunks in)
    264273    (let get-chunks ([data '()])
  • chicken/branches/release/site/index.html

    r15303 r16012  
    157157<h3>DOCUMENTATION</h3>
    158158<p>
    159 Browse the <a href="http://chicken.wiki.br/man/4/">User's manual</a> at the CHICKEN
     159Browse the <a href="http://chicken.wiki.br/man/4/The User's Manual">User's manual</a> at the CHICKEN
    160160<a href="http://chicken.wiki.br/">wiki</a>
    161161</p>
  • chicken/branches/release/support.scm

    r15293 r16012  
    2929
    3030
    31 (private compiler
    32   compiler-arguments process-command-line dump-nodes dump-undefined-globals
    33   default-standard-bindings default-extended-bindings
    34   foldable-bindings dump-defined-globals
    35   installation-home optimization-iterations compiler-cleanup-hook decompose-lambda-list
    36   file-io-only banner disabled-warnings internal-bindings
    37   unit-name insert-timer-checks used-units source-filename pending-canonicalizations
    38   foreign-declarations block-compilation line-number-database-size node->sexpr sexpr->node
    39   target-heap-size target-stack-size variable-visible? hide-variable export-variable
    40   default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
    41   current-program-size line-number-database-2 foreign-lambda-stubs immutable-constants foreign-variables
    42   rest-parameters-promoted-to-vector inline-table inline-table-used constant-table constants-used
    43   dependency-list broken-constant-nodes inline-substitutions-enabled emit-syntax-trace-info
    44   block-variable-literal? copy-node! valid-c-identifier? tree-copy copy-node-tree-and-rename
    45   direct-call-ids foreign-type-table first-analysis scan-sharp-greater-string
    46   make-block-variable-literal block-variable-literal-name variable-mark
    47   expand-profile-lambda profile-lambda-list profile-lambda-index profile-info-vector-name
    48   initialize-compiler canonicalize-expression expand-foreign-lambda update-line-number-database scan-toplevel-assignments
    49   perform-cps-conversion analyze-expression simplifications perform-high-level-optimizations perform-pre-optimization!
    50   reorganize-recursive-bindings substitution-table simplify-named-call
    51   perform-closure-conversion prepare-for-code-generation compiler-source-file create-foreign-stub expand-foreign-lambda*
    52   transform-direct-lambdas! finish-foreign-result csc-control-file
    53   debugging-chicken bomb check-signature posq stringify symbolify build-lambda-list
    54   string->c-identifier c-ify-string words words->bytes check-and-open-input-file close-checked-input-file fold-inner
    55   constant? basic-literal? source-info->string mark-variable load-inline-file
    56   collapsable-literal? immediate? canonicalize-begin-body string->expr get get-all
    57   put! collect! count! get-line get-line-2 find-lambda-container display-analysis-database varnode qnode
    58   build-node-graph build-expression-tree fold-boolean inline-lambda-bindings match-node expression-has-side-effects?
    59   simple-lambda-node? compute-database-statistics print-program-statistics output gen gen-list
    60   pprint-expressions-to-file foreign-type-check estimate-foreign-result-size scan-used-variables scan-free-variables
    61   topological-sort print-version print-usage initialize-analysis-database estimate-foreign-result-location-size
    62   real-name real-name-table set-real-name! real-name2 display-real-name-table display-line-number-database
    63   default-declarations units-used-by-default words-per-flonum emit-control-file-item compiler-warning
    64   foreign-string-result-reserve parameter-limit eq-inline-operator optimizable-rest-argument-operators
    65   membership-test-operators membership-unfold-limit valid-compiler-options valid-compiler-options-with-argument
    66   default-optimization-iterations chop-separator chop-extension follow-without-loop
    67   generate-code make-variable-list make-argument-list generate-foreign-stubs foreign-type-declaration
    68   foreign-argument-conversion foreign-result-conversion final-foreign-type debugging source-info->line
    69   constant-declarations process-lambda-documentation big-fixnum? sort-symbols llist-length
    70   export-dump-hook intrinsic? node->sexpr emit-global-inline-file inline-max-size
    71   make-random-name foreign-type-convert-result foreign-type-convert-argument
    72   load-identifier-database)
    73 
    74 
     31(include "compiler-namespace")
    7532(include "tweaks")
    7633(include "banner")
     
    819776       (write sym)
    820777       (newline) ) )
     778   db) )
     779
     780(define (dump-global-refs db)
     781  (##sys#hash-table-for-each
     782   (lambda (sym plist)
     783     (when (assq 'global plist)
     784       (let ((a (assq 'references plist)))
     785         (write (list sym (if a (length (cdr a)) 0)))
     786         (newline) ) ) )
    821787   db) )
    822788
     
    11611127
    11621128
    1163 ;;; Simple topological sort:
    1164 ;
    1165 ; - Taken from SLIB (slightly adapted): Copyright (C) 1995 Mikael Djurfeldt
    1166 
    1167 (define (topological-sort dag pred)
    1168   (if (null? dag)
    1169       '()
    1170       (let* ((adj-table '())
    1171              (sorted '()))
    1172 
    1173         (define (insert x y)
    1174           (let loop ([at adj-table])
    1175             (cond [(null? at) (set! adj-table (cons (cons x y) adj-table))]
    1176                   [(pred x (caar at)) (set-cdr! (car at) y)]
    1177                   [else (loop (cdr at))] ) ) )
    1178        
    1179         (define (lookup x)
    1180           (let loop ([at adj-table])
    1181             (cond [(null? at) #f]
    1182                   [(pred x (caar at)) (cdar at)]
    1183                   [else (loop (cdr at))] ) ) )
    1184        
    1185         (define (visit u adj-list)
    1186           ;; Color vertex u
    1187           (insert u 'colored)
    1188           ;; Visit uncolored vertices which u connects to
    1189           (for-each (lambda (v)
    1190                       (let ((val (lookup v)))
    1191                         (if (not (eq? val 'colored))
    1192                             (visit v (or val '())))))
    1193                     adj-list)
    1194           ;; Since all vertices downstream u are visited
    1195           ;; by now, we can safely put u on the output list
    1196           (set! sorted (cons u sorted)) )
    1197        
    1198         ;; Hash adjacency lists
    1199         (for-each (lambda (def) (insert (car def) (cdr def)))
    1200                   (cdr dag))
    1201         ;; Visit vertices
    1202         (visit (caar dag) (cdar dag))
    1203         (for-each (lambda (def)
    1204                     (let ((val (lookup (car def))))
    1205                       (if (not (eq? val 'colored))
    1206                           (visit (car def) (cdr def)))))
    1207                   (cdr dag))
    1208         sorted) ) )
    1209 
    1210 
    12111129;;; Some pathname operations:
    12121130
     
    12721190    -emit-import-library MODULE  write compile-time module information into
    12731191                                  separate file
     1192    -emit-all-import-libraries   emit import-libraries for all defined modules
    12741193    -no-compiler-syntax          disable expansion of compiler-macros
    12751194
     
    13541273                                  declarations
    13551274    -ignore-repository           do not refer to repository for extensions
     1275    -setup-mode                  prefer the current directory when locating extensions
    13561276
    13571277EOF
  • chicken/branches/release/tests/runtests.sh

    r15293 r16012  
    142142echo "======================================== srfi-18 tests ..."
    143143$interpret -s srfi-18-tests.scm
     144echo "*** Skipping \"feeley-dynwind\" (for now) ***"
    144145# $interpret -s feeley-dynwind.scm
    145146
     
    194195        *)
    195196            echo $x
    196             ../csc $x -compiler $CHICKEN -C -I.. -L.. -O3 -d0
     197            ../csc $x -compiler $CHICKEN -I.. -L.. -O3 -d0
    197198            ./`basename $x .scm`;;
    198199    esac
  • chicken/branches/release/types.db

    r15293 r16012  
    452452(sort! (procedure sort! ((or list vector) (procedure (* *) *)) (or list vector)))
    453453(sorted? (procedure sorted? ((or list vector) (procedure (* *) *)) boolean))
     454(topological-sort (procedure topological-sort (list (procedure (* *) *)) list))
    454455(string-chomp (procedure string-chomp (string #!optional string) string))
    455456(string-chop (procedure string-chop (string fixnum) list))
     
    13701371(system* (procedure system* (string #!rest) undefined))
    13711372(qs (procedure qs (string) string))
     1373(compile-file (procedure compile-file (string #!rest) string))
     1374(compile-file-options (procedure compile-file-options (#!optional list) list))
    13721375
    13731376;; missing: setup-api, setup-download
  • chicken/branches/release/utils.import.scm

    r13859 r16012  
    3131   read-all
    3232   system*
    33    qs))
     33   qs
     34   compile-file))
  • chicken/branches/release/utils.scm

    r13859 r16012  
    2828(declare
    2929  (unit utils)
    30   (uses extras srfi-13)
     30  (uses extras srfi-13 posix files)
    3131  (usual-integrations)
    3232  (fixnum)
     
    120120                     (string c)))
    121121               (string->list str)))))))
     122
     123
     124;;; Compile and load file
     125
     126(define compile-file-options (make-parameter '("-S" "-O2" "-d2")))
     127
     128(define compile-file
     129  (let ((csc (foreign-value "C_CSC_PROGRAM" c-string))
     130        (path (foreign-value "C_INSTALL_BIN_HOME" c-string))
     131        (load-file load))
     132    (lambda (filename #!key (options '()) output-file (load #t))
     133      (let ((cscpath (or (file-exists? (make-pathname path csc)) "csc"))
     134            (tmpfile (and (not output-file) (create-temporary-file "so")))
     135            (crapshell (cond-expand ((or mingw32 msvc) #t) (else #f))))
     136        (print "; compiling " filename " ...")
     137        (system*
     138         "~a~a -s ~a ~a -o ~a~a"
     139         (if crapshell "\"" "")
     140         (qs cscpath)
     141         (string-intersperse (append (compile-file-options) options) " ")
     142         (qs filename)
     143         (qs (or output-file tmpfile))
     144         (if crapshell "\"" ""))
     145        (unless output-file
     146          (on-exit
     147           (lambda ()
     148             (handle-exceptions ex #f (delete-file* tmpfile)))))
     149        (when load
     150          (let ((f (or output-file tmpfile)))
     151            (handle-exceptions ex
     152                (begin
     153                  (delete-file* f)
     154                  (abort ex))
     155              (load-file f)
     156              f)))))))
  • chicken/branches/release/version.scm

    r15293 r16012  
    1 (define-constant +build-version+ "4.1.0")
     1(define-constant +build-version+ "4.2.0")
     2
Note: See TracChangeset for help on using the changeset viewer.