2009-11-21 Shiro Kawai * release 0.9 * examples/spigot, examples/mqueue-cpp: Updated to use the newer stub forms. * lib/gauche/cgen/stub.scm (process-expr-spec, process-call-spec): As a transition from old (expr ...) and (call ...) form, we make these forms check the :: style return-type if the result type is not given in these forms. We can't obsolete these forms completely, for the new CiSE spec is not yet fixed and it won't cover all cases (esp. C++ support is weak). So the stub file may still use expr or call form if CiSE can't be used. However, the stub can now use the new style of return type form, e.g.: (define-cproc foo () :: (expr "Some_C_Expr")) instead of the old style: (define-cproc foo () (expr "Some_C_Expr")) * ext/template.DIST, examples/spigot/DIST, examples/mqueue-cpp/DIST: Exclude .svn subdir from tarball as well as CVS. * lib/rfc/http.scm (consider-proxy): Fix host header handling with proxy. Now the server given to :proxy only used for the connection. The host request header is the destination server, which may be overwritten by :host keyword argument. Patch for teppey. 2009-11-19 Shiro Kawai * src/gauche.h (SCM_CHAR_VALUE): make sure it returns unsigned value. 2009-11-18 Shiro Kawai * src/gauche.h: Include gauche/arch.h as it should be. * src/main.c (version): Includes the architecture in output. 2009-11-15 Shiro Kawai * lib/gauche/fileutil.scm (glob-fold-1): Fixed a bug that caused an error on (glob "**"). 2009-11-11 Shiro Kawai * lib/rfc/http.scm (with-connection): Fixed to make a connection to the proxy if it is specified (pointed by Naohiro NISHIKAWA). 2009-11-10 Shiro Kawai * src/vmcall.c (ADJUST_ARGUMENT_FRAME): Fixed a boundary case of CHECK_STACK when unfolding rest args. (Patch from enami). 2009-11-03 Shiro Kawai * gc/dyn_load.c (GC_FirstDLOpenedLinkMap): Applied a patch from enami to support the newest NetBSD-current. NB: We avoid using __NetBSD_Prereq__, for its definition was changed in incompatible way sometime around 4.99.x and that made it unusable to test across wider range of NetBSD versions. * gc/misc.c, gc/alloc.c, gc/os_dep.c, gc_pthread_support.c, gc/pthread_stop_world.c, gc/include/private/gcconfig.h, gc/include/private/gc_priv.h: Back port pthread_cancel safe patch from gc cvs head. * gc_pthread_support.c (GC_new_thread): Remove duplicate entry before registering a new one. This particular case happens with glibc-2.7/i386, where GC_exit_handler isn't called when the thread exits with pthread_exit() or pthread_cancel(). I'm not sure the real cause is in gc or glibc, but at least this change workarounds the deadlock situation caused by the failure of GC_exit_handler. 2009-10-28 Shiro Kawai * ext/net/net.c, ext/net/net.ac, src/gauche/config.h.in (HAVE_STRUCT_IFREQ_IFR_IFINDEX, HAVE_STRUCT_IFREQ_IFR_INDEX): FreeBSD7.2 has ifreq.ifr_index instead of ifreq.ifr_ifindex, so we check which is available. Patch from Naohiro NISHIKAWA. 2009-10-27 Shiro Kawai * ext/zlib/zliblib.stub (Z_TEXT, Z_FIXED): Conditionally define these, since older zlib doesn't have them. 2009-10-26 Shiro Kawai * lib/gauche/cgen/stub.scm (process-body): Recognize obsoleted (return ) and (return ) to issue a warning and treat them as 'call' forms. The extensions that have not been updated recently may have thes forms, and it will be inconvenient if we stop supporting them now. 2009-10-25 Shiro Kawai * src/port.c (Scm_FdReady): Made it work with Windows pipe. * src/syslib.stub (sys-get-osfhandle): Added this for low-level tweaking on Windows. * ext/termios/termios.scm (without-echoing): Added a high-level utitily for reading input without echoing, which can be used across platforms. * lib/gauche/package/util.scm (get-password): Rewrote this using without-echoing. * lib/gauche/cgen/type.scm, ext/uvector/uvlib.stub.tmpl: Moved stub type definitions of etc. from ext/uvector to cgen/type.scm, since they are now supported by core. * ext/termios/termiolib.stub: Added bunch of Windows Console API on GAUCHE_WINDOWS. 2009-10-24 Shiro Kawai * src/syslib.stub (Scm_MakeWinHandle, Scm_WinHandleP etc.), src/system.c (Scm_WinProcessPID), src/gauche/system.h: Created generic Windows HANDLE wrapper and redefined Windows process handle API on top of it. * src/scmlib.scm (%sys-escape-windows-command-line), src/system.c (win_create_command_line), lib/gauche/process.scm (shell-escape-string): Moved Windows shell argument escape routine from shell-escape-string to src/scmlib.scm, since it is also needed to implement Scm_Exec on Windows correctly (well, almost. Windows does not enforce consistent rules of parsing command lines, so all we can do is cross our fingers.) 2009-10-21 Shiro Kawai * src/system.c (Scm_SysExec, pipe), src/gauche/win-compat.h: Support I/O redirection using pipes on Windows, and try to align process exit status handling. * src/port.c (Scm_PortFdDup), src/extlib.stub (port-fd-dup!): Support these under Windows as well (via _dup2()). They are not fully compatible (Windows seems to have some restrictions on which file descriptors can be dup'ed?) but it's better than nothing. * src/error.c (Scm_SysError): On GAUCHE_WINDOWS, check both errno and GetLastError; posix-compatible API uses the former and Windows API uses the latter, and Scm_SysError doesn't know which for sure. We always reset both errors after Scm_SysError so we can guess that non-zero one reflects the actual error. * src/syslib.stub (sys-stat): On GAUCHE_WINDOWS, remove trailing path separator in PATH if any (excluding the root directory; e.g. "/" or "c:\\" are untouched). This is because Windows stat() raises error if there's trailing separator, except the root directory case. * src/main.c (main): On GAUCHE_WINDOWS, sets stdin, stdout and stderr to binary mode. This will align gosh's behavior the same on Windows and Unix, and save lots of troubles. Note that applications that want to link libgauche.dll should take care of this by themselves. 2009-10-20 Shiro Kawai * src/syslib.stub (sys-unlink): On GAUCHE_WINDOWS, make file writable before unlink(), since Windows doesn't allow unlinking a read-only file. 2009-10-19 Shiro Kawai * test/system.scm: Excluded fork&wait test on cygwin platform since fork() on cygwin is so unreliable. * src/mingw-exify: Updated to use 0.9 API. * src/core.c (init_cond_features): Added a feature gauche.os.cygwin on cygwin platform. It comes short to provide an illusion of complete unix emulation, so the program may want to switch its behavior. * gencomp: Resurrected for the backward compatibility. It issues warning to move on to precomp. * src/gauche.h, src/gauche/load.h, src/gauche/hash.h, src/gauche/port.h, src/main.c, src/test-vmstack.c, ext/Makefile.ext.in: Removed GAUCHE_API_0_9 flags. Now 0.9 API is the default. The backward compatibility API is available under a new flag, GAUCHE_API_PRE_0_9. 2009-10-18 Shiro Kawai * src/gauche/extend.h (SCM_INIT_EXTENSION): Revived data/bss area registration code only for Cygwin; it still seems to need them. * gc/configure.ac: Applied a patch to avoid adding -lpthread -ldl when building on Cygwin, for it causes link error. 2009-10-17 Shiro Kawai * src/vm.c (vm_finalize): Issue a warning when a thread is terminated by an uncaught exception and its state is never retrieved by thread-join!. Such a case must be a coding error, and usually causes pain in debugging if such thread dies silently. * src/exclib.stub, src/gauche/exception.h, ext/thread/thrlib.stub: Moved thread exception definitions from the thread subsystem to the core; we need in the core to implement the above feature. * ext/threads/threads.c (Scm_ThreadJoin): Use SAEF_LOCK_BEGIN|END. 2009-10-16 Shiro Kawai * src/gauche-install.in: Added -C|--canonical-suffix option that renames *.sci to *.scm upon install. This is to avoid confusion when both foo.sci and foo.scm happens to be installed. * ext/Makefile.ext.in, ext/template.Makefile.in: Added -C option to gauche-install. 2009-10-13 Shiro Kawai * lib/gauche/cgen/cise.scm (define-cfn): Fixed a bug that didn't escape identifiers for forward-declaration in record-static. * src/extlib.stub (%vm-show-stack-trace): experimentally expose this function for diagnostics. 2009-10-11 Shiro Kawai * configure.ac: platform match for freebsd allows *freebsd, in order to support kfreebsd (Patch from Jens Thiele). 2009-10-10 Shiro Kawai * lib/rfc/http.scm (http-generic): adds user-agent header automatically, using default value from the parameter http-user-agent. Also supports :proxy option. 2009-10-09 Shiro Kawai * lib/rfc/http.scm (http-compose-form-data, http-generic): Support automatic multipart/form-data composition in http-post and http-put. 2009-10-08 Shiro Kawai * lib/rfc/http.scm (http-compose-query, http-generic): Support application/x-www-form-urlencoded query composition in http-* procedures. 2009-10-07 Shiro Kawai * lib/rfc/mime.scm (mime-compose-message, mime-compose-message-string) (mime-make-boundary): Added support of composing a MIME message. (mime-parse-parameters, mime-compose-parameters): Expose those APIs (the former renamed from mime-parse-parameter-value). 2009-09-29 Shiro Kawai * src/gauche/gloc.h, src/gloc.c (Scm_GlocMarkConst,Scm_GlocUnmarkConst): APIs for better encapsulation. Also dropped Scm_MakeConstGloc, because of duplicated feature. * src/module.c (Scm_Define, Scm_DefineConst): Factored out the common parts, and make sure modules.mutex is unlocked. 2009-09-26 Shiro Kawai * src/gauche/gloc.h, src/gloc.c, src/gauche/module.h, src/module.c (Scm_HideBinding, Scm_FindBinding), src/intlib.stub (%hide-binding): Added a hack to hide binding inherited from parent modules. This feature is not for general use; it is an internal tool to implement import's :except and :rename qualifiers via intermediate module. * src/compile.scm (process-import): Added support of :except qualifier in import, using the above feature. 2009-09-24 Shiro Kawai * src/compile.scm (import): Added support of :only qualifier in import. 2009-09-23 Shiro Kawai * src/module.c (Scm_FindBinding, Scm_ImportModule), src/gauche/module.h, src/intlib.stub (%import-module), src/compile.scm (import): Added a feature to import a module with prefixed names. (import (MODULE :prefix PREFIX)) imports exported bindings of MODULE into the current module, exposing the symbols with PREFIX attached. The C-level API Scm_ImportModules() is deprecated, since it is not very convenient for the callers to call it with the new prefixed format. Instead the C programs should call Scm_ImportModule() for each module to be imported. * src/main.c: Rewritten using Scm_ImportModule() instead of Scm_ImportModules(). 2009-09-21 Shiro Kawai * src/core.c (Scm__MutexCleanup), src/vm.c (process_queued_requests), src/gauche/pthread.h (SCM_INTERNAL_MUTEX_SAFE_LOCK_BEGIN|END), src/gauche/uthread.h (SCM_INTERNAL_MUTEX_SAFE_LOCK_BEGIN|END): Abstracted the pattern of mutex lock/unlock with cleanup handler installed. 2009-09-19 Shiro Kawai * src/vm.c (process_queued_requests): Make sure the VM's lock is unlocked when the thread is canceled while stopped. Note: The same fix is needed wherever LOCK/UNLOCK pair contains cancellation point. 2009-09-05 Shiro Kawai * ext/digest/md5.*: Renamed MD5Final -> MD5_Final etc. to avoid name conflict in Snow Leopard. Patch from KOGURO Naoki. * gc/match_dep.c: Fix build problem on Snow Leopard. Patch from KOGURO Naoki. * src/symbol.c (Scm_Gensym), src/main.c (cleanup_main): Suppress warning on printf directive size mismatch. Patch from KOGURO Naoki. * m4/ax_check_define.m4, configure.ac, acinclude.m4: Fix build problem on Snow Leopard. Patch from KOGURO Naoki. 2009-08-26 Shiro Kawai * lib/gauche/cgen/cise.scm (cise-translate): Added per-file cise rendering support. This enables automatic generation of forward prototype declarations of static procedures in the file. 2009-08-25 Shiro Kawai * lib/gauche/cgen/cise.scm (, define-cise-toplevel): Added "toplevel" context so that we can have a toplevel cise macro that expands into toplevel cise forms. (cise-render, cies-render-to-string): Because of the above change, the optional argument to indicate the context now takes a symbol either one of 'toplevel, 'stmt or 'expr, as opposed to the boolean value. * lib/gauche/cgen/stub.scm (define-cfn, process-expr-spec) (c-literal-expr): Changed accordingly. 2009-08-23 Shiro Kawai * ext/net/net.ac (net/if.h, struct ifreq): need sys/socket.h on OSX to check these. 2009-08-21 Shiro Kawai * src/number.c (MAX_EXPONENT): Changed to 325, since the least absolute value of denormalized number (expt 2.0 -1024) would be printed to 5.0e-324, so we do need to handle exponent -324 to keep read/write invariance. (iexpt10): handle cases where e is larger than pre-computed table size. It can happen in legitimate input, although rarely. * src/vm.c (Scm_VMFlushFPStack): Fixed a bug that forgot to scan ARGP of in-stack continuation when flonum registers are flushed. (Thanks to naoya_t for finding and providing reproduceable test case.) 2009-08-20 Shiro Kawai * src/portapi.c (Scm_PortSeek): Fixed to revert the buffer pointer when a seek method of a procedural buffered port gives up the operation. (See ext/vport/test.scm for the actual case). 2009-08-19 Shiro Kawai * lib/gauche/cgen/cise.scm (.if): Changed preprocessor directive macro from |#if| to .if, since the former is too intrusive in the code. (.cond, .include): Added these to generate preprocessor directives #if..#elif..#endif and #include. * src/*.stub, ext/syslog/syslog.scm: Changed accordingly. 2009-07-28 Shiro Kawai * src/read.c (read_string), src/gauche/char_*.h (SCM_CHAR_EXTRA_WHITESPACE_INTRALINE): Fully support all intraline whitespace characters. 2009-07-27 Shiro Kawai * src/read.c (skipws), src/gauche/char_*.h (SCM_CHAR_EXTRA_WHITESPACE): Recognize all whitespace characters in the reader. * src/list.c (Scm_DeleteDuplicates): Fixed a bug that SEGVs when dotted list is given. 2009-07-26 Shiro Kawai * lib/gauche/test.scm (prim-test, test-check): Changed the default check procedure from equal? to a new test-check procedure. It treats objects specially, for the comparison of error case is non symmetric. The old version handled error cases by overloading object-equal? for , but it is awkward since object-equal? is expected to be symmetric. * test/*, ext/*/test.scm: Rewrote *test-error* in error case tests with test-error; the *test-error* variable is obsoleted. 2009-07-25 Shiro Kawai * lib/rfc/uri.scm (uri-decompose-hierarchical): Changed to regard empty PATH part as missing, and returns #f instead of "". It is also consistent with rfc2396 section 3. (Pointed out by, and tests provided by Hisashi Morita). 2009-07-24 Shiro Kawai * src/gauche/symbol.h, src/symbol.c (Scm_WriteSymbolName): Made symbol printing routine available for keyword printing. * src/keyword.c (print_keyword): Escapes keyword name if it contains weird characters. * src/read.c (read_keyword): Supports :|...| style escaped keywords. 2009-07-06 Shiro Kawai * lib/gauche/test.scm (test-error): Supersedes the global *test-error* variable. Now the user can create a new object for each test, giving expected condition type, so that it will be easier to test if the code raises a particular condition. *test-error* variable is deprecated, and will fade away. 2009-07-03 Shiro Kawai * src/syslib.stub (sys-stfrerror): avoid using 'errno' as argument name, for it may collide with a system macro. 2009-07-02 Shiro Kawai * src/read.c (read_shebang): Removed unnecessary EOF check. 2009-06-28 Shiro Kawai * src/prof.c (collect_samples): Replaced a call to HashTableGet for HashTableRef. (Scm_ProfilerCountBufferFlush): Replaced a call to HashTableAdd for HashTableSet. 2009-06-26 Shiro Kawai * src/write.c, src/keyword.c: Replaced calls to obsoleted APIs HashTableGet/Put for the new APIs HashTableRef/Set. 2009-06-25 Shiro Kawai * src/symbol.c (symbol_print, Scm_MakeSymbol), src/read.c (read_internal, read_escaped_symbol), src/write.c (write_walk): Support #:symbol notation of uninterned symbols. * src/extlib.stub (string->uninterned-symbol, symbol-interned?): Added. 2009-06-24 Shiro Kawai * src/symbol.c (Scm_SymbolSansPrefix), src/extlib.stub (symbol-sans-prefix): Added. * src/symbol.c (Scm_Intern): Doh! Scm_Intern wasn't MT-safe. Fixed. 2009-06-15 Shiro Kawai * src/gauche/vm.h (ScmVM): Use of queueNotEmpty flag had a race condition. We ditched it and introduced separate flags for atomicity. Also dropped unused SCM_VM_BLOCKED state and introduced SCM_VM_STOPPED state; the former is for blocked on system calls, but it's too expensive to change the state for every syscall. SVM_VM_STOPPED is for being stopped by other thread for debugging. * src/core.c, src/signal.c, src/extlib.stub: Changed accordingly. * src/vm.c (process_queued_requests), ext/threads/threads.c (Scm_ThreadStop, Scm_ThreadCont), ext/threads/thrlib.stub (thread-stop!, thread-cont!): Implemented a hand-shake protocol to stop/continue a thread from another thread. * ext/threads/thrlib.stub (thread-state): Added. 2009-06-07 Shiro Kawai * lib/rfc/http.scm (http-put, http-delete): Added. Patch from illness-P. 2009-06-01 Shiro Kawai * lib/rfc/ftp.scm (ftp-size): Adjust transfer-type by the connection's transfer-type before sending ftp SIZE request; the value is affected by transfer-type, and some ftpd rejects SIZE request in ASCII mode (since the server needs to scan the file to calculate effects of CRLF conversions). 2009-05-31 Shiro Kawai * lib/gauche/portutil.scm (copy-port): Make SIZE argument to accept zero as a valid size; previously zero meant no size limit. This argument was undocumented, so I hope this change won't affect existing code. 2009-05-30 Shiro Kawai * lib/www/cgi.scm (cgi-main): Change buffering mode of the current error port so that httpd error log will be cleaner. 2009-05-20 Shiro Kawai * ext/net/netaux.scm (call-with-client-socket): Added :input-buffering and :output-buffering keyword arguments. 2009-05-02 Shiro Kawai * src/gauche-package.in (compile): Fix a problem when --rpath-flag is empty (e.g. on OSX) 2009-04-30 Shiro Kawai * doc/corelib.texi (atan): fix description of 2-argument atan. (atan y x) and (atan (/ y x)) are equivalent only when x and y are both nonegative. Rewrote to use R5RS's definition. 2009-04-29 Shiro Kawai * src/list.c, src/gauche.h (Scm_ArrayToListWithTail): Added new API. * src/proc.c: Added 'optcount' slot to the procedure object. * lib/gauche/procedure.scm (case-lambda), src/intlib.stub (make-case-lambda-dispatcher): Rewrote case-lambda implemetation to take advantage of non-consing optional arguments (i.e. optional > 1). Simple benchmark showed 20x-80x speedup. 2009-04-27 Shiro Kawai * lib/gauche/cgen/precomp.scm (compile-toplevel-form): Instead of matchin toplevel define/define-macro/... literally, we override special form definitions within compile-module to hook the special actions. The former approach doesn't work if those special forms are generated as the result of macro expansion. The new approach may bread if the compiled source overrides those special forms as well. See the comment near "Special form handlers" for the details. 2009-04-24 Shiro Kawai * src/gauche-package.in (compile), lib/gauche/package/compile (gauche-package-compile) (gauche-package-link): Added --gauche-builddir option / :gauche-builddir keyword arg to allow compiling extension using not-yet-installed Gauche. * src/core.c (Scm_SimpleMain): Added for the convenience of creating a compiled binary that kicks a Gauche script. 2009-04-23 Shiro Kawai * src/gauche.h: include scmconst.h. * lib/gauche/cgen/literal.scm (): properly handles inifinity and NaN flonum constants. 2009-04-22 Shiro Kawai * src/system.c (Scm_SysExec), src/syslib.stub (sys-exec, sys-fork-and-exec): Added support to chdir() before exec(), by :directory keyword argument. Dropped support of ancient-style API (sys-exec cmd args iomap). * lib/gauche/process.scm (run-process): Added :directory keyword argument. 2009-04-21 Shiro Kawai * ext/sparse/ctrie.c (CompactTrieDelete): Fixed a bug that failed to shrink tree properly. (CompactTrieCheck): Added consistency checking routine. (CompactTrieCopy): Added copy operation. * ext/sparse/spvec.[ch]: Added SparseVectorCopy. * ext/sparse/sptab.[ch]: Added SparseTableCopy. Fixed a bug in SparseTableAdd in the edge case when hash keys conflict. * ext/sparse/sparse.scm (sparse-table-copy, sparse-vector-copy): Added. 2009-04-20 Shiro Kawai * ext/sparse/sparse.scm: Added *-update!, *-push! and *-pop!. * lib/gauche/cgen/stub.scm (cgen-genstub): Moved genstub main functionarity here. * src/genstub: only command-line processing remains. 2009-04-19 Shiro Kawai * ext/sparse/spvec.[ch], ext/sparse/sparse.scm (sparse-vector-inc!): Experimentally added. (CompactTrieClear): Fixed a bug that segfaults when ctrie is empty. 2009-04-18 Shiro Kawai * src/gauche/bits_inline.h (Scm__CountBitsInWord): Faster code. (Benchmarks on Core2 Quad Q6600 2.4GHz 64bit: 11ns -> 6.2ns, Core Duo L2400 1.66GHz 32bit: 10ns -> 8ns) * ext/sparse/spvec.[ch], ext/sparse/sparse.scm: Added sparse uniform vector support. 2009-04-17 Shiro Kawai * src/gauche/bits.h: Added SCM_BITS_TEST_IN_WORD etc. for single- word bit manipulation. * ext/sparse/spvec.[ch], ext/sparse/sparse.scm: Revised implementation of sparse vector; dropped extra leaf array and let it store values directly in the ctrie's leaf node, which showed better performance and memeory usage. Added delete!, exists? and iterators. 2009-04-16 Shiro Kawai * lib/rfc/http.scm (receive-body-nochunked): Fixed the bug that made http-get hang when Content-Length is 0. Patch from kzfm1024. * src/compile.scm (pass1/extended-lambda), lib/gauche/cgen/precomp.scm (cgen-precompile, cgen-precompile-multi): precomp.scm has been using a new keyword arg syntax in extended lambda (the one compatible to CL's), but that prevents svn trunk from compiling on 0.8.14 since it doesn't understand the new syntax. So we reverted the offending part temporarily, and changed compile.scm to allow both syntax; they should be gone once we roll out the next release. (NB: You need fresh 0.8.14 installed to compile this revision) 2009-04-15 Shiro Kawai * ext/sparse/sparse.scm, ext/sparse/sptab.c: Implemented dictionary protocol to . (sparse-table-exists?): added. 2009-04-14 Shiro Kawai * ext/auxsyslib.stub, ext/auxsys.scm, src/syslib.stub, src/autoloads.scm (sys-chown, sys-lchown): Moved these from auxsys to core. The primary motivation is to avoid file.util depending on auxsys (the dependency causes a build problem). But in fact, I don't remember why I factored these out to auxsys. Since loading time isn't much issue now, probably I should consider merging all auxsys into core again. * ext/net/netlib.stub (socket-sendmsg, socket-buildmsg, socket-ioctl), ext/net/net.c (Scm_SocketSendMsg, Scm_SocketBuildMsg, Scm_SocketIoctl): Added these low-level stuff. SocketIoctl only supports SIOCGIFINDEX for now. * ext/net/net.ac, src/gauche/configure.h.in (HAVE_NET_IF_H, HAVE_STRUCT_IFREQ): Added these checks to support socket-ioctl. 2009-04-10 Shiro Kawai * libsrc/file/util.scm (create-directory-tree): Make :owner and :group work with :symlink to change symlink's owner/group instead of the file pointed by it. Note that :mode is ignored if :symlink; we may honor :mode on systems that has lchmod in future. (check-directory-tree): Fix bug in attribute check. * src/gauche-install.in: Changed -p option to take actual path prefix instead of the number of path components to strip. It is rather useful to make it so to strip $(srcdir) in the make rules. * src/precomp, lib/gauche/cgen/precomp.scm: Support multiple Scheme sources to precompile into single DSO. Each source generates individual *.sci file, which includes dynamic-load form with :init-function to initialize the corresponding part of DSO. It is the key to solve the dependency problem. The API and functionality are not fixed yet; especially we need to redesign naming convention of init function name, since currently we can't have more than one source file with the same basename (e.g. foo/bar.scm and baz/bar.scm). 2009-04-09 Shiro Kawai * src/load.c (Scm_DynLoad): Allow multiple initialization function in a DSO, in order to support precompiling multiple Scheme sources (modules) into single DSO. 2009-04-07 Shiro Kawai * src/load.c (Scm_DynLoad): Turned the obsoleted third argument into 'flags' argument for future extension. * src/read.c (read_shebang): Fixed a problem that left incorrect VM's numVals after calling shebang handler. 2009-04-06 Shiro Kawai * lib/gauche/cgen/precomp.scm (check-first-form-is-define-module): We can't read entire source first, since it may contain srfi-10 extended reader syntax precomp is not aware of. Instead we just read the first sexp to check define-module, then read and process forms one by one. * ext/*: Removed dependency on ext/uvector. Extension modules only need the uvector features built into core, so they don't need to link DSO in ext/uvector. Now we can avoid hairy dependency issues at build time. 2009-04-05 Shiro Kawai * ext/*: Modified to match the new naming convention of DSO files and generated scheme interface files (except uvector, for some external modules depend on the name "libgauche-uvector.so" yet). Also removed *_head.c/*_tail.c magics; they are no longer relevant with modern compilers. * src/precomp: Support --strip-prefix and --strip-prefix-all options. Added short options. * lib/gauche/cgen/precomp.scm: Recognize export-if-defined form. * src/genconfig.in: Write to tmp file then rename. Otherwise parallel make may grab a partially written file and fail. 2009-04-04 Shiro Kawai * src/precomp, lib/gauche/cgen/precomp.scm: Reworked API. Since 'ext-module' should be generated for each scheme file that implements individual modules, there's no point splitting cgen-with-ext-module API. For the convenience of converting Scheme libraries into precompiled DSO + ext-module file, we set a new convention: A Scheme library "foo/bar.scm" is to be precompiled into "foo--bar.so" and "foo/bar.sci". Since we can now infer ext-module file name, --ext-module option for precomp isn't a necessary condition to generate ext-module file and to generate extention initializer. Now ext-module file is generated if the source contains define-module form at the beginning, and extension initializer is generated by --ext-main option. The --ext-module option is left mainly for backward compatibility. 2009-04-02 Shiro Kawai * src/load.c (Scm__InitLoad): Recognize "sci" (Scheme Interface) as a valid suffix as well as traditional "scm". "sci" takes precedence, and to be used for generated interface files by the precompiler. (Scm_Require): Fixed where it assumed "scm" suffix. * src/precomp: Renamed from gencomp to reflect its function. * */Makefile.in: Changed accordingly. * src/gauche-install.in: Added -p option. * test/scripts.scm: Start adding tests for script utilities. 2009-04-01 Shiro Kawai * libsrc/file/util.scm (create-directory-tree, check-directory-tree): Added. 2009-03-31 Shiro Kawai * src/compile.scm (pass1/extended-lambda): Fixed the case when :rest and (:optional and/or :key) are both specified. * src/scmlib.scm (exit-handler): Let the default exit handler add newline to the output. 2009-03-30 Shiro Kawai * src/gencomp, lib/gauche/cgen/precomp.scm: Some modifications to support muliple scm files into one DSO case. This version is still not good enough; if the source consists of multiple modules, each modules should have corresponding ext-module file instead of just one in the current version. But then, who is responsible to load the common DSO? Trying to find better pattern. 2009-03-28 Shiro Kawai * lib/gauche/cgen/literal.scm (): Properly escape emitted C string constants. 2009-03-27 Shiro Kawai * lib/gauche/cgen/literal.scm, lib/gauche/cgen/literal-uv.scm: Added support for uvector literals. (NOTE: To build this revision you have to use 0.8.14 as host Gauche. The bug in %uvector-ref inlining support, which was fixed by the previous commit, would interfere with this module. See also the comment in literal-uv.scm and don't forget to merge it into literal.scm after releasing the next version.) * src/extlib.stub (uvector-length, uvector-immutable?, SCM_UVECTOR_*): Expose some more uvector stuff here to support uvector literal in cgen. * src/compile.scm (%uvector-ref): Fix the inliner to emit UVEC-REF only when 'type' arg is a constant integer. 2009-03-26 Shiro Kawai * lib/gauche/cgen/precomp.scm (cgen-with-ext-module): ensure the directory to put ext module file. * lib/gauche/cgen/literal.scm (cgen-make-literal) (, infer-literal-handler): Allow precompiler to embed a constant value of user-defined type, as far as the type has external representation using SRFI-10 syntax. * src/read.c (Scm_GetReaderCtor), src/extlib.stub (%get-reader-ctor): Added interface to obtain reader constructor. * src/read.c (Scm_DefineReaderCtor): Added an argument for future extension of making reader-ctor module-aware. * lib/gauche/cgen/precomp.scm: Removed old cruft and reorganized the source a bit. * src/module.c (Scm_MakeModule): Made anonymous module name's name to #f instead of '|#|. I planned this change long time ago, but apparently forgot to implement it. It shouldn't affect existing code. 2009-03-25 Shiro Kawai * src/gauche.h (SCM_IGNORE_RESULT): fix again to properly fool gcc. * src/gencomp, lib/gauche/cgen/precomp.scm: Moved gencomp functionality into gauche.cgen.precomp module. 2009-03-23 Shiro Kawai * ext/sparse/sparse.scm (sparse-table-fold): fix a bug about the end marker. * ext/sparse/spvec.c (g_desc): elementAtomic should be FALSE. 2009-03-22 Shiro Kawai * ext/sparse: Renamed spvector for sparse-vector and sptable for sparse-table. It's more verbose, but abbrev form seems to lack consistency. 2009-03-21 Shiro Kawai * lib/gauche/cgen/stub.scm (process-body): Fix the case when C routine calls Scm_Values*. In such case, the stub generator doesn't need to generate Scm_Values* code, but just passes the return value from C routine as if it returns a single value. * src/write.c (Scm_Vprintf): Support '*' in the precision and width position of the format directives. * src/hash.c (insert_entry): Clears old bucket array when hashtable is extended, in order to reduce inadvertent retention of garbages. (Scm_HashString): Allow modulo == 0. * ext/sparse: Added sparse data structures (initially just a sparse vector; eventually we'll add sparse uniform vectors and sparse hashtable---hashtable using sparse vector as a backend store). The main advantage of sparse vectors over hashtables is that it behaves better in memory consumption when structures with large number of elements (like >1M) are repeatedly created and discarded. Although each sparse vector uses more memory than a hashtable of the same number of elements, large hashtables are more likely to become "dead memory", because of its large bucket vector. 2009-03-19 Shiro Kawai * src/Makefile.in: added gauche/bits_inline.h * src/gauche/bits_inline.h, src/bits.c: Splitted some useful and performance-critical routines from bits.c into a separate header. The header is not for general inclusion; only those code that needs such routines should explicitly include it. 2009-03-18 Shiro Kawai * src/gauche.h (SCM_IGNORE_RESULT): Added this macro to silence "ignoring return value" warnings when the return value is intentionally ignored. * src/core.c (Scm_Abort), src/string.c (Scm_DStringDump): Using SCM_IGNORE_RESULT. 2009-03-17 Shiro Kawai * lib/gauche/dictionary.scm (): Added bidirectional map. (dict-get, dict-put!, dict-exists?, dict-delete!): Completed dictionary interface protocol. * lib/dbm.scm (dict-get, dict-put!, dict-exists?, dict-delete!): Adapted to the new dictionary protocol. * test/dict.scm: added. 2009-03-10 Shiro Kawai * ext/net/addr.c: Allocates instances as ATOMIC to reduce the risk of false pointers. * src/core.c (Scm_Abort): Tells the compiler that we intentionally ignore the return value of write(2). Newer gcc whined on it. 2009-03-01 Shiro Kawai * src/gauche/extend.h (SCM_INIT_EXTENSION): Redefined this macro to no-op. The old scheme of registering data/bss start/end by this macro is no longer relevant, since modern linkers doesn't keep the relative locations of static symbols anyway. Eventually we'll make *_head.c/_tail.c fade out as well. 2009-02-28 Shiro Kawai * src/string.c (Scm_StringCiCmp): a couple of bug fix, thanks to Tsugutomo Enami. 2009-02-26 Shiro Kawai * src/vmcall.c (ADJUST_ARGUMENT_FRAME): Fix CHECK_STACK assertion condition and no optargs case in APPLY_CALL. 2009-02-23 Shiro Kawai * lib/util/toposort.scm (topological-sort): Fix the code that locally shadows '=' by the given optional argument, that breaks when the optional equality predicate isn't compatibile with numeric comparison. 2009-02-22 Shiro Kawai * src/vminsn.scm: Bug fix: added some missing SCM_FLONUM_ENSURE_MEMs. * src/vm.c (Scm_VMFlushFPStack), src/vminsn.scm ($values): Allow register flonums in vm->vals registers. Make sure they're moved to heap when FP stack is flushed. * src/vminsn.scm (UVEC-REFI), src/compile.scm: An experimental code to add UVEC-REFI instruction. Not enough evidence is collected to support the instruction, though, so they are commented out in this commit. * src/compile.scm (attach-inline-transformer): Experimentally added a hook for pass1 inliner. It's still highly experimental and purely for internal use. * ext/uvector/uvutil.scm: Renamed from uvseq.scm. Inline expand TAGvector-ref into %uvector-ref using inline transformer. 2009-02-21 Shiro Kawai * ext/uvector/uvlib.stub.tmpl: Flag :fast-flonum for uvector arithmetic (e.g. TAGvector-add etc.) The second arg can be a register flonum. * ext/uvector/uvector.c.tmpl (arg2_check): Fixed a bug that passed too few arguments to Scm_Error. * src/vminsn.scm (NUMBERP, REALP): Added instructions. * src/stdlib.stub (number?, complex?, real?, rational?): Use new instructions for inline. * src/stdlib.stub (numcmp): Rewrote =, <, <=, >= and > using :optarray to avoid consing in 3- and 4-ary cases. * src/number.c (Scm_NumCmp): Deferred SCM_FLONUM_ENSURE_MEM until it's absolutely necessary, reducing flonum allcation. * lib/gauche/cgen/stub.scm: Added support of :optarray argument spec; it allows SUBR to receive optional arguments as a C array of ScmObj. * ext/uvector/uvector.c.tmpl, ext/uvector/uvector.h.tmpl, ext/uvector/uvlib.stub.tmpl: Changed 'TAGvector' function using :optarray argument spec, so that if the argument list is short it won't cons. 2009-02-20 Shiro Kawai * lib/gauche/cgen/stub.scm, src/vmcall.c (ADJUST_ARGUMENT_FRAME): Made SUBR's :optional argument does not cause caller to cons the optional arguments. Improved performance quite a bit, especially when passing flonums in optional args (if optional args are consed, the flonums have to be moved to the heap; now it can stay in the flonum stack). 2009-02-17 Shiro Kawai * lib/gauche/cgen/stub.scm (process-cproc-args): Code cleanup. * src/vmcall.c (ADJUST_ARGUMENT_FRAME), src/gauche.h (ScmProcedure): Allow procedure->optional to be more than 1. This is preparation for optional arg handling optimization. 2009-02-15 Shiro Kawai * src/gauche/vector.h, src/vector.c, src/extlib.stub (%uvector-ref): Experimentally added internal support of generic uvector referencer. * src/vminsn.scm (UVEC-REF), src/compile.scm: Experimentally added instruction for %uvector-ref * ext/uvector/uvlib.stub.tmpl, ext/uvector/uvector.h.tmpl, ext/uvector/uvector.c.tmpl, ext/uvector/uvgen.scm: Let *vector-dot routine to take advantage of FFX. * lib/gauche/cgen/type.scm: Fixed boxer definition of , and to use ScmVMReturnFlonum to take advantage of FFX. Also added to builtin types, since it is now supported in the core. 2009-02-14 Shiro Kawai * src/gauche/vector.h, src/vector.c, ext/uvector/uvector.c.tmpl, ext/uvector/uvector.h.tmpl: Moved definition of ScmUVector structure, constructors, and classes from ext/uvector to the core. The role of uniform vector has gotten bigger, for it is used to treat binary data in the Scheme world. It is awkward to require extensions to link ext.uvector only to use ScmUVector structure. The utility procedures for uvectors remain in ext.uvector. NOTE: This changes definition of type-specific uniform vectors such as Scm_S8Vector; the difference is the type of 'elements' field. As long as you access uvector elements using SCM_*VECTOR_ELEMENTS macro, this change shouldn't affect your code. 2009-02-03 Shiro Kawai * ext/auxsys/auxsys.scm (sys-realpath): Fixed to follow '..' correctly and other corner cases, thanks to Tsugutomo Enami. 2009-02-01 Shiro Kawai * ext/auxsys/auxsys.scm (sys-realpath): realpath(3) can be not safe (Linux manpage recommends not to use it), so we reimplemented it in Scheme. 2009-01-28 Shiro Kawai * src/gauche.h, src/gauche/module.h, src/Makefile.in: Splitted ScmModule related declarations into a separate header. 2009-01-19 Shiro Kawai * ext/sxml/sxml/tree-trans.scm.in: Added missing 'use srfi-11'. 2008-12-20 Shiro Kawai * INSTALL.in: Updated some instructions. * src/geninsn, lib/gauche/vm/insn-core.scm: Allow :obsoleted flag in the insturction definition to suppress emission of the particular combined instructions. It is a step before removing them (we can't just remove them from vminsn.scm, since the current release of Gauche would generate them when compiling the trunk code, and the trunk VM must be able to execute them). * src/vminsn.scm: Add :obsoleted flag to LREF0-PUSH-GREF-* insns. 2008-12-16 Shiro Kawai * src/geninsn (construct-vmbody): Fixed handling of insns that combine more than two basic insns. In the previous code, if you want an insn A-B-C, you have to have the insn B-C. Now you don't need to. (You still need A-B, for the insn combine state machine can only keep one instruction in a queue; this limitation should be addressed sometime in future.) * src/vminsn.scm: Removed NUMADDI-PUSH, for it is no longer needed by the above change. 2008-12-13 Shiro Kawai * src/vminsn.scm, src/compile.scm: Experimentally added supports for combined instructions: LREF-VAL0-BNUMNE, LREF-VAL0-NUMADD2, NUMADDI-PUSH, LREF-NUMADDI, LREF-NUMADDI-PUSH and LREF-RET. Some of these combinations frequently appear in typical loop constructs. This change improves performance slightly (about 7-8% in tak). The improvement is not so much as expected, though, so we might revert this if we find more fundamental improvements. * src/gauche/code.h (SCM_VM_INSN_CODE): utilize full 12bits for code. 2008-12-09 Shiro Kawai * lib/util/combinations (but-kth, permutations, permutations*, permutations-for-each, permutations*-for-each, combinations, combinations*, combinations-for-each, combinations*-for-each): Optimized a bit. 2008-12-06 Shiro Kawai * src/gauche.h (ScmFlonum): Make ScmFlonum a structure containing double instead of just a bare double; some 32bit processors/compilers do not align bare double on 8-byte boundary, but they do a struct that containing a double. * src/number.c (Scm_MakeFlonum), src/gauche/vm.h (Scm_VMReturnFlonum): Changed accordingly. 2008-12-04 Shiro Kawai * src/gauche.h (struct ScmClassRec, SCM__DEFINE_CLASS_COMMON): Changed the initial element of the ScmClass structure so that it is likely to be placed in 8-byte align boundary on ILP32 machines. 2008-11-28 Shiro Kawai * lib/rfc/ip.scm (ip-version, ip-header-length, ip-protocol, ip-source-address, ip-destination-address): Added 'offset' argument, since it is much needed in the practical situation. THIS IS AN INCOMPATIBLE CHANGE. Hope there are not many people who have used this obscure module. 2008-11-27 Shiro Kawai * src/load.c (Scm_LoadFromPort): Fixed a bug in initilalizing load_from_port. 2008-11-23 Shiro Kawai * ext/digest/sha2.h: Incorporate checks of endianness and uintXX_t from gauche/config.h. 2008-11-22 Shiro Kawai * src/load.c (Scm_Require, Scm_Provide): Implemented 'autoprovide' feature. If (require "X") causes loading of X.scm, and there's no 'provide' form in X.scm, the feature "X" is provided upon successful completion of loading X.scm as if there is (provide "X") form at the end of X.scm. If X.scm contains 'provide' form, autoproviding is turned off. (provide #f) can be used to disable autoproviding and not providing any feature. 2008-11-21 Shiro Kawai * src/load.c (Scm_LoadPacketInit), src/gauche/load.h (ScmLoadPacket): Cleadned up the structure. Added Scm_LoadPacketInit to keep room of future extension. 2008-11-20 Shiro Kawai * src/load.c (Scm_Load, Scm_LoadFromPort), src/stdlib.stub (load), src/extlib.stub (load-from-port): Moved definitions of Scheme's 'load' and 'load-from-port' into stub files for simplicity. * lib/gauche/cgen/cise.scm (dopairs): Added a new macro. (render-rec): Added some heuristics to distinguish types and expressions; some operators (such as sizeof) and macros may take types instead of expressions as arguments, and they need to be rendered differently. This reverts the kludge of sizeof introduced on 11/18. * lib/gauche/cgen/stub.scm (process-cproc-args): Switched the stub function's lambda keywords from {&optional,&keyword,&rest,&allow-other-keys} to {:optional,:key,:rest,:allow-other-keys}. The latter set is consistent with the extended lambda syntax, and it doesn't need to treat ordinary symbols such as &optional specially. The old lambda keywords are supported for the backward compatibility, but will eventually fade out. (process-setter): Make static setter definition handling consistent with define-cproc. * *.stub: Changed accordingly. 2008-11-19 Shiro Kawai * src/extlib.stub (%open/allow-noexist?): Check errno==ENXIO as well. 2008-11-18 Shiro Kawai * lib/gauche/cgen/stub.scm (declcode): Added 'declcode' directive to insert raw code in the decl part. Traditionally, the first raw string in the stub file has served for this purpose, but it won't work when the stub stuff is embedded by inline-stub, since this special handling of the first raw string is treated specially only by genstub. It is better to be explicit. (The special treatment by genstub remains only for the backward compatibility.) (define-cmethod): Allow the new cproc body syntax here as well. * lib/gauche/cgen/sice.scm (sizeof): Made sizeof a cgen macro to allow e.g. (sizeof struct foo). 2008-11-17 Shiro Kawai * lib/gauche/cgen/cise.scm (cise-render-typed-var): Allow expr in size part of array declaration. (list): fixed a bug when many elements are given. * ext/auxsyslib/auxsyslib.stub, ext/binary/binarylib.stub, ext/dbm/{gdbm,ndbm,odbm}-lib.scm, ext/digest/{md5,sha}-lib.scm: Rewrote using new stub syntax. * ext/charconv/convaux.scm, ext/charconv/convlib.stub: Made convaux.scm absorb convlib.stub. * lib/gauche/cgen/stub.scm: Changed define-cproc flag syntax, and supports a more concise way for the case when C function takes the same arguments as Scheme one (the old 'call' clause). 'code', 'call', 'expr', and 'body' clauses are deprecated. Old 'return' clause support is finally omitted. * src/*.stub, ext/uvector/uvlib.stub.tmpl: Changed accordingly. 2008-11-15 Shiro Kawai * src/syslib.stub: (sys-rename, sys-remove, sys-chdir, sys-mkdir, sys-chmod, sys-fchmod, sys-link, sys-close, sys-rmdir, sys-truncate, sys-ftruncate, sys-symlink): Now returns # * lib/gauche/cgen/stub.scm (define-cproc): Introduced a new syntax of define-cproc to specify return-type, eliminating the necessity of body form, allowing more concise definition, and being more consistent with define-cfn. * src/*.stub: Changed using the new define-cproc syntax whenever possible. * lib/gauche/cgen/cise.scm (dolist, dotimes, |#if|): Added new cise macros. (cise-render-to-string): Added an utility api. * src/objlib.scm: Integrated moplib.stub into objlib.scm using inline-stub. * src/moplib.stub: Removed. * src/core.c, src/Makefile.in: Changed accordingly. 2008-11-14 Shiro Kawai * src/vminsn.scm: Removed obsoleted VM instructions, and rearranged the order of some instructions. Developers should rebuild from maintainer-clean to make sure precompiled files are in sync. * src/stdlib.stub (%complex->real/imag): Removed; this API is superfluous, since calling real-part and imag-part separately doesn't hurt performance at all. * src/gauche.h etc: Integrated fast flonum extension (FFX) (cf. http://portal.acm.org/citation.cfm?id=1408687 ). This boosts up speed of programs involving heavy floating-point number calculation. It can be turned off by changing #define GAUCHE_FFX 1 to #define GAUCHE_FFX 0 in gauche.h; if you find suspicious behaviors (like incorrect result of flonum calculation), recompile without FFX to see if it is the reason. 2008-11-13 Shiro Kawai * lib/gauche/package/compile.scm (gauche-package-compile-and-link): Fix the :output keyword arg for the filnal DSO file affecting individual C-file compilation inadvertently. 2008-11-11 Shiro Kawai * src/gauche/system.h (SCM_SYS_STAT_STAT): wrap access to the statrec field by a macro. * src/system.c, src/syslib.stub: changed accordingly. 2008-11-09 Shiro Kawai * src/gauche/memory.h: Removed, since Boehm GC's inline macros have been changed since 7.0 and are no longer straightforward to use. 2008-11-08 Shiro Kawai * configure.ac, ext/zlib/zlib.ac, ext/zlib/Makefile.in: Check zlib availability, and allow --with-zlib configure option to specify zlib location. 2008-11-07 Shiro Kawai * ext/zlib/*: Renamed deflate-port/inflate-port for deflating-port/ inflating-port, since deflate/inflate are verbs. (zlib-version): made it a function instead of a constant. * lib/gauche/cgen/stub.scm (process-call-spec): Allow symbol as the C function name in 'call' clause of define-cproc. (I'm not sure why I didn't allow this. Maybe just an overlook.) * lib/gauche/cgen/cise.scm (canonicalize-vardecl): Allow more flexible notation of typed variables, e.g. var::type, var:: type, var ::type are all treated as (var :: type) in the define-cfn argument list, and (var::type [init]), (var:: type [init]), or (var ::type [init]) are all treated as (var :: type [init]) in the let* variable list. * ext/zlib/zliblib.stub, ext/dbm/ndbm-lib.scm, ext/dbm/odbm-lib.scm, ext/dbm/gdbm-lib.scm: Modified to reflect the above change. 2008-10-31 Shiro Kawai * ext/zlib/zlib.scm, ext/zlib/Makefile.in: fixed for zlib.scm to be installed into proper location. 2008-10-30 Shiro Kawai * ext/zlib/*: Added rfc.zlib (written by Rui Ueyama). Probably we should add libz check in the main configure.ac later. 2008-10-27 Shiro Kawai * src/compile.scm (pass1/extended-lambda): Changed keyword argument spec with different variable name to match the CL-style, i.e. you write (define (foo x :key ((:bar baz) 'init)) ...) to let the baz receives the value supplied to the keyword :bar. Also extended :allow-other-keys to take optional argument that receives unrecognized keyword-value list. * test/package.scm: Added to test gauche.package.*. * test/cgen.scm: Added to test gauche.cgen.*. * lib/*, libsrc/*: Rewrote most let-keywords*/let-optionals* with extended lambda experimentally to see how it looks like in the real code. 2008-10-09 Shiro Kawai * src/compile.scm (compile-toplevel-form, do-it): Instead of recognizing inline-stub literally in compile-toplevel-form, we override inline-stub macro in the compile-module. It allows macros that generates inline-stub form. * src/gauche/macro.h, src/gauche/code.h, src/gauche/extend.h, ext/uvector/uvector.h.tmpl: Increase C++ friendliness. * src/extlib.stub (%open-input-file, %open-output-file): When :if-does-not-exist is #f or :if-exists is #f, these procedures have ignored all errors, even if open(2) failed with other reasons such as EPERM. Now we check errno for these cases and raise appropriate if the error reason is not expected one. 2008-10-08 Shiro Kawai * ext/digest: Added support of SHA2 (SHA224, SHA256, SHA384 and SHA512), using Aaron Gifford's implementation. 2008-10-07 Shiro Kawai * lib/gauche/cgen/cise.scm (cise-render-typed-var): Allow array type declaration e.g. (.array (unsigned char) (10 10)). * src/compile.scm, src/intlib.stub: Moved some C-implemented compiler-internal routines from intlib.stub to compile.scm using inline-stub. 2008-10-06 Shiro Kawai * release 0.8.14 2008-10-05 Shiro Kawai * test/rfc.scm, ext/net/test.scm: Avoid using sys-fork to run the test server process; fork doesn't go well with windows. * ext/net/netlib.stub (sockaddr-name): correctly identifies the length of pathname of the unix domain socket; it can be 0. 2008-10-03 Shiro Kawai * ext/net/netlib.stub (SHUT_RD, SHUT_WR, SHUT_RDWR): defines constants for 'how' argument of socket-shutdown. * configure.ac, ext/Makefile.in, DIST_EXCLUDE: Exclude ext/peg and lib/rfc/json.scm; these are not ready for 0.8.14 release. * src/number.c (read_real): Fixed the bug that misunderstands the case when no integral part appears right after the initial sign (e.g. ++i or +/4). 2008-09-18 Shiro Kawai * lib/rfc/ip.scm (ipv4-global-address?): added. * src/Makefile.in (scmlib.c, objlib.c): added dependency on ../lib/gauche/vm/insn.scm. 2008-09-11 Shiro Kawai * src/scmlib.scm (inline-stub): just issue warning instead of error, for it is sometimes useful to 'load' the source with inline-stub during debugging. 2008-09-04 Shiro Kawai * src/scmlib.scm (exit, exit-handler): Implemented exit-handler feature to hook application's exit operation. See the manual for detailed explanation and design rationale. * src/builtin-syms.scm (SCM_SYM_PLUSP): defined to an wrong symbol '+?'; should be '++'. 2008-09-02 Shiro Kawai * lib/gauche/cgen/cise.scm (define-referencer): Allow C++-style method invocation: (-> A (B C) (D E)) expands to "A->B(C)->D(E)". 2008-08-31 Shiro Kawai * src/vm.c (wna), src/vmcall.c, src/proc.c (Scm_CurryProcedure), src/gauche.h, src/builtin-syms.scm, src/intlib.stub, lib/gauche/procedure.scm: Experimentally added some code to support automatic currying. This version still has an issue (see the comment in src/proc.c), so the feature is commented out. 2008-08-29 Shiro Kawai * lib/gauche/cgen/cise.scm (values): Expands 'values' cise macro into appropiate Scm_Values* call. * src/gauche/experimental/lamb.scm (^., ^*): added shorthand notation of match-lambda and match-lambda* experimentally. 2008-08-28 Shiro Kawai * src/extlib.stub (%open-input-file): Use Scm_SysError when Scm_OpenFilePort returns #f, since if it returns #f the reason is the failure of open(2). 2008-08-26 Shiro Kawai * lib/gauche/cgen/unit.scm (cgen-safe-comment): Added. * lib/gauche/cgen/literal.scm, src/gencomp: Emit more comments into generated C file for ease of debugging. * src/gencomp, src/scmlib.scm (declare): Added ad-hoc 'declare' syntax to support keep-private-macro in source instead of command-line args for gencomp. This is a purely temporary solution, since it won't be needed once we can byte-compile hygienic macros. It is convenient for the time being to produce some extensions, but it will disappear soon. 2008-08-23 Shiro Kawai * src/syslib.stub (sys-lstat): On windows, make it behave just like sys-stat. Windows doesn't have lstat(), but since it works the same as stat() when path is not a symlink, it is reasonable to make it so (and it reduces one headache of cross-platform dev.) * ext/peg/peg-lib.scm: Renamed semantic-value-finalize! to rope-finalize, in order to reflect its function more clearly, and also avoid unecessary consing. Added $<<. (This is still a temporary snapshot; large restructuring is planned.) * lib/rfc/json.scm: Changed accordingly. 2008-08-21 Shiro Kawai * src/getdir_darwin.c (get_install_dir): fixed a bug that releases unretained resource. Based on a patch by Naoya Tozuka. * lib/gauche/experimental/*: Moved some weird syntactic experiment into separate modules, so that it will be easy to track their users in case if we want to change or drop the support. NOTE: the '$' experiment is now in gauche.experimental.app. (used to be built-in). * src/autoloads.scm, lib/gauche/procedure.scm: Moved $ and $* to gauche.experimental.app. Experimentally added .$ as an alias of compose. * src/Makefile.in (INSTALL_SUBHEADERS): added some missing headers. 2008-08-20 Shiro Kawai * src/port.c (SCM_PORT_CASE_FOLD), src/gauche/port.h, src/read.c, src/gauche/reader.h: Moved the case folding flag from read context to port. * src/scmlib.scm, src/extlib.stub (port-case-fold-set!): Changed accordingly. * src/core.c: Moved InitVM much earlier than InitPort, since now VM's runtime flag affects the port's case folding flag. The VM's standard I/O are set in InitPort. * **/*.scm: Cleaned up use of |-escapes meant to work for both case- sensitive and case-insensitive mode. Now we have #!no-case-fold, so we can ensure the file is read in case-sensitive mode. * src/gauche/reader.h, src/gauche.h: splitted reader API from gauche.h to reader.h * src/read.c (ScmReadContext, Scm_MakeReadContext): made read context a Scheme object of class . * src/class.c, src/load.c: changed accordingly. * src/portapi.c, src/gauche/port.h: Added 'bytes' field in ScmPort that counts the cumulative bytes read from the port. It is used by the reader to distinguish the script's shebang line and #! directive. * src/read.c (Scm_DefineReaderDirective, read_shebang): src/extlib.stub (define-reader-directive): Modified the reader to recognize R6RS-style #! directive. Now, only the '#!' of the beginning of the port, followed by '/' or ' ', are recognized as the script shebang line. All other '#!'s are treated as #! directive (before, '#!'s unconditionally worked as a comment-to-end-of-line). The behavior of #! is customizable by define-reader-directive. * src/scmlib.scm: Added standard #! directives: #!r6rs, #!fold-case and #!no-fold-case. * src/gencomp (global-eq??): fixed a bug when the comparing identifier is not yet defined in the host gosh. * src/Makefile.in (scmlib.c): use --keep-private-macro=inline-stub to keep inline-stub macro definition in the core. 2008-08-19 Shiro Kawai * lib/gauche/cgen/cise.scm (define-cfn): Introduced define-cfn cise form to enable to write pure C function (not cproc, which is a Scheme subr with C body) in cise. * lib/gauche/cgen/stub.scm: Recognizes define-cfn within stub code. (initcode): Allow cise in the code portion. (make-literal, c-literal-expr): Allow cise expression in the expr section of raw c literal (e.g. (c expr)). (define-cclass): Allow :private qualifier to emit the CLASS_DECL and standard macros into the c file. (cclass-emit-standard-decls): is the body to generate standard macros mentioned above. Eventually there should be an option to emit these into a separate header file. * ext/peg/peg-lib.scm: Rewrote a couple of C static functions within inline-stub by define-cfn. * ext/dbm/gdbm-lib.scm, ext/dbm/ndbm-lib.scm, ext/dbm/odbm-lib.scm: Include stub code in the Scheme code using init-stub. *.stub are no longer needed. {gdbm,ndbm,odbm}.scm are auto- generated. * ext/dbm/dbm.ac: changed accordingly. * ext/dbm/bdbm.c, ext/dbm/bsddb.h, ext/dbm/bsddb.stub: Removed. Berkeley DB licensing terms are like GPL, so it's better to be supported in a separate extension to avoid complication of Gauche-embedded application development. * ext/digest/md5-lib.scm, ext/digest/sha1-lib.scm: Include stub code in the Scheme code using init-stub. *.stub are no longer needed. {md5,sha1}.scm are autogenerated. 2008-08-17 Shiro Kawai * src/vminsn.scm (VALUES-APPLY), src/vm.c (Scm_ApplyRec): fixed a bug that caused SEGV when more than SCM_VM_MAX_VALUES args are given to Scm_ApplyRec. This hasn't been noticed since Scheme version of APPLY doesn't go through this path. (Note: This is a temporary fix. VALUES-APPLY can keep the rest list until argumet adjustment, in the same way as TAIL-APPLY.) * src/intlib.stub: Added some procedures that uses Scm_ApplyRec family for the testing purpose. * lib/gauche/sortutil.scm, src/autoloads.scm, test/sort.scm: Added sort-by, sort-by!, stable-sort-by, stable-sort-by!. 2008-08-08 Shiro Kawai * lib/dbm.scm (dbm-db-copy, dbm-db-move): Provides fallback methods. * doc/modutil.texi (dbm): Added explanation on the protocol a new dbm implementation should conform. 2008-08-04 Shiro Kawai * doc/modgauche.texi: added missing description of the return value of mutex-unlock!. 2008-08-02 Shiro Kawai * src/vminsn.scm: added LREF-CAR and LREF-CDR combined insns. We could wait for the new instruction scheme ('push' bit), but this is simple and effective, so why not? Also added VALUES-RET. * ext/peg/peg-lib.scm ($fold-parsers, $fold-parsers-right): change $fold and $fold-right to these names to avoid confusion. ($count, $sep-end-by): rewrote to use $loop macro for speed and correct behavior. * ext/peg/test.scm, tests/rfc.scm: moved rfc.json test under ext/peg, for it depends on parser.peg. 2008-07-31 Shiro Kawai * ext/net/netlib.stub: Added several IP socket option constants. 2008-07-28 Shiro Kawai * src/compile.scm (pack-iform): Fixed a bug handling $RECEIVE node. (pass3/branch-core): Added an optimization to cut the unreachable branch of $if. Such $if may occur as a result of macro expansion. 2008-07-26 Shiro Kawai * src/compile.scm (pass1/body-wrap-intdefs): Ensure the evaluation order of internal define the same as corresponding letrec. Before it was reversed and a source of confusion. It is also consistent to letrec* behavior. * ext/peg/peg-lib.scm ($many_): Removed, for it is same as $skip-many. ($fold, $fold-right, $many-chars, $many1): Added. (peg-parse-string): Renamed from parse-string. (peg-run-parser, peg-parse-port): Added. 2008-07-25 Shiro Kawai * lib/gauche/parseopt.scm (compose-entry): Allow '*' modifier in option-spec, for options that can be specified multiple times. This is just a preparation; the actual code to support multiple appearance of an option hasn't been done yet. 2008-07-20 Shiro Kawai * lib/gauche/vm/insn.scm.src, lib/gauche/vm/insn-core.scm: Removed the template file insn.scm.src and added a separate module insn-core.scm. The generated insn.scm extends insn-core. This is required since geninsn needs to refer to , but gauche.vm.insn doesn't exist yet when geninsn is generating it. * src/geninsn: changed accordingly. 2008-07-15 Shiro Kawai * src/vminsn.svm ($insn-body), src/geninsn (insn-alist): Allow insn definition to retrieve other insn body. * src/vminsn.scm ($arg-source, LREF-VAL0-BNxx), src/compile.scm (pass3/if-numcmp): Emit special instructions for BNxx when one of the arguments are LREF. This saves one stack push/pop pair. 2008-07-14 Shiro Kawai * src/vminsn.scm ($vm-err): Avoid expanding CISE into VM_ERR macro, for some C compilers choke on #line directives between macro arguments. 2008-07-10 Shiro Kawai * src/compile.scm (pass1/define-inline), src/gencomp (check-packed-inliner): Properly emit inliner information of the procedures defined by define-inline, even if the target VM's instruction codes differ from host VM's. 2008-07-08 Shiro Kawai * configure.ac: Checking for gcc by $GCC instead of $CC, to cope with the case when $CC is actually "gcc -std=gnu99" etc. 2008-07-02 Shiro Kawai * lib/gauche/vm/insn.scm.src, src/gauche/code.h: Extended the opcode width in the instruction word from 8 bits to 12 bits. * src/compile.scm: Instead of reading vminsn.scm to define vm instruction constants, using gauche.vm.insn to do so. * src/geninsn: allow define-insn-lref* and define-insn-lref+, that automatically defines LERFn-XXX and LREFmn-XXX combined instructions from the base LREF-XXX instruction definition. * lib/gauche/procedure.scm (disasm): removed kludge for old versions. * src/code.c (Scm_CompiledCodeEmit): Adopted STN created from vminsn.scm to handle instruction combination. With this change, the VM instruction set architecture is solely defined by vminsn.scm. * src/geninsn: some extension to handle more combined insns. * src/vminsn.scm: some fixes 2008-07-01 Shiro Kawai * src/vminsn.scm, src/geninsn, src/vm.c (run_loop): Having VM loop code fragment within the VM instruction definition in vminsn.scm, and use geninsn to generate the "meat" of the VM loop into vminsn.c. This is a big step towards VM generation. * lib/gauche/cgen/literal.scm (cgen-emit-static-data), lib/gauche/cgen/unit.scm (cgen-emit-c): Moved SCM_CGEN_CONST kludge emission from unit to literal, since it is only required for the static data array generated by cgen-emit-static-data. 2008-06-28 Shiro Kawai * src/vm.c (VALUES_APPLY): Removed unnecessary code. 2008-06-27 Shiro Kawai * lib/gauche/cgen/cise.scm (source-info): Replaced makeshift source info extractor for debug-source-info. (cise-render-rec): Expose an API to call back to cise expander recursievly. Needed to write certain type of cise macros. (cise-context, cise-context-copy, cise-register-macro!, cise-lookup-macro): Allow to have multiple cise macro namespaces. (define-cise-stmt, define-cise-expr): allow to specify a variable to receive the cise environment, which is required to call cise-render-rec within the expander. 2008-06-26 Shiro Kawai * src/autoload.scm, lib/gauche/miscutil.scm (object-source-info): Removed. Use debug-source-info. 2008-06-25 Shiro Kawai * lib/rfc/http.scm (http-generic): fixed 'host' field being messed up when redirected. 2008-06-24 Shiro Kawai * lib/gauche/cgen/cise.scm: Added cise macros: while, label, goto, post++, post--. Allow variable declaration only (without init nor type) in let*. 2008-06-20 Shiro Kawai * src/vm.c, src/gauche.h (Scm_ApplyRec[01234]): Added these to avoid consing in callback from C to Scheme. * src/vminsn.scm (VALUES-APPLY): Changed the name from CONST-APPLY. 2008-06-19 Shiro Kawai * src/vm.c (Scm_ApplyRec): Avoid allocation by using valN registers to pass the arguments. * src/vminsn.scm (CONST-APPLY): Changed the definition since we no longer need an operand. 2008-06-08 Shiro Kawai * src/extlib.stub (hash-table-copy): added. Why this hasn't been implemented until now? It must be an overlook. 2008-06-03 Shiro Kawai * ext/peg/peg-lib.scm (space): recognized 'v' as a space incorrectly. (patch from Masayuki Muto). 2008-06-01 Shiro Kawai * src/vm.c (user_eval_inner), src/gauche/vm.h (ScmCStrackRec): save/restore signal mask by ourselves, since sigsetjmp's behavior is platform-dependent w.r.t. threads. * src/signal.c (Scm_GetSigmask, Scm_SetSigmask) :added convenience functions to hide sigprocmask/pthread_sigmask difference among platforms. 2008-05-30 Shiro Kawai * src/Makefile.in (INSTALL_HEADERS): install some more gc headers. 2008-05-27 Shiro Kawai * ext/peg/peg-lib.scm (make-peg-parse-error): better error message. 2008-05-26 Shiro Kawai * src/extlib.stub (eof-object): added from R6RS. 2008-05-25 Shiro Kawai * rfc/json.scm : Added (written by Rui Ueyama. Using parser.peg). * ext/peg/*, configure.ac, ext/Makefile.in: Added parser.peg module, PEG parser combinator library originally written by Rui Ueyama. 2008-05-22 Shiro Kawai * src/number.c (Scm_FiniteP, Scm_InfiniteP, Scm_NanP), src/extlib.stub (finite?, infinite?, nan?): Added from R6RS. 2008-05-21 Shiro Kawai * lib/srfi-26.scm (srfi-26-internal-cut): performance fix (see the comment). * src/load.c (Scm_DynLoad): Fixed a bug that leaves dlobj inconsisntent state when dl_sym couldn't find initfn. 2008-05-19 Shiro Kawai * src/load.c (Scm_DynLoad): Fixed a bug that caused a dead-lock when the initialization function of DSO executes some Scheme function (it happens if the DSO is pre-compiled from Scheme source), and the execution triggers an autoload, which in turn tries to dynamic-load some other module. Before, we had a global lock for dynamic-load, so the recursive call to it caused a dead lock. Now the lock is per-DSO. 2008-05-12 Shiro Kawai * src/gencomp, src/genstub, lib/gauche/cgen/stub.scm: Allow stub definitions to be embedded in an ordinary *.scm file for pre- compilation. When gencomp sees a toplevel (inline-stub stub-form ...) form, the stub-form ... part is passed to gauche.cgen.stub to generate C code into the pre-compiled output. * src/gencomp, src/compile.scm (global-eq??): Now gencomp takes into account the module visibility when it checks the special identifiers in the toplevel, so that it won't accidentally step on the source where those identifiers are redefined. * src/scmlib.scm (inline-stub): A macro inline-stub is defined to detect when the form is evaluated at runtime (it's only valid for precompilation, so at runtime the form throws an error.) * gc/thread_local_alloc.c (GC_mark_thread_local_fls_for): Fixed size-zero allocation problem. 2008-05-10 Shiro Kawai * libsrc/file/util.scm (safe-stat): fix for platforms that don't have sys-lstat. * src/genstub, lib/gauche/cgen/type.scm, lib/gauche/cgen/stub.scm: Moved most of the stub handling stuff into gauche.cgen.type and gauche.cgen.stub modules. Now genstub is a thin frontend for those modules. 2008-05-09 Shiro Kawai * src/macro.c (Scm_VMMacroExpand): properly handles the case when the operator is an indentifier. * libsrc/util/match.scm: Added support to a certain degree for the case when match macros are used with hygienic macros. Specifically it gracefully handles the case that match macros are inserted as the result of hygienic macro expansion. It's not complete, but we'll patch the holes as it goes, until we replace the current version with completely hygienic match macro. 2008-05-08 Shiro Kawai * ext/dbm/ndbm-makedb.c (main): fix. some versions of ndbm don't like O_WRONLY. * ext/dbm/ndbm.scm (dbm-db-copy, dbm-db-move): fixed for the case when ndbm uses single database file. 2008-05-07 Shiro Kawai * src/compile.scm (pass1/lambda): Merged EXPERIMENTAL extended-lambda support (CL-style :optional, :key, :rest and :allow-other-keys args). Not sure if it fits in Scheme style, but let's see how it goes. Currently an extended lambda is expanded into a normal lambda and let-keywords/let-optionals forms within the compiler. Eventually I prefer them being supported natively, so that the compiler can do some optimizations. * test/system.scm (get-pwd-via-pwd): adapted to OSX's /bin/pwd different behavior. 2008-05-08 ENDO Yasuyuki * winnt/nsis/setup.nsi.in (OutFile): use "mingw" instead of "win32". * winnt/nsis/Makefile (TARGET): use "mingw" instead of "win32". * winnt/nsis/README: use "mingw" instead of "win32". 2008-05-07 Shiro Kawai * ext/dbm/ndbm.stub, ext/dbm/ndbm.scm, ext/dbm/ndbm-makedb.c, ext/dbm/ndbm-suffixes.scm, ext/dbm/Makefile.in: Since different ndbm implementations attach different suffixes for the database files, we determine the suffixes at the build time by actually creating the ndbm database. The extra files (ndbm-makedb.c and ndbm-suffixes.scm) are used in the build time to create ndbm-suffixes.h, which is included from ndbm.c (generated from ndbm.stub). Probably some adjustment will be required for cross- compilation. * ext/Makefile.ext.in: For the convenience, defined LOCAL_LFLAGS make variable that exports library flags generated from --with-local configure option. 2008-05-06 Shiro Kawai * gc/libatomic_ops-1.2/Makefile.in etc. Ran automake again to make Makefile.in etc. keep up to the newest autoconf. * lib/dbm.scm, lib/dbm/fsdbm.scm, ext/dbm/*: Renamed dbm-rename to dbm-move, for the consistency of copy-file/move-file. The old name dbm-rename is kept as an alias of dbm-move. Added dbm-copy and dbm-move support to dbm.fsdbm. * libsrc/file/util.scm, ext/file/test.scm: Added copy-directory*. Fixed the behavior on dangling symlinks in copy-file. Dropped copy-files and move-files, for its API need to be considered more. * gc/tests/test.c: excluded GC_FREE(GC_MALLOC(0))-type tests for they cause problems with DONT_ADD_BYTE_AT_END. 2008-05-04 Shiro Kawai * gc/*, Makefile.in, src/Makefile.in: Bumped up to Boehm GC 7.1. 2008-05-03 Shiro Kawai * lib/gauche/numerical.scm (scheme): added two-argument log support. (log z b) is base-b logarithm of z, i.e. (/ (log z) (log b)). This is an R6RS addition. 2008-04-28 ENDO Yasuyuki * winnt/nsis/setup.nsi.in: delete gauche-logo.ico 2008-04-21 ENDO Yasuyuki * winnt/nsis/setup.nsi.in: add language English. 2008-04-19 Shiro Kawai * src/parameter.c (Scm__VMParameterTableInit): Potentially allocating too few elements. * src/hash.c (Scm_HashTableAdd): Typo fix in the error message. * ext/charconv/jconv.c (jconv): Use Scm_Panic instead of Scm_Error in the logically unreachable code within the critical section. * src/gauche/mingw-compat.h: Removed, for this is replaced by win-compat.h * src/Makefile.in: install win-compat.h instead of mingw-compat.h. 2008-04-19 ENDO Yasuyuki * DIST: fix winnt/nsis make clean bug. 2008-04-18 Shiro Kawai * configure.ac (RPATH_FLAG): substitutes RPATH_FLAG for system-dependent compiler flags to embed library paths in the DSO. "-Wl,--rpath -Wl," for Linux, for example. * src/genconfig (--rpath-flag): A new flag to return RPATH_FLAG info. * src/gauche-package.in ("compile"): added --local option to the 'compile' command to add local include paths and local library search paths conveniently. * ext/template.configure.ac, ext/template.Makefile.in: added --with-local configure option that propagates to --local option of gauche-package. * lib/gauche/process.scm (shell-escape-string): Added a utility function. 2008-04-18 ENDO Yasuyuki * winnt/nsis/setup.nsi (VIProductVersion): get version from ##(incdude (*current-version*)) macro. * winnt/nsis/file-list.scm (main): check path exists. * winnt/nsis/Makefile (GAUCHE_VERSION): hide error message if ../../VVERSION not exists. 2008-04-17 ENDO Yasuyuki * winnt/nsis/Makefile (all): add target all. (gen): add target gen. (build): add target build. (clean): add target clean. (MAKENSIS): check makensis.exe. * winnt/nsis/file-list.scm (include): fix match bug. * winnt/nsis/setup.nsi.in: include version from "##(include (*current-version*))". * winnt/nsis/Makefile (setup.nsi): add argument , for file-list.scm. version from `cat ../../VERSION`. * winnt/nsis/file-list.scm (*current-version*): add. (main): required args: (include): match inline "##(include exp)" template. 2008-04-15 ENDO Yasuyuki * winnt/nsis/Makefile (setup.nsi): generate setup.nsi from setup.nsi.in. * winnt/nsis/file-list.scm: list Gauche-mingw files and generate NSIS script. * winnt/nsis/setup.nsi.in: add. (template for NSIS script) * winnt/nsis/README: add. * winnt/nsis/gauche-logo.ico: Windows icon file for Gauche. 2008-04-11 Shiro Kawai * src/main.c (main, getopt): fixed argument processing on Windows. 2008-03-03 Shiro Kawai * lib/util/trie.scm (call-with-builder): incorrect argument order * lib/util/relation.scm (relation-column-getters): typo fix * lib/gauche/cgen/literal.scm (cgen-emit-xtrn): fixed incorrect variable name. (Thanks to koguro for the above three fixes.) 2008-02-26 Shiro Kawai * lib/gauche/dictionary.scm: removed undefined dict-map-to from export list. * lib/gauche/common-macros.scm, src/autoloads.scm, src/scmlib.scm (let-optionals*, let-keywords, let-keywords*): moved from common-macros to scmlib. This is a step toward supporting keyword and optional args in VM core. * lib/gauche/test.scm (read-summary): avoid using file-exists?, for it triggers autoload which may not be tested in the early stage of testing. 2008-02-24 Shiro Kawai * various scm files: cosmetic changes and adoption of rlet1. * lib/gauche/common-macros.scm: added if-let1 and rlet1. * libsrc/file/util.scm: added touch-files, copy-files, move-files, remove-files, and delete-files. 2008-02-23 Shiro Kawai * lib/binary/pack.scm (read-count): fixed wrong arguments in function call. * lib/srfi-27.scm (random-source-make-reals): fixed nonexistent function call. 2008-02-20 Shiro Kawai * src/write.c (format_proc): raise an error on incomplete tilde sequence in format string. * lib/gauche/time.scm (with-time-counter): avoid multiple evaluation of time-counter expression. 2008-02-16 Shiro Kawai * lib/www/cgi.scm (get-mime-parts): allow :mode option for mime part handler. 2008-02-14 Shiro Kawai * src/vmcall.c (ADJUST_ARGUMENT_FRAME): Fixed a bug that apply didn't copy the argument list when it needed to 'unfold' the passed argument list. 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