Changeset 13143 in project


Ignore:
Timestamp:
02/01/09 08:46:41 (11 years ago)
Author:
Kon Lovett
Message:

Chgd "can not" -> "cannot" - saves bytes your know ;-)
Renamed "chicken-sys-macros.scm" -> "chicken-primitive-object-inlines.scm"
Added "chicken-primitive-object-inlines.scm"

Location:
chicken/branches/chicken-3
Files:
2 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/chicken-3/benchmarks/scheme.scm

    r1016 r13143  
    8787    (scheme-error "Identifier expected" x))
    8888  (if (memq x scheme-syntactic-keywords)
    89     (scheme-error "Variable name can not be a syntactic keyword" x)))
     89    (scheme-error "Variable name cannot be a syntactic keyword" x)))
    9090
    9191(define (shape form n)
  • chicken/branches/chicken-3/c-backend.scm

    r8588 r13143  
    13751375             str) ) )
    13761376         ((##sys#immediate? lit)
    1377           (bomb "invalid literal - can not encode" lit))
     1377          (bomb "invalid literal - cannot encode" lit))
    13781378         ((##core#inline "C_byteblockp" lit)
    13791379          (##sys#string-append ; relies on the fact that ##sys#string-append doesn't check
  • chicken/branches/chicken-3/chicken-setup.scm

    r12543 r13143  
    859859    (if (file-exists? dir)
    860860        (unless (directory? dir)
    861           (error "can not create directory: a file with the same name already exists") )
     861          (error "cannot create directory: a file with the same name already exists") )
    862862        (begin
    863863          (create-directory dir)
  • chicken/branches/chicken-3/chicken.h

    r13135 r13143  
    2828/* Configuration: */
    2929
     30/*
     31 * The Watcom (__WATCOMC__), Metroworks (__MWERKS__), and Delorie (__DJGPP__)
     32 * compilers are not currently supported but existing references remain,
     33 * just in case.
     34 */
     35
    3036#ifndef ___CHICKEN
    3137#define ___CHICKEN
     
    4046#endif
    4147
    42 #if !defined(__GNUC__) && !defined(__WATCOMC__)
     48/* Kind of platform */
     49
     50#ifndef C_SIXTY_FOUR
     51# if defined (__alpha__) || defined (__sparc_v9__) || defined (__sparcv9) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__powerpc64__)
     52#   define C_SIXTY_FOUR
     53# elif defined(__mips64) && (!defined(__GNUC__) || _MIPS_SZPTR == 64)
     54#   define C_SIXTY_FOUR
     55# endif
     56#endif
     57
     58#if defined(__APPLE__) && defined(__MACH__)
     59# define C_MACOSX
     60#endif
     61
     62#if defined(C_MACOSX) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
     63# define C_XXXBSD
     64#endif
     65
     66#if /*defined(__GNUC__) &&*/ (defined(__linux__) || defined(C_XXXBSD))
     67# define C_GNU_ENV
     68#endif
     69
     70#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__MWERKS__) || defined(__DJGPP__)
     71# define C_NONUNIX
     72#endif
     73
     74/* Headers */
     75
     76#include <stdio.h>
     77#include <stdlib.h>
     78#include <stdarg.h>
     79#include <ctype.h>
     80#include <string.h>
     81#include <setjmp.h>
     82#include <limits.h>
     83#include <time.h>
     84
     85#if !defined(C_NONUNIX) || defined(__MINGW32__) || defined(__WATCOMC__)
     86# include <unistd.h>
     87# include <inttypes.h>
     88# include <sys/types.h>
     89#endif
     90
     91/* Byteorder in machine word */
     92
     93#if defined(__MINGW32__)
     94# include <sys/param.h>
     95#elif defined(__CYGWIN__)
     96# include <endian.h>
     97#elif defined(__linux__)
     98# include <endian.h>
     99#elif defined(C_XXXBSD)
     100# include <machine/endian.h>
     101#elif defined(__hpux__)
     102# include <arpa/nameser.h>
     103#elif defined(_AIX)
     104# include <sys/machine.h>
     105#elif defined(__sun__)
     106# include <sys/isa_defs.h>
     107#elif defined(__svr4__)
     108# include <sys/byteorder.h>
     109#endif
     110
     111#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
     112# define C_BIG_ENDIAN
     113#elif defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
     114# define C_BIG_ENDIAN
     115#elif defined(__BIG_ENDIAN__)
     116# define C_BIG_ENDIAN
     117#elif defined(__sparc__) || defined(__POWERPC__) || defined(__MC68K__) || defined(__mips__)
     118# define C_BIG_ENDIAN
     119#endif
     120
     121#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
     122# define C_LITTLE_ENDIAN
     123#elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && BYTE_ORDER == LITTLE_ENDIAN
     124# define C_LITTLE_ENDIAN
     125#elif defined(__LITTLE_ENDIAN__)
     126# define C_LITTLE_ENDIAN
     127#elif defined (__alpha__) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
     128# define C_LITTLE_ENDIAN
     129#endif
     130
     131#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)
     132# include <malloc.h>
     133#endif
     134
     135/* Much better with stack allocation API */
     136
     137#if defined(_MSC_VER)
     138# if HAVE_ALLOCA_H
     139#  define alloca            _alloca
     140# endif
     141#elif !defined(__GNUC__) && !defined(__WATCOMC__)
    43142# if HAVE_ALLOCA_H
    44143#  include <alloca.h>
    45 # else
    46 #  ifdef _AIX
     144# elif defined(_AIX)
    47145#   pragma alloca
    48 #  else
    49 #   ifndef alloca /* predefined by HP cc +Olibcalls */
    50 char *alloca ();
    51 #   endif
    52 #  endif
     146# elif !defined(alloca) /* predefined by HP cc +Olibcalls */
     147    char *alloca ();
    53148# endif
    54149#elif (defined(__sun__) && defined(__svr4__)) || defined(__sgi__)
     
    58153#endif
    59154
     155#ifdef _MSC_VER
     156# include <io.h>
     157# define strncasecmp       strnicmp
     158# define isatty            _isatty
     159typedef __int8             int8_t;
     160typedef unsigned __int8    uint8_t;
     161typedef __int16            int16_t;
     162typedef unsigned  __int16  uint16_t;
     163typedef __int32            int32_t;
     164typedef unsigned __int32   uint32_t;
     165typedef __int64            int64_t;
     166typedef unsigned __int64   uint64_t;
     167# pragma warning(disable: 4101)
     168#endif
     169
     170/* */
     171
    60172#ifdef __cplusplus
    61173# define C_extern                  extern "C"
     
    67179# define C_END_C_DECLS
    68180#endif
     181 
     182 /* Function declaration options */
    69183 
    70184#define C_varextern                C_extern
     
    116230#endif
    117231
     232/* Thread Local Stoarage declaration */
     233
    118234#ifdef C_ENABLE_TLS
    119235# if defined(__GNUC__)
     
    127243# define C_TLS
    128244#endif
     245
     246/* Stack growth direction; used to compute stack addresses */
    129247
    130248#ifndef C_STACK_GROWS_DOWNWARD
     
    154272#else
    155273# define C_resize_stack(n)           C_do_resize_stack(n)
    156 #endif
    157 
    158 #ifndef C_SIXTY_FOUR
    159 # if defined (__alpha__) || defined (__sparc_v9__) || defined (__sparcv9) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__powerpc64__)
    160 #   define C_SIXTY_FOUR
    161 # elif defined(__mips64) && (!defined(__GNUC__) || _MIPS_SZPTR == 64)
    162 #   define C_SIXTY_FOUR
    163 # endif
    164 #endif
    165 
    166 #if defined(__APPLE__) && defined(__MACH__)
    167 # define C_MACOSX
    168 #endif
    169 
    170 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
    171 # define C_XXXBSD
    172 #endif
    173 
    174 #if defined(C_MACOSX) || defined(__linux__) || defined(C_XXXBSD)
    175 # define C_GNU_ENV
    176 #endif
    177 
    178 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__DJGPP__) || defined(__MINGW32__) || defined(__WATCOMC__)
    179 # define C_NONUNIX
    180 #endif
    181 
    182 #include <stdio.h>
    183 #include <stdlib.h>
    184 #include <stdarg.h>
    185 #include <ctype.h>
    186 #include <string.h>
    187 #include <setjmp.h>
    188 #include <limits.h>
    189 #include <time.h>
    190 
    191 #if !defined(C_NONUNIX) || defined(__MINGW32__) || defined(__WATCOMC__)
    192 # include <unistd.h>
    193 # include <inttypes.h>
    194 # include <sys/types.h>
    195 #endif
    196 
    197 #if defined(__MINGW32__)
    198 # include <sys/param.h>
    199 #elif defined(__CYGWIN__)
    200 # include <endian.h>
    201 #elif defined(__linux__)
    202 # include <endian.h>
    203 #elif defined(C_MACOSX) || defined(C_XXXBSD)
    204 # include <machine/endian.h>
    205 #elif defined(__hpux__)
    206 # include <arpa/nameser.h>
    207 #elif defined(_AIX)
    208 # include <sys/machine.h>
    209 #elif defined(__sun__)
    210 # include <sys/isa_defs.h>
    211 #elif defined(__svr4__)
    212 # include <sys/byteorder.h>
    213 #endif
    214 
    215 #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
    216 # define C_BIG_ENDIAN
    217 #elif defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
    218 # define C_BIG_ENDIAN
    219 #elif defined(__BIG_ENDIAN__)
    220 # define C_BIG_ENDIAN
    221 #elif defined(__sparc__) || defined(__POWERPC__) || defined(__MC68K__) || defined(__mips__)
    222 # define C_BIG_ENDIAN
    223 #endif
    224 
    225 #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
    226 # define C_LITTLE_ENDIAN
    227 #elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && BYTE_ORDER == LITTLE_ENDIAN
    228 # define C_LITTLE_ENDIAN
    229 #elif defined(__LITTLE_ENDIAN__)
    230 # define C_LITTLE_ENDIAN
    231 #elif defined (__alpha__) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
    232 # define C_LITTLE_ENDIAN
    233 #endif
    234 
    235 #ifdef __MINGW32__
    236 # include <malloc.h>
    237 #endif
    238 
    239 #ifdef _MSC_VER
    240 # include <malloc.h>
    241 # include <io.h>
    242 # define alloca            _alloca
    243 # define strncasecmp       strnicmp
    244 # define isatty            _isatty
    245 typedef __int8             int8_t;
    246 typedef unsigned __int8    uint8_t;
    247 typedef __int16            int16_t;
    248 typedef unsigned  __int16  uint16_t;
    249 typedef __int32            int32_t;
    250 typedef unsigned __int32   uint32_t;
    251 typedef __int64            int64_t;
    252 typedef unsigned __int64   uint64_t;
    253 # pragma warning(disable: 4101)
    254 #endif
    255 
    256 #ifdef __WATCOMC__
    257 # include <malloc.h>
    258274#endif
    259275
     
    336352# define C_CLOSURE_TYPE           (0x0400000000000000L | C_SPECIALBLOCK_BIT)
    337353# define C_FLONUM_TYPE            (0x0500000000000000L | C_BYTEBLOCK_BIT | C_8ALIGN_BIT)
    338 # define C_UNUSED_TYPE            (0x0600000000000000L)
     354/*       unused                   (0x0600000000000000L ...) */
    339355# define C_PORT_TYPE              (0x0700000000000000L | C_SPECIALBLOCK_BIT)
    340356# define C_STRUCTURE_TYPE         (0x0800000000000000L)
    341357# define C_POINTER_TYPE           (0x0900000000000000L | C_SPECIALBLOCK_BIT)
    342 # define C_BUCKET_TYPE            (0x0f00000000000000L)
    343358# define C_LOCATIVE_TYPE          (0x0a00000000000000L | C_SPECIALBLOCK_BIT)
    344359# define C_TAGGED_POINTER_TYPE    (0x0b00000000000000L | C_SPECIALBLOCK_BIT)
    345360# define C_SWIG_POINTER_TYPE      (0x0c00000000000000L | C_SPECIALBLOCK_BIT)
    346361# define C_LAMBDA_INFO_TYPE       (0x0d00000000000000L | C_BYTEBLOCK_BIT)
     362/*       unused                   (0x0e00000000000000L ...) */
     363# define C_BUCKET_TYPE            (0x0f00000000000000L)
    347364#else
    348365# define C_INT_SIGN_BIT           0x80000000
     
    361378# define C_CLOSURE_TYPE           (0x04000000 | C_SPECIALBLOCK_BIT)
    362379# ifdef C_DOUBLE_IS_32_BITS
    363 #  define C_FLONUM_TYPE            (0x05000000 | C_BYTEBLOCK_BIT)
     380#  define C_FLONUM_TYPE           (0x05000000 | C_BYTEBLOCK_BIT)
    364381# else
    365 #  define C_FLONUM_TYPE            (0x05000000 | C_BYTEBLOCK_BIT | C_8ALIGN_BIT)
     382#  define C_FLONUM_TYPE           (0x05000000 | C_BYTEBLOCK_BIT | C_8ALIGN_BIT)
    366383# endif
    367 # define C_UNUSED_TYPE            (0x06000000)
     384/*       unused                   (0x06000000 ...) */
    368385# define C_PORT_TYPE              (0x07000000 | C_SPECIALBLOCK_BIT)
    369386# define C_STRUCTURE_TYPE         (0x08000000)
    370387# define C_POINTER_TYPE           (0x09000000 | C_SPECIALBLOCK_BIT)
    371 # define C_BUCKET_TYPE            (0x0f000000)
    372388# define C_LOCATIVE_TYPE          (0x0a000000 | C_SPECIALBLOCK_BIT)
    373389# define C_TAGGED_POINTER_TYPE    (0x0b000000 | C_SPECIALBLOCK_BIT)
    374390# define C_SWIG_POINTER_TYPE      (0x0c000000 | C_SPECIALBLOCK_BIT)
    375391# define C_LAMBDA_INFO_TYPE       (0x0d000000 | C_BYTEBLOCK_BIT)
     392/*       unused                   (0x0e000000 ...) */
     393# define C_BUCKET_TYPE            (0x0f000000)
    376394#endif
    377395
     
    806824#define C_zero_length_p(x)        C_mk_bool(C_header_size(x) == 0)
    807825#define C_boundp(x)               C_mk_bool(((C_SCHEME_BLOCK *)(x))->data[ 0 ] != C_SCHEME_UNBOUND)
     826#define C_unboundvaluep(x)        C_mk_bool((x) == C_SCHEME_UNBOUND)
    808827#define C_blockp(x)               C_mk_bool(!C_immediatep(x))
    809828#define C_forwardedp(x)           C_mk_bool((C_block_header(x) & C_GC_FORWARDING_BIT) != 0)
  • chicken/branches/chicken-3/chicken.texi

    r11047 r13143  
    914914@item -no-usual-integrations
    915915
    916 Specifies that standard procedures and certain internal procedures may be redefined, and can not be inlined. This is equivalent to declaring @code{(not usual-integrations)}.
     916Specifies that standard procedures and certain internal procedures may be redefined, and cannot be inlined. This is equivalent to declaring @code{(not usual-integrations)}.
    917917@item -version
    918918
     
    12291229@code{csi @{FILENAME|OPTION}@}
    12301230
    1231 where @code{FILENAME} specifies a file with Scheme source-code.  If the extension of the source file is @code{.scm}, it may be omitted. The runtime options described in @uref{http://galinha.ucpel.tche.br/Using%20the%20compiler#Compiler%20command%20line%20format, Compiler command line format} are also available for the interpreter.  If the environment variable @code{CSI_OPTIONS} is set to a list of options, then these options are additionally passed to every direct or indirect invocation of @code{csi}. Please note that runtime options (like @code{-:...}) can not be passed using this method. The options recognized by the interpreter are:
     1231where @code{FILENAME} specifies a file with Scheme source-code.  If the extension of the source file is @code{.scm}, it may be omitted. The runtime options described in @uref{http://galinha.ucpel.tche.br/Using%20the%20compiler#Compiler%20command%20line%20format, Compiler command line format} are also available for the interpreter.  If the environment variable @code{CSI_OPTIONS} is set to a list of options, then these options are additionally passed to every direct or indirect invocation of @code{csi}. Please note that runtime options (like @code{-:...}) cannot be passed using this method. The options recognized by the interpreter are:
    12321232
    12331233@table @b
     
    30173017[declaration specifier] (not interrupts-enabled)
    30183018@end verbatim
    3019 Disable timer-interrupts checks in the compiled program. Threads can not be preempted in main- or library-units that contain this declaration.
     3019Disable timer-interrupts checks in the compiled program. Threads cannot be preempted in main- or library-units that contain this declaration.
    30203020
    30213021@node Declarations - disable-warning, Declarations - import, Declarations - disable-interrupts, Declarations
     
    41684168[procedure] (cpu-time)
    41694169@end verbatim
    4170 Returns the used CPU time of the current process in milliseconds as two values: the time spent in user code, and the time spent in system code. On platforms where user and system time can not be differentiated, system time will be always be 0.
     4170Returns the used CPU time of the current process in milliseconds as two values: the time spent in user code, and the time spent in system code. On platforms where user and system time cannot be differentiated, system time will be always be 0.
    41714171
    41724172@node Unit library - Execution time - current-milliseconds, Unit library - Execution time - current-seconds, Unit library - Execution time - cpu-time, Unit library - Execution time
     
    1356513565% csc -static-extensions my-program.scm -uses my-ext
    1356613566@end verbatim
    13567 The compiler will try to do the right thing, but can not handle all extensions, since the ability to statically link eggs is relatively new. Eggs that support static linking are designated as being able to do so. If you require a statically linkable version of an egg that has not been converted yet, contact the extension author or the CHICKEN  mailing list.
     13567The compiler will try to do the right thing, but cannot handle all extensions, since the ability to statically link eggs is relatively new. Eggs that support static linking are designated as being able to do so. If you require a statically linkable version of an egg that has not been converted yet, contact the extension author or the CHICKEN  mailing list.
    1356813568
    1356913569Previous: @ref{Interface to external functions and variables, Interface to external functions and variables}
     
    1377113771
    1377213772
    13773 @code{case} expands into a cascaded @code{if} expression, where the first item in each arm is treated as a quoted list. So the @code{case} macro can not infer whether a symbol is to be treated as a constant-name (defined via @code{define-constant}) or a literal symbol.
     13773@code{case} expands into a cascaded @code{if} expression, where the first item in each arm is treated as a quoted list. So the @code{case} macro cannot infer whether a symbol is to be treated as a constant-name (defined via @code{define-constant}) or a literal symbol.
    1377413774
    1377513775@node FAQ - General - How can I enable case sensitive reading/writing in user code?, FAQ - General - How can I change match-error-control during compilation?, FAQ - General - Why are constants defined by define-constant not honoured in case constructs?, FAQ - General
     
    1406314063
    1406414064
    14065 Even when the @code{match} unit is not used, the macros from that package are visible in the compiler. The reason for this is that macros can not be accessed from library units (only when explicitly evaluated in running code). To speed up macro-expansion time, the compiler and the interpreter both already provide the compiled  @code{match-...} macro definitions. Macros shadowed lexically are no problem, but global definitions of variables named identically to (global) macros are useless - the macro definition shadows the global variable.
     14065Even when the @code{match} unit is not used, the macros from that package are visible in the compiler. The reason for this is that macros cannot be accessed from library units (only when explicitly evaluated in running code). To speed up macro-expansion time, the compiler and the interpreter both already provide the compiled  @code{match-...} macro definitions. Macros shadowed lexically are no problem, but global definitions of variables named identically to (global) macros are useless - the macro definition shadows the global variable.
    1406614066
    1406714067This problem can be solved using a different name or undefining the macro, like this:
  • chicken/branches/chicken-3/compiler.scm

    r11702 r13143  
    188188;   call-sites -> ((<lambda-id> <node>) ...) Known call-nodes of a named procedure
    189189;   home -> <lambda-id>                      Procedure which introduces this variable
    190 ;   unknown -> <boolean>                     If true: variable can not have a known value
     190;   unknown -> <boolean>                     If true: variable cannot have a known value
    191191;   assigned -> <boolean>                    If true: variable is assigned somewhere
    192192;   assigned-locally -> <boolean>            If true: variable has been assigned inside user lambda
     
    22722272                                   "coerced inexact literal number `~S' to fixnum ~S" c (inexact->exact c))
    22732273                                  (immediate-literal (inexact->exact c)) )
    2274                                  (else (quit "can not coerce inexact literal `~S' to fixnum" c)) ) )
     2274                                 (else (quit "cannot coerce inexact literal `~S' to fixnum" c)) ) )
    22752275                          (else (make-node '##core#literal (list (literal c)) '())) ) )
    22762276                   ((immediate? c) (immediate-literal c))
  • chicken/branches/chicken-3/csi.scm

    r13134 r13143  
    419419                   (else
    420420                    (let ((old (##sys#slot s 0)))
    421                       (cond ((not (procedure? old)) (##sys#error "can not trace non-procedure" s))
     421                      (cond ((not (procedure? old)) (##sys#error "cannot trace non-procedure" s))
    422422                            (else
    423423                             (set! traced-procedures (cons (cons s old) traced-procedures))
     
    457457               (set! traced-procedures (del a traced-procedures eq?)) )
    458458             (let ((old (##sys#slot s 0)))
    459                (cond ((not (procedure? old)) (##sys#error "can not set breakpoint on non-procedure" s))
     459               (cond ((not (procedure? old)) (##sys#error "cannot set breakpoint on non-procedure" s))
    460460                     (else
    461461                      (set! broken-procedures (cons (cons s old) broken-procedures))
     
    721721         [out ##sys#standard-output] )
    722722      (define (bestlen n) (if len (min len n) n))
    723       (cond [(##sys#immediate? x) (##sys#error 'dump "can not dump immediate object" x)]
     723      (cond [(##sys#immediate? x) (##sys#error 'dump "cannot dump immediate object" x)]
    724724            [(##sys#bytevector? x) (hexdump x (bestlen (##sys#size x)) ##sys#byte out)]
    725725            [(string? x) (hexdump x (bestlen (##sys#size x)) ##sys#byte out)]
     
    729729             (let ([bv (##sys#slot x 1)])
    730730               (hexdump bv (bestlen (##sys#size bv)) ##sys#byte out) ) ]
    731             [else (##sys#error 'dump "can not dump object" x)] ) ) ) )
     731            [else (##sys#error 'dump "cannot dump object" x)] ) ) ) )
    732732
    733733(define hexdump
  • chicken/branches/chicken-3/data-structures.scm

    r13134 r13143  
    4444      ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-string
    4545      ##sys#substring ##sys#for-each ##sys#map ##sys#setslot
    46       ##sys#allocate-vector ##sys#check-pair ##sys#not-a-proper-list-error
     46      ##sys#allocate-vector ##sys#check-pair ##sys#error-not-a-proper-list
    4747      ##sys#member ##sys#assoc ##sys#error ##sys#signal-hook ##sys#read-string!
    4848      ##sys#check-symbol ##sys#check-vector ##sys#floor ##sys#ceiling
     
    258258      (cond [(null? lsts) '()]
    259259            [(cond-expand [unsafe #f] [else (not (pair? lsts))])
    260              (##sys#not-a-proper-list-error lsts) ]
     260             (##sys#error-not-a-proper-list lsts) ]
    261261            [else
    262262             (let ([l (##sys#slot lsts 0)]
     
    532532               (loop1 (##sys#slot ss 1)
    533533                      (fx+ (##sys#size stri) (fx+ dslen n)) ) ) )
    534             (else (##sys#not-a-proper-list-error strs)) ) ) ) )
     534            (else (##sys#error-not-a-proper-list strs)) ) ) ) )
    535535
    536536
     
    898898         (if (or (not (##core#inline "C_blockp" lst))
    899899                 (not (##core#inline "C_pairp" lst)) )
    900              (##sys#not-a-proper-list-error lst0 'list->queue) ) ) ) ) )
     900             (##sys#error-not-a-proper-list lst0 'list->queue) ) ) ) ) )
    901901
    902902
  • chicken/branches/chicken-3/distribution/manifest

    r13134 r13143  
    121121chicken-ffi-macros.scm
    122122chicken-more-macros.scm
    123 chicken-sys-macros.scm
     123chicken-primitive-object-inlines.scm
     124chicken-thread-object-inlines.scm
    124125chicken-profile.1
    125126chicken-profile.scm
  • chicken/branches/chicken-3/eval.scm

    r13134 r13143  
    5151    (bound-to-procedure
    5252     ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-string ##sys#load-library
    53      ##sys#for-each ##sys#map ##sys#setslot ##sys#allocate-vector ##sys#check-pair ##sys#not-a-proper-list-error
     53     ##sys#for-each ##sys#map ##sys#setslot ##sys#allocate-vector ##sys#check-pair ##sys#error-not-a-proper-list
    5454     ##sys#check-symbol ##sys#check-vector ##sys#floor ##sys#ceiling ##sys#truncate ##sys#round
    5555     ##sys#check-number ##sys#cons-flonum ##sys#copy-env-table
     
    985985                                                ##core#foreign-primitive
    986986                                                ##core#foreign-lambda* ##core#define-foreign-type)
    987                               (##sys#syntax-error-hook "can not evaluate compiler-special-form" x) ]
     987                              (##sys#syntax-error-hook "cannot evaluate compiler-special-form" x) ]
    988988
    989989                             [(##core#app)
     
    992992                             [else
    993993                              (cond [(eq? head 'location)
    994                                      (##sys#syntax-error-hook "can not evaluate compiler-special-form" x) ]
     994                                     (##sys#syntax-error-hook "cannot evaluate compiler-special-form" x) ]
    995995
    996996                                    [else (compile-call x e tf cntr)] ) ] )
     
    11701170            [evproc (or evaluator eval)] )
    11711171        (cond [(and (string? input) (not fname))
    1172                (##sys#signal-hook #:file-error 'load "can not open file" input) ]
     1172               (##sys#signal-hook #:file-error 'load "cannot open file" input) ]
    11731173              [(and (load-verbose) fname)
    11741174               (display "; loading ")
     
    13721372                        (set! ##sys#loaded-extensions (cons p ##sys#loaded-extensions))
    13731373                        #t)
    1374                        ((:optional err? #t) (##sys#error loc "can not load extension" id))
     1374                       ((:optional err? #t) (##sys#error loc "cannot load extension" id))
    13751375                       (else #f) ) ) ) ) ) ) ) )
    13761376
  • chicken/branches/chicken-3/extras.scm

    r13134 r13143  
    4545      ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-string
    4646      ##sys#substring ##sys#for-each ##sys#map ##sys#setslot
    47       ##sys#allocate-vector ##sys#check-pair ##sys#not-a-proper-list-error
     47      ##sys#allocate-vector ##sys#check-pair ##sys#error-not-a-proper-list
    4848      ##sys#member ##sys#assoc ##sys#error ##sys#signal-hook ##sys#read-string!
    4949      ##sys#check-symbol ##sys#check-vector ##sys#floor ##sys#ceiling
  • chicken/branches/chicken-3/library.scm

    r13135 r13143  
    187187
    188188
     189;;; Helpers
     190
     191(define-inline (%pointer? x)
     192  (and (##core#inline "C_blockp" x) (##core#inline "C_anypointerp" x)) )
     193
     194(define-inline (%port? x)
     195  (and (##core#inline "C_blockp" x) (##core#inline "C_portp" x)) )
     196
     197(define-inline (%generic-vector? x)
     198  (and (##core#inline "C_blockp" x)
     199       (not (or (##core#inline "C_specialp" x)
     200                (##core#inline "C_byteblockp" x)))) )
     201
     202(define-inline (%special-block? x)
     203  (and (##core#inline "C_blockp" x) (##core#inline "C_specialp" x)) )
     204
    189205
    190206;;; System routines:
     
    13511367        (##sys#signal-hook
    13521368         #:bounds-error 'vector-copy!
    1353          "can not copy vector - count exceeds length" from to n) ) ]
     1369         "cannot copy vector - count exceeds length" from to n) ) ]
    13541370     [else] )
    13551371    (do ([i 0 (fx+ i 1)])
     
    18851901               [(#:append)
    18861902                (if inp
    1887                     (##sys#error loc "can not use append mode with input file")
     1903                    (##sys#error loc "cannot use append mode with input file")
    18881904                    (set! fmode "a") ) ]
    18891905               [else (##sys#error loc "invalid file option" o)] ) ) )
     
    18911907           (unless (##sys#open-file-port port name (##sys#string-append fmode bmode))
    18921908             (##sys#update-errno)
    1893              (##sys#signal-hook #:file-error loc (##sys#string-append "can not open file - " strerror) name) )
     1909             (##sys#signal-hook #:file-error loc (##sys#string-append "cannot open file - " strerror) name) )
    18941910           port) ) )
    18951911     #:open (not inp) modes) )
     
    19892005  (if (##sys#slot port 1)
    19902006      (##sys#values (##sys#slot port 4) (##sys#slot port 5))
    1991       (##sys#error 'port-position "can not compute position of port" port) ) )
     2007      (##sys#error 'port-position "cannot compute position of port" port) ) )
    19922008
    19932009(define (delete-file filename)
     
    20002016       (##sys#signal-hook
    20012017        #:file-error 'delete-file
    2002         (##sys#string-append "can not delete file - " strerror) filename) ) )
     2018        (##sys#string-append "cannot delete file - " strerror) filename) ) )
    20032019   #:delete) )
    20042020
     
    20162032          (##sys#signal-hook
    20172033           #:file-error 'rename-file
    2018            (##sys#string-append "can not rename file - " strerror) old new) ) ) ) )
     2034           (##sys#string-append "cannot rename file - " strerror) old new) ) ) ) )
    20192035   #:rename new) )
    20202036
     
    23182334                    (cond [val
    23192335                           (when (and (##sys#inexact? val) rat-flag)
    2320                              (##sys#read-warning port "can not represent exact fraction - coerced to flonum" tok) )
     2336                             (##sys#read-warning port "cannot represent exact fraction - coerced to flonum" tok) )
    23212337                           val]
    23222338                          [radix (##sys#read-error port "illegal number syntax" tok)]
     
    37733789        ((8) (apply ##sys#signal-hook #:bounds-error loc "out of range" args))
    37743790        ((9) (apply ##sys#signal-hook #:type-error loc "call of non-procedure" args))
    3775         ((10) (apply ##sys#signal-hook #:arity-error loc "continuation can not receive multiple values" args))
     3791        ((10) (apply ##sys#signal-hook #:arity-error loc "continuation cannot receive multiple values" args))
    37763792        ((12) (apply ##sys#signal-hook #:limit-error loc "recursion too deep" args))
    3777         ((13) (apply ##sys#signal-hook #:type-error loc "inexact number can not be represented as an exact number" args))
     3793        ((13) (apply ##sys#signal-hook #:type-error loc "inexact number cannot be represented as an exact number" args))
    37783794        ((14) (apply ##sys#signal-hook #:type-error loc "bad argument type - not a proper list" args))
    37793795        ((15) (apply ##sys#signal-hook #:type-error loc "bad argument type - not a fixnum" args))
     
    43984414(define (##sys#make-locative obj index weak? loc)
    43994415  (cond [(##sys#immediate? obj)
    4400          (##sys#signal-hook #:type-error loc "locative can not refer to immediate object" obj) ]
     4416         (##sys#signal-hook #:type-error loc "locative cannot refer to immediate object" obj) ]
    44014417        [(or (vector? obj) (pair? obj))
    44024418         (##sys#check-range index 0 (##sys#size obj) loc)
     
    44544470         (##sys#signal-hook
    44554471          #:type-error loc
    4456           "bad argument type - locative can not refer to objects of this type"
     4472          "bad argument type - locative cannot refer to objects of this type"
    44574473          obj) ] ) )
    44584474
  • chicken/branches/chicken-3/lolevel.scm

    r13135 r13143  
    5858     ##sys#check-pointer ##sys#check-closure ##sys#check-integer ##sys#check-special
    5959     ##sys#error ##sys#signal-hook
    60      ##sys#not-a-proper-list-error
     60     ##sys#error-not-a-proper-list
    6161     ##sys#hash-table-ref ##sys#hash-table-set!
    6262     ##sys#make-pointer ##sys#make-tagged-pointer ##sys#make-locative ##sys#locative?
     
    6969     extend-procedure ) ) ] )
    7070
     71
    7172;;; Helpers:
    7273
    7374(define-inline (%pointer? x)
    74   (and (##core#inline "C_blockp" x) (##core#inline "C_anypointerp" x)
    75        #; ;C_anypointerp covers it
    76        (or (##core#inline "C_pointerp" x)
    77            (##core#inline "C_taggedpointerp" x)
    78            (##core#inline "C_swigpointerp" x))) )
     75  (and (##core#inline "C_blockp" x) (##core#inline "C_anypointerp" x)) )
     76
     77(define-inline (%generic-pointer? x)
     78  (or (%pointer? x)
     79      (##core#inline "C_locativep" x) ) )
     80
     81(define-inline (%special-block? x)
     82  ; generic-pointer, port, closure
     83  (and (##core#inline "C_blockp" x) (##core#inline "C_specialp" x)) )
    7984
    8085(define-inline (%generic-vector? x)
     
    8388                (##core#inline "C_byteblockp" x)))) )
    8489
    85 (define-inline (%special-block? x)
    86   (and (##core#inline "C_blockp" x) (##core#inline "C_specialp" x)) )
    87 
    8890(define-inline (%record-structure? x)
    8991  (and (##core#inline "C_blockp" x) (##core#inline "C_structurep" x)) )
    9092
    91 (define-inline (%generic-pointer? x)
    92   (or (##core#inline "C_anypointerp" x)
    93       (##sys#locative? x) ) )
    9493
    9594;;; Argument checking:
     
    503502                (##sys#check-exact b 'list->byte-vector)
    504503                (##sys#setbyte v i b) )
    505               (##sys#not-a-proper-list-error lst) ) ) ) ) )
     504              (##sys#error-not-a-proper-list lst) ) ) ) ) )
    506505
    507506(define string->byte-vector string->blob) ; DEPRECATED
     
    528527                 (when (pair? init) (byte-vector-fill! bv (##sys#slot init 0)))
    529528                 bv]
    530                 [else (##sys#signal-hook #:runtime-error "can not allocate statically allocated bytevector" size)] ) ) ) )
     529                [else (##sys#signal-hook #:runtime-error "cannot allocate statically allocated bytevector" size)] ) ) ) )
    531530  (set! make-static-byte-vector         ; DEPRECATED
    532531    (lambda (size . init) (make size init malloc 'make-static-byte-vector))))
     
    539538          (##core#inline "C_pointer_to_block" p bv)
    540539          p)
    541         (##sys#error 'static-byte-vector->pointer "can not coerce non-static blob" bv) ) ) )
     540        (##sys#error 'static-byte-vector->pointer "cannot coerce non-static blob" bv) ) ) )
    542541
    543542(define (byte-vector-move! src src-start src-end dst dst-start) ; DEPRECATED
     
    574573         (##sys#signal-hook
    575574          #:type-error 'number-of-bytes
    576           "can not compute number of bytes of immediate object" x) ]
     575          "cannot compute number of bytes of immediate object" x) ]
    577576        [(##core#inline "C_byteblockp" x)
    578577         (##sys#size x)]
     
    678677                           (make-property-condition
    679678                            'exn 'location 'object-evict-to-location
    680                             'message "can not evict object - limit exceeded"
     679                            'message "cannot evict object - limit exceeded"
    681680                            'arguments (list x limit))
    682681                           (make-property-condition 'evict 'limit limit) ) ) ) )
  • chicken/branches/chicken-3/ports.scm

    r10827 r13143  
    5454      ##sys#check-char ##sys#check-exact ##sys#check-port ##sys#check-string
    5555      ##sys#substring ##sys#for-each ##sys#map ##sys#setslot
    56       ##sys#allocate-vector ##sys#check-pair ##sys#not-a-proper-list-error
     56      ##sys#allocate-vector ##sys#check-pair ##sys#error-not-a-proper-list
    5757      ##sys#member ##sys#assoc ##sys#error ##sys#signal-hook ##sys#read-string!
    5858      ##sys#check-symbol ##sys#check-vector ##sys#floor ##sys#ceiling
  • chicken/branches/chicken-3/rules.make

    r13010 r13143  
    711711        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-more-macros.scm $(DESTDIR)$(IDATADIR)
    712712        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-ffi-macros.scm $(DESTDIR)$(IDATADIR)
    713         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-sys-macros.scm $(DESTDIR)$(IDATADIR)
     713        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-primitive-object-inlines.scm $(DESTDIR)$(IDATADIR)
     714        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-thread-object-inlines.scm $(DESTDIR)$(IDATADIR)
    714715        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) *.exports $(DESTDIR)$(IDATADIR)
    715716        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(DESTDIR)$(IINFODIR)
  • chicken/branches/chicken-3/runtime.c

    r13135 r13143  
    573573 
    574574  if(!CHICKEN_initialize(h, s, n, toplevel))
    575     panic(C_text("can not initialize - out of memory"));
     575    panic(C_text("cannot initialize - out of memory"));
    576576
    577577  CHICKEN_run(NULL);
     
    592592
    593593  if(C_main_argv == NULL)
    594     panic(C_text("can not allocate argument-list buffer"));
     594    panic(C_text("cannot allocate argument-list buffer"));
    595595
    596596  C_main_argc = 0;
     
    608608   
    609609    if(aptr == NULL)
    610       panic(C_text("can not allocate argument buffer"));
     610      panic(C_text("cannot allocate argument buffer"));
    611611
    612612    C_strcpy(aptr, bptr0);
     
    751751  memset(signal_mapping_table, 0, sizeof(int) * NSIG);
    752752  initialize_symbol_table();
    753   C_dlerror = "can not load compiled code dynamically - this is a statically linked executable";
     753  C_dlerror = "cannot load compiled code dynamically - this is a statically linked executable";
    754754  error_location = C_SCHEME_FALSE;
    755755  C_pre_gc_hook = NULL;
     
    773773
    774774  if(pt == NULL)
    775     panic(C_text("out of memory - can not create initial ptable"));
     775    panic(C_text("out of memory - cannot create initial ptable"));
    776776
    777777  C_pte(termination_continuation);
     
    850850
    851851  if(r == NULL)
    852     panic(C_text("out of memory - can not allocate GC root"));
     852    panic(C_text("out of memory - cannot allocate GC root"));
    853853
    854854  r->value = C_SCHEME_UNDEFINED;
     
    11151115                           tospace_limit - tospace_start,
    11161116                           size, &ptr2a)) == NULL)
    1117     panic(C_text("out of memory - can not allocate heap"));
     1117    panic(C_text("out of memory - cannot allocate heap"));
    11181118
    11191119  heapspace1 = ptr1, heapspace1_size = size;
     
    15241524
    15251525  case C_CONTINUATION_CANT_RECEIVE_VALUES_ERROR:
    1526     msg = C_text("continuation can not receive multiple values");
     1526    msg = C_text("continuation cannot receive multiple values");
    15271527    c = 1;
    15281528    break;
     
    15341534
    15351535  case C_CANT_REPRESENT_INEXACT_ERROR:
    1536     msg = C_text("inexact number can not be represented as an exact number");
     1536    msg = C_text("inexact number cannot be represented as an exact number");
    15371537    c = 1;
    15381538    break;
     
    23052305
    23062306  if(dptr == NULL)
    2307     panic(C_text("out of memory - can not allocate static string"));
     2307    panic(C_text("out of memory - cannot allocate static string"));
    23082308   
    23092309  strblock = (C_word)dptr;
     
    23212321
    23222322  if(dptr == NULL)
    2323     panic(C_text("out of memory - can not allocate static lambda info"));
     2323    panic(C_text("out of memory - cannot allocate static lambda info"));
    23242324
    23252325  strblock = (C_word)dptr;
     
    23432343  C_SCHEME_BLOCK *pbv = C_malloc(len + sizeof(C_header));
    23442344
    2345   if(pbv == NULL) panic(C_text("out of memory - can not allocate permanent blob"));
     2345  if(pbv == NULL) panic(C_text("out of memory - cannot allocate permanent blob"));
    23462346
    23472347  pbv->header = C_BYTEVECTOR_TYPE | len;
     
    26722672     
    26732673      if(mutation_stack_bottom == NULL)
    2674         panic(C_text("out of memory - can not re-allocate mutation stack"));
     2674        panic(C_text("out of memory - cannot re-allocate mutation stack"));
    26752675
    26762676      mutation_stack_limit = mutation_stack_bottom + mssize + MUTATION_STACK_GROWTH;
     
    32173217
    32183218  if ((new_heapspace = heap_alloc (size, &new_tospace_start)) == NULL)
    3219     panic(C_text("out of memory - can not allocate heap segment"));
     3219    panic(C_text("out of memory - cannot allocate heap segment"));
    32203220  new_heapspace_size = size;
    32213221
     
    33103310 
    33113311  if ((heapspace2 = heap_alloc (size, &tospace_start)) == NULL)
    3312     panic(C_text("out ot memory - can not allocate heap segment"));
     3312    panic(C_text("out ot memory - cannot allocate heap segment"));
    33133313  heapspace2_size = size;
    33143314
     
    37363736
    37373737  if((result = (char *)C_malloc(STRING_BUFFER_SIZE)) == NULL)
    3738     horror(C_text("out of memory - can not allocate trace-dump buffer"));
     3738    horror(C_text("out of memory - cannot allocate trace-dump buffer"));
    37393739
    37403740  *result = '\0';
     
    37563756      if(C_strlen(result) > STRING_BUFFER_SIZE - 32) {
    37573757        if((result = C_realloc(result, C_strlen(result) * 2)) == NULL)
    3758           horror(C_text("out of memory - can not reallocate trace-dump buffer"));
     3758          horror(C_text("out of memory - cannot reallocate trace-dump buffer"));
    37593759      }
    37603760
     
    37783778
    37793779    if(trace_buffer == NULL)
    3780       panic(C_text("out of memory - can not allocate trace-buffer"));
     3780      panic(C_text("out of memory - cannot allocate trace-buffer"));
    37813781  }
    37823782
     
    73497349    while((C_uword)(C_fromspace_limit - C_fromspace_top) < (bytes + stack_size)) {
    73507350      if(C_heap_size_is_fixed)
    7351         panic(C_text("out of memory - can not allocate vector (heap resizing disabled)"));
     7351        panic(C_text("out of memory - cannot allocate vector (heap resizing disabled)"));
    73527352
    73537353      C_save(init);
     
    82798279  a = C_alloc(2 + C_bytestowords(7));
    82808280  s = C_string2(&a, "windows");
    8281 #elif defined(__unix__) || defined(C_MACOSX) || defined(C_XXXBSD)
     8281#elif defined(__unix__) || defined(C_XXXBSD)
    82828282  a = C_alloc(2 + C_bytestowords(4));
    82838283  s = C_string2(&a, "unix");
     
    84208420  if(finalizer_free_list == NULL) {
    84218421    if((flist = (FINALIZER_NODE *)C_malloc(sizeof(FINALIZER_NODE))) == NULL)
    8422       panic(C_text("out of memory - can not allocate finalizer node"));
     8422      panic(C_text("out of memory - cannot allocate finalizer node"));
    84238423
    84248424    ++allocated_finalizer_count;
     
    85768576     
    85778577      if(tmp == NULL)
    8578         panic(C_text("out of memory - can not allocate toplevel name string"));
     8578        panic(C_text("out of memory - cannot allocate toplevel name string"));
    85798579     
    85808580      C_strcpy(tmp, C_text("_"));
     
    87388738    if(i == 0) {
    87398739      if((forwarding_table = (C_word *)realloc(forwarding_table, (forwarding_table_size + 1) * 4 * sizeof(C_word))) == NULL)
    8740         panic(C_text("out of memory - can not re-allocate forwarding table"));
     8740        panic(C_text("out of memory - cannot re-allocate forwarding table"));
    87418741       
    87428742      i = forwarding_table_size;
     
    88238823
    88248824    if(locative_table == NULL)
    8825       panic(C_text("out of memory - can not resize locative table"));
     8825      panic(C_text("out of memory - cannot resize locative table"));
    88268826
    88278827    locative_table_size *= 2;
     
    89738973
    89748974    if(collectibles == NULL)
    8975       panic(C_text("out of memory - can not allocate GC protection vector"));
     8975      panic(C_text("out of memory - cannot allocate GC protection vector"));
    89768976   
    89778977    collectibles_top = collectibles + k;
     
    92379237
    92389238  if((bits & C_SPECIALBLOCK_BIT) != 0)
    9239     panic(C_text("literals with special bit can not be decoded"));
     9239    panic(C_text("literals with special bit cannot be decoded"));
    92409240
    92419241  size = decode_size(str);
  • chicken/branches/chicken-3/srfi-4.scm

    r13134 r13143  
    7878     ##sys#check-inexact-interval ##sys#check-number ##sys#check-structure ##sys#cons-flonum ##sys#check-list
    7979     ##sys#check-range ##sys#error ##sys#signal-hook
    80      ##sys#not-a-proper-list-error ##sys#print ##sys#allocate-vector) ) ] )
     80     ##sys#error-not-a-proper-list ##sys#print ##sys#allocate-vector) ) ] )
    8181
    8282(cond-expand
     
    273273              (let ([bv (ext-alloc len)])
    274274                (or bv
    275                     (##sys#error loc "not enough memory - can not allocate external number vector" len)) )
     275                    (##sys#error loc "not enough memory - cannot allocate external number vector" len)) )
    276276              (let ([bv (##sys#allocate-vector len #t #f #t)]) ; this could be made better...
    277277                (##core#inline "C_string_to_bytevector" bv)
     
    408408          (if (and (##core#inline "C_blockp" p) (##core#inline "C_pairp" p))
    409409              (set v i (##core#inline "C_slot" p 0))
    410               (##sys#not-a-proper-list-error lst) ) ) ) ) )
     410              (##sys#error-not-a-proper-list lst) ) ) ) ) )
    411411
    412412  (set! list->u8vector (init make-u8vector u8vector-set! 'list->u8vector))
  • chicken/branches/chicken-3/support.scm

    r13134 r13143  
    312312    (lambda (str)
    313313      (handle-exceptions ex
    314           (quit "can not parse expression: ~s [~a]~%"
     314          (quit "cannot parse expression: ~s [~a]~%"
    315315                str
    316316                (if (exn? ex)
     
    10541054(define (estimate-foreign-result-location-size type)
    10551055  (define (err t)
    1056     (quit "can not compute size of location for foreign type `~S'" t) )
     1056    (quit "cannot compute size of location for foreign type `~S'" t) )
    10571057  (follow-without-loop
    10581058   type
  • chicken/branches/chicken-3/tcp.scm

    r13134 r13143  
    188188
    189189(unless (##net#startup)
    190   (##sys#signal-hook #:network-error "can not initialize Winsock") )
     190  (##sys#signal-hook #:network-error "cannot initialize Winsock") )
    191191
    192192(define ##net#getservbyname
     
    254254                         (##sys#update-errno)
    255255                         (##sys#signal-hook
    256                           #:network-error 'tcp-connect (##sys#string-append "can not compute port from service - " strerror)
     256                          #:network-error 'tcp-connect (##sys#string-append "cannot compute port from service - " strerror)
    257257                          s) )
    258258                       p) )
     
    277277    (when (eq? _invalid_socket s)
    278278      (##sys#update-errno)
    279       (##sys#error "can not create socket") )
     279      (##sys#error "cannot create socket") )
    280280    ;; PLT makes this an optional arg to tcp-listen. Should we as well?
    281281    (when (eq? -1 ((foreign-lambda* int ((int socket))
     
    293293        (when (eq? -1 b)
    294294          (##sys#update-errno)
    295           (##sys#signal-hook #:network-error 'tcp-listen (##sys#string-append "can not bind to socket - " strerror) s port) )
     295          (##sys#signal-hook #:network-error 'tcp-listen (##sys#string-append "cannot bind to socket - " strerror) s port) )
    296296        (values s addr) ) ) ) )
    297297
     
    305305        (when (eq? -1 l)
    306306          (##sys#update-errno)
    307           (##sys#signal-hook #:network-error 'tcp-listen (##sys#string-append "can not listen on socket - " strerror) s port) )
     307          (##sys#signal-hook #:network-error 'tcp-listen (##sys#string-append "cannot listen on socket - " strerror) s port) )
    308308        (##sys#make-structure 'tcp-listener s) ) ) ) )
    309309
     
    317317    (when (fx= -1 (##net#close s))
    318318      (##sys#update-errno)
    319       (##sys#signal-hook #:network-error 'tcp-close (##sys#string-append "can not close TCP socket - " strerror) tcpl) ) ) )
     319      (##sys#signal-hook #:network-error 'tcp-close (##sys#string-append "cannot close TCP socket - " strerror) tcpl) ) ) )
    320320
    321321(define-constant +input-buffer-size+ 1024)
     
    346346      (unless (##net#make-nonblocking fd)
    347347        (##sys#update-errno)
    348         (##sys#signal-hook #:network-error (##sys#string-append "can not create TCP ports - " strerror)) )
     348        (##sys#signal-hook #:network-error (##sys#string-append "cannot create TCP ports - " strerror)) )
    349349      (let* ((buf (make-string +input-buffer-size+))
    350350             (data (vector fd #f #f))
     
    378378                                  (##sys#signal-hook
    379379                                   #:network-error
    380                                    (##sys#string-append "can not read from socket - " strerror)
     380                                   (##sys#string-append "cannot read from socket - " strerror)
    381381                                   fd) ) ) )
    382382                          (else
     
    400400                         (##sys#signal-hook
    401401                          #:network-error
    402                           (##sys#string-append "can not check socket for input - " strerror)
     402                          (##sys#string-append "cannot check socket for input - " strerror)
    403403                          fd) )
    404404                       (eq? f 1) ) ) )
     
    411411                     (##sys#signal-hook
    412412                      #:network-error
    413                       (##sys#string-append "can not close socket input port - " strerror)
     413                      (##sys#string-append "cannot close socket input port - " strerror)
    414414                      fd) ) ) )
    415415               #f
     
    475475                                  (##sys#signal-hook
    476476                                   #:network-error
    477                                    (##sys#string-append "can not write to socket - " strerror)
     477                                   (##sys#string-append "cannot write to socket - " strerror)
    478478                                   fd) ) ) )
    479479                          ((fx< n len)
     
    500500                     (##sys#update-errno)
    501501                     (##sys#signal-hook
    502                       #:network-error (##sys#string-append "can not close socket output port - " strerror) fd) ) ) )
     502                      #:network-error (##sys#string-append "cannot close socket output port - " strerror) fd) ) ) )
    503503               (and outbuf
    504504                    (lambda ()
     
    547547      (##sys#update-errno)
    548548      (##sys#signal-hook
    549        #:network-error 'tcp-accept-ready? (##sys#string-append "can not check socket for input - " strerror)
     549       #:network-error 'tcp-accept-ready? (##sys#string-append "cannot check socket for input - " strerror)
    550550       tcpl) )
    551551    (eq? 1 f) ) )
     
    575575        (##sys#update-errno)
    576576        (##sys#signal-hook
    577          #:network-error 'tcp-connect (##sys#string-append "can not connect to socket - " strerror)
     577         #:network-error 'tcp-connect (##sys#string-append "cannot connect to socket - " strerror)
    578578         host port) )
    579579      (when (eq? -1 s)
    580580        (##sys#update-errno)
    581         (##sys#signal-hook #:network-error 'tcp-connect (##sys#string-append "can not create socket - " strerror) host port) )
     581        (##sys#signal-hook #:network-error 'tcp-connect (##sys#string-append "cannot create socket - " strerror) host port) )
    582582      (unless (##net#gethostaddr addr host port)
    583         (##sys#signal-hook #:network-error 'tcp-connect "can not find host address" host) )
     583        (##sys#signal-hook #:network-error 'tcp-connect "cannot find host address" host) )
    584584      (unless (##net#make-nonblocking s)
    585585        (##sys#update-errno)
     
    608608               (##sys#signal-hook #:network-error 'tcp-connect (##sys#string-append "getsockopt() failed - " strerror)))
    609609              ((> err 0)
    610                (##sys#signal-hook #:network-error 'tcp-connect (##sys#string-append "can not create socket - " (general-strerror err))))))
     610               (##sys#signal-hook #:network-error 'tcp-connect (##sys#string-append "cannot create socket - " (general-strerror err))))))
    611611      (##net#io-ports s) ) ) )
    612612
     
    622622    (values
    623623     (or (##net#getsockname fd)
    624          (##sys#signal-hook #:network-error 'tcp-addresses (##sys#string-append "can not compute local address - " strerror) p) )
     624         (##sys#signal-hook #:network-error 'tcp-addresses (##sys#string-append "cannot compute local address - " strerror) p) )
    625625     (or (##net#getpeername fd)
    626          (##sys#signal-hook #:network-error 'tcp-addresses (##sys#string-append "can not compute remote address - " strerror) p) ) ) ) )
     626         (##sys#signal-hook #:network-error 'tcp-addresses (##sys#string-append "cannot compute remote address - " strerror) p) ) ) ) )
    627627
    628628(define (tcp-port-numbers p)
     
    631631    (values
    632632     (or (##net#getsockport fd)
    633          (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute local port - " strerror) p) )
     633         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "cannot compute local port - " strerror) p) )
    634634     (or (##net#getpeerport fd)
    635          (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute remote port - " strerror) p) ) ) ) )
     635         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "cannot compute remote port - " strerror) p) ) ) ) )
    636636
    637637(define (tcp-listener-port tcpl)
     
    641641    (when (eq? -1 port)
    642642      (##sys#signal-hook
    643        #:network-error 'tcp-listener-port (##sys#string-append "can not obtain listener port - " strerror)
     643       #:network-error 'tcp-listener-port (##sys#string-append "cannot obtain listener port - " strerror)
    644644       tcpl fd) )
    645645    port) )
  • chicken/branches/chicken-3/tests/path-tests.scm

    r4232 r13143  
    1 (use utils)
    2 (define-macro (test x) `(printf "~s\t=> ~s~%" ',x ,x))
    3 (test (pathname-directory "/"))
    4 (test (pathname-directory "/abc"))
    5 (test (pathname-directory "abc/"))
    6 (test (pathname-directory "abc/def"))
    7 (test (pathname-directory "abc/def.ghi"))
    8 (test (pathname-directory "abc/.def.ghi"))
    9 (test (pathname-directory "abc/.ghi"))
    10 (test (pathname-directory "/abc/"))
    11 (test (pathname-directory "/abc/def"))
    12 (test (pathname-directory "/abc/def.ghi"))
    13 (test (pathname-directory "/abc/.def.ghi"))
    14 (test (pathname-directory "/abc/.ghi"))
    15 (test (pathname-directory "q/abc/"))
    16 (test (pathname-directory "q/abc/def"))
    17 (test (pathname-directory "q/abc/def.ghi"))
    18 (test (pathname-directory "q/abc/.def.ghi"))
    19 (test (pathname-directory "q/abc/.ghi"))
     1(use files)
     2
     3(assert (equal? "/" (pathname-directory "/")))
     4(assert (equal? "/" (pathname-directory "/abc")))
     5(assert (equal? "abc" (pathname-directory "abc/")))
     6(assert (equal? "abc" (pathname-directory "abc/def")))
     7(assert (equal? "abc" (pathname-directory "abc/def.ghi")))
     8(assert (equal? "abc" (pathname-directory "abc/.def.ghi")))
     9(assert (equal? "abc" (pathname-directory "abc/.ghi")))
     10(assert (equal? "/abc" (pathname-directory "/abc/")))
     11(assert (equal? "/abc" (pathname-directory "/abc/def")))
     12(assert (equal? "/abc" (pathname-directory "/abc/def.ghi")))
     13(assert (equal? "/abc" (pathname-directory "/abc/.def.ghi")))
     14(assert (equal? "/abc" (pathname-directory "/abc/.ghi")))
     15(assert (equal? "q/abc" (pathname-directory "q/abc/")))
     16(assert (equal? "q/abc" (pathname-directory "q/abc/def")))
     17(assert (equal? "q/abc" (pathname-directory "q/abc/def.ghi")))
     18(assert (equal? "q/abc" (pathname-directory "q/abc/.def.ghi")))
     19(assert (equal? "q/abc" (pathname-directory "q/abc/.ghi")))
Note: See TracChangeset for help on using the changeset viewer.