Changeset 10952 in project


Ignore:
Timestamp:
05/29/08 13:19:44 (11 years ago)
Author:
felix winkelmann
Message:

merged changed from trunk rev. 10622:10950 (untested)

Location:
chicken/branches/hygienic
Files:
7 added
40 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/hygienic/Makefile

    r10657 r10952  
    6767        $(MAKE) -f Makefile.$(PLATFORM) fullcheck
    6868dist:
    69         $(MAKE) -f Makefile.$(PLATFORM) dist
     69        $(MAKE) -f Makefile.$(PLATFORM) distfiles
     70        csi -s scripts/makedist.scm
    7071libs:
    7172        $(MAKE) -f Makefile.$(PLATFORM) libs
  • chicken/branches/hygienic/Makefile.linux

    r10209 r10952  
    3232# options
    3333
     34LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,-soname,libchicken.so.$(BINARYVERSION)
     35LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,-soname,libuchicken.so.$(BINARYVERSION)
    3436C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
    3537ifdef DEBUGBUILD
     
    4345LIBRARIES = -lm -ldl
    4446NEEDS_RELINKING = yes
    45 
     47SONAME_LINK = 1
    4648
    4749# special files
  • chicken/branches/hygienic/NEWS

    r10872 r10952  
    2828    define-macro
    2929
    30 3.1.9
    31 
    32 - precompiled chicken.h is included in the Chicken distribution
    33 
    34 3.1.6
     303.2.5
     31
     32- bug fix in versioned symlink for shared library in rules.make
     33
     343.2.4
     35
     36- the build system now sets the SONAME field of libchicken.so under Linux
     37- fixed an allocation bug in decode_literal
     38
     393.2.3
     40
     41- some fixes to the build system when USE_HOST_PCRE is set
     42
     433.2.2
     44
     45- added use of unit ports to unit extras and chicken-setup
     46
     473.2.1
     48
     49- unit utils and extras: moved port extensions to unit ports
     50- new unit ports
     51
     523.2.0
    3553
    3654- unit extras: moved lists, queues, strings to data-structures
    3755- new unit data-structures
    38 
    39 3.1.5
    40 
    4156- unit library: symbol->string now copies its argument
    42 
    43 3.1.3
    44 
    4557- chicken-setup: added option -svn-trunk
    46 
    47 3.1.2
    48 
    4958- unit utils: added file-copy and file-move (request by the einit team)
    50 
    51 3.1.1
    52 
    5359- unit srfi-69: added hash-table-clear!
    5460- unit srfi-69: new
  • chicken/branches/hygienic/TODO

    r10951 r10952  
    11TODO for macro/module system                                    -*- Outline -*-
     2
     3* documentation
     4** chicken.texi needs to be regenerated
    25
    36* bugs
  • chicken/branches/hygienic/c-platform.scm

    r10788 r10952  
    100100       ##sys#profile-entry ##sys#profile-exit) ) ) )
    101101
    102 (define units-used-by-default '(library eval data-structures extras srfi-69))
     102(define units-used-by-default '(library eval data-structures ports extras srfi-69))
    103103(define words-per-flonum 4)
    104104(define parameter-limit 1024)
  • chicken/branches/hygienic/chicken-bug.1

    r8361 r10952  
    44.SH NAME
    55
    6 chicken-bug - generates a bug report from user input.
     6chicken-bug \- generates a Chicken Scheme bug report from user input
    77
    88.SH SYNOPSIS
  • chicken/branches/hygienic/chicken-profile.1

    r8361 r10952  
    44.SH NAME
    55
    6 chicken-profile - program that generates a human readable report
    7 from profiling output of Scheme code compiled with the
    8 .I CHICKEN
    9 compiler
     6chicken-profile \- generate a report from Chicken Scheme profiled program output
    107
    118.SH SYNOPSIS
  • chicken/branches/hygienic/chicken-setup.1

    r10629 r10952  
    11.\" dummy line
    2 .TH CHICKEN-SETUP 1 "14 Apr 2008"
     2.TH CHICKEN-SETUP 1 "20 May 2008"
    33
    44.SH NAME
    55
    6 chicken-setup - program to simplify building and installation of extension libraries for the
    7 .I CHICKEN
    8 Scheme system.
     6chicken-setup \- install extension libraries for Chicken Scheme
    97
    108.SH SYNOPSIS
  • chicken/branches/hygienic/chicken-setup.scm

    r10712 r10952  
    2828(declare
    2929  (run-time-macros)                     ;*** later: compile-syntax
    30   (uses srfi-1 regex utils posix tcp srfi-18 srfi-13)
     30  (uses srfi-1 regex utils posix tcp srfi-18 srfi-13 ports)
    3131  (export move-file run:execute make/proc uninstall-extension
    3232          install-extension install-program install-script setup-verbose-flag
  • chicken/branches/hygienic/chicken.1

    r8361 r10952  
    44.SH NAME
    55
    6 Chicken \- A Scheme\-to\-C compiler
     6chicken \- A Scheme\-to\-C compiler
    77
    88.SH SYNOPSIS
  • chicken/branches/hygienic/chicken.texi

    r9422 r10952  
    22@settitle Chicken Scheme Reference Manual
    33@setchapternewpage on
     4@ifinfo
     5@format
     6START-INFO-DIR-ENTRY
     7* Chicken: (chicken.info). Chicken Scheme Reference Manual.
     8END-INFO-DIR-ENTRY
     9@end format
     10@end ifinfo
    411@copying
    512Copyright 2007-2008 Felix Winkelmann and the Chicken Team
     
    10791086@item @ref{Unit eval, Unit eval} evaluation and macro-handling
    10801087
     1088@item @ref{Unit ports, Unit ports} I/O ports
     1089
    10811090@item @ref{Unit extras, Unit extras} useful utility definitions
    10821091
     
    11151124Identifiers are by default case-sensitive (see @uref{http://galinha.ucpel.tche.br:8080/Using%20the%20compiler#Compiler%20command%20line%20format, Compiler command line format}).
    11161125
    1117 [4.1.3] The maximal number of arguments that may be passed to a compiled procedure or macro is 120.  A macro-definition that has a single rest-parameter can have any number of arguments.  If the @code{libffi} library is available on this platform, and if it is installed, then CHICKEN can take advantage of this. See the @uref{http://chicken.wiki.br/chicken/README, README} file for more details.
     1126[4.1.3] The maximal number of arguments that may be passed to a compiled procedure or macro is 120.  A macro-definition that has a single rest-parameter can have any number of arguments. 
    11181127
    11191128[4.2.2] @code{letrec} does evaluate the initial values for the bound variables sequentially and not in parallel, that is:
     
    16771686    (args (apply + args))))
    16781687
    1679 (plus)                      =@strong{=>} 9
     1688(plus)                      =@strong{=>} 0
    16801689(plus 1)                    =@strong{=>} 1
    16811690(plus 1 2 3)                =@strong{=>} 6
     
    49054914Calls the procedure @code{PROC} with a single argument that is a string-input-port with the contents of @code{STRING}.
    49064915
    4907 @node Unit extras - String-port extensions - call-with-output-string, Unit extras - String-port extensions - with-input-from-string, Unit extras - String-port extensions - call-with-input-string, Unit extras - String-port extensions
     4916@node Unit ports - String-port extensions - call-with-output-string, Unit ports - String-port extensions - with-input-from-string, Unit ports - String-port extensions - call-with-input-string, Unit ports - String-port extensions
    49084917@subsection call-with-output-string
    49094918
     
    49144923Calls the procedure @code{PROC} with a single argument that is a string-output-port.  Returns the accumulated output-string.
    49154924
    4916 @node Unit extras - String-port extensions - with-input-from-string, Unit extras - String-port extensions - with-output-to-string, Unit extras - String-port extensions - call-with-output-string, Unit extras - String-port extensions
     4925@node Unit ports - String-port extensions - with-input-from-string, Unit ports - String-port extensions - with-output-to-string, Unit ports - String-port extensions - call-with-output-string, Unit ports - String-port extensions
    49174926@subsection with-input-from-string
    49184927
     
    49234932Call procedure @code{THUNK} with the current input-port temporarily bound to an input-string-port with the contents of @code{STRING}.
    49244933
    4925 @node Unit extras - String-port extensions - with-output-to-string,  , Unit extras - String-port extensions - with-input-from-string, Unit extras - String-port extensions
     4934@node Unit ports - String-port extensions - with-output-to-string,  , Unit ports - String-port extensions - with-input-from-string, Unit ports - String-port extensions
    49264935@subsection with-output-to-string
    49274936
     
    52085217
    52095218@menu
    5210 * Unit extras - Input/Output extensions - make-input-port::
    5211 * Unit extras - Input/Output extensions - make-output-port::
    52125219* Unit extras - Input/Output extensions - pretty-print::
    52135220* Unit extras - Input/Output extensions - pretty-print-width::
     
    52225229* Unit extras - Input/Output extensions - write-string::
    52235230* Unit extras - Input/Output extensions - read-token::
    5224 * Unit extras - Input/Output extensions - with-error-output-to-port::
    5225 * Unit extras - Input/Output extensions - with-input-from-port::
    5226 * Unit extras - Input/Output extensions - with-output-to-port::
    5227 
    5228 @end menu
    5229 
    5230 
    5231 @node Unit extras - Input/Output extensions - make-input-port, Unit extras - Input/Output extensions - make-output-port,  , Unit extras - Input/Output extensions
    5232 @subsection make-input-port
    5233 
    5234 
    5235 @verbatim
    5236 [procedure] (make-input-port READ READY? CLOSE [PEEK])
    5237 @end verbatim
    5238 Returns a custom input port. Common operations on this port are handled by the given parameters, which should be procedures of no arguments. @code{READ} is called when the next character is to be read and should return a character or @code{#!eof}. @code{READY?} is called when @code{char-ready?} is called on this port and should return @code{#t} or @code{#f}.  @code{CLOSE} is called when the port is closed. @code{PEEK} is called when @code{peek-char} is called on this port and should return a character or @code{#!eof}. if the argument @code{PEEK} is not given, then @code{READ} is used instead and the created port object handles peeking automatically (by calling @code{READ} and buffering the character).
    5239 
    5240 @node Unit extras - Input/Output extensions - make-output-port, Unit extras - Input/Output extensions - pretty-print, Unit extras - Input/Output extensions - make-input-port, Unit extras - Input/Output extensions
    5241 @subsection make-output-port
    5242 
    5243 
    5244 @verbatim
    5245 [procedure] (make-output-port WRITE CLOSE [FLUSH])
    5246 @end verbatim
    5247 Returns a custom output port. Common operations on this port are handled by the given parameters, which should be procedures.  @code{WRITE} is called when output is sent to the port and receives a single argument, a string.  @code{CLOSE} is called when the port is closed and should be a procedure of no arguments. @code{FLUSH} (if provided) is called for flushing the output port.
    5248 
    5249 @node Unit extras - Input/Output extensions - pretty-print, Unit extras - Input/Output extensions - pretty-print-width, Unit extras - Input/Output extensions - make-output-port, Unit extras - Input/Output extensions
     5231
     5232@end menu
     5233
     5234
     5235@node Unit extras - Input/Output extensions - pretty-print, Unit extras - Input/Output extensions - pretty-print-width,  , Unit extras - Input/Output extensions
    52505236@subsection pretty-print
    52515237
     
    53285314Read or write @code{NUM} characters from/to @code{PORT}, which defaults to the value of @code{(current-input-port)} or @code{(current-output-port)}, respectively.  If @code{NUM} is @code{#f} or not given, then all data up to the end-of-file is read, or, in the case of @code{write-string} the whole string is written. If no more input is available, @code{read-string} returns the empty string. @code{read-string!} reads destructively into the given @code{STRING} argument, but never more characters that would fit into @code{STRING}. If @code{START} is given, then the read characters are stored starting at that position. @code{read-string!} returns the actual number of characters read.
    53295315
    5330 @node Unit extras - Input/Output extensions - read-token, Unit extras - Input/Output extensions - with-error-output-to-port, Unit extras - Input/Output extensions - write-string, Unit extras - Input/Output extensions
     5316@node Unit extras - Input/Output extensions - read-token,  , Unit extras - Input/Output extensions - write-string, Unit extras - Input/Output extensions
    53315317@subsection read-token
    53325318
     
    87508736* Unit utils - Executing shell commands with formatstring and error checking::
    87518737* Unit utils - Reading a file's contents::
    8752 * Unit utils - Funky ports::
    8753 * Unit utils - Miscellaneous handy things::
    87548738
    87558739@end menu
     
    89688952* Unit utils - Iterating over input lines and files - for-each-line::
    89698953* Unit utils - Iterating over input lines and files - for-each-argv-line::
    8970 * Unit utils - Iterating over input lines and files - port-for-each::
    8971 * Unit utils - Iterating over input lines and files - port-map::
    8972 * Unit utils - Iterating over input lines and files - port-fold::
    89738954
    89748955@end menu
     
    89848965Calls @code{PROCEDURE} for each line read from @code{PORT} (which defaults to the value of @code{(current-input-port)}. The argument passed to @code{PROCEDURE} is a string with the contents of the line, excluding any line-terminators. When all input has been read from the port, @code{for-each-line} returns some unspecified value.
    89858966
    8986 @node Unit utils - Iterating over input lines and files - for-each-argv-line, Unit utils - Iterating over input lines and files - port-for-each, Unit utils - Iterating over input lines and files - for-each-line, Unit utils - Iterating over input lines and files
     8967@node Unit utils - Iterating over input lines and files - for-each-argv-line,  , Unit utils - Iterating over input lines and files - for-each-line, Unit utils - Iterating over input lines and files
    89878968@subsection for-each-argv-line
    89888969
     
    89988979(for-each-argv-line print)
    89998980@end example
    9000 @node Unit utils - Iterating over input lines and files - port-for-each, Unit utils - Iterating over input lines and files - port-map, Unit utils - Iterating over input lines and files - for-each-argv-line, Unit utils - Iterating over input lines and files
    9001 @subsection port-for-each
    9002 
    9003 
    9004 @verbatim
    9005 [procedure] (port-for-each FN THUNK)
    9006 @end verbatim
    9007 Apply @code{FN} to successive results of calling the zero argument procedure @code{THUNK} until it returns @code{#!eof}, discarding the results.
    9008 
    9009 @node Unit utils - Iterating over input lines and files - port-map, Unit utils - Iterating over input lines and files - port-fold, Unit utils - Iterating over input lines and files - port-for-each, Unit utils - Iterating over input lines and files
    9010 @subsection port-map
    9011 
    9012 
    9013 @verbatim
    9014 [procedure] (port-map FN THUNK)
    9015 @end verbatim
    9016 Apply @code{FN} to successive results of calling the zero argument procedure @code{THUNK} until it returns @code{#!eof}, returning a list of the collected results.
    9017 
    9018 @node Unit utils - Iterating over input lines and files - port-fold,  , Unit utils - Iterating over input lines and files - port-map, Unit utils - Iterating over input lines and files
    9019 @subsection port-fold
    9020 
    9021 
    9022 @verbatim
    9023 [procedure] (port-map FN ACC THUNK)
    9024 @end verbatim
    9025 Apply @code{FN} to successive results of calling the zero argument procedure @code{THUNK}, passing the @code{ACC} value as the second argument. The @code{FN} result becomes the new @code{ACC} value. When @code{THUNK} returns @code{#!eof}, the last @code{FN} result is returned.
    9026 
    90278981@node Unit utils - Executing shell commands with formatstring and error checking, Unit utils - Reading a file's contents, Unit utils - Iterating over input lines and files, Unit utils
    90288982@section Executing shell commands with formatstring and error checking
     
    90438997Similar to @code{(system (sprintf FORMATSTRING ARGUMENT1 ...))}, but signals an error if the invoked program should return a nonzero exit status.
    90448998
    9045 @node Unit utils - Reading a file's contents, Unit utils - Funky ports, Unit utils - Executing shell commands with formatstring and error checking, Unit utils
     8999@node Unit utils - Reading a file's contents,  , Unit utils - Executing shell commands with formatstring and error checking, Unit utils
    90469000@section Reading a file's contents
    90479001
     
    90619015If @code{FILE-OR-PORT} is a string, then this procedure returns the contents of the file as a string. If @code{FILE-OR-PORT} is a port, all remaining input is read and returned as a string. The port is not closed. If no argument is provided, input will be read from the port that is the current value of @code{(current-input-port)}.
    90629016
    9063 @node Unit utils - Funky ports, Unit utils - Miscellaneous handy things, Unit utils - Reading a file's contents, Unit utils
    9064 @section Funky ports
    9065 
    9066 @menu
    9067 * Unit utils - Funky ports - make-broadcast-port::
    9068 * Unit utils - Funky ports - make-concatenated-port::
    9069 
    9070 @end menu
    9071 
    9072 
    9073 @node Unit utils - Funky ports - make-broadcast-port, Unit utils - Funky ports - make-concatenated-port,  , Unit utils - Funky ports
    9074 @subsection make-broadcast-port
    9075 
    9076 
    9077 @verbatim
    9078 [procedure] (make-broadcast-port PORT ...)
    9079 @end verbatim
    9080 Returns a custom output port that emits everything written into it to the ports given as @code{PORT ...}. Closing the broadcast port does not close any of the argument ports.
    9081 
    9082 @node Unit utils - Funky ports - make-concatenated-port,  , Unit utils - Funky ports - make-broadcast-port, Unit utils - Funky ports
    9083 @subsection make-concatenated-port
    9084 
    9085 
    9086 @verbatim
    9087 [procedure] (make-concatenated-port PORT1 PORT2 ...)
    9088 @end verbatim
    9089 Returns a custom input port that reads its input from @code{PORT1}, until it is empty, then from @code{PORT2} and so on. Closing the concatenated port does not close any of the argument ports.
    9090 
    9091 @node Unit utils - Miscellaneous handy things,  , Unit utils - Funky ports, Unit utils
    9092 @section Miscellaneous handy things
    9093 
    9094 @menu
    9095 * Unit utils - Miscellaneous handy things - shift! DEPRECATED::
    9096 * Unit utils - Miscellaneous handy things - unshift! DEPRECATED::
    9097 
    9098 @end menu
    9099 
    9100 
    9101 @node Unit utils - Miscellaneous handy things - shift! DEPRECATED, Unit utils - Miscellaneous handy things - unshift! DEPRECATED,  , Unit utils - Miscellaneous handy things
    9102 @subsection shift! DEPRECATED
    9103 
    9104 
    9105 @verbatim
    9106 [procedure] (shift! LIST [DEFAULT])
    9107 @end verbatim
    9108 Returns the car of @code{LIST} (or @code{DEFAULT} if @code{LIST} is empty) and replaces the car of @code{LIST} with it's cadr and the cdr with the cddr. If @code{DEFAULT} is not given, and the list is empty, @code{#f} is returned. An example might be clearer, here:
    9109 
    9110 @example
    9111 (@strong{define} @strong{lst} '(1 2 3))
    9112 (shift! lst)             =@strong{=>} 1, lst is now (2 3)
    9113 @end example
    9114 @verbatim
    9115 
    9116 @end verbatim
    9117 The list must contain at least 2 elements.
    9118 
    9119 @node Unit utils - Miscellaneous handy things - unshift! DEPRECATED,  , Unit utils - Miscellaneous handy things - shift! DEPRECATED, Unit utils - Miscellaneous handy things
    9120 @subsection unshift! DEPRECATED
    9121 
    9122 
    9123 @verbatim
    9124 [procedure] (unshift! X PAIR)
    9125 @end verbatim
    9126 Sets the car of @code{PAIR} to @code{X} and the cdr to its cddr. Returns @code{PAIR}:
    9127 
    9128 @example
    9129 (@strong{define} @strong{lst} '(2))
    9130 (unshift! 99 lst)      @emph{; lst is now (99 2)
    9131 }@end example
    91329017Previous: @ref{Unit posix, Unit posix}
    91339018
     
    1186911754@section Installing extensions
    1187011755
     11756@menu
     11757* chicken-setup - Installing extensions - Installing extensions that use libraries::
     11758
     11759@end menu
     11760
    1187111761
    1187211762To install an extension library, run the @code{chicken-setup} program with the extension name as argument. The extension archive is downloaded, its contents extracted and the contained @emph{setup} script is executed. This setup script is a normal Scheme source file, which will be interpreted by @code{chicken-setup}. The complete language supported by @code{csi} is available, and the library units @code{srfi-1 regex utils posix tcp} are loaded. Additional libraries can be loaded at run-time.
     
    1187511765
    1187611766If no extension name is given on the command-line, and if none of the options @code{-list}, @code{-version}, @code{-repository} (without argument), @code{-program-path} (without argument), @code{-fetch}, @code{-fetch-tree} or @code{-docindex} is given, then all @code{.setup} scripts in the current directory are processed.
     11767
     11768@node chicken-setup - Installing extensions - Installing extensions that use libraries,  ,  , chicken-setup - Installing extensions
     11769@subsection Installing extensions that use libraries
     11770
     11771
     11772Sometimes an extension requires a C library to compile. Compilation can fail when your system has this library in a nonstandard location. Luckily, normally Chicken searches in the default locations @code{/usr} and @code{/usr/local}, and in the prefix where Chicken itself was installed. Sometimes this is not enough, so you'll need to supply chicken-setup with some extra hints to the C compiler/linker. Here's an example:
     11773
     11774@verbatim
     11775 chicken-setup -c '-I/usr/pkg/include/mysql' -c '-L/usr/pkg/lib/mysql' -c '-L -R/usr/pkg/lib/mysql' mysql
     11776@end verbatim
     11777This installs the mysql egg with the extra compiler options -I and -L to set the include path and the library search path. The second -L switch passes the -R option directly to the linker, which causes the library path to get hardcoded into the resulting extension file (for systems that do not use ld.so.conf).
    1187711778
    1187811779@node chicken-setup - Creating extensions, chicken-setup - Procedures and macros available in setup scripts, chicken-setup - Installing extensions, chicken-setup
     
    1280712708
    1280812709
    12809 Currently native threads are not supported. The runtime system is not reentrant, and the garbage-collection algorithm would be made much more complicated, since the location of every object (whether it is allocated on the stack or on the heap or completely outside the GC-able data space) has to be checked - this would be rather complex and inefficient in a situation where multiple threads are involved.
     12710Native threads are not supported for two reasons. One, the runtime system is not reentrant.  Two, concurrency implemented properly would require mandatory locking of every object that could be potentially shared between two threads. The garbage-collection algorithm would then become much more complex and inefficient, since the location of every object has to be accessed via a thread synchronization protocol. Such a design would make native threads in Chicken essentially equivalent to Unix processes and shared memory.
     12711
     12712For a different approach to concurrency, please see the @uref{http://www.call-with-current-continuation.org/eggs/3/mpi.html, mpi} egg.
    1281012713
    1281112714@node FAQ - General - Does CHICKEN support Unicode strings?, FAQ - General - Why do I get an "Error; invalid syntax; ;;;" using 'match' and 'syntax-case'?, FAQ - General - Does CHICKEN support native threads?, FAQ - General
  • chicken/branches/hygienic/csc.1

    r8361 r10952  
    44.SH NAME
    55
    6 csc - driver program to simplify compilation of Scheme files with the
    7 .I CHICKEN
    8 compiler
     6csc \- driver program for the Chicken Scheme compiler
    97
    108.SH SYNOPSIS
  • chicken/branches/hygienic/csc.scm

    r10922 r10952  
    2828(declare
    2929  (block)
    30   (uses data-structures srfi-1 srfi-13 utils extras ))
     30  (uses data-structures ports srfi-1 srfi-13 utils extras ))
    3131
    3232#>
     
    271271         id) ) )
    272272
    273 (define compile-options
    274   (if include-dir (list "-I" include-dir) '()))
     273(define compile-options '())
     274(define builtin-compile-options
     275  (if include-dir (list (conc "-I" (quotewrap include-dir))) '()))
    275276
    276277(define compile-only-flag "-c")
     
    279280(define linking-optimization-options default-linking-optimization-options)
    280281
    281 (define link-options
     282(define library-dir
     283  (prefix "" "lib"
     284         (if host-mode
     285             INSTALL_LIB_HOME
     286             TARGET_LIB_HOME)) )
     287
     288(define link-options '())
     289(define builtin-link-options
    282290  (cond ((or osx hpux-hppa mingw)
    283          (list (conc "-L" (quotewrap
    284                            (prefix "" "lib"
    285                                    (if host-mode
    286                                        INSTALL_LIB_HOME
    287                                        TARGET_LIB_HOME)) ))))
     291         (list (conc "-L" (quotewrap library-dir))))
    288292        (msvc
    289          (list (conc "-LIBPATH:" (quotewrap
    290                                   (prefix "" "lib"
    291                                           (if host-mode
    292                                               INSTALL_LIB_HOME
    293                                               TARGET_LIB_HOME)) ))))
     293         (list (conc "-LIBPATH:" (quotewrap library-dir))))
    294294        (else
    295295         (list
    296           (conc "-L" (quotewrap (prefix "" "lib"
    297                                         (if host-mode
    298                                             INSTALL_LIB_HOME
    299                                             TARGET_LIB_HOME))))
     296          (conc "-L" (quotewrap library-dir))
    300297          (conc " -Wl,-R" (quotewrap (prefix "" "lib"
    301298                                             (if host-mode
     
    502499  (let loop ([args args])
    503500    (cond [(null? args)
     501           ;Builtin search directory options do not override explict options
     502           (set! compile-options (append compile-options builtin-compile-options))
     503           (set! link-options (append link-options builtin-link-options))
     504           ;
    504505           (when inquiry-only
    505506             (when show-cflags (print* (compiler-options) #\space))
  • chicken/branches/hygienic/csi.1

    r10788 r10952  
    11-.\" dummy line
    2 .TH CSI 1 "10 May 2001"
     2.TH CSI 1 "20 May 2008"
    33
    44.SH NAME
     
    5454Evaluate
    5555.I expressions
     56\.
     57
     58.TP
     59.BI \-p\ \-print \ expressions
     60Evaluate
     61.I expressions
     62and print result(s)
     63\.
     64
     65.TP
     66.BI \-P\ \-pretty-print \ expressions
     67Evaluate
     68.I expressions
     69and pretty-print result(s)
    5670\.
    5771
  • chicken/branches/hygienic/csi.scm

    r10922 r10952  
    2727
    2828(declare
    29   (uses srfi-69)                        ; is here because a bootstrap from an older chicken may not make
     29  (uses srfi-69 ports)                  ; is here because a bootstrap from an older chicken may not make
    3030  (usual-integrations)                  ;  this used automatically
    3131  (disable-interrupts)
  • chicken/branches/hygienic/debian/chicken-bin.files

    r2616 r10952  
    1 usr/bin/chicken
    2 usr/bin/csc
    3 usr/bin/csi
    4 usr/bin/chicken-setup
    5 usr/bin/chicken-profile
  • chicken/branches/hygienic/debian/chicken-bin.manpages

    r2616 r10952  
    44chicken-setup.1
    55chicken-profile.1
     6chicken-bug.1
  • chicken/branches/hygienic/debian/control

    r3839 r10952  
    2828Depends: ${shlibs:Depends}
    2929Conflicts: chicken, chicken-dev
    30 Description: Simple Scheme-to-C compiler - runtime
     30Description: A practical and portable Scheme system - runtime
    3131 CHICKEN is a Scheme compiler which compiles a subset of R5RS into C.
    3232 It uses the ideas presented in Baker's paper "Cheney on the MTA", and
     
    3535 This package contains the shared library needed to run programs using
    3636 chicken.
    37  .
    38  Homepage: http://www.call-with-current-continuation.org
     37 
    3938
    4039Package: libchicken-dev
     
    4342Priority: optional
    4443Conflicts: chicken, chicken-dev
    45 Depends: libchicken0 (= ${Source-Version}), libpcre3-dev
     44Depends: libchicken0 (= ${binary:Version}), libpcre3-dev
    4645Replaces: chicken, chicken-dev
    47 Description: Simple Scheme-to-C compiler - development
     46Description: A practical and portable Scheme system - development
    4847 CHICKEN is a Scheme compiler which compiles a subset of R5RS into C.
    4948 It uses the ideas presented in Baker's paper "Cheney on the MTA", and
     
    5251 This package contains the header file and static library for developing
    5352 with chicken.
    54  .
    55  Homepage: http://www.call-with-current-continuation.org
     53
  • chicken/branches/hygienic/debian/rules

    r8341 r10952  
    11#!/usr/bin/make -f
    2 export DH_COMPAT=4
    3 
    42BUILD_ARCH = $(shell dpkg --print-installation-architecture)
    53
     
    119endif
    1210
    13 version=0.0.0
    14 major=0
     11version=3.2
    1512
    1613MAKE:=$(MAKE) PLATFORM=linux
     
    3027            SHAREDIR="$(PREFIX)/share" \
    3128            EGGDIR="/var/lib/chicken/$(BINARYVERSION)" \
    32             MAKEINFO_PROGRAM_OPTIONS= \
     29            MAKEINFO_PROGRAM_OPTIONS="" \
    3330            HOSTNAME=debian
    3431        touch build-stamp
     
    3835        dh_testroot
    3936        rm -f build-stamp
    40 #       -test -r /usr/share/misc/config.sub && \
    41 #         cp -f /usr/share/misc/config.sub $(CURDIR)/config.sub
    42 #       -test -r /usr/share/misc/config.guess && \
    43 #         cp -f /usr/share/misc/config.guess $(CURDIR)/config.guess
    44         -$(MAKE) clean
    45         -$(MAKE) distclean
     37        $(MAKE) clean
     38        $(MAKE) distclean
    4639        rm -f c_defaults.h
    4740        rm -f chicken_defaults.h
     
    6053        $(MAKE) \
    6154            install \
     55            USE_HOST_PCRE=1 \
    6256            PREFIX="$(CURDIR)/debian/tmp/usr" \
    6357            MANDIR="$(CURDIR)/debian/tmp/usr/share/man" \
     
    6559            SHAREDIR="$(CURDIR)/debian/tmp/usr/share" \
    6660            EGGDIR="$(CURDIR)/debian/tmp/var/lib/chicken/$(BINARYVERSION)" \
    67             MAKEINFO_PROGRAM_OPTIONS= \
     61            MAKEINFO_PROGRAM_OPTIONS="" \
    6862            HOSTNAME=debian
    6963
     
    7165        dh_testdir
    7266        dh_testroot
    73         dh_movefiles
    7467        dh_installdocs
    7568        dh_installman
     
    7972        dh_installinfo chicken.info*
    8073        dh_installchangelogs ChangeLog.*
     74        dh_install --sourcedir=debian/tmp
    8175        dh_link
    8276ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" ""
  • chicken/branches/hygienic/distribution/manifest

    r10931 r10952  
    5555eval.c
    5656data-structures.c
     57ports.c
    5758extras.c
    5859library.c
     
    7677uextras.c
    7778udata-structures.c
     79uports.c
    7880ulibrary.c
    7981ulolevel.c
     
    104106chicken.1
    105107chicken.h
    106 chicken.h.gch
    107108chicken.ico
    108109chicken.rc
     
    118119extras.scm
    119120data-structures.scm
     121ports.scm
    120122chicken-bug.1
    121123chicken-bug.scm
     
    149151html/supported-language.html
    150152html/unit-data-structures.html
     153html/unit-ports.html
    151154html/unit-eval.html
    152155html/unit-extras.html
  • chicken/branches/hygienic/eval.scm

    r10951 r10952  
    101101
    102102(define ##sys#core-library-modules
    103   '(extras lolevel utils tcp regex regex-extras posix srfi-1 srfi-4 srfi-13 srfi-14 srfi-18))
     103  '(extras lolevel utils tcp regex regex-extras posix srfi-1 srfi-4 srfi-13
     104           srfi-14 srfi-18 data-structures ports))
    104105
    105106(define ##sys#explicit-library-modules '())
  • chicken/branches/hygienic/extras.import.scm

    r10788 r10952  
    2727(##sys#register-primitive-module
    2828 'extras
    29  '(call-with-input-string
    30    call-with-output-string
    31    format
     29 '(format
    3230   fprintf
    33    make-input-port
    34    make-output-port
    3531   pp
    3632   pretty-print
     
    4844   read-token
    4945   sprintf
    50    with-error-output-to-port
    51    with-input-from-port
    52    with-input-from-string
    53    with-output-to-port
    54    with-output-to-string
    5546   write-byte
    5647   write-line
  • chicken/branches/hygienic/extras.scm

    r10951 r10952  
    2828(declare
    2929 (unit extras)
    30  (uses data-structures)
     30 (uses data-structures ports)
    3131 (usual-integrations)
    3232 (disable-warning redef)
     
    7575
    7676(register-feature! 'extras)
    77 
    7877
    7978;;; Read expressions from file:
     
    304303
    305304
    306 ;;; Redirect standard ports:
    307 
    308 (define (with-input-from-port port thunk)
    309   (##sys#check-port port 'with-input-from-port)
    310   (fluid-let ([##sys#standard-input port])
    311     (thunk) ) )
    312 
    313 (define (with-output-to-port port thunk)
    314   (##sys#check-port port 'with-output-from-port)
    315   (fluid-let ([##sys#standard-output port])
    316     (thunk) ) )
    317 
    318 (define (with-error-output-to-port port thunk)
    319   (##sys#check-port port 'with-error-output-from-port)
    320   (fluid-let ([##sys#standard-error port])
    321     (thunk) ) )
    322 
    323 
    324 ;;; Extended string-port operations:
    325  
    326 (define call-with-input-string
    327   (let ([open-input-string open-input-string])
    328     (lambda (str proc)
    329       (let ((in (open-input-string str)))
    330         (proc in) ) ) ) )
    331 
    332 (define call-with-output-string
    333   (let ((open-output-string open-output-string)
    334         (get-output-string get-output-string) )
    335     (lambda (proc)
    336       (let ((out (open-output-string)))
    337         (proc out)
    338         (get-output-string out) ) ) ) )
    339 
    340 (define with-input-from-string
    341   (let ((open-input-string open-input-string))
    342     (lambda (str thunk)
    343       (fluid-let ([##sys#standard-input (open-input-string str)])
    344         (thunk) ) ) ) )
    345 
    346 (define with-output-to-string
    347   (let ([open-output-string open-output-string]
    348         [get-output-string get-output-string] )
    349     (lambda (thunk)
    350       (fluid-let ([##sys#standard-output (open-output-string)])
    351         (thunk)
    352         (get-output-string ##sys#standard-output) ) ) ) )
    353 
    354 
    355 ;;; Custom ports:
    356 ;
    357 ; - Port-slots:
    358 ;
    359 ;   10: last
    360 
    361 (define make-input-port
    362   (lambda (read ready? close #!optional peek read-string read-line)
    363     (let* ((class
    364             (vector
    365              (lambda (p)                ; read-char
    366                (let ([last (##sys#slot p 10)])
    367                  (cond [peek (read)]
    368                        [last
    369                         (##sys#setislot p 10 #f)
    370                         last]
    371                        [else (read)] ) ) )
    372              (lambda (p)                ; peek-char
    373                (let ([last (##sys#slot p 10)])
    374                  (cond [peek (peek)]
    375                        [last last]
    376                        [else
    377                         (let ([last (read)])
    378                           (##sys#setslot p 10 last)
    379                           last) ] ) ) )
    380              #f                         ; write-char
    381              #f                         ; write-string
    382              (lambda (p)                ; close
    383                (close)
    384                (##sys#setislot p 8 #t) )
    385              #f                         ; flush-output
    386              (lambda (p)                ; char-ready?
    387                (ready?) )
    388              read-string                ; read-string!
    389              read-line) )               ; read-line
    390            (data (vector #f))
    391            (port (##sys#make-port #t class "(custom)" 'custom)) )
    392       (##sys#setslot port 9 data)
    393       port) ) )
    394 
    395 (define make-output-port
    396   (let ([string string])
    397     (lambda (write close #!optional flush)
    398       (let* ((class
    399               (vector
    400                #f                       ; read-char
    401                #f                       ; peek-char
    402                (lambda (p c)            ; write-char
    403                  (write (string c)) )
    404                (lambda (p s)            ; write-string
    405                  (write s) )
    406                (lambda (p)              ; close
    407                  (close)
    408                  (##sys#setislot p 8 #t) )
    409                (lambda (p)              ; flush-output
    410                  (when flush (flush)) )
    411                #f                       ; char-ready?
    412                #f                       ; read-string!
    413                #f) )                    ; read-line
    414              (data (vector #f))
    415              (port (##sys#make-port #f class "(custom)" 'custom)) )
    416         (##sys#setslot port 9 data)
    417         port) ) ) )
    418305
    419306
  • chicken/branches/hygienic/library.scm

    r10788 r10952  
    18561856(define open-input-file)
    18571857(define open-output-file)
    1858 (define close-input-file)
    1859 (define close-output-file)
     1858(define close-input-port)
     1859(define close-output-port)
    18601860
    18611861(let ()
  • chicken/branches/hygienic/manual/Deviations from the standard

    r7036 r10952  
    99[4.1.3] The maximal number of arguments that may be passed to a
    1010compiled procedure or macro is 120.  A macro-definition that has a
    11 single rest-parameter can have any number of arguments.  If the
    12 {{libffi}} library is available on this platform, and if it is
    13 installed, then CHICKEN can take advantage of this. See the
    14 [[http://chicken.wiki.br/chicken/README|README]] file for more
    15 details.
     11single rest-parameter can have any number of arguments. 
    1612
    1713[4.2.2] {{letrec}} does evaluate the initial values for the bound
  • chicken/branches/hygienic/manual/Non-standard macros and special forms

    r10872 r10952  
    134134    (args (apply + args))))
    135135
    136 (plus)                      ==> 9
     136(plus)                      ==> 0
    137137(plus 1)                    ==> 1
    138138(plus 1 2 3)                ==> 6
  • chicken/branches/hygienic/manual/Supported language

    r10872 r10952  
    1515* [[Unit expand]] macro- and module handling
    1616* [[Unit data-structures]] data structures
     17* [[Unit ports]] I/O ports
    1718* [[Unit extras]] useful utility definitions
    1819* [[Unit srfi-1]] List Library
  • chicken/branches/hygienic/manual/Unit data-structures

    r10872 r10952  
    576576Previous: [[Unit expand]]
    577577
    578 Next: [[Unit extras]]
     578Next: [[Unit ports]]
  • chicken/branches/hygienic/manual/Unit extras

    r9587 r10952  
    130130
    131131Returns true if {{X}} is one of the tails (cdr's) of {{LIST}}.
    132 
    133 
    134 
    135 === String-port extensions
    136 
    137 
    138 ==== call-with-input-string
    139 
    140  [procedure] (call-with-input-string STRING PROC)
    141 
    142 Calls the procedure {{PROC}} with a single argument that is a
    143 string-input-port with the contents of {{STRING}}.
    144 
    145 
    146 ==== call-with-output-string
    147 
    148  [procedure] (call-with-output-string PROC)
    149 
    150 Calls the procedure {{PROC}} with a single argument that is a
    151 string-output-port.  Returns the accumulated output-string.
    152 
    153 
    154 ==== with-input-from-string
    155 
    156  [procedure] (with-input-from-string STRING THUNK)
    157 
    158 Call procedure {{THUNK}} with the current input-port temporarily
    159 bound to an input-string-port with the contents of {{STRING}}.
    160 
    161 
    162 ==== with-output-to-string
    163 
    164  [procedure] (with-output-to-string THUNK)
    165 
    166 Call procedure {{THUNK}} with the current output-port temporarily
    167 bound to a string-output-port and return the accumulated output string.
    168132
    169133
     
    406370
    407371
    408 
    409372=== Input/Output extensions
    410 
    411 
    412 ==== make-input-port
    413 
    414  [procedure] (make-input-port READ READY? CLOSE [PEEK])
    415 
    416 Returns a custom input port. Common operations on this
    417 port are handled by the given parameters, which should be
    418 procedures of no arguments. {{READ}} is called when the
    419 next character is to be read and should return a character or
    420 {{#!eof}}. {{READY?}} is called
    421 when {{char-ready?}} is called on this port and should return
    422 {{#t}} or {{#f}}.  {{CLOSE}} is called when the port is
    423 closed. {{PEEK}} is called when {{peek-char}} is called on this
    424 port and should return a character or {{#!eof}}.
    425 if the argument {{PEEK}} is not given, then {{READ}} is used
    426 instead and the created port object handles peeking automatically (by
    427 calling {{READ}} and buffering the character).
    428 
    429 
    430 ==== make-output-port
    431 
    432  [procedure] (make-output-port WRITE CLOSE [FLUSH])
    433 
    434 Returns a custom output port. Common operations on this port are handled
    435 by the given parameters, which should be procedures.  {{WRITE}} is
    436 called when output is sent to the port and receives a single argument,
    437 a string.  {{CLOSE}} is called when the port is closed and should
    438 be a procedure of no arguments. {{FLUSH}} (if provided) is called
    439 for flushing the output port.
    440 
    441373
    442374==== pretty-print
  • chicken/branches/hygienic/manual/Unit utils

    r6691 r10952  
    164164</enscript>
    165165
    166 ==== port-for-each
    167 
    168  [procedure] (port-for-each FN THUNK)
    169 
    170 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}}
    171 until it returns {{#!eof}}, discarding the results.
    172 
    173 ==== port-map
    174 
    175  [procedure] (port-map FN THUNK)
    176 
    177 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}}
    178 until it returns {{#!eof}}, returning a list of the collected results.
    179 
    180 ==== port-fold
    181 
    182  [procedure] (port-map FN ACC THUNK)
    183 
    184 Apply {{FN}} to successive results of calling the zero argument procedure {{THUNK}},
    185 passing the {{ACC}} value as the second argument. The {{FN}} result becomes the new
    186 {{ACC}} value. When {{THUNK}} returns {{#!eof}}, the last {{FN}} result is returned.
    187 
    188166=== Executing shell commands with formatstring and error checking
    189167
     
    208186port that is the current value of {{(current-input-port)}}.
    209187
    210 
    211 === Funky ports
    212 
    213 ==== make-broadcast-port
    214 
    215  [procedure] (make-broadcast-port PORT ...)
    216 
    217 Returns a custom output port that emits everything written into it to
    218 the ports given as {{PORT ...}}. Closing the broadcast port does not close
    219 any of the argument ports.
    220 
    221 ==== make-concatenated-port
    222 
    223  [procedure] (make-concatenated-port PORT1 PORT2 ...)
    224 
    225 Returns a custom input port that reads its input from {{PORT1}}, until it
    226 is empty, then from {{PORT2}} and so on. Closing the concatenated port
    227 does not close any of the argument ports.
    228 
    229 
    230 ===  Miscellaneous handy things
    231 
    232 ==== shift! DEPRECATED
    233 
    234  [procedure] (shift! LIST [DEFAULT])
    235 
    236 Returns the car of {{LIST}} (or {{DEFAULT}} if {{LIST}} is empty) and replaces
    237 the car of {{LIST}} with it's cadr and the cdr with the cddr. If {{DEFAULT}} is not given, and
    238 the list is empty, {{#f}} is returned. An example might be clearer, here:
    239 
    240 <enscript highlight=scheme>
    241 (define lst '(1 2 3))
    242 (shift! lst)             ==> 1, lst is now (2 3)
    243 </enscript>
    244 
    245 The list must contain at least 2 elements.
    246 
    247 ==== unshift! DEPRECATED
    248 
    249  [procedure] (unshift! X PAIR)
    250 
    251 Sets the car of {{PAIR}} to {{X}} and the cdr to its cddr. Returns {{PAIR}}:
    252 
    253 <enscript highlight=scheme>
    254 (define lst '(2))
    255 (unshift! 99 lst)      ; lst is now (99 2)
    256 </enscript>
    257 
    258 
    259188Previous: [[Unit posix]]
    260189
  • chicken/branches/hygienic/manual/chicken-setup

    r9418 r10952  
    5252directory are processed.
    5353
     54==== Installing extensions that use libraries
     55
     56Sometimes an extension requires a C library to compile. Compilation can fail when your system has this library in a nonstandard location. Luckily, normally Chicken searches in the default locations {{/usr}} and {{/usr/local}}, and in the prefix where Chicken itself was installed. Sometimes this is not enough, so you'll need to supply chicken-setup with some extra hints to the C compiler/linker. Here's an example:
     57
     58  chicken-setup -c '-I/usr/pkg/include/mysql' -c '-L/usr/pkg/lib/mysql' -c '-L -R/usr/pkg/lib/mysql' mysql
     59
     60This installs the mysql egg with the extra compiler options -I and -L to set the include path and the library search path. The second -L switch passes the -R option directly to the linker, which causes the library path to get hardcoded into the resulting extension file (for systems that do not use ld.so.conf).
    5461
    5562=== Creating extensions
  • chicken/branches/hygienic/manual/faq

    r9418 r10952  
    129129==== Does CHICKEN support native threads?
    130130
    131 Currently native threads are not supported. The runtime system is not reentrant, and the garbage-collection
    132 algorithm would be made much more complicated, since the location of every object (whether it is allocated
    133 on the stack or on the heap or completely outside the GC-able data space) has to be checked - this would
    134 be rather complex and inefficient in a situation where multiple threads are involved.
    135 
     131Native threads are not supported for two reasons. One, the runtime
     132system is not reentrant.  Two, concurrency implemented properly would
     133require mandatory locking of every object that could be potentially
     134shared between two threads. The garbage-collection algorithm would
     135then become much more complex and inefficient, since the location of
     136every object has to be accessed via a thread synchronization
     137protocol. Such a design would make native threads in Chicken
     138essentially equivalent to Unix processes and shared memory.
     139
     140For a different approach to concurrency, please see the
     141[[http://www.call-with-current-continuation.org/eggs/3/mpi.html|mpi]]
     142egg.
    136143
    137144==== Does CHICKEN support Unicode strings?
  • chicken/branches/hygienic/rules.make

    r10872 r10952  
    2929
    3030LIBCHICKEN_OBJECTS_1 = \
    31        library eval data-structures extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     31       library eval data-structures ports extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    3232       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    3333       profiler stub expand runtime
     
    3636
    3737LIBUCHICKEN_OBJECTS_1 = \
    38        ulibrary ueval udata-structures uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
     38       ulibrary ueval udata-structures uports uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
    3939       usrfi-13 usrfi-14 usrfi-18 usrfi-69 u$(POSIXFILE) uregex scheduler \
    4040       profiler stub expand uruntime
     
    4343
    4444LIBCHICKENGUI_OBJECTS_1 = \
    45        library eval data-structures extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     45       library eval data-structures ports extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    4646       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    4747       profiler stub expand gui-runtime
     
    4949LIBCHICKENGUI_STATIC_OBJECTS = $(LIBCHICKENGUI_OBJECTS_1:=-static$(O))
    5050
     51ifeq ($(USE_HOST_PCRE),)
    5152PCRE_OBJECTS_1 ?= \
    5253       pcre/pcre_compile \
     
    7273PCRE_SHARED_OBJECTS = $(PCRE_OBJECTS_1:=$(O))
    7374PCRE_STATIC_OBJECTS = $(PCRE_OBJECTS_1:=-static$(O))
     75endif
    7476
    7577COMPILER_OBJECTS_1 = \
     
    103105          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    104106          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     107ports$(O): ports.c chicken.h $(CHICKEN_CONFIG_H)
     108        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     109          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     110          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    105111extras$(O): extras.c chicken.h $(CHICKEN_CONFIG_H)
    106112        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    181187          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    182188udata-structures$(O): udata-structures.c chicken.h $(CHICKEN_CONFIG_H)
     189        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     190          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     191          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     192uports$(O): uports.c chicken.h $(CHICKEN_CONFIG_H)
    183193        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    184194          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     
    262272          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    263273          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     274ports-static$(O): ports.c chicken.h $(CHICKEN_CONFIG_H)
     275        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     276          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     277          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    264278extras-static$(O): extras.c chicken.h $(CHICKEN_CONFIG_H)
    265279        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    340354          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    341355udata-structures-static$(O): udata-structures.c chicken.h $(CHICKEN_CONFIG_H)
     356        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     357          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     358          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     359uports-static$(O): uports.c chicken.h $(CHICKEN_CONFIG_H)
    342360        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    343361          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     
    427445          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    428446data-structures.import$(O): data-structures.import.c chicken.h $(CHICKEN_CONFIG_H)
     447        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     448          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     449          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     450ports.import$(O): ports.import.c chicken.h $(CHICKEN_CONFIG_H)
    429451        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
    430452          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     
    856878        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)
    857879        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)
     880ifdef SONAME_LINK
     881        ln -sf $(DESTDIR)$(ILIBDIR)/$(LIBCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)/$(LIBCHICKEN_SO_FILE).$(BINARYVERSION)
     882endif
    858883endif
    859884ifdef WINDOWS
     
    913938        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-4.import.so
    914939        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/data-structures.import.so
     940        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/ports.import.so
    915941        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/posix.import.so
    916942        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-13.import.so
     
    9991025data-structures.c: data-structures.scm private-namespace.scm
    10001026        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1027ports.c: ports.scm private-namespace.scm
     1028        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
    10011029extras.c: extras.scm private-namespace.scm
    10021030        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     
    10381066udata-structures.c: data-structures.scm private-namespace.scm unsafe-declarations.scm
    10391067        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
     1068uports.c: ports.scm private-namespace.scm unsafe-declarations.scm
     1069        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    10401070uextras.c: extras.scm private-namespace.scm unsafe-declarations.scm
    10411071        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
     
    11301160.PHONY: distfiles dist
    11311161
    1132 distfiles: buildsvnrevision library.c eval.c expand.c data-structures.c extras.c lolevel.c utils.c \
     1162distfiles: buildsvnrevision library.c eval.c expand.c data-structures.c ports.c extras.c lolevel.c utils.c \
    11331163        tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
    11341164        posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    1135         ulibrary.c ueval.c udata-structures.c uextras.c ulolevel.c \
     1165        ulibrary.c ueval.c udata-structures.c uports.c uextras.c ulolevel.c \
    11361166        uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    11371167        usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c \
     
    11681198
    11691199spotless: distclean
    1170         -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c extras.c lolevel.c utils.c \
     1200        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c ports.c extras.c lolevel.c utils.c \
    11711201          tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c expand.c \
    11721202          posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    1173           ulibrary.c ueval.c udata-structures.c uextras.c ulolevel.c \
     1203          ulibrary.c ueval.c udata-structures.c uports.c uextras.c ulolevel.c \
    11741204          uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    11751205          usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c chicken-profile.c chicken-setup.c chicken-bug.c \
     
    12221252
    12231253bootstrap.tar.gz: posixunix.c posixwin.c $(IMPORT_LIBRARIES:=.import.c)
    1224         tar cfz bootstrap.tar.gz library.c eval.c data-structures.c extras.c lolevel.c utils.c tcp.c \
     1254        tar cfz bootstrap.tar.gz library.c eval.c data-structures.c ports.c extras.c lolevel.c utils.c tcp.c \
    12251255          srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c posixunix.c posixwin.c regex.c \
    12261256          scheduler.c profiler.c stub.c expand.c $(COMPILER_OBJECTS_1:=.c)
  • chicken/branches/hygienic/runtime.c

    r8640 r10952  
    91769176
    91779177
    9178 static C_regparm C_word C_fcall decode_literal2(C_word **ptr, C_char **str)
     9178static C_regparm C_word C_fcall decode_literal2(C_word **ptr, C_char **str,
     9179                                                C_word *dest)
    91799180{
    91809181  unsigned long bits = *((*str)++) & 0xff;
     
    92609261   
    92619262  case C_SYMBOL_TYPE:
    9262     val = C_intern(ptr, size, *str);
     9263    if(dest == NULL)
     9264      panic(C_text("invalid literal symbol destination"));
     9265
     9266    val = C_h_intern(dest, size, *str);
    92639267    *str += size;
    92649268    break;
     
    92859289
    92869290      while(size--) {
    9287         *(dptr++) = decode_literal2(ptr, str);
     9291        *dptr = decode_literal2(ptr, str, dptr);
     9292        ++dptr;
    92889293      }
    92899294    }
     
    92969301C_regparm C_word C_fcall C_decode_literal(C_word **ptr, C_char *str)
    92979302{
    9298   return decode_literal2(ptr, &str);
    9299 }
     9303  return decode_literal2(ptr, &str, NULL);
     9304}
  • chicken/branches/hygienic/scripts/maketexi.scm

    r10909 r10952  
    77(require-extension posix)
    88(require-extension utils)
     9(require-extension srfi-40)
     10(require-extension html-stream)
     11(require-extension stream-ext)
    912(require-extension stream-wiki)
    10 (require-extension stream-ext)
    1113
    1214(define extensions (make-hash-table))
  • chicken/branches/hygienic/srfi-4.scm

    r10788 r10952  
    568568            (cond [(or (eq? tag 'f) (eq? tag 'F)) #f]
    569569                  [(memq tag consers) => (lambda (c) ((##sys#slot (##sys#slot c 1) 0) (read port)))]
    570                   [else (##sys#error "illegal bytevector syntax" tag)] ) )
     570                  [else (##sys#read-error port "illegal bytevector syntax" tag)] ) )
    571571          (old-hook char port) ) ) ) )
    572572
  • chicken/branches/hygienic/srfi-69.scm

    r10712 r10952  
    2929 (unit srfi-69)
    3030 (usual-integrations)
    31  #;(disable-warning redef) )
     31 (disable-warning redef) ) ; hash-table-ref is an extended binding!
    3232
    3333(cond-expand
  • chicken/branches/hygienic/stub.scm

    r10629 r10952  
    2828(declare
    2929  (unit default_stub)
    30   (uses library eval data-structures extras)
     30  (uses library eval data-structures ports extras)
    3131  (not safe) )
    3232
  • chicken/branches/hygienic/tests/test-gc-hooks.scm

    r7036 r10952  
    11;;;; test-gc-hooks.scm
    2 
    32
    43#>
  • chicken/branches/hygienic/utils.scm

    r10788 r10952  
    501501        (read-string #f file)
    502502        (with-input-from-file file (cut read-string #f)) ) ) )
    503 
    504 
    505 ;;;; Port-mapping (found in Gauche):
    506 
    507 (define (port-for-each fn thunk)
    508   (let loop ()
    509     (let ((x (thunk)))
    510       (unless (eq? x #!eof)
    511         (fn x)
    512         (loop) ) ) ) )
    513 
    514 (define port-map
    515   (let ((reverse reverse))
    516     (lambda (fn thunk)
    517       (let loop ((xs '()))
    518         (let ((x (thunk)))
    519           (if (eq? x #!eof)
    520               (reverse xs)
    521               (loop (cons (fn x) xs))))))))
    522 
    523 (define (port-fold fn acc thunk)
    524   (let loop ([acc acc])
    525     (let ([x (thunk)])
    526       (if (eq? x #!eof)
    527         acc
    528         (loop (fn x acc))) ) ) )
    529 
    530 ;;;; funky-ports
    531 
    532 (define (make-broadcast-port . ports)
    533   (make-output-port
    534    (lambda (s) (for-each (cut write-string s #f <>) ports))
    535    noop
    536    (lambda () (for-each flush-output ports)) ) )
    537 
    538 (define (make-concatenated-port p1 . ports)
    539   (let ((ports (cons p1 ports)))
    540     (make-input-port
    541      (lambda ()
    542        (let loop ()
    543          (if (null? ports)
    544              #!eof
    545              (let ((c (read-char (car ports))))
    546                (cond ((eof-object? c)
    547                       (set! ports (cdr ports))
    548                       (loop) )
    549                      (else c) ) ) ) ) )
    550      (lambda ()
    551        (and (not (null? ports))
    552             (char-ready? (car ports))))
    553      noop
    554      (lambda ()
    555        (let loop ()
    556          (if (null? ports)
    557              #!eof
    558              (let ((c (peek-char (car ports))))
    559                (cond ((eof-object? c)
    560                       (set! ports (cdr ports))
    561                       (loop) )
    562                      (else c))))))
    563      (lambda (p n dest start)
    564        (let loop ((n n) (c 0))
    565          (cond ((null? ports) c)
    566                ((fx<= n 0) c)
    567                (else
    568                 (let ((m (read-string! n dest (car ports) (fx+ start c))))
    569                   (when (fx< m n)
    570                     (set! ports (cdr ports)) )
    571                   (loop (fx- n m) (fx+ c m))))))))))
Note: See TracChangeset for help on using the changeset viewer.