Changeset 10788 in project


Ignore:
Timestamp:
05/12/08 23:20:53 (13 years ago)
Author:
felix winkelmann
Message:
  • added remaining import libraries
  • csi uses srfi-69 now to avoid bootstrapping problem
  • csi: renamed "-se" to "-sx"
  • global assigns get variable name in comment in generated C code
  • import libs are compiled to .so's (likely to be not complete for windoze builds - that would be too easy)
  • removed a lot of deprecated stuff
  • it really seems to work...
Location:
chicken/branches/hygienic
Files:
13 added
23 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/hygienic/Makefile.macosx

    r10209 r10788  
    4545POSTINSTALL_PROGRAM_FLAGS = -change libchicken$(SO) $(LIBDIR)/libchicken$(SO)
    4646LIBRARIAN_OPTIONS = scru
     47LINKER_LINK_DLOADABLE_OPTIONS = -bundle
    4748
    4849# file extensions
  • chicken/branches/hygienic/Makefile.msvc

    r9078 r10788  
    9393LINKER_LIBRARY_SUFFIX = .lib
    9494LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dll
     95LINKER_LINK_DLOADABLE_OPTIONS = -dll
    9596
    9697PROGRAM_IMPORT_LIBRARIES = chicken.lib csi.lib csc.lib chicken-setup.lib chicken-profile.lib chicken-bug.lib
  • chicken/branches/hygienic/NEWS

    r10629 r10788  
     14.0.0x
     2
     3- added "-sx" option to csi
     4
    153.1.9
    26
  • chicken/branches/hygienic/TODO

    r10754 r10788  
    1313* test
    1414** reexports
     15** compiled import libs
     16** syntax-export of srfi-14 module
     17** hiding of non-exported module vars in compiler
     18** def of exported module variables with defie-values
    1519** foreign module
    1620** bootstrap
     
    2529*** reimport of imported id
    2630** hide unexported module definitions
    27 ** create remaining import libraries
    28 ** let-string-start+end should go into srfi-14 import lib
    2931
    3032* update manual/NEWS
     
    3739*** define-compiled-syntax
    3840*** modules
     41** removed deprecated stuff
     42   [un]shift!
     43   andmap ormap
     44   byte-vector? byte-vector-fill!
     45   make-byte-vector byte-vector
     46   byte-vector-set! byte-vector-ref
     47   byte-vector->list list->byte-vector
     48   string->byte-vector byte-vector->string
     49   byte-vector-length
     50   make-static-byte-vector static-byte-vector->pointer
     51   byte-vector-move! byte-vector-append!
     52   set-file-position! set-user-id! set-group-id!
     53   set-process-group-id!
    3954** ack synrules authors
    4055** DSSSL lambda-lists work only with imported "chicken" module
  • chicken/branches/hygienic/c-backend.scm

    r10374 r10788  
    220220
    221221            ((##core#global)
    222              (let ([index (first params)]
    223                    [safe (second params)]
    224                    [block (third params)] )
     222             (let ((index (first params))
     223                   (safe (second params))
     224                   (block (third params)) )
    225225               (cond [block
    226226                      (if safe
     
    231231
    232232            ((##core#setglobal)
    233              (let ([index (first params)]
    234                    [block (second params)] )
     233             (let ((index (first params))
     234                   (block (second params))
     235                   (var (third params)))
    235236               (if block
    236                    (gen "C_mutate(&lf[" index "],")
    237                    (gen "C_mutate((C_word*)lf[" index "]+1,") )
     237                   (gen "C_mutate(&lf[" index "]")
     238                   (gen "C_mutate((C_word*)lf[" index "]+1") )
     239               (gen " /* " (uncommentify (symbol->string var)) " ...) */,")
    238240               (expr (car subs) i)
    239241               (gen #\)) ) )
    240242
    241243            ((##core#setglobal_i)
    242              (let ([index (first params)]
    243                    [block (second params)] )
     244             (let ((index (first params))
     245                   (block (second params))
     246                   (var (third params)) )
    244247               (cond [block
    245                       (gen "lf[" index "]=")
     248                      (gen "lf[" index "] /* "
     249                           (uncommentify (symbol->string var)) " */ =")
    246250                      (expr (car subs) i)
    247251                      (gen #\;) ]
    248252                     [else
    249                       (gen "C_set_block_item(lf[" index "],0,")
     253                      (gen "C_set_block_item(lf[" index "] /* "
     254                           (uncommentify (symbol->string var)) " */,0,")
    250255                      (expr (car subs) i)
    251256                      (gen #\)) ] ) ) )
  • chicken/branches/hygienic/c-platform.scm

    r10715 r10788  
    160160    arithmetic-shift void flush-output thread-specific thread-specific-set!
    161161    not-pair? atom? null-list? print print* error cpu-time proper-list? call/cc
    162     u8vector->byte-vector s8vector->byte-vector u16vector->byte-vector s16vector->byte-vector ; DEPRECATED
    163     u32vector->byte-vector s32vector->byte-vector byte-vector-length ; DEPRECATED
    164     f32vector->byte-vector f64vector->byte-vector byte-vector-ref byte-vector-set! ; DEPRECATED
    165162    blob-size u8vector->blob/shared s8vector->blob/shared u16vector->blob/shared
    166163    s16vector->blob/shared u32vector->blob/shared s32vector->blob/shared
     
    215212(define non-foldable-extended-bindings
    216213  '(##sys#slot ##sys#setslot ##sys#call-with-current-continuation ##sys#fudge flush-output print void
    217     u8vector->byte-vector s8vector->byte-vector u16vector->byte-vector s16vector->byte-vector u32vector->byte-vector ; DEPRECATED
    218     f32vector->byte-vector f64vector->byte-vector s32vector->byte-vector ;DEPRECATED
    219214    u8vector->blob/shared s8vector->blob/shared u16vector->blob/shared s16vector->blob/shared u32vector->blob/shared
    220215    f32vector->blob/shared f64vector->blob/shared
     
    222217    ##sys#make-structure print* ##sys#make-vector ##sys#apply ##sys#setislot ##sys#block-ref
    223218    ##sys#byte ##sys#setbyte
    224     byte-vector-ref byte-vector-set!    ; DEPRECATED
    225219    u8vector-length s8vector-length u16vector-length s16vector-length u32vector-length s32vector-length
    226220    f32vector-length f64vector-length ##sys#apply-values ##sys#setter setter
     
    907901(rewrite '##sys#direct-return 17 2 "C_direct_return")
    908902
    909 (rewrite 'byte-vector-ref 2 2 "C_subbyte" #f #f) ; DEPRECATED
    910 (rewrite 'byte-vector-set! 2 3 "C_setbyte" #f #f) ; DEPRECATED
    911 (rewrite 'byte-vector-length 2 1 "C_block_size" #f #f) ; DEPRECATED
    912 (rewrite 'blob-size 2 1 "C_block_size" #f #f) ; DEPRECATED
     903(rewrite 'blob-size 2 1 "C_block_size" #f #f)
    913904
    914905(rewrite 'u8vector-ref 2 2 "C_u_i_u8vector_ref" #f #f)
     
    939930(rewrite 'atom? 17 1 "C_i_not_pair_p")
    940931(rewrite 'null-list? 17 1 "C_i_null_list_p" "C_i_nullp")
    941 
    942 (rewrite 'u8vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    943 (rewrite 's8vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    944 (rewrite 'u16vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    945 (rewrite 's16vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    946 (rewrite 'u32vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    947 (rewrite 's32vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    948 (rewrite 'f32vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    949 (rewrite 'f64vector->byte-vector 7 1 "C_slot" 1 #f) ; DEPRECATED
    950932
    951933(rewrite 'u8vector->blob/shared 7 1 "C_slot" 1 #f)
     
    10191001    (hash-table-ref . hash-table-set!)
    10201002    (block-ref . block-set!)
    1021     (byte-vector-ref . byte-vector-set!) ; DEPRECATED
    10221003    (locative-ref . locative-set!)
    10231004    (u8vector-ref . u8vector-set!)
  • chicken/branches/hygienic/chicken-ffi-macros.scm

    r10753 r10788  
    2626
    2727
    28 (define ##sys#me-0 (##sys#macro-environment))
     28(define ##sys#chicken-ffi-macro-environment
     29  (let ((me0 (##sys#macro-environment)))
    2930
    3031(##sys#extend-macro-environment
     
    177178      '(##core#undefined) ) ) ) )
    178179
    179 
    180 ;;; save macros for import library
    181 
    182 (define ##sys#chicken-ffi-macro-environment
    183   (let loop ((me (##sys#macro-environment)))
    184     (if (or (null? me) (eq? me ##sys#me-0))
    185         '()
    186         (cons (car me) (loop (cdr me))))))
     180(##sys#macro-subset me0)))
  • chicken/branches/hygienic/chicken-more-macros.scm

    r10753 r10788  
    2828(##sys#provide 'chicken-more-macros)
    2929
    30 (define ##sys#me-0 (##sys#macro-environment))
    31 
    3230
    3331;;; Non-standard macros:
     32
     33(define ##sys#chicken-macro-environment
     34(let ((me0 (##sys#macro-environment)))
    3435
    3536(##sys#extend-macro-environment
     
    245246 (##sys#er-transformer
    246247  (lambda (form r c)
    247     (##sys#check-syntax 'set!-values form '(_ #(symbol 0) _))
     248    (##sys#check-syntax 'set!-values form '(_ #(variable 0) _))
    248249    (let ((vars (cadr form))
    249250          (exp (caddr form))
     
    269270 (##sys#er-transformer
    270271  (lambda (form r c)
     272    (##sys#check-syntax 'define-values form '(_ #(variable 0) _))
     273    (for-each (cut ##sys#register-export <> (##sys#current-module)) (cadr form))
    271274    `(,(r 'set!-values) ,@(cdr form)))))
    272275
     
    10391042
    10401043
    1041 ;;; Register features provided by this file
    1042 
    1043 (define ##sys#chicken-macro-environment
    1044   (let loop ((me (##sys#macro-environment)))
    1045     (if (or (null? me) (eq? me ##sys#me-0))
    1046         '()
    1047         (cons (car me) (loop (cdr me))))))
     1044;;; just in case someone forgets
     1045
     1046(##sys#extend-macro-environment
     1047 'define-macro '()
     1048 (##sys#er-transformer
     1049  (lambda (form r c)
     1050    (syntax-error 'define-macro "`define-macro' is not supported - please use `define-syntax'"))))
     1051
     1052(##sys#macro-subset me0)))
    10481053
    10491054(eval-when (compile load eval)
  • chicken/branches/hygienic/chicken.import.scm

    r10753 r10788  
    2727(##sys#register-primitive-module
    2828 'chicken
    29  '(abort add1 andmap argc+argv argv
     29 '(abort add1 argc+argv argv
    3030         bit-set?
    3131         bitwise-and
     
    128128         open-input-string
    129129         open-output-string
    130          ormap
    131130         port-name
    132131         port-position
     
    169168         void
    170169         warning
     170         expand expand*
    171171         with-exception-handler)
    172172 ##sys#chicken-macro-environment)
  • chicken/branches/hygienic/compiler.scm

    r10745 r10788  
    11;;;; compiler.scm - The CHICKEN Scheme compiler
    2 ;
    32;
    43;
     
    173172; [##core#setlocal {<index>} <exp>]
    174173; [##core#global {<literal> <safe-flag> <block-mode> [<name>]}]
    175 ; [##core#setglobal {<literal> <block-mode>} <exp>]
    176 ; [##core#setglobal_i {<literal> <block-mode>} <exp>]
     174; [##core#setglobal {<literal> <block-mode> <name>} <exp>]
     175; [##core#setglobal_i {<literal> <block-mode> <name>} <exp>]
    177176; [##core#literal {<literal>}]
    178177; [##core#immediate {<type> [<immediate>]}]     - type: bool/fix/nil/char
     
    740739                                     (caddr x)))
    741740                               (me0 (##sys#macro-environment)))
     741                          (when (##sys#current-module)
     742                            (##sys#syntax-error-hook 'module "modules may not be nested" name))
    742743                          (when (pair? se)
    743744                            (##sys#syntax-error-hook 'module "module definition not in toplevel scope"
     
    24092410                                 (blockvar-literal var)
    24102411                                 (literal var) )
    2411                              blockvar)
     2412                             blockvar
     2413                             var)
    24122414                       (list (walk (car subs) e here boxes)) ) ) ) ) ) )
    24132415
  • chicken/branches/hygienic/csi.1

    r10745 r10788  
    112112
    113113.TP
    114 .BI \-se\ pathname
     114.BI \-sx\ pathname
    115115Similar to
    116116.B \-script
  • chicken/branches/hygienic/csi.scm

    r10753 r10788  
    2727
    2828(declare
    29   (usual-integrations)
     29  (uses srfi-69)                        ; is here because a bootstrap from an older chicken may not make
     30  (usual-integrations)                  ;  this used automatically
    3031  (disable-interrupts)
    3132  (disable-warning var)
     
    9495    -s  -script PATHNAME        use interpreter for shell scripts
    9596        -ss PATHNAME            shell script with `main' procedure
    96         -se PATHNAME            same as `-s', but print each expression as it is evaluated
     97        -sx PATHNAME            same as `-s', but print each expression as it is evaluated
    9798    -R  -require-extension NAME require extension before executing code
    9899    -I  -include-path PATHNAME  add PATHNAME to include path
     
    797798    "-eval" "-case-insensitive"
    798799    "-require-extension" "-batch" "-quiet" "-no-warnings" "-no-init"
    799     "-include-path" "-release" "-ss" "-se"
     800    "-include-path" "-release" "-ss" "-sx"
    800801    "-print" "-pretty-print") )
    801802
     
    828829         [args (canonicalize-args (command-line-arguments))]
    829830         [kwstyle (member* '("-k" "-keyword-style") args)]
    830          [script (member* '("-s" "-ss" "-se" "-script") args)])
     831         [script (member* '("-s" "-ss" "-sx" "-script") args)])
    831832    (cond [script
    832833           (when (or (not (pair? (cdr script)))
     
    921922                  '("--" "-batch" "-quiet" "-no-init" "-no-warnings" "-script"
    922923                    "-b" "-q" "-n" "-w" "-s" "-i"
    923                     "-case-insensitive" "-ss" "-se") ) )
     924                    "-case-insensitive" "-ss" "-sx") ) )
    924925                ((member arg '("-feature" "-include-path" "-keyword-style"
    925926                               "-D" "-I" "-k"))
     
    945946                   (##sys#load
    946947                    arg
    947                     (and (equal? "-se" scr)
     948                    (and (equal? "-sx" scr)
    948949                         (lambda (x)
    949950                           (pretty-print x ##sys#standard-error)
     
    951952                           (eval x)))
    952953                    #f)
    953                    (when (and scr (member scr '("-ss" "-se")))
     954                   (when (and scr (member scr '("-ss" "-sx")))
    954955                     (call-with-values (cut main (command-line-arguments))
    955956                       (lambda results
  • chicken/branches/hygienic/defaults.make

    r10657 r10788  
    182182endif
    183183LINKER_LINK_SHARED_LIBRARY_OPTIONS ?= -shared
     184LINKER_LINK_DLOADABLE_OPTIONS ?= -shared
    184185LIBRARIAN_OPTIONS ?= cru
    185186LIBRARIAN_OUTPUT_OPTION ?=
     
    278279CHICKEN_COMPILER_OPTIONS = $(CHICKEN_PROGRAM_OPTIONS) -extend private-namespace.scm
    279280CHICKEN_UNSAFE_OPTIONS = -unsafe -no-lambda-info
     281CHICKEN_IMPORT_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -feature chicken-compile-shared -dynamic
    280282
    281283ifneq ($(USE_HOST_PCRE),)
     
    293295CHICKEN_SETUP_PROGRAM = $(PROGRAM_PREFIX)chicken-setup$(PROGRAM_SUFFIX)
    294296CHICKEN_BUG_PROGRAM = $(PROGRAM_PREFIX)chicken-bug$(PROGRAM_SUFFIX)
     297IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures posix srfi-13 srfi-69 extras \
     298        regex srfi-14 tcp foreign scheme srfi-18 utils
    295299
    296300ifdef STATICBUILD
     
    314318        $(CSI_SHARED_EXECUTABLE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    315319        $(CSC_PROGRAM)$(EXE) $(CHICKEN_SETUP_PROGRAM)$(EXE) chicken.info \
    316         $(CHICKEN_BUG_PROGRAM)$(EXE)
     320        $(CHICKEN_BUG_PROGRAM)$(EXE) \
     321        $(IMPORT_LIBRARIES:=.import.so)
    317322endif
    318323
  • chicken/branches/hygienic/distribution/manifest

    r10753 r10788  
    269269foreign.import.scm
    270270foreign.import.c
     271lolevel.import.scm
     272srfi-1.import.scm
     273srfi-4.import.scm
     274data-structures.import.scm
     275posix.import.scm
     276srfi-13.import.scm
     277srfi-69.import.scm
     278extras.import.scm
     279regex.import.scm
     280srfi-14.import.scm
     281tcp.import.scm
     282srfi-18.import.scm
     283utils.import.scm
     284lolevel.import.c
     285srfi-1.import.c
     286srfi-4.import.c
     287data-structures.import.c
     288posix.import.c
     289srfi-13.import.c
     290srfi-69.import.c
     291extras.import.c
     292regex.import.c
     293srfi-14.import.c
     294tcp.import.c
     295srfi-18.import.c
     296utils.import.c
  • chicken/branches/hygienic/expand.scm

    r10753 r10788  
    661661               (mod (##sys#find-module mname #f)))
    662662          (unless mod
    663             (let ((il (##sys#resolve-include-filename
     663            (let ((il (##sys#find-extension
    664664                       (string-append (symbol->string mname) ".import")
    665                        #f #t) ) )
     665                       #t)))
    666666              (cond (il (parameterize ((##sys#current-module #f)
    667667                                       (##sys#import-environment '())
     
    11291129        (else #f)))
    11301130
     1131(define (##sys#toplevel-definition-hook sym mod exp val) #f)
     1132
    11311133(define (##sys#register-export sym mod #!optional val)
    11321134  (when mod
    1133     (when (##sys#find-export sym mod)
    1134       (d "defined: " sym)
    1135       (when (assq sym (module-defined-list mod))
    1136         (##sys#warn
    1137          "exported variable multiply defined"
    1138          sym (module-name mod)))
    1139       (set-module-defined-list!
    1140        mod
    1141        (cons (cons sym val)
    1142              (module-defined-list mod))))))
     1135    (let ((exp (##sys#find-export sym mod)))
     1136      (##sys#toplevel-definition-hook (##sys#module-rename sym (module-name mod)) mod exp val)
     1137      (when exp
     1138        (d "defined: " sym)
     1139        (when (assq sym (module-defined-list mod))
     1140          (##sys#warn
     1141           "exported variable multiply defined"
     1142           sym (module-name mod)))
     1143        (set-module-defined-list!
     1144         mod
     1145         (cons (cons sym val)
     1146               (module-defined-list mod)))))) )
    11431147
    11441148(define (##sys#register-module name explist #!optional (vexports '()) (sexports '()))
     
    12311235
    12321236(define ##sys#module-table '())
     1237
     1238(define (##sys#macro-subset me0)
     1239  (let loop ((me (##sys#macro-environment)))
     1240    (if (or (null? me) (eq? me me0))
     1241        '()
     1242        (cons (car me) (loop (cdr me))))))
  • chicken/branches/hygienic/library.scm

    r10712 r10788  
    43034303
    43044304
    4305 ;;; andmap + ormap: DEPRECATED
    4306 
    4307 (define andmap
    4308   (lambda (f first . rest)
    4309     (cond ((null? rest)
    4310            (let mapf ((l first))
    4311              (or (null? l)
    4312                  (and (f (car l)) (mapf (cdr l))))))
    4313           ((null? (cdr rest))
    4314            (let mapf ((l1 first) (l2 (car rest)))
    4315              (or (null? l1)
    4316                  (and (f (car l1) (car l2)) (mapf (cdr l1) (cdr l2))))))
    4317           (else
    4318            (let mapf ((first first) (rest rest))
    4319              (or (null? first)
    4320                  (and (apply f (car first) (map (lambda (x) (car x)) rest))
    4321                       (mapf (cdr first) (map (lambda (x) (cdr x)) rest)))))))))
    4322 
    4323 (define ormap
    4324   (lambda (f first . rest)
    4325     (and (pair? first)
    4326          (let ([lists (cons first rest)])
    4327            (or (apply f (map (lambda (x) (car x)) lists))
    4328                (apply ormap f (map (lambda (x) (cdr x)) lists)) ) ) ) ) )
    4329 
    4330 
    43314305;;; Internal string-reader:
    43324306
  • chicken/branches/hygienic/lolevel.scm

    r10712 r10788  
    276276            proc
    277277            (##sys#signal-hook #:type-error 'set-procedure-data! "bad argument type - not an extended procedure" proc) ) ) ) ) )
    278 
    279 
    280 ;;; Bytevector stuff:
    281 
    282 (define byte-vector? blob?)             ; DEPRECATED
    283 
    284 (define (byte-vector-fill! bv n)        ; DEPRECATED
    285   (##sys#check-byte-vector bv 'byte-vector-fill!)
    286   (##sys#check-exact n 'byte-vector-fill!)
    287   (let ([len (##sys#size bv)])
    288     (do ([i 0 (fx+ i 1)])
    289         ((fx>= i len))
    290       (##sys#setbyte bv i n) ) ) )
    291 
    292 (define make-byte-vector                ; DEPRECATED
    293     (lambda (size . init)
    294       (let ([bv (make-blob size)])
    295         (when (pair? init) (byte-vector-fill! bv (car init)))
    296         bv) ) )
    297 
    298 (define byte-vector                     ; DEPRECATED
    299     (lambda bytes
    300       (let* ([n (length bytes)]
    301              [bv (make-byte-vector n)] )
    302         (do ([i 0 (fx+ i 1)]
    303              [bytes bytes (##sys#slot bytes 1)] )
    304             ((fx>= i n) bv)
    305           (##sys#setbyte bv i (##sys#slot bytes 0)) ) ) ) )
    306 
    307 (define byte-vector-set!                ; DEPRECATED
    308   (lambda (bv i x)
    309     (##sys#check-byte-vector bv 'byte-vector-set!)
    310     (##sys#check-exact i 'byte-vector-set!)
    311     (##sys#check-exact x 'byte-vector-set!)
    312     (let ([n (##sys#size bv)])
    313       (if (or (fx< i 0) (fx>= i n))
    314           (##sys#error 'byte-vector-set! "out of range" bv i)
    315           (##sys#setbyte bv i x) ) ) ) )
    316 
    317 (define byte-vector-ref                 ; DEPRECATED
    318   (getter-with-setter
    319    (lambda (bv i)
    320      (##sys#check-byte-vector bv 'byte-vector-ref)
    321      (##sys#check-exact i 'byte-vector-ref)
    322      (let ([n (##sys#size bv)])
    323        (if (or (fx< i 0) (fx>= i n))
    324            (##sys#error 'byte-vector-ref "out of range" bv i)
    325            (##sys#byte bv i) ) ) )
    326    byte-vector-set!) )
    327 
    328 (define (byte-vector->list bv)          ; DEPRECATED
    329   (##sys#check-byte-vector bv 'byte-vector->list)
    330   (let ([len (##sys#size bv)])
    331     (let loop ([i 0])
    332       (if (fx>= i len)
    333           '()
    334           (cons (##sys#byte bv i)
    335                 (loop (fx+ i 1)) ) ) ) ) )
    336 
    337 (define list->byte-vector               ; DEPRECATED
    338     (lambda (lst)
    339       (##sys#check-list lst 'list->byte-vector)
    340       (let* ([n (length lst)]
    341              [v (make-byte-vector n)] )
    342         (do ([p lst (##sys#slot p 1)]
    343              [i 0 (fx+ i 1)] )
    344             ((eq? p '()) v)
    345           (if (pair? p)
    346               (let ([b (##sys#slot p 0)])
    347                 (##sys#check-exact b 'list->byte-vector)
    348                 (##sys#setbyte v i b) )
    349               (##sys#not-a-proper-list-error lst) ) ) ) ) )
    350 
    351 (define string->byte-vector string->blob) ; DEPRECATED
    352 
    353 (define byte-vector->string blob->string) ; DEPRECATED
    354 
    355 (define byte-vector-length blob-size) ; DEPRECATED
    356 
    357 (define-foreign-variable _c_header_size_mask int "C_HEADER_SIZE_MASK")
    358 
    359 (let ([malloc
    360        (foreign-lambda* scheme-object ((int size))
    361          "char *bv;
    362            if((bv = (char *)C_malloc(size + 3 + sizeof(C_header))) == NULL) return(C_SCHEME_FALSE);
    363            bv = (char *)C_align((C_word)bv);
    364            ((C_SCHEME_BLOCK *)bv)->header = C_BYTEVECTOR_TYPE | size;
    365            return((C_word)bv);") ] )
    366   (define (make size init alloc loc)
    367     (##sys#check-exact size loc)
    368     (if (fx> size _c_header_size_mask)
    369         (##sys#signal-hook #:bounds-error loc "out of range" size _c_header_size_mask)
    370         (let ([bv (alloc size)])
    371           (cond [bv
    372                  (when (pair? init) (byte-vector-fill! bv (##sys#slot init 0)))
    373                  bv]
    374                 [else (##sys#signal-hook #:runtime-error "can not allocate statically allocated bytevector" size)] ) ) ) )
    375   (set! make-static-byte-vector         ; DEPRECATED
    376     (lambda (size . init) (make size init malloc 'make-static-byte-vector))))
    377 
    378 (define static-byte-vector->pointer             ; DEPRECATED
    379   (lambda (bv)
    380     (##sys#check-byte-vector bv 'static-byte-vector->pointer)
    381     (if (##core#inline "C_permanentp" bv)
    382         (let ([p (##sys#make-pointer)])
    383           (##core#inline "C_pointer_to_block" p bv)
    384           p)
    385         (##sys#error 'static-byte-vector->pointer "can not coerce non-static blob" bv) ) ) )
    386 
    387 (define (byte-vector-move! src src-start src-end dst dst-start) ; DEPRECATED
    388   (let ((from (make-locative src src-start))
    389         (to   (make-locative dst dst-start)) )
    390     (move-memory! from to (- src-end src-start)) ) )
    391 
    392 (define (byte-vector-append . vectors)          ; DEPRECATED
    393   (define (append-rest-at i vectors)
    394     (if (pair? vectors)
    395         (let* ((src (car vectors))
    396                (len (byte-vector-length src))
    397                (dst (append-rest-at (+ i len) (cdr vectors))) )
    398           (byte-vector-move! src 0 len dst i)
    399           dst )
    400         (make-byte-vector i) ) )
    401   (append-rest-at 0 vectors) )
    402278
    403279
  • chicken/branches/hygienic/manual/Using the interpreter

    r10745 r10788  
    4848; -s  -script PATHNAME : This is equivalent to {{-batch -quiet -no-init PATHNAME}}. Arguments following {{PATHNAME}} are available by using  {{command-line-arguments}} and are not processed as interpreter options. Extra options in the environment variable {{CSI_OPTIONS}} are ignored.
    4949
    50 ; -se PATHNAME : The same as {{-s PATHNAME}} but prints each expression to {{(current-error-port)}} before it is evaluated.
     50; -sx PATHNAME : The same as {{-s PATHNAME}} but prints each expression to {{(current-error-port)}} before it is evaluated.
    5151
    5252; -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.
  • chicken/branches/hygienic/posixunix.scm

    r10712 r10788  
    817817    (foreign-value "C_issock" bool))
    818818
    819 (define set-file-position!              ; DEPRECATED
    820   (lambda (port pos . whence)
    821     (let ([whence (if (pair? whence) (car whence) _seek_set)])
    822       (##sys#check-exact pos 'set-file-position!)
    823       (##sys#check-exact whence 'set-file-position!)
    824       (when (fx< pos 0) (##sys#signal-hook #:bounds-error 'set-file-position! "invalid negative port position" pos port))
    825       (unless (cond [(port? port)
    826                      (and (eq? (##sys#slot port 7) 'stream)
    827                           (##core#inline "C_fseek" port pos whence) ) ]
    828                     [(fixnum? port) (##core#inline "C_lseek" port pos whence)]
    829                     [else (##sys#signal-hook #:type-error 'set-file-position! "invalid file" port)] )
    830         (posix-error #:file-error 'set-file-position! "cannot set file position" port pos) ) ) ) )
    831 
    832819(define file-position
    833820  (getter-with-setter
     
    842829        (posix-error #:file-error 'file-position "cannot retrieve file position of port" port) )
    843830      pos) )
    844    set-file-position!) )
     831   (lambda (port pos . whence)
     832     (let ([whence (if (pair? whence) (car whence) _seek_set)])
     833       (##sys#check-exact pos 'set-file-position!)
     834       (##sys#check-exact whence 'set-file-position!)
     835       (when (fx< pos 0) (##sys#signal-hook #:bounds-error 'set-file-position! "invalid negative port position" pos port))
     836       (unless (cond [(port? port)
     837                      (and (eq? (##sys#slot port 7) 'stream)
     838                           (##core#inline "C_fseek" port pos whence) ) ]
     839                     [(fixnum? port) (##core#inline "C_lseek" port pos whence)]
     840                     [else (##sys#signal-hook #:type-error 'set-file-position! "invalid file" port)] )
     841         (posix-error #:file-error 'set-file-position! "cannot set file position" port pos) ) ) ) ) )
    845842
    846843
     
    12451242          _uname-machine) ) )
    12461243
    1247 (define set-user-id!                  ; DEPRECATED
    1248   (lambda (id)
    1249     (when (fx< (##core#inline "C_setuid" id) 0)
    1250       (##sys#update-errno)
    1251       (##sys#error 'set-user-id! "cannot set user ID" id) ) ) )
    1252 
    12531244(define current-user-id
    12541245  (getter-with-setter
    12551246   (foreign-lambda int "C_getuid")
    1256    set-user-id!) )
     1247   (lambda (id)
     1248     (when (fx< (##core#inline "C_setuid" id) 0)
     1249       (##sys#update-errno)
     1250       (##sys#error 'set-user-id! "cannot set user ID" id) ) ) ) )
    12571251
    12581252(define current-effective-user-id
     
    12651259         'effective-user-id!-setter "cannot set effective user ID" id) ) ) ) )
    12661260
    1267 (define set-group-id!                 ; DEPRECATED
    1268   (lambda (id)
    1269     (when (fx< (##core#inline "C_setgid" id) 0)
    1270       (##sys#update-errno)
    1271       (##sys#error 'set-user-id! "cannot set group ID" id) ) ) )
    1272 
    12731261(define current-group-id
    12741262  (getter-with-setter
    12751263   (foreign-lambda int "C_getgid")
    1276    set-group-id!) )
     1264   (lambda (id)
     1265    (when (fx< (##core#inline "C_setgid" id) 0)
     1266      (##sys#update-errno)
     1267      (##sys#error 'set-user-id! "cannot set group ID" id) ) ) ) )
    12771268
    12781269(define current-effective-group-id
     
    14961487    a) )
    14971488
    1498 (define (set-process-group-id! pid pgid) ; DEPRECATED
    1499   (##sys#check-exact pid 'set-process-group-id!)
    1500   (##sys#check-exact pgid 'set-process-group-id!)
    1501   (when (fx< (##core#inline "C_setpgid" pid pgid) 0)
    1502     (##sys#update-errno)
    1503     (##sys#error 'set-process-group-id! "cannot set process group ID" pid pgid) ) )
    1504 
    15051489(define process-group-id
    15061490  (getter-with-setter
     
    15111495         (##sys#update-errno)
    15121496         (##sys#error 'process-group-id "cannot retrieve process group ID" pid) )
    1513     a) )
    1514    set-process-group-id!) )
     1497       a))
     1498   (lambda (pid pgid)
     1499     (##sys#check-exact pid 'set-process-group-id!)
     1500     (##sys#check-exact pgid 'set-process-group-id!)
     1501     (when (fx< (##core#inline "C_setpgid" pid pgid) 0)
     1502       (##sys#update-errno)
     1503       (##sys#error 'set-process-group-id! "cannot set process group ID" pid pgid) ) ) ) )
     1504
    15151505
    15161506;;; Hard and symbolic links:
  • chicken/branches/hygienic/rules.make

    r10713 r10788  
    7979COMPILER_STATIC_OBJECTS = $(COMPILER_OBJECTS_1:=-static$(O))
    8080
     81
    8182# library objects
    8283
     
    398399          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    399400          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     401
     402# import library objects
     403
     404scheme.import$(O): scheme.import.c chicken.h $(CHICKEN_CONFIG_H)
     405        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     406          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     407          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     408chicken.import$(O): chicken.import.c chicken.h $(CHICKEN_CONFIG_H)
     409        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     410          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     411          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     412lolevel.import$(O): lolevel.import.c chicken.h $(CHICKEN_CONFIG_H)
     413        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     414          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     415          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     416srfi-1.import$(O): srfi-1.import.c chicken.h $(CHICKEN_CONFIG_H)
     417        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     418          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     419          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     420srfi-4.import$(O): srfi-4.import.c chicken.h $(CHICKEN_CONFIG_H)
     421        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     422          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     423          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     424data-structures.import$(O): data-structures.import.c chicken.h $(CHICKEN_CONFIG_H)
     425        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     426          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     427          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     428posix.import$(O): posix.import.c chicken.h $(CHICKEN_CONFIG_H)
     429        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     430          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     431          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     432srfi-13.import$(O): srfi-13.import.c chicken.h $(CHICKEN_CONFIG_H)
     433        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     434          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     435          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     436srfi-69.import$(O): srfi-69.import.c chicken.h $(CHICKEN_CONFIG_H)
     437        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     438          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     439          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     440extras.import$(O): extras.import.c chicken.h $(CHICKEN_CONFIG_H)
     441        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     442          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     443          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     444regex.import$(O): regex.import.c chicken.h $(CHICKEN_CONFIG_H)
     445        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     446          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     447          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     448srfi-14.import$(O): srfi-14.import.c chicken.h $(CHICKEN_CONFIG_H)
     449        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     450          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     451          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     452tcp.import$(O): tcp.import.c chicken.h $(CHICKEN_CONFIG_H)
     453        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     454          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     455          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     456foreign.import$(O): foreign.import.c chicken.h $(CHICKEN_CONFIG_H)
     457        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     458          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     459          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     460srfi-18.import$(O): srfi-18.import.c chicken.h $(CHICKEN_CONFIG_H)
     461        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     462          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     463          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     464utils.import$(O): utils.import.c chicken.h $(CHICKEN_CONFIG_H)
     465        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     466          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     467          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    400468
    401469# compiler objects
     
    651719          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    652720
    653 # libchicken
     721# libraries
    654722
    655723.PHONY: libs
     
    699767        $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^
    700768
     769# import libraries
     770
     771.SUFFIXES: .import.so
     772
     773%.import.so: %.import.o
     774        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_DLOADABLE_OPTIONS) $^ $(LINKER_OUTPUT_OPTION) $@ \
     775          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LIBRARIES)
     776
    701777# executables
    702778
     
    740816# installation
    741817
    742 .PHONY: install uninstall install-libs install-manifests
     818.PHONY: install uninstall install-libs install-manifests install-import-libs
    743819
    744820install-libs:
     
    808884endif
    809885else
    810 install: $(TARGETS) install-libs install-manifests
     886install: $(TARGETS) install-libs install-import-libs install-manifests
    811887ifneq ($(DESTDIR),)
    812888        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
     
    828904        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)
    829905        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)
     906        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/chicken.import.so
     907        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/lolevel.import.so
     908        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-1.import.so
     909        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-4.import.so
     910        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/data-structures.import.so
     911        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/posix.import.so
     912        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-13.import.so
     913        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-69.import.so
     914        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/extras.import.so
     915        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/regex.import.so
     916        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-14.import.so
     917        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/tcp.import.so
     918        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/foreign.import.so
     919        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/scheme.import.so
     920        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-18.import.so
     921        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/utils.import.so
    830922endif
    831923ifndef STATICBUILD
     
    853945        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) csibatch.bat $(DESTDIR)$(IBINDIR)
    854946endif
     947endif
     948
     949ifdef STATICBUILD
     950install-import-libs:
     951        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(IMPORT_LIBRARIES:=.import.scm) $(DESTDIR)$(IEGGDIR)
     952else
     953install-import-libs:
     954        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(IMPORT_LIBRARIES:=.import.so) $(DESTDIR)$(IEGGDIR)
    855955endif
    856956
     
    9601060        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_PCRE_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    9611061
     1062chicken.import.c: chicken.import.scm
     1063        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1064lolevel.import.c: lolevel.import.scm
     1065        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1066srfi-1.import.c: srfi-1.import.scm
     1067        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1068srfi-4.import.c: srfi-4.import.scm
     1069        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1070data-structures.import.c: data-structures.import.scm
     1071        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1072posix.import.c: posix.import.scm
     1073        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1074srfi-13.import.c: srfi-13.import.scm
     1075        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1076srfi-69.import.c: srfi-69.import.scm
     1077        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1078extras.import.c: extras.import.scm
     1079        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1080regex.import.c: regex.import.scm
     1081        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1082srfi-14.import.c: srfi-14.import.scm
     1083        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1084tcp.import.c: tcp.import.scm
     1085        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1086foreign.import.c: foreign.import.scm
     1087        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1088scheme.import.c: scheme.import.scm
     1089        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1090srfi-18.import.c: srfi-18.import.scm
     1091        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1092utils.import.c: utils.import.scm
     1093        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1094
    9621095chicken.c: chicken.scm chicken-more-macros.scm chicken-ffi-macros.scm private-namespace.scm
    9631096        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     
    9981131        chicken-profile.c chicken-setup.c csc.c csi.c \
    9991132        chicken.c batch-driver.c compiler.c optimizer.c support.c \
    1000         c-platform.c c-backend.c chicken-bug.c
     1133        c-platform.c c-backend.c chicken-bug.c $(IMPORT_LIBRARIES:=.import.c)
    10011134
    10021135dist: distfiles
     
    10361169          csc.c csi.c \
    10371170          chicken.c batch-driver.c compiler.c optimizer.c support.c \
    1038           c-platform.c c-backend.c
     1171          c-platform.c c-backend.c \
     1172          $(IMPORT_LIBRARIES:=.import.c)
    10391173
    10401174distclean: clean confclean
     
    10801214        touch *.scm
    10811215
    1082 bootstrap.tar.gz: posixunix.c posixwin.c
     1216bootstrap.tar.gz: posixunix.c posixwin.c $(IMPORT_LIBRARIES:=.import.c)
    10831217        tar cfz bootstrap.tar.gz library.c eval.c data-structures.c extras.c lolevel.c utils.c tcp.c \
    10841218          srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c posixunix.c posixwin.c regex.c \
  • chicken/branches/hygienic/srfi-4.scm

    r10712 r10788  
    512512            (##sys#error loc "blob does not have correct size for packing" tag len sz) ) ) ) )
    513513
    514   (set! u8vector->byte-vector (pack 'u8vector 'u8vector->byte-vector)) ; DEPRECATED
    515   (set! s8vector->byte-vector (pack 's8vector 's8vector->byte-vector)) ; DEPRECATED
    516   (set! u16vector->byte-vector (pack 'u16vector 'u16vector->byte-vector)) ; DEPRECATED
    517   (set! s16vector->byte-vector (pack 's16vector 's16vector->byte-vector)) ; DEPRECATED
    518   (set! u32vector->byte-vector (pack 'u32vector 'u32vector->byte-vector)) ; DEPRECATED
    519   (set! s32vector->byte-vector (pack 's32vector 's32vector->byte-vector)) ; DEPRECATED
    520   (set! f32vector->byte-vector (pack 'f32vector 'f32vector->byte-vector)) ; DEPRECATED
    521   (set! f64vector->byte-vector (pack 'f64vector 'f64vector->byte-vector)) ; DEPRECATED
    522 
    523514  (set! u8vector->blob/shared (pack 'u8vector 'u8vector->blob/shared))
    524515  (set! s8vector->blob/shared (pack 's8vector 's8vector->blob/shared))
     
    538529  (set! f32vector->blob (pack-copy 'f32vector 'f32vector->blob))
    539530  (set! f64vector->blob (pack-copy 'f64vector 'f64vector->blob))
    540 
    541   (set! byte-vector->u8vector (unpack 'u8vector #t 'byte-vector->u8vector)) ; DEPRECATED
    542   (set! byte-vector->s8vector (unpack 's8vector #t 'byte-vector->s8vector)) ; DEPRECATED
    543   (set! byte-vector->u16vector (unpack 'u16vector 2 'byte-vector->u16vector)) ; DEPRECATED
    544   (set! byte-vector->s16vector (unpack 's16vector 2 'byte-vector->s16vector)) ; DEPRECATED
    545   (set! byte-vector->u32vector (unpack 'u32vector 4 'byte-vector->u32vector)) ; DEPRECATED
    546   (set! byte-vector->s32vector (unpack 's32vector 4 'byte-vector->s32vector)) ; DEPRECATED
    547   (set! byte-vector->f32vector (unpack 'f32vector 4 'byte-vector->f32vector)) ; DEPRECATED
    548   (set! byte-vector->f64vector (unpack 'f64vector 8 'byte-vector->f64vector)) ; DEPRECATED
    549531
    550532  (set! blob->u8vector/shared (unpack 'u8vector #t 'blob->u8vector/shared))
  • chicken/branches/hygienic/support.scm

    r10715 r10788  
    779779      (for-each (cut compiler-warning 'var "exported global variable `~S' is not defined" <>) exps) ) ) )
    780780
    781 (define (export-import-hook x id) (void))
     781
     782;;; change hook function to hide non-exported module bindings
     783
     784(set! ##sys#toplevel-definition-hook
     785  (lambda (sym mod exp val)
     786    (when (and (not val) (not exp))
     787      (debugging 'o "hiding nonexported module bindings" sym)
     788      (set! block-globals (cons sym block-globals)) ) ) )
     789
    782790
    783791
  • chicken/branches/hygienic/utils.scm

    r10745 r10788  
    503503
    504504
    505 ;;; Handy little things:
    506 
    507 (define (shift! lst #!optional default) ;; DEPRECATED
    508   (if (null? lst)
    509       default
    510       (begin
    511         (##sys#check-pair lst 'shift!)
    512         (let ([x (##sys#slot lst 0)]
    513               [d (##sys#slot lst 1)] )
    514           (##sys#check-pair d 'shift!)
    515           (##sys#setslot lst 1 (##sys#slot d 1))
    516           (##sys#setslot lst 0 (##sys#slot d 0))
    517           x) ) ) )
    518 
    519 (define (unshift! x lst) ;; DEPRECATED
    520   (##sys#check-pair lst 'unshift!)
    521   (##sys#setslot lst 1 (cons (##sys#slot lst 0) (##sys#slot lst 1)))
    522   (##sys#setslot lst 0 x)
    523   lst)
    524 
    525 
    526505;;;; Port-mapping (found in Gauche):
    527506
Note: See TracChangeset for help on using the changeset viewer.