2008-02-13 Shiro Kawai * release 0.8.13 2008-02-12 Shiro Kawai * src/load.c (Scm_ResolveAutoload): fixed another bug that, when N threads (N >= 3) tried to resolve the same autoload and N-1 threads goes to wait, only one of them is ever waked up. 2008-02-09 Shiro Kawai * src/load.c (Scm_ResolveAutoload): fix a bug that caused malfunction of autoload resolving in multithreaded environment. 2008-02-08 Shiro Kawai * src/gauche.h (ScmDefaultCPL): make SCM_EXTERN to extern, for cygwin to treat them as compile-time constants. (Needs more work for Win/VC platform). 2008-02-07 Shiro Kawai * src/char.c (charset_print_ch): Safer print method for charset literal. 2008-02-06 Shiro Kawai * ext/net/netlib.stub: Added some more socket option constants. 2008-02-05 Shiro Kawai * src/scmlib.scm (rxmatch->string): added. * src/system.c (Scm_CurrentMicroseconds), src/extlib.stub (greatest-fixnum, least-fixnum): fixes for 64bit architecture. 2008-02-04 Shiro Kawai * test/system.scm, ext/termios/test.scm: excluded some tests from cygwin, for they are not supported well on it. * src/vmcall.c: fixed a bug that takes calling context (normal or applyargs) incorrectly when a next-method object is created in applyargs context, is invoked in normal calling context, a new next-method is created during it, and the new next-method is invoked in the normal calling context. 2008-02-03 Shiro Kawai * lib/gauche/test.scm (closure-grefs): We've been missing checking the closures in the operand of LOCAL-ENV-CLOSURES. Check added. * configure.ac, */Makefile.in, src/genconfig.in: Adapted for cross compilation. (Parch from YOKOTA Hiroshi). * src/bignum.c, src/gauche/config.h.in: checks malloc.h to use alloca on mingw. (Parch from YOKOTA Hiroshi). * src/string.c, src/system.c, src/number.c, src/dl_win.c, src/class.c, ext/mt-random/mt-random.c: removing inline from externed procs, and some other fixes for better portability. (Parch from YOKOTA Hiroshi). * Makefile.in (uninstall): avoid going into gc/, since we don't install a separate libgc.a so we shouldn't uninstall it. 2008-02-02 Shiro Kawai * lib/gauche/parseopt.scm (next-option): fixed a problem that regexp might run out the stack when very long option arg is given. 2008-02-01 Shiro Kawai * libsrc/file/util.scm (copy-file): Fixed a bug that didn't preserve the mode of dst when dst already exists, safe is #f and keep-mode is #f. * src/read.c (read_char): allow 5, 6, or 7 hex digits in unicode char literal (#\uxxxxx etc.) The old code only allows 4 or 8 digits, which is too restrictive (and not much point since Unicode is now only up to #\u10ffff.) * src/extlib.stub (fixnum-width, greatest-fixnum, least-fixnum): Added. * src/syslib.stub (current-microseconds): Experimentally added. Returns # of microseconds since system-dependent epoch, wrapped around fixnum resolution (possibly negative). Useful for micro benchmarking since it doesnt' allocate. 2008-01-31 Shiro Kawai * 0.8.13_pre1 * lib/gauche/procedure.scm, src/autoloads.scm: Experimentally added '$' and '$*' macro. It's unofficial yet. See how it works. 2008-01-26 Shiro Kawai * lib/gauche/process.scm (handle-abnormal-exit): Fix not to call :on-error-exit handler if the process' exit status is zero. 2008-01-23 Shiro Kawai * src/class.c (generic_print): Reverted the display format of generic functions; maxReqargs is not relevant for most users, so it's just confusing. 2008-01-04 Shiro Kawai * lib/slib.scm.in (require, provide, provided?): adapted to slib3a5 (using slib:require instead of require:require, etc). This should also work with slib 3a4 as well, since 3a4 exports both APIs. 2007-12-31 Shiro Kawai * src/vm.c (run_loop): Implemented an optimization on TAIL-APPLY instruction. Since arguments are already on the stack except the last one, we can share large part of processing with TAIL-CALL instruction, with a modification of the special treatment of the last argument. This eliminates the need to call Scm_VMApply, and also allows large argument list to be applied, such as (apply + (iota 10000)). (Scm_VMApply): changed to use TAIL-APPLY instruction. This also eliminates need of unfoling the passed args. * src/vmcall.c: Added to refactor the similar code between CALL and TAIL-APPLY instruction handling. * src/compile.scm (pass3/$ASM), src/stdlib.stub (apply): A little hack to make *every* 'apply' call a tail-call, so that it is compiled as TAIL-APPLY instruction. 2007-12-28 Shiro Kawai * src/class.c (Scm_ComputeApplicableMethods): Optimized inner loop a little bit. General code cleanup. * src/moplib.stub: Rewrote some procs using cise. 2007-12-25 Shiro Kawai * lib/gauche/numerical.scm (asin, asinh): fixed a problem of avoiding numerical instability. (exp, expt, cos, cosh, sin, sinh): use real-part/imag-part instead of %complex->real/imag, for the former is slightly faster. 2007-12-22 Shiro Kawai * src/extlib.stub (rxmatch-num-matches): returns 0 if #f is passed, as described in the manual. 2007-12-18 Shiro Kawai * lib/rfc/822.scm (rfc822-write-headers): Added generic message header generation routine. (rfc822-read-headers): Renamed rfx822-header->list for the symmetry with rfc822-write-headers. We keep the old name for the backward compatibility. 2007-12-11 Shiro Kawai * src/read.c (read_string): Supports R6RS-style line folding in string literal. This should be reworked once we support all kind of whitespaces and line endings, but for the time being we just hardcode treatment of SPC and TABs. * lib/rfc/mime.scm (mime-decode-text, mime-encode-word, mime-encode-text): Added utilities to encode/decode header fields according to RFC2047. 2007-12-09 Shiro Kawai * lib/rfc/quoted-printable.scm (quoted-printable-encode): Added line- width and binary keyword arguments. Encode '?' to avoid interference with RFC2047 encoded header body. 2007-12-07 Shiro Kawai * lib/rfc/base64.scm (base64-encode): Added line-width keyword argument to specify line width or suppress line breaking of the output. 2007-12-06 Shiro Kawai * lib/rfc/http.scm (request-response): Fixed to pass the port number to host header field (RFC2616 section 14.23). 2007-11-30 Shiro Kawai * src/port.c (Scm__InitPort): Set stdout buffering mode to FULL if the file descriptor 1 is not connected to a terminal. This greatly improves performance when large number of lines of output are redirected to a file. 2007-11-23 Shiro Kawai * lib/gauche/fileutil.scm (glob-fold, make-glob-fs-fold): Removed :root and :current args from glob-fold, for they should belong to the 'folder' function rather than the glob-fold function itself. Instead, we added a utility function make-glob-fs-fold to generate a customized 'folder' function with root/current dirs. (glob-fold-1): Added support of '**' wildcard. 2007-11-20 Shiro Kawai * lib/gauche/fileutil.scm (glob-fold): Added :root and :current keyword arguments for the flexibility. * lib/gauche/regexp.scm, src/scmlib.scm, src/autoloads.scm: Moved regexp-replace, regexp-replace-all, regexp-replace*, regexp-replace-all* and regexp-quote from the autoloaded regexp.scm to the compiled scmlib.scm. * src/regexp.c, src/objlib.scm: Implemented regexp printer in Scheme write-object instead of C's class print function. Properly escapes slashes in the regexp and adds 'i' suffix for case-folded regexp, so that read/write invariance is sufficed for trivial cases. (See the comment before write-object ( ) for the work to do to realize full read/write invariance). * src/read.c (read_regexp): let the reader consume a backslash before a slash, for it has nothing to do with regexp parser (and it will be consistent from the regexp created via string->regexp). * src/preload.scm: use gauche.regexp explicitly, for it is needed to compile HEAD with 0.8.12. Can be removed after 0.8.13 release. 2007-11-09 Shiro Kawai * configure.ac, src/gauche/config.h.in: Enabled large file support (AC_SYS_LARGEFILE). On Linux this defines _FILE_OFFSET_BITS as 64. COMPATIBILITY NOTE: The definition may affect the behavior of the standard libraries. It is crucial to include *before* any other standard headers. * src/system.c (Scm_IntegerToOffset, Scm_OffsetToInteger, ScmSysStat): properly handles 64bit offsets. * ext/fcntl/fcntl.c: properly handles 64bit offsets. * examples/mqueue-cpp/README: added explanation to include gauche.h first. 2007-11-08 Shiro Kawai * lib/gauche/regexp.scm (regexp-parse-subpattern): allow named reference in the replace string in regexp-replace etc. Patch from Rui Ueyama. 2007-11-07 Shiro Kawai * configure.ac, src/gauche/config.h.in (HAVE_SYS_RESOURCE_H, SIZEOF_RLIM_T): configuration for getrlimit/setrlimit * src/syslib.stub (sys-getrlimit, sys-setrlimit): Added. (Patch from Tatsuya BIZENN). * src/extlib.stub (tree-map-floor etc.): Added Scheme-level interface to find the closest entry in the treemap. Also added tree-map-clear! 2007-11-06 Shiro Kawai * lib/text/gettext.scm, lib/text/tr.scm: Moved to ext/text. * libsrc/text/tr.scm, ext/text/*: Made text.gettext and text.tr compiled modules. * src/gencomp (compile-toplevel-form): Modified to recognize define-constant form so that constant-folding works in pre-compilation. * ext/srfi/srfi-19-lib.scm: switched back julian-day calculation to use exact numbers (Cf. ChangeLog at 2007-01-16 below). By scaling everything except nanoseconds first, we can avoid ratnums in intermediate calculations. With working constant folding in pre-compilation, the overhead isn't as bad as before. See the comment near TM_EXACT_CALC for the details. * src/gauche/system.h (ScmTime): use ScmInt64 to represent seconds to avoid year 2038 problem. * src/system.c: Changed accordingly. Added Scm_MakeTime64() and Scm_Int64SecondsToTime(). * src/gauche/int64.h, src/number.c: Added macros (SCM_INT64_EQV, SCM_INT64_CMP, SCM_SET_INT64_BY_LONG, SCM_SET_INT64_BY_DOUBLE) and APIs (Scm_Int64ToDouble, Scm_UInt64ToDouble, Scm_DoubleToInt64, Scm_UInt64ToDouble). 2007-10-29 Shiro Kawai * release 0.8.12 * winnt/winvc-prep.sh, DIST: enable preparation for winvc from the distribution tarball. * src/system.c: Some fixes for MinGW. 2007-10-27 Shiro Kawai * gc/configure.in: Added CFLAGS to compile on Leopard. * src/objlib.scm (x->integer, x->string): a bit of simplification. 2007-10-23 Shiro Kawai * ext/dbm/gdbm.scm (dbm.gdbm): added missing exports (gdbm-errno, GDBM_SYNCMODE. 2007-10-01 Shiro Kawai * src/number.c (read_number, double_print): Changed infinities and NaN notation to +inf.0, -inf.0 and +nan.0, according to R6RS. The old syntax #i1/0, #i-1/0 and #i0/0 are recognized for the compatibility. * ext/net/net.ac, ext/net/net.c: Removed dependency on inet_aton (always using inet_pton). * lib/gauche/parseopt.scm: When "f" is specified as the option's argument type, it allows rational number to be given but coerces it to flonum. 2007-09-28 Shiro Kawai * ext/auxsys/auxsys.c (Scm_Environ), ext/auxsys/auxsyslib.stub (sys-environ), ext/auxsys/auxsys.scm (sys-environ->alist): Added sys-environ and sys-environ->alist to obtain all environment variable bindings of the current process. 2007-09-27 Shiro Kawai * ext/sxml/Makefile.in, ext/sxml/sxml-sxpath.scm.in: avoid dependency on sxml-tools at generation time, by turning the references to it into autoloads. * lib/gauche/fileutil.scm (glob-fold-1): Changed the traversal procedure from 'lister' (returns a list) to 'folder' (works like fold), for better flexibility. 2007-09-24 Shiro Kawai * lib/text/progress.scm (make-text-progress-bar): added a feature to show information text on right, and allow to alter header and info text on the fly. * ext/sxml/Makefile.in: temporarily reverted to make sxml-sxpath.c to depend on sxml-tools.so, because of the build problem. This doesn't work on windows port, though, so we might need to find some trick. 2007-09-18 Shiro Kawai * libsrc/gauche/sequence.scm: added permute and shuffle. 2007-09-17 Shiro Kawai * src/system.c, src/syslib.stub, src/auxsyslib.stub, src/process.scm: Implemented an abstraction layer for kill and waitpid (Scm_SysKill, Scm_SysWait) to support windows process smoothly. For Windows processes we keep its process handle instead of an integer pid. 2007-09-16 Shiro Kawai * src/number.c (Scm_NumCmp): apply short cut path for the case when both args are negative. 2007-09-13 Shiro Kawai * src/gauche.h, src/class.c: Resurrected windows DLL data import hack we used to had for cygwin support (back in 2002). We have dropped the hack since the newer gcc supports auto data importing (by runtime pseudo reloc), but we found that the same technique can be used for Windows/VC++. This supersedes the kludge in 2007-09-10 changes. * src/gauche/extend.h: SCM_EXTENSION_ENTRY macro to indicate the initialization function entry of extension modules; needed for Win/VC. * src/* : various additions for MSVC support. shouldn't affect unix build. 2007-09-10 Shiro Kawai * src/gencomp: make it accept -D option to specify preprocessor symbols. * src/gauche/extern.h: added to hide windows dll insanity. * src/gauche.h, src/gauche/class.h, src/gauche/string.h, src/gauche/code.h, src/genstub, src/gencomp, lib/gauche/cgen/literal.scm: Experimentally added a workaround to the MSVC linker limitation that the address of external variables in a separate DLL can't be used in a constant expression to initialize static variables. It defeats the Gauche's tag architecture. This fix makes the static Scheme objects to be initialized with dummy tags (see SCM_CLASS_STATIC_TAG in gauche.h), and "patches" the correct tag in the initializatin code. 2007-09-06 Shiro Kawai * src/char.c, src/read.c, src/port.c, ext/charconv/charconv.c, ext/uvector/uvinit.c: Instead of letting extensions set the hook function pointer, added an explicit API to set the hook (for easier handling in windows dll). 2007-08-29 Shiro Kawai * ext/net/net.scm, ext/net/gauche/net.h, lib/gauche/cgen/cise.scm: typo fix. * src/number.c (numcmp3): optimization in case when all args are fixnums (can happen on 64bit machines). 2007-08-28 Shiro Kawai * src/number.c, src/string.c, src/class.c, src/bignum.c: various small fixes. * lib/gauche/fileutil.scm (glob, glob-fold, sys-glob): Implemented glob functionality in Scheme. * src/autoload.scm (glob, glob-fold, sys-glob): sets these autoloads. * src/syslib.stub (sys-glob), src/system.c (Scm_GlobDirectory): removed C-function for the glob() interface. * src/extlib.stub (read-char-set): Expose char-set parser to the Scheme level. 2007-08-26 Shiro Kawai * libsrc/file/util.scm (file->string etc.): made them gracefully return #f if the file doesn't exist and :if-does-not-exist #f is given. (temporary-directory): look at TMPDIR environment variable. (current-directory): clean up. * src/number.c (Scm_NumCmp): fixed a bug in the short cut path of ratnum vs ratnum comparison. * ext/net/netlib.stub (socket-input-port, socket-output-port): Fixed a bug that (effectively) forces socket input mode to be :full, making many network applications behave incorrectly. 2007-08-25 Shiro Kawai * src/regexp.c (regmatch_ref): fixed a bug that the failed named submatch returns "" instead of #f. * lib/gauche/cgen/cise.scm (render-rec): handles character constants outside of alphanumeric range. 2007-08-24 Shiro Kawai * Start adding Windows/MSVC support. * DIST: added 'winvc' target to pre-generate files necessary to compile with VisualStudio. * winnt/*: files for VisualStudio. * src/gauche/win-compat.h: renamed from mingw-compat.h and integrated MSVC support. * src/*.c : various touch-up for Windows support. 2007-08-21 Shiro Kawai * DIST, */Makefile.in : adjusted pre-package make target so that it will do most of the pre-packaging job, hence can make DIST script less cluttered. 2007-08-16 Shiro Kawai * release 0.8.11 2007-08-15 Shiro Kawai * lib/gauche/cgen/cise.scm (define-cise-stmt, define-cise-expr): A bit of touch-up for cise API. * src/genstub: recognize define-cise-stmt and define-cise-expr as a stub forms, so that one doesn't need to use eval* form. I'm ambivalent on the eval* stub form; maybe it should be removed. * src/stdlib.stub, src/extlib.stub: changed accordingly. 2007-08-14 Shiro Kawai * configure.ac: fixed a problem to set GAUCHE_USE_PTHREADS correctly when thread type isn't specified. 2007-08-13 Shiro Kawai * src/port.c (Scm_PortFdDup), src/extlib.stub (port-fd-dup!): Added an interface to dup2(2). Patch from Rui Ueyama. * src/bignum.c (Scm_BignumToDouble): Fixed a double rounding bug caused from using flonum arithmetic (see the comment for the details). * src/bignum.c (Scm_BignumLogCount), src/extlib.stub (logcount): Implemented logcount natively on top of ScmBits API. * src/gauche/float.h (ScmIEEEDouble): moved the structure definition from src/number.c, for it is now used by both number.c and bignum.c. * lib/gauche/logical.scm: removed logcount. * src/bits.c: finally a working version. 2007-08-11 Shiro Kawai * src/load.c (Scm_ResolveAutoload): Renamed from Scm_LoadAutoload, and changed so that it returns SCM_UNBOUND instead of raising an error when it detects the autoload is recursive. That allows more natural handling in implicit binding checks like implicit generic definition by define-method or implicit redefinition check by define-class. Note that the caller of Scm_ResolveAutoload must check if the return value is SCM_UNBOUND and take an appropriate action. * src/gauche.h: Because of the above change, we dropped SCM_BINDING_KEEP_AUTOLOAD flag for Scm_GlobalVariableRef, since it was introduced only to avoid the recursive autoload in the implicit generic definition. We no longer need it. * src/module.c (Scm_GlobalVariableRef): Changed accordingly. * src/moplib.stub (%ensure-generic-function): Changed accordingly. * src/class.c (Scm_CheckClassBinding): Simplified according to the above change. * test/load2.scm: Added to test the above autoload mechanisms. This can't be in load.scm, since we have to test it after object.scm. 2007-08-10 Shiro Kawai * lib/gauche/test.scm (test-end): Let it return the number of failed tests. May be useful if the test script wants to return non-zero exit status when test fails (e.g. (exit (test-end)) ). Suggested by Masatake YAMATO. 2007-08-09 Shiro Kawai * configure.ac: When --enable-threads is not given (or 'default' is given) we turn on pthreads support on available platforms, and turn off on others. Also defines _POSIX_PTHREAD_SEMANTICS on Solaris with threads so that we can get a pthread-compatible API (more specifically, sigwait()). * gc/configure.in: Adapted to the above change; now we ignore --enable-threads, and rely on the info the main 'configure.ac' left in 'config.threads'. * src/gauche/config.h.in: added _POSIX_PTHREAD_SEMANTICS. * src/gauche.h: Include gauche/config.h before any headers so that the definitions like _POSIX_PTHREAD_SEMANTICS can affect the system headers. * src/signal.c: removed system header includes, since they are included in gauche.h anyway. * libsrc/srfi-1.scm (list=): bug fix for handling more than three lists. (Patch from OGURISU Osamu). * ext/template.Makefile.in, lib/gauche/package/compile.scm: Supports separate buiddir during compiling extension packages (Patch from Leonardo Boiko). * doc/corelib.texi (Symbols): removed the remark of "symbols are always interned", since gensym'ed symbols are not interned. * src/gencomp (allocate-code-vector): properly escape '/*' and '*/' in the inserted comments. * src/class.c, src/port.c, src/vm.c: added casts between intptr_t and void* for proper operation on LP64. (Patch from Rui Ueyama). * lib/gauche/time.scm (gauche.time): export . Although it is a pure abstract class, user may want to define a method specializing for a bunch of time-counter subclasses. 2007-08-08 Shiro Kawai * src/intlib.stub: include gauche/memory.h to get decl of GC_print_static_roots. * src/core.c (Scm_Init): added missing call to Scm__InitCollection(). 2007-08-07 Shiro Kawai * src/port.c (port_cleanup): resurrected unregister_buffered_port to remove active buffererd port entry when a port is closed. It was removed before, since when port_cleanup is called via port's finalizer, the entry is already cleared by GC. However, it turned out that there was a case that number of closed ports retained from GC grew, prohibiting new ports from being registered to the active buffered port vector. Note: maybe we can also clear some pointers in the port when it is closed, so that the stuff referenced from the port can be GCed even the closed port itself lives longer. 2007-08-06 Shiro Kawai * src/number.c (Scm_DoubleToHalf): fixed to make sure shifting long literal instead of int literal to generate a mask larger than 32bits. The bug yielded incorrect rounding behaviour on 64bit platforms. 2007-08-05 Shiro Kawai * ext/net/test.scm: Avoid using "ip" for testing getprotobyname/ getprotobynumber, since the official name of protocol number 0 has been changed and we're in transition phase. Using "icmp" instead. * libsrc/file/util.scm (copy-file): Added :keep-mode keyword arg. 2007-08-02 Shiro Kawai * src/syslib.stub (sys-umask): Support omitting mode to query the current umask without changing it. 2007-07-31 Shiro Kawai * libsrc/srfi-13.scm (%string-*case!): fixed a bug that caused an error when the last optional args are omitted for string-downcase! etc. 2007-07-25 Shiro Kawai * src/hash.c (string_access): fixed invalid argument passed to Scm_Error (ScmHashTableCore* is not ScmObj). 2007-07-16 Shiro Kawai * src/number.c (Scm_GetDouble): fixed a bug on big ratnum coercion that caused SEGV in some cases. (Scm_NumCmp): fixed a bug on comparing small ratnum with big denominator with fixnum. 2007-07-10 Shiro Kawai * libsrc/gauche/collection.scm: Added find-min, find-max, and find-min&max. 2007-06-30 Shiro Kawai * src/scmlib.scm (error): error message formatting routines didn't consider circular structure, causing SEGV when such a structure is given to error/errorf. 2007-06-22 Shiro Kawai * src/compile.scm (cond, case): exclude dotted list from clauses and properly reports syntax error instead of SEGV. * lib/rfc/http.scm (request-response): fixed a bug that ignores :sink and :flusher keyword arguments. * lib/gauche/interactive/info.scm (viewer): fixed malformed with-signal-handlers (enbugged when we rewrite with-error-handler to guard?) * ext/uvector/uvector.c.tmpl (Scm_WriteBlock): added a missing breaks. (Scm_UVectorCopy, Scm_UVectorSwapBytes, Scm_UVectorSwapBytesX): f16vector support was missing. * src/vm.c (get_debug_info): fixed a bug in the range check. 2007-05-31 Shiro Kawai * src/hash.c, src/weak.c, src/gauche/hash.h, src/gauche/weak.h, src/extlib.stub: some additions for weak hash tables. unfortunately I found the current hash core implementation doesn't go well with key-weak hash table, and am planning to replace hash core implementation; for the time being, I freeze development of weak hash tables. 2007-05-22 Shiro Kawai * lib/rfc/ftp.scm (req&send, ftp-put-unique): made ftp-put-unique to return two values, a final server's response and the remote file path given by 1xx response. AN INCOMPATIBLE API CHANGE. But I assume nobody has been used ftp-put-unique seriously, for it is almost useless without obtaining the generated remote path. * configure.ac: shows some of the configuration parameters at the end, upon a request. * ext/net/netlib.stub (sockaddr-addr): fixed inet6 address bug in LP64 architectures, and also adaped to gauche.cgen.cise. * lib/rfc/ftp.scm (call-with-ftp-connection): Fix passing wrong keyword argument to ftp-login. * src/number.c (Scm_NumCmp): Fixed a bug that raises an error when attempted to compare bignum and infinity. * lib/slib.scm.in (force-output): oversight. made it an alias of flush. * src/main.c (main): temporarily avoided using new Scm_Apply API due to the bug that lost stack traces. 2007-05-21 Shiro Kawai * src/gauche/charset.h (SCM_CHAR_SET etc): Changed CHARSET in macro names to CHAR_SET for the consistency. Old names are defined for compatibility but will fade out. * src/char.c, src/regexp.c, src/class.c: changed accordingly. * lib/gauche/cgen/cise.scm: Allow embedding Scheme constants by quote form. Allow omitting type declaration if it's ScmObj. Some more conveniece macros. * src/extlib.stub: changed to use gauche.cgen.cise more. 2007-05-19 Shiro Kawai * lib/gauche/miscutil.scm: added. * src/autoload.scm: added autoload for gauche.miscutil. * lib/gauche/cgen/cise.scm: added. A utility to generate C code from S-expression. The spec is still experimental and may be tweaked. * src/genstub, src/stdlib.stub, src/extlib.stub: changed to use gauche.cgen.cise module. * lib/Makefile.in, lib/gauche/cgen/unit.scm: changed accordingly. 2007-05-15 Shiro Kawai * ext/fcntl/fcntl.c, ext/net/netdb.c, ext/termios/termios.c, ext/threads/mutex.c, src/class.c, src/codec, src/compaux.c, src/error.c, src/genstub, src/proc.c, src/system.c: Use SCM_CLASS_SLOT_SPEC_END() macro instead of literal constant. Patch from MUTOU Masayuki. 2007-05-04 Shiro Kawai * lib/gauche/interpolate.scm (%string-interpolate): recognize '[' and '{' as the beginning of unquoted expression as well. * src/genstub, lib/gauche/cgen/unit.scm, lib/gauche/cgen/literal.scm: Further integrated genstub's code into gauche.cgen.*. Changes include: Cpp conditions are now supported by . The subclass of should override cgen-emit-* methods, not the cgen-emit method. Some of literal handling code are moved to gauche.cgen.*. Also experimentally testing shorthand notation of ref. 2007-04-26 Shiro Kawai * src/genstub: Refactored to utilize more features of gauche.cgen; the original genstub predated gauche.cgen and had many kludges that gauche.cgen solved better. * src/gauche/port.h: Fixed a problem that compatibility functions are not declared when necessary (#ifdef area got wrong). 2007-04-23 Shiro Kawai * lib/gauche/cgen.scm, lib/gauche/cgen/unit.scm, lib/gauche/cgen/literal.scm: Splitted gauche.cgen module for modularity and readability. 2007-04-22 Shiro Kawai * ext/auxsys/auxsys.scm (sys-realpath): typo fix. 2007-04-21 Shiro Kawai * src/gauche/weak.h, src/weak.c: Start adding weak hash table (not finished yet). * src/hash.c: added Scm_HashCoreInitGeneral. 2007-04-20 Shiro Kawai * src/extlib.stub (hash-table-clear!): added. * ext/net/net.c (init_winsock): typo fix for mingw. 2007-04-18 Shiro Kawai * release 0.8.10 * lib/www/cgi.scm (cgi-main): fix to make error handler called correctly. * src/system.c (copy_win32_path): bug fix on mingw. 2007-04-17 Shiro Kawai * src/vm.c, src/vminsn.scm, src/compile.scm: Inline inexact arithmetic operators (+., -., *. and /., as NUMIADD2, NUMISUB2, NUMIMUL2, and NUMIDIV2). These operators are meant for performance tuning, so it's better to make them as fast as normal operators. * ext/net/netlib.stub (inet-checksum): fix for big-endian machines. * src/hash.c (NOTFOUND): added missing 'return'. * src/gauche/bits.h (SCM_BITS_TEST): fix for 64bit platform 2007-04-16 Shiro Kawai * ext/charconv/cvt.scm (generate-utf8->eucj): fix for not generating mappings from U+0080-U+009f range; they produced wrong EUC sequence, causing troubles. Now they are replaced to alternative characters. 2007-04-15 Shiro Kawai * src/port.c, src/scmlib.scm, src/stdlib.stub, src/extlib.stub, src/gauche/port.h: Made current-{input|output|error}-port like parameters, allowing replacing them. Moved implementation of with-input-from-port etc. to Scheme (scmlib.scm), hence dropping them from extlib.stub. Scm_WithPort is also dropped. New API Scm_SetCurrentInputPort etc. The old Scm_WithPort had a bug that didn't set a proper "before" thunk for dynamic-wind. The bug doesn't exist in the new version. * src/genstub (emit-definition): removed remanings of GAUCHE_SUBR_VM support. (): moved several slots from to fix define-cmethod. (define-cmethod): fixed incorrectly placed close paren. (parse-specialized-args): reversing parsed arglist. (process-body-spec): removed remainings of GAUCHE_VMAPI_VM support * src/gauche/mingw-compat.h: added #undef small, for defines 'small' to 'char'. 2007-04-13 Shiro Kawai * lib/www/cgi.scm: Fixed a bug that hangs when Content-Length is zero (Patch from Tatsuya BIZENN). * src/hash.c (Scm_HashIterInit, Scm_HashIterNext): changed so that the initial iterator points "one before the first entry" and the 'next' operation returns an entry after proceeding the pointer. It is consistent with Scm_TreeMapInit/Next. - Nope. Reverted. If the caller happens to delete the curent entry from the table, the new version of the iterator loses the iteration. We can prevent that by letting the iterator prefetch the next entry---but the code to do prefetch is exactly the same the previous version was doing! (The change would be visible if we have HashIterCurrent, but it seems little use so we dropped it. If we ever re-adopt HashIterCurrent do not forget to keep the current entry pointer as well as the 'next' prefetch pointer). 2007-04-11 Shiro Kawai * src/write.c (Scm_Sprintf, Scm_SprintfShared, Scm_Vsprintf): added convenience functions. * src/error.c : changed to use above new APIs. * src/load.c, src/gauche/load.h (Scm_Load, Scm_LoadFromPort, Scm_Require): New APIs for better error handling. * src/read.c, src/main.c, src/extlib.stub, src/char.c: changed accordingly. 2007-04-08 Shiro Kawai * src/collection.c, src/gauche/colleciton.h: Make SCM_DICT_SET_VALUE to check iff given value isn't an obviously illegal value (e.g. NULL or SCM_UNBOUND), for the safety. * src/module.c: Replaced old hashtable APIs for the new ones. 2007-04-07 Shiro Kawai * src/char.c (Scm_CharSetLE): fixed a bug. * lib/gauche/test.scm: record "abort count", the # of test processes aborted, as well. * src/hash.c, src/gauche/hash.h, src/gauche.h: Changed hashtable API for consistency of dictionary API. This introduces incompatibility in Scm_HashIterInit and Scm_HashIterNext, which we provide the backward compatibility routines by default; defining GAUCHE_API_0_9 make the new API visible. Also we deprecate Scm_HashTableGet, Scm_HashTablePut, and Scm_HashTableAdd, in favor of the new APIs Scm_HashTableRef and Scm_HashTableSet. (Scm_HashTableDelete is also changed, but it only changes its return type which isn't used much.) All the "raw" hashtable support is dropped, in favor of ScmHashTableCore. * src/class.c, src/extilb.stub, src/module.c: Changed to adapt the new hashtable API. 2007-04-06 Shiro Kawai * lib/text/progress.scm: fix. * examples/text-progress.scm: added. 2007-04-04 Shiro Kawai * src/gauche/charset.h: splitted char-set related API decls. * src/char.c: rewrote ScmCharSet using ScmBits and ScmTreeCore. API rename for consistency: Scm_CopyCharSet -> ScmCharSetCopy. * src/treemap.c: adjust some APIs based on the experience of reimplementing ScmCharSet. * src/gauche/collection.h (ScmDictEntry): make 'key' member const. 2007-03-31 Shiro Kawai * src/gauche/bits.h, src/bits.c: added ScmBits, generic bitarray operation support. A plan is to use this to cleanup charset implementation and also for CL-ish bitvector. Some other datastuructures may take advantage of this. * src/char.c: using ScmBits for the small character maps. * src/core.c (init_cond_features): adds the feature gauche.sys.pthreads if Gauche is compiled w/ pthread support. * src/syslib.stub (sys-symlink): defines sys-symlink conditionally, with the feature identifier gauche.sys.symlink. 2007-03-28 Shiro Kawai * src/core.c: defines the feature identifier gauche.sys.pthreads if Gauche is compiled with pthreads enabled. 2007-03-27 Shiro Kawai * test/system.scm: use sys-nanosleep instead of sys-sleep if possible, to reduce the time of test. * ext/auxsys/auxsys.c (Scm_SetEnv): added a wrapper routine for sys-putenv and sys-setenv, so that we can use whichever available on the system. Importantly, this will fix the leak problem of sys-putenv on the common platform that supports setenv(3). * ext/auxsys/auxsys.scm: cleanup some cond-expands. 2007-03-26 Shiro Kawai * src/stdlib.stub (vector-ref, vector-set!), src/vector.c (Scm_VectorRef, Scm_VectorSet): we can't use :: type for the index of vector-ref, since bignum is allowed if fallback is also given. Because of this, we moved range check to stub, and made Scm_VectorRef not raise an error. Similar change on vector-set! for consistency. * src/vm.c (SCM_VEC_REF etc): fix error message. if bignum is given as an index, the message should be "out of bound" instead of wrong type argument. * src/number.c (Scm_GetDouble): handles the corner case when ratnum has very large denominator and/or numerator. * src/treemap.c, src/gauche/treemap.h: Renamed and cleaned up some treemap API for the consistency. 2007-03-24 Shiro Kawai * ext/net/net.ac: added a hack to avoid dragonfly's broken gethostbyaddr_r. 2007-03-23 Shiro Kawai * configure.ac, gc/configure.in, gc/libtool.m4: Patched to support DragonFly BSD. * ext/net/addr.c, ext/net/test.scm: struct in6_addr.s6_addr32 isn't portable, so we roll our own. also make sure we won't run ipv6 inet_pton/ntop if Gauche isn't configured with ipv6. Patch from Tatsuya BIZENN. 2007-03-22 Shiro Kawai * ext/sxml/sxml-ssax.scm.in: extend text.parse as well, for ssax:make-parser inserts assert-curr-char. * ext/mt-random/mt-random.c (mt_allocate): Seed initialization was broken when seed is given to the initialization argument. Consolidated mt-random-set-seed! and seed initialization into Scm_MTSetSeed. * ext/net/netaux.scm, ext/net/netlib.stub, ext/net/net.c: Implemented inet-address->string and inet-string->address in C, using inet_pton and inet_ntop. 2007-03-21 Shiro Kawai * ext/srfi/srfi-19-lib.scm (tm:directives): fix date formats to make them iso-8601 compliant. 2007-03-16 Shiro Kawai * ext/dbm/dbm.ac: checks for ndbm funcs in more libraries. * ext/xlink: allow no file arguments; depending on configuration, both $(LIBFILES) and $(SCMFILES) can be empty in ext/Makefile.ext. * src/genconfig.in: be friendly to autoconf 2.60. * lib/gauche/dictionary.scm: dictionary generic functions. experimental. * src/objlib.scm: added 'ref' and 'set!' methods for tree-map. 2007-03-15 Shiro Kawai * lib/rfc/icmp.scm: added ICMPv6 support. * ext/net/net.c, ext/net/netlib.stub (inet-checksum+): added inet-checksum+, which can be used to combine checksums; handy for IPv6 packet checksum calculation, for it requires including pseudo-IPv6 header. See RFC2460 sectin 8.1. Nope! reverted. Kernel takes care of IPv6 checksum, so we don't need it. 2007-03-14 Shiro Kawai * ext/net/addr.c (sockaddr_in6_allocate): fixed memory leak (missing freeaddrinfo). 2007-03-12 Shiro Kawai * src/error.c, src/gauche/exception.h: Dropped exception; it doesn't work well. The most annoying part is that the exception may be shadowed by other exceptions if the latter is thrown within the error handler; it does happen, for example, in the cleanup clause of unwind-protect. We still want the applictation to exit without reporting stack trace even something fails in cleanup handlers. It seems that application-exit needs different mechanism to trap (e.g. exit-handler) after all. 2007-03-11 Shiro Kawai * src/number.c (Scm_RoundToExact), src/extlib.stub (round->exact etc): implemented round->exact etc in C, for it can avoid some overhead and makes them much faster. Since the operation is so common I think it's worth of it. * lib/gauche/numerical.scm, src/autoloads.scm: removed round->exact etc, for they're in extlib.stub now. 2007-03-10 Shiro Kawai * src/genconfig.in : Lets genconfig generate lib/gauche/config.scm, so that gauche.config no longer needs to call gauche-config command. * lib/gauche/config.scm: Removed from repository, for it is now generated by src/genconfig. 2007-03-09 Shiro Kawai * src/Makefile.in (HOSTGOSH): reset GAUCHE_LOAD_PATH and GAUCHE_DYNLOAD_PATH to avoid unexpected interference. * ext/auxsys/auxsys.scm (sys-fdset): added a convenience constructor of . 2007-03-06 Shiro Kawai * lib/text/progress.scm: added. * src/gauche-init.scm, src/scmlib.scm: moved string-interpolate read-ctor and definition from gauche-init.scm to scmlib.scm. We can't move three define-macro stuff yet, since gencomp doens't preserve macro definitions, but eventually we want to eliminate gauche-init.scm totally. * lib/gauche/numerical.scm, src/autoloads.scm: added round->exact, floor->exact, ceiling->exact and truncate->exact. 2007-03-05 Shiro Kawai * src/main.c: Added -F option and -L option. 2007-03-04 Shiro Kawai * src/main.c: Handle during execution of 'main' procedure. * lib/gauche/process.scm: Added support of remove execution by :host keyword argument. * ext/net/addr.c: Allow and constructors to take integer and u8vector IP address as :host initializer keywords. * ext/net/netlib.stub, ext/net/netaux.scm: Implements sockaddr-name of and in Scheme, since now we have inet-address->string so they're more concise in Scheme. * ext/net/net.c (socket-setsockopt): Accepts uniform vector as a value. We'll phase out the use of string as a binary data and replace them for uvectors. 2007-03-03 Shiro Kawai * lib/gauche/time.scm: use inexact arithmetics to avoid the timer results being ratnums. * src/number.c (div_internal): fix: (/ 0 ) must be the inexact zero, not the exact zero. * src/extlib.stub: added inexact arithmetics: +. -. *. /. * ext/net/netaux.scm: added inet-address->string, inet->string->address and inet-string->address! (these have replaced the provisional address parsers in rfc.ip). 2007-03-01 Shiro Kawai * ext/net/net.c: cleaned up winsock-specific code using Scm_AddCleanupHandler. Also add the feature gauche.net.ipv6 conditionally. * src/core.c (Scm_AddFeature): Moved cond-features management code here from load.c, and cleaned up API. * src/intlib.stub (cond-features): ditto. * lib/srfi-0.scm (cond-expand): ditto. * src/genstub: added 'when' directive. * src/char.c: added a feature, either one of gauche.ces.utf8, gauche.ces.sjis, gauche.ces.eucjp, or gauche.ces.none, according to the compile-time option. * src/syslib.stub: conditionally add features: gauche.sys.sigwait, gauche.sys.nanosleep, gauche.sys.crypt, gauche.sys.symlink, gauche.sys.readlink, gauche.sys.select. * ext/auxsys/*: conditionally add features: gauche.sys.realpath, gauche.sys.getloadavg, gauche.sys.putenv, gauche.sys.setenv, gauche.sys.unsetenv, gauche.sys.lchown. * ext/fcntl/fcntl.c: conditionally add a feature: gauche.sys.fcntl. * ext/termios/termiolib.stub: conditionally add features: gauche.sys.openpty, gauche.sys.forkpty. * ext/syslog/syslog.stub: conditionally add features: gauche.sys.syslog, gauche.sys.setlogmask 2007-02-26 Shiro Kawai * src/error.c, src/vm.c, src/gauche/exception.h: Support condition experimentally. 2007-02-24 Shiro Kawai * lib/rfc/ip.scm: added ip-parse-address and ip-parse-address! 2007-02-21 Shiro Kawai * ext/uvector/*: added Scm_UVectorSizeInBytes and uvector-size to get uvector's size in bytes. Useful to treat uvectors as a binary buffer. * ext/binary/binary.c: changed to use above API. * ext/net/netlib.stub: added inet-checksum routine; the same checksum routine is used for various protocols, so it may be worth to have it (and it's pretty fast in C). * lib/rfc/ip.scm: Added experimentally. 2007-02-20 Shiro Kawai * lib/rfc/uri.scm (uri-encode-string, uri-decode-string): Support :encoding keyword argument. (*rfc2396-unreserved-char-set*, *rfc3986-unreserved-char-set*): Export two slightly different "unreserved" char set, so that the application can choose (or modify from) either one. (uri-encode): Change the default :noescape value to *rfc3986-unreserved-char-set*. Patch by Tatsuya BIZENN. * ext/net/*: Added socket-recv! and socket-recvfrom!. Changed socket-send and socket-sendto to accept uniform vectors as well as strings. These are a part of shift towards using uniform vectors uniformly for binary data, instead of strings. * lib/rfc/icmp.scm: added experimentally. * ext/binary/*: reconsidered and changed the argument order of put-*! to be consistent with u*vector-set!; after some coding I found that the original one was too confusing. 2007-02-19 Shiro Kawai * configure.ac: added check for sys/types.h; gauche.h includes it unconditionally, but some configure check (on some specific OS) needs it to be included, so it is convenient to force all checks include sys/types.h. (Specifically, sys/socket.h requires sys/types.h on older MacOSX). * ext/binary/*: Made default-endian a parameter; it eliminates need to provide endian argument in almost all cases. The peculiar endianness of double floats in ARM processors are supported as arm-little-endian. Renamed read-binary-uint8 etc. to read-u8 etc. for brevity and consistency with uniform vectors (old names are supported for the compatibility, but deprecated). Added support of read from and write to uniform vectors. 2007-02-18 Shiro Kawai * ext/uvector/*, src/read.c: added f16vector support. changed {s,u}{8,16} unbox routine to use the new conversion API below. * src/gauche/number.h, src/number.c: Introduced ScmObj -> C integer conversion routines for u8, s8, u16, and s16. 2007-02-17 Shiro Kawai * src/gauche/parameter.h, src/parameter.c: Cleaned up Parameter-related API. Introduced ScmParameterLoc and Scm_DefinePrimitiveParameter to make it easier to create and access (builtin) parameters from C. * src/vm.c, src/gauche/vm.h, src/gauche.h, src/extlib.stub: Changed accordingly. * src/number.c (Scm_HalfToDouble, Scm_DoubleToHalf): Added conversion functions for 16-bit float (half). * src/gauche/float.h: added. * configure.ac, src/gauche/config.h.in: added checks for uint16_t and long double. * src/test-arith.c: added tests for 16-bit float support. * ext/binary/binarylib.stub, ext/binary/binary.c, ext/binary/io.scm: added {read|write}-binary-half-float. 2007-02-16 Shiro Kawai * lib/gauche/test.scm: Added an experimental feature to report the total test result across multiple test processes. If the environment variable GAUCHE_TEST_RECORD_FILE is defined, gauche.test accumulates the test result stats into the named file. * Makefile.in, src/Makefile.in, ext/Makefile.ext.in: modified to support the above feature. 2007-02-13 Shiro Kawai * src/compile.scm (iform-copy-lvar): fixed bug (compared lvars by assoc, now by assq). Patch from Rui Ueyama. 2007-02-12 Shiro Kawai * src/treemap.c, src/gauche/treemap.h, lib/gauche/treeutil.scm: Added native support of red-black tree, for it is useful to implement efficient char-set, character attribute map, and readtable. * src/collection.c, src/gauche/collection.h: Besides and , added two more abstract classes, and . These files implement some of common stuff for these classes. * src/hash.c: Now inherits as well. * src/genstub: added as a builtin type. * src/extlib.stub: added some tree-map native cprocs. * src/autoloads.scm: added autoloads for gauche.treeutil. * lib/util/rbtree.scm: removed the previous content and changed to use builtin tree-map. This is kept for the backward compatibility. 2007-02-10 Rui Ueyama * src/char.c (charset_print): write a character at once instead of byte-by-byte. * src/write.c: fixed a bug of handling multibyte character, causing Scm_WriteLimited to raise an error. 2007-02-09 Rui Ueyama * test/rfc.scm: Added tests for rfc.html module. * lib/rfc/http.scm: Added . Fixed a bug in the case of HTTP request is redirected, causing malformed request-line is sent to a server. 2007-02-04 Shiro Kawai * lib/www/cgi/test.scm: Renamed www.cgi-test module to www.cgi.test module (www.cgi-test is kept for backward compatibility). * src/port.c, src/gauche.h (Scm_GetOutputString, Scm_GetOutputStringUnsafe, Scm_GetRemainingInputString): API CHANGE: New API takes string constructor flags. Compatibility macros are provided by default; defining GAUCHE_API_0_9 makes the new API visible. * src/gauche/string.h: Splitted String API. * src/string.c, src/extlib.stub: Removed string mutating APIs: Scm_StringSet(), Scm_StringByteSet(), Scm_StringSubstitute(), and Scm_StringFill(). Since string bodies are immutable, there's little advantage for providing these operations in C. Instead, String_ReplaceBody() and Scheme-level %string-replace-body! are added. Scheme-level string mutators are built on top of this. * src/scmlib.scm: Defines string-set!, string-byte-set! and string-fill! here. Note: There's no more string-substitute!. * libsrc/srfi-13.scm: Changed string-copy!, string-upcase!, string-downcase!, string-titlecase!, string-reverse!, string-map! and string-xcopy! to use %string-replace-body! instead of string-substitute!. 2007-02-02 Shiro Kawai * src/core.c (Scm_GC): added an API to trigger GC. * src/gauche.h (SCM_NEW_ATOMIC_ARRAY): added for consistency. * src/gauche/symbol.h, src/gauche/gloc.h, src/gauche/keyword.h, src/gloc.c, src/Makefile.in: Reorganized the sources. 2007-02-01 Shiro Kawai * ext/dbm/dbm.ac, ext/dbm/dbmconf.h.in, ext/dbm/ndbm.stub, ext/dbm/odbm.stub: Some platform has gdbm-ndbm.h etc., and/or requires -lgdbm_compat, for dbm/ndbm compatibility. Added autoconf stuff to detect that. It became unnecessarily complicated because of the defect of autoconf design (its name translation scheme can't distinguish gdbm/ndbm.h and gdbm-ndbm.h!) * test/system.scm: Changed tests for mkdir/chmod/fchmod to tolerate the case that the directory is sgid-ed. * lib/gauche/process.scm (run-process): Changed the API to be consistent with other keyword-argument taking procedures. Old API is still supported but deprecated. The reasons of the change are (1) STk compatibility is much less important now, and (2) it's easier to write code that calls run-process if it takes keyword arguments canonically. 2007-01-30 Rui Ueyama * src/read.c (read_internal, process_sharp_comma), src/gauche.h: avoid evaluating SRFI-10 sharp-comma expression within SRFI-62 S-expression comment. 2007-01-21 Shiro Kawai * lib/gauche/package/compile.scm (gauche-package-link, gauche-package-compile): let them recognize extra keyword args, for such keywords can be passed via gauche-package-compile-and-link. * lib/www/cgi-test.scm (call-with-cgi-script): added :on-abnormal-exit :ignore to call-with-process-io. (Note: the proper fix may be to mask SIGPIPE when running the child process instead of ignoring the error.) 2007-01-21 Rui Ueyama * lib/gauche/common-macros.scm (let-keywords): added let-keywords. * src/autoloads.scm, test/procedure.scm: changed accordingly. * lib/gauche/common-macros.scm (let-keywords*): issue a warning if given argument list contains unknown keyword. It will be changed to raise an error soon. * src/genstub (define-cproc etc.): added check for unknown keyword parameter. A new keyword argument, &allow-other-keys is introduced to disables the checking. * ext/charconv/convaux.scm, ext/net/netaux.scm, ext/vport/vport.scm, lib/dbi.scm, lib/dbm.scm, lib/file/filter.scm, lib/gauche/libutil.scm, lib/gauche/package.scm, lib/gauche/portutil.scm, lib/gauche/process.scm, lib/gauche/test.scm, lib/gauche/package/build.scm, lib/gauche/package/compile.scm, lib/gauche/package/fetch.scm, lib/gauche/package/util.scm, lib/gauche/vm/profiler.scm, lib/net/client.scm, lib/rfc/822.scm, lib/rfc/hmac.scm, lib/rfc/telnet.scm, lib/rfc/uri.scm, lib/text/diff.scm, lib/text/html-lite.scm, , lib/text/tr.scm, lib/www/cgi-test.scm, lib/www/cgi.scm, libsrc/file/util.scm, libsrc/gauche/collection.scm, libsrc/gauche/sequence.scm: changed to use let-keywords instead of let-keywords* or get-keyword. * ext/threads/test.scm: typo fix. * ext/uvector/uvseq.scm: call-with-iterator for uniform vector classes didn't recognize `:size' keyword. * lib/binary/pack.scm: removed unused variable `keys'. added keyword check. 2007-01-21 Shiro Kawai * lib/gauche/process.scm: added a mechanism to handle child process' abnormal exit status via condition. This changes the default behavior of process port procedures, which used to ignore nonzero exit status, now raises an error. To get the old behavior, add ':on-abnormal-exit :ignore' to the call of those procedures. 2007-01-18 Shiro Kawai * ext/charconv/convaux.scm, ext/dbm/gdbm.scm, ext/net/netaux.scm, ext/uvector/uvgen.scm, lib/dbm.scm, lib/file/filter.scm, lib/gauche/cgen.scm, lib/gauche/interpolate.scm, lib/gauche/libutil.scm, lib/gauche/parseopt.scm, lib/gauche/process.scm, lib/gauche/redefutil.scm, lib/gauche/test.scm, lib/gauche/interactive/info.scm, lib/gauche/package/fetch.scm, lib/rfc/mime.scm, lib/text/gettext.scm, lib/www/cgi.scm, libsrc/file/util.scm, src/compile.scm: Replaced 'with-error-handler' for 'guard' or 'unwind-protect'. There are some left in src/scmlib.scm, which should be replaced after the next release, since 0.8.9 doesn't know about unwind-protect yet so it wouln't build the CVS HEAD if we replace them now. * lib/rfc/ftp.scm: Added. Based on the contribution from OOHASHI Daichi. 2007-01-17 Shiro Kawai * lib/gauche/common-macros.scm (unwind-protect): added unwind-protect, finally. * src/autoload.scm: changed accordingly. * release 0.8.9 2007-01-16 Shiro Kawai * ext/net/net.ac: on mingw, we need to inlcude to check struct sockaddr_storage. * ext/srfi/srfi-19-lib.scm: make julian-day calculation in inexact numbers to avoid the huge overhead of rational arithmetic. * config.guess, config.sub: updated to the newer version. 2007-01-15 Shiro Kawai * src/gauche.h: reintroduced the compatibility macros for Scm_Eval, Scm_EvalCString and Scm_Apply, since there are extension packages that need more time to migrate. By default, these are defined to Scm_EvalRec etc. If GAUCHE_API_0_8_8 is defined, these becomes the new APIs. 2007-01-14 Shiro Kawai * src/signal.c (Scm_SigWait): Added a wrapper of sigwait to ensure removing signal handlers for the signals to wait. The behavior of sigwait with signal handlers is underined in the spec, and it causes unpleasant effect on some systems. We also need to ensure removing signals from the passed masks that are not under control of Gauche. (sig_handle): treat signalPendingLimit == 0 case separately to avoid potential overflow of sigcounts. 2007-01-13 Shiro Kawai * src/system.c (Scm_GlobDirectory): dropped SCM_SYSCALL around glob(), since it doesn't necessarily return a negative value on error, and it doesn't necessarily set errno. Well, eventually this function should go away, but for the time being this fix may be effective. * gc/darwin_stop_world.c (GC_stop_world): applied a patch posted to gc-list by Allan Hsu that prevents SEGV on OSX. * src/class.c (find_core_allocator): added more precise check for inheritance; the previous code incorrectly rejected a valid inheritance in which more than one BASE class are included but they form a single inheritance. The previous code also incorrectly accepted a class that inherits from BUILTIN class. 2007-01-11 Shiro Kawai * src/syslib.stub (sys-fchmod): added. Patch from UEYAMA Rui. * lib/slib.scm.in: adapted to slib3a4 changes. Based on a patch by YOKOTA Hiroshi. There're some hacks to make it work with both old and new slibs. 2007-01-10 Shiro Kawai * src/signal.c: (Scm_SetSignalHandler): set up C-level signal handler so that all signals are blocked during its execution, in order to avoid race condition. (sig_handle): interpret signalPendingLimit==0 as no limit. 2007-01-09 Shiro Kawai * src/signal.c, src/gauche/vm.h: changed signal handling; we no longer queue the signals; instead the C-level signal handler just counts what signals it received. The order of signal arrival isn't preserved, but it's ok for most Unixes doesn't guarantee that anyway. The upper limit of the # of occurrences of the same signal before VM handles them can be configured by set-signal-pending-limit; if the signals excceds this limit, Scm_Abort() is called. * src/syslib.stub (set-signal-pending-limit, get-signal-pending-limit): added. 2007-01-09 Rui Ueyama * configure.ac, src/syslib.stub, test/system.scm, src/gauche/config.h.in : added sys-sigwait 2007-01-08 Shiro Kawai * Makefile.in, src/Makefile.in, ...: added datarootdir = @datarootdir@ definition for autoconf 2.60 and after. It works for both pre-2.60 and 2.60; pre-2.60 leaves @datarootdir@ as is, but no other place refers $(datarootdir) so it is ok; for 2.60, @datadir@ is replaced for reference of $(datarootdir), so it also works. 2007-01-07 Shiro Kawai * lib/gauche/listener.scm (listener-read-handler): fixed a bug that exits the listener when an error is signaleld during evaluation. This fix is temporary; more complete fix is required. * src/mingw-exify : Adapted to Scm_Apply API change. * src/signal.c (Scm_SetSignalHandler, Scm_SigCheck): Added "mask" argument to Scm_SetSignalHandler so that one can ensure a signal handler is executed while certain signals are blocked. Also added Scm_GetSignalHandlerMask(). * src/syslib.stub (set-signal-handler!, get-signal-handler-mask): changed accordingly. * src/scmlib.scm (sys-sigset): added the convenience function. 2007-01-06 Shiro Kawai * configure.ac: Removed warning of defaulting encoding to utf-8. 0.8.9_pre1. 2007-01-03 Shiro Kawai * src/number.c (Scm_Mul): fixed a silly bug in the short cut paths, which resulted (* +i 0.0) => +i etc. 2006-12-26 Shiro Kawai * lib/gauche/process.scm (%run-process): Fixed a leak bug that didn't delete a process from the active process list if :wait #t is given. Thanks for Tomas Stanek to point this out. 2006-12-21 Shiro Kawai * lib/dbi.scm (dbi-execute-query): fixed a wrong way of passing :pass-through arg to dbi-do. This bug only surfaced if the app was using compatibility APIs. 2006-12-09 Shiro Kawai * src/vm.c (run_loop): fix tail-recursive APPLY. * src/compile.scm (pass2/$LREF): Added a check for circle in initialization of local variables introduced by letrec. It have caused an infinite loop in the compiler. Patch from Rui Ueyama. 2006-12-08 Shiro Kawai * src/hash.c (Scm_EqvHash): didn't considered RATNUMs. 2006-12-06 Shiro Kawai * vm.c: removed obsoleted experimental code (SMALL_REGS switch and SAVE_REGS/RESTORE_REGS stuff). 2006-11-30 Shiro Kawai * src/string.c (get_string_from_body), src/gauche.h: Avoid accessing out-of-bound element of the string content to check whether the string is NUL-terminated. Instead, we introduced a new flag SCM_STRING_TERMINATED to track whether the string content is NUL-terminated. Also we deprecate SCM_MAKSTR_* flags, and consolidated them to SCM_STRING_* flags. * various files: Replaced SCM_MAKSTR_* flags for SCM_STRING_* flags. 2006-11-27 Shiro Kawai * src/number.c (Scm_InexactToExact): Rule out NaN and Inf before applying modf. 2006-11-26 Shiro Kawai * src/intlib.stub (global-call-type): Experimentally added a feature to record modules used during expansion, to be used by test-module later. 2006-11-23 Shiro Kawai * src/regexp.c (Scm_RegMatchStart etc.): Optimized counting length of submatch strings. Patch from Rui Ueyama. 2006-11-20 Shiro Kawai * src/class.c (Scm__InitClass): Added missing initialization of class. 2006-11-19 Shiro Kawai * src/string.c (substring): avoid counting characters when the end of the substring is equal to the end of the source string. Patch from Rui Ueyama. * src/vm.c (Scm_NewVM): a newly created VM didn't inherit current ports from the prototype. This became visible when a new thread was created when current ports were bound to ports other than the standard ones. 2006-11-17 Shiro Kawai * src/main.c (main): the change to use the new Scm_Apply was incorrect; (1) it returns exit_code == 0 when 'main' returns non-integer, and (2) it exits silently when non-captured error occurs. * lib/gauche/condutil.scm (define-condition-type): automatically add :init-keyword to slots, for the convenience. Based on the patch from Rui Ueyama. 2006-11-15 Shiro Kawai * src/class.c (Scm__InternalClassName): make sure to return a string, for some code in error.c assumes a string and SEGVs otherwise. 2006-11-13 Shiro Kawai * src/vm.c, src/gauche.h: removed compatibility stuff about Scm_Eval etc. 2006-11-12 Shiro Kawai * src/vm.c (Scm_EvalCStringRec): typo fix (was: Scm_EvalRecCString). * src/gauche.h, src/gauche/vector.h: splitted vector API header. * src/compile.scm (case, cond): Applied srfi-61/srfi-87 patch from Rui Ueyama. 2006-11-11 Shiro Kawai * release 0.8.8 2006-11-10 Shiro Kawai * configure.ac, src/gauche/config.h.in (sunmath): Solaris's compiler provides isinf() in a separate header/library. Added checks for it. * src/class.c (unlock_class_redefinition): reset class_redefition_lock.owner to NULL as well, otherwise the redefinition lock keeps other threads waiting until the lock holding thread terminates. * src/number.c (SCM_IS_INF): Provide an alternative function when the system does not provide isinf(). We used to inline the check, but some version of gcc appears to assume incorrectly the condition would never be satisfied and optimizes it away. (It happened on gcc-3.3.2/Solaris 5.9/i86pc). * lib/gauche/logger.scm: We can't determine lock policy statically, since the lock file may be placed on a filesystem that doesn't support fcntl lock. So I changed the lock policy to be dynamically determined at the first access to the file-based log drain. 2006-11-09 Shiro Kawai * INSTALL.in, doc/extract: moved away from escm to generate INSTALL and INSTALL.eucjp, since it is awkward for escm to handle eucjp doc with utf-8 gauche. Instead I use doc/extract. * src/vm.c (Scm_VMDefaultExceptionHandler), src/gauche/vm.h (ScmEscapePoint): added a flag in ScmEscapePoint to specify whether the dynamic handlers should be rewind before or after the error handler is invoked. Legacy with-error-handler assumes they are invoked after the error handler. SRFI-34's guard requires the handler clauses are invoked after the dynamic env is rewound. It may be better to change with-error-handler semantics, but for now, we go with this flag. Do not count on this flag kept in future. * src/exclib.stub (with-error-handler): added a keyword arg to set the ScmEscapePoint flag mentioned above. This is a temporary solution; applications should not cound on this feature. * lib/gauche/common-macros.scm (guard): fixed guard semantics to conform srfi-34, using the above feature. 2006-11-08 Shiro Kawai * ext/sxml/sxml-tools.scm.in: Avoid mutual dependency between sxml.sxpath and sxml.tools by autoloads. * configre.ac, src/gauche/config.h.in, src/syslib.stub (HAVE_CRYPT_H): Adds crypt.h if exists, to suppress warnings. Patch from David Mosberger-Tang and YAEGASHI Takeshi. * ext/dbm/gdbm.stub (gdbm-open): improved error message. * src/read.c (ref_val): added missing type declaration of the argument, which became a problem on 64bit architecture. Patch from David Mosberger-Tang and YAEGASHI Takeshi. * lib/gauche/test.scm (closure-grefs): fixed to trace code in the internal closures. Thanks to Rui Ueyama. * ext/srfi/srfi-19-lib.scm, ext/sxml/sxml-sxpath.scm.in, ext/sxml/sxml-tools.scm.in, ext/sxml/sxml/adaptor-scm, lib/text/gettext.scm, lib/util/stream.scm: fixed the undefined global reference found by the above patch. * gc/darwin_stop_world.c, gc/include/private/gc_priv.h, gc/os_dep.c: Applied Allan Hsu's GC patch for Xcode-2.4/OSX. * gc/*: bumped to Boehm GC 6.8. 2006-11-07 Shiro Kawai * src/gauche.h: define SCM_ILLEGAL_CHAR_* enums to specify illegal character handling mode. * src/string.c, src/extlib.stub: add 'handling' argument to string-incomplete->complete, so that the caller can ensure to obtain a complete string by omitting or replacing incomplete chars in the original string. The linear-update versions, string-complete->incomplete! and string-incomplete->complete!, are obsoleted (the latter is kept for backward compatibility, but will go away soon). * src/gauche/char_utf_8.h (scm_CharUtf8Getc): more strict error checking. 2006-11-05 Shiro Kawai * src/gauche.h (ScmModule): added a field to track module dependency. * src/error.c (Scm_TypeError): added a convenience API to report argument type error. 2006-11-04 Shiro Kawai * src/gauche/port.h (PORT_SAFE_CALL): Remove bogus check of lockOwner. * src/class.c (lock_class_redefinition): There was an off-by-one error in the recursive lock count. 2006-11-02 Shiro Kawai * gauche.h, vm.c (Scm_Eval etc.): changed my mind about the names of the new Eval API. If GAUCHE_API_0_8_8 is defined before including gauche.h, Scm_Eval, Scm_EvalCString and Scm_Apply have the new APIs (the old ones are accessible as Scm_EvalRec etc.). If GAUCHE_API_0_8_8 is not defined, Scm_Eval, Scm_EvalCString and Scm_Apply have the original API (and Scm_EvalRec etc., are also available). This helps the transition, while maintaining compatibility and avoid further extra names like SafeEval. NB: I'm still not sure about what Scm_Eval etc. should return. May change my mind again. * various files: updated accordingly. 2006-10-29 Shiro Kawai * src/vm.c (Scm_SafeEval etc.): The previous version was broken. Needed to set up error handler properly. 2006-10-28 Shiro Kawai * src/gauche.h, src/vm.c (Scm_SafeEval): Added convenient and robust API to call Scheme program casually from C code. Scm_Safe* APIs catch errors and returns the info in the packet. They also handle multiple values. The existing Scm_Eval and Scm_Apply are renamed to Scm_EvalRec and Scm_ApplyRec, for they call VM recursively. The old names are #defined for backward compatibility. The plan is to give Scm_Eval etc. to Scm_SafeEval eventually. The reason is that Scm_EvalRec etc. are not really for end-user programming, since handling errors are still cumbersome. Scm_SafeEval is more intuitive that it (almost) always returns, error or no error. So Scm_SafeEval is more suitable to get the simpler name, Scm_Eval. 2006-10-21 Shiro Kawai * ext/net/test.scm: On some systems IPv6 loopback host name isn't "localhost" by default, so we apply some heuristics. Patch from Rui Ueyama. * src/number.c (read_real): some fixes to handle divide-by-zero cases. Patch from OOHASHI Daichi. * lib/util/rbtree.scm, test/util.scm, lib/Makefile.in: added util.rbtree, contributed from Rui Ueyama. 2006-10-20 Shiro Kawai * libsrc/gauche/collection.scm: original 'fold' is now built-in instead of srfi-1. * libsrc/gauche/sequence.scm (fold-right): added generic version of fold-right. It is sequence's operation, since collections don't care about the order of elements. 2006-10-18 Shiro Kawai * src/port.c (Scm_FlushAllPorts): fixed MT-hazard in Scm_FlushAllPorts. * src/number.c (read_real): Fixed the behavior when too big or too small exponent is given. Also fixed the handling of explicitly exact fractional numbers (e.g. #e12.34e3 or #e4e-2). 2006-10-16 Shiro Kawai * lib/util/list.scm (cond-list): extended the syntax to allow splicing, using '@' modifier. * lib/util/trie.scm (make-trie): revised using new cond-list syntax. 2006-10-15 Shiro Kawai * lib/util/trie.scm, lib/Makefile.in, test/util.scm: Added util.trie module, contributed by OOHASHI Daichi and other people on WiLiKi. 2006-10-14 Shiro Kawai * src/extlib.stub (boolean): added boolean procedure, which is just (compose not not), but convenient if you want to guarantee the returned value is boolean. 2006-10-07 Shiro Kawai * ext/threads/threads.h: ScmConditionVariable and ScmMutexRec should have SCM_INSTANCE_HEADER, for they are BASE class (I'm not sure whether I should let them inheritable or not, so I may revert this and change them to BUILTIN class in future; but for now, let's maintain the consistency.) * src/write.c (Scm_WriteCircular, Scm_WriteLimited): Fix for write/ss is called during walk pass of outer write/ss. Patch from Rui Ueyama. * ext/charconv/convaux.scm (%open-{input|output}-file/conv): Avoid creating conversion ports when it is unnecessary. Patch from Tatsuya BIZENN. * configure.ac: bumped to 0.8.8_pre1. * ext/sxml/src/serializer.scm, ext/sxml/sxml-serializer.scm.in, ext/sxml/Makefile.in, doc/modutil.texi: Added sxml.serializer module, a customizable SXML serializer. Original code is by Dmitry Lizorkin. Ported to Gauche and documented by Leonardo Boiko. * ext/sxml/test.scm: Added simple tests for sxml.serializer 2006-10-06 Shiro Kawai * src/number.c (Scm_Div, Scm_DivInexact): provide backward-compatible version of division, Scm_DivInexact, which returns flonum when arguments are exact integers and the result isn't a whole number. * src/extlib.stub (inexact-/): make the backward-compatible version of division as 'inexact-/'. * lib/compat/norational.scm: when used, redefines '/' by 'inexact-/', so that the existing code that counts on the old behavior can work as before. 2006-10-05 Shiro Kawai * src/port.c (register_buffered_port): Run global GC when the port vector gets full, so that we may be able to clean up some entries for garbaged ports. I also found unregister_buffered_port wasn't necessary. See the comment titled "Tracking buffered ports" in the source. The original fix is provided from Michal Maruška. 2006-10-01 Shiro Kawai * ext/srfi/srfi-19-lib.scm (date->string): allow '@' option in the format directive (e.g. ~@b) to gurantee the 'C' locale is used. Since srfi-19 only provides locale-sensitive directives for month and day-of-week names, without such extention you cannot write a library whose output isn't affected with locale settings. 2006-09-30 Shiro Kawai * lib/rfc/cookie.scm (construct-cookie-string): accepts srfi-19