2012-05-28 Shiro Kawai * release 0.9.3.3 2012-05-27 Shiro Kawai * src/port.c (Scm__SetupPortsForWindows): Protect the origina scm_stdout and scm_stderr to be GC-ed, for not having fd 1 and 2 open causes problems when spawning child processes and communicate with them via pipes. Thanks to @natsutan for tracking the problem. * src/main.c (init_console): make sure fd 0, 1, and 2 are redirected to NUL in no console mode. * src/string.c (Scm_StringScanRight, Scm_StringScanCharRight), src/libstr.scm (string-scan-right): Added. 2012-05-26 Shiro Kawai * gc/*: Bumped to bdwgc 7.2b. 2012-05-25 Shiro Kawai * src/liblist.scm (every): In multi-arg case, the return value should have been the first non-false return value of PROC but it was #t. Patch from leque. * lib/util/stream.scm (stream-every): Similar fix as above for the consistency. Patch from leque. * src/gauche/vm.h, src/signal.c (SCM_NSIG): On FreeBSD, NSIG doesn't count RT signals, having caused signal.c overrun when setting a handler for SIGRT* signals. Thanks to Vitaly Magerya for tracking this down. 2012-05-24 Shiro Kawai * test/system.scm (normalize): Avoid using $HOME to calculate the expected value of tilde-expansion, for $HOME may be altered during testing. Use getpwuid instead. 2012-05-12 Shiro Kawai * src/Makefile.in: If install location was redirected by DESTDIR, install-aux target in src/Makefile failed, since it tried to use ./gosh which was already relinked to use libgauche.so under $(libdir). Changed the order of install-aux and install-core so that we'll first install headers and scripts, then relink and install binaries. * lib/text/info.scm (read-info-file-split): Since we now have rfc.zlib, use it instead of external gunzip process to read compressed info files (bonus: it works on Windows/MinGW too). 2012-05-11 Shiro Kawai * release 0.9.3.2 : Follow-up release. * doc/extract: Fixed a bug that caused doc build fail if native encoding isn't utf-8. The bug was introduced by out-of-tree build modification. 2012-05-10 Shiro Kawai * src/libeval.scm (%vm-parameter-ref, %vm-parameter-set!): The compatibility definition of these procedures was incorrect. If files using parameterize and precompiled by 0.9.2 or before are used in 0.9.3 an error will be signalled. Let's see how big the problem will be and decide whether we'll make another follow-up release or not. * lib/gauche/procedure.scm (generator-map): Fixed a bug that depended on argument evaluation order. * release 0.9.3.1 : Special follow-up release for MinGW because of the previous bug. * src/libsys.scm (check-trailing-separator): It raised an error erroneously when "" is given. It prevented self-building 0.9.3 on Windows/MinGW. * lib/gauche/portutil.scm, lib/gauche/procedure.scm: Removed duplicated definitions of port-fold etc. which was need to compile 0.9.3 by 0.9.2. The procedures are kept as aliases of generator-fold etc. * src/autoloads.scm: Autoload port-fold etc. from gauche.procedure instead of gauche.portutil. 2012-05-09 Shiro Kawai * release 0.9.3 2012-05-08 Shiro Kawai * src/parameter.c, src/gauche/parameter.h, src/libeval.scm, libsrc/gauche/parameter.scm: Fixed semantics of parameters created by other threads. Accessing parameters created by unrelated threads used to be an error; now it works as if the parameter is defined in every thread. This reduces the annoyance if parameter creation timing is shifted by autoloads, for example. The internal API is slightly changed. See the comment in src/libeval.scm. * src/load.c: Adapted to the above change. 2012-05-07 Shiro Kawai * winnt/*: Removed old MSVC project files and NSIS-related sources. Using MinGW and WiX is now the official way to build Windows native version. If anyone wants to support alternative builds, she can always resurrect those files from the repository. * src/liblist.scm, libsrc/srfi-1.scm: Moved remove, remove! and filter-map to the core. * gc/libatomic_ops: Backported d923334022938240c43c167d66549b1211aed2ba of git://github.com/ivmai/libatomic_ops.git to avoid build errors on certain Xcode version. 2012-05-05 Shiro Kawai * ext/tls/Makefile.in, ext/tls/system-fix.c, ext/tls/kick_openssl, ext/tls/test.scm, ext/tls/axTLS/ssl/test/killopenssl.sh, ext/tls/axTLS/ssl/test/ssltest.c: TLS test fixes - Avoid using system(), for it doesn't go well with MT on some OSes (e.g. OSX). This fix calls /bin/sh explicitly, which may have its own problem, but let's see. - Avoid using 'ps' to extract openssl servers to kill. Instead, we intercept openssl invocations and record pids. This (1) avoids complications of 'ps' difference between OSes, and (2) prevents collateral damange when there are more than one test is going on. Again, this fix is quite a kludge and may have other problems. Note that we substitute strings "openssl " in the ssltest.c in order to make this work, so be careful changing ssltest.c not to include the code that can be affected by this substitution inadvertently. 2012-05-03 Shiro Kawai * lib/srfi-27.scm: Fixed bugs in random-source-make-reals. * ext/mt-random/test.scm: Added tests for srfi-27. 2012-05-01 Shiro Kawai * lib/gauche/generator (x->generator): The implementation for the generic collection was incorrect. 2012-04-20 Shiro Kawai * lib/gauche/test.scm (test-end, test-summary-check): Extended the module to enable exitting gosh with nonzero status so that it can be detected by make and/or other build monitoring tools. 2012-04-18 Shiro Kawai * lib/gauche/test.scm (arity-invalid?): Exclude check on generics with no methods. See the comment. 2012-04-14 Shiro Kawai * ext/tls/Makefile.in, ext/tls/tls.ac, ext/tls/tls.c, ext/tls/gauche-tls.h: Enable compilation with --disable-tls. * lib/rfc/http.scm: Fixed to raise a proper error when :secure is given on a platform without tls support. 2012-04-12 Shiro Kawai * libsrc/util/match.scm (validate-pattern): Temporary fix for interference with hygienic macro. * src/liblazy.scm (lcons*, llist*, liota): Added for completeness. * doc/corelib.texi: Added lazy sequence examples. 2012-04-11 Shiro Kawai * src/vm.c (Scm__VMUnprotectStack), src/lazy.c (Scm_ForceLazyPair): Fixed a bug that corrupts VM stack when lazy-pair forcing occurs during a comined instruction such as CAR-PUSH. The original code pushed an extra continuation frame during forcing to protect the stack. If that happened, CAR-PUSH pushes the result on top of the extra continuation. However, the next instruction to be executed after this CAR-PUSH will be RET, set by Scm__VMProtectStack, which discards the just pushed value by CAR-PUSH. The fix correctly adjusts the VM stack after forcing is done. * src/librx.scm (regexp-num-groups, regexp-named-groups): Added accessors to these internal info. * doc/corelib.texi: Made reference from regexp-replace-all to lrxmatch and grxmatch. 2012-04-03 Shiro Kawai * src/libeval.scm (add-load-path): Enable adding load path relative to the currently loaded file. Handy to distribute scripts that can just copied by directories. 2012-03-31 Shiro Kawai * src/vm.c, src/gauche/vm.h: Changed continuation frame structure. It turned out we don't need to save argp, so we have one word less in each cont frame. Previously we marked C continuation frame by argp=NULL; now it is marked by a special value in env. The C continuation frame is also changed to have pushed data before ScmContFrame, which is symmetric to ordinary continuation frames. 6-8% performance improvement is observed in heavily recursive micro benchmarks (e.g. fibonacci or ackerman). 2012-03-30 Shiro Kawai * src/char.c (Scm_CharSetCaseFold), src/regexp.c (match_ci): Fixed case-folding match beyond ASCII range. Patch from OOHASHI Daichi. 2012-03-26 Shiro Kawai * lib/rfc/http.scm (http-request, http-default-redirect-handler): Fixed the behavior of redirection for 3xx responses, and made it customizable. 2012-03-21 Shiro Kawai * lib/rfc/cookie.scm (parse-av-pairs): RFC2616 allows period appear in cookie attr name. Fixed. (Patch from Kirill Zorin). * libsrc/gauche/parameter.scm (object-apply): Splitted methods for getter and setter; it makes arity checking work better. * lib/gauche/test.scm (test-module): Added a feature to check arity of global procedures, based on the patch by Masahiro Hayashi. * lib/rfc/ip.scm, lib/binary/ftype.scm: Fixed bugs catched by the above check. * src/class.c (), src/libobj.scm (subtype?): Added the bottom type , and type relation predicate subtype?. is needed for applicable? to be useful. * doc/corelib.texi, doc/object.texi: Reorganized a bit to have brief introduction of type/class system on top of corelib.texi. 2012-03-19 Shiro Kawai * lib/gauche/generator.scm: Removed consume, for it is the same thing as generator-for-each. * lib/gauche/procedure.scm (generator-fold, generator-fold-right, generator-for-each, generator-map): Supersedes port-fold etc. (To avoid build compilication, we still keep port-fold etc. in portutil.scm until 0.9.3 release; see the comments in portutil.scm.) * src/autoloads.scm: Added autoloads for the above procedures. * various files: Replaced port-for-each to generator-for-each etc. 2012-03-17 Shiro Kawai * lib/srfi-42.scm: Added :generator ec-qualifier. 2012-03-16 Shiro Kawai * lib/gauche/generator.scm (do-generator): Added. 2012-03-14 Shiro Kawai * src/liblist.scm (fold-left): Added according to R6RS, for the completeness. 2012-03-09 Shiro Kawai * lib/gauche/portutil.scm (port-map, port-fold): Guarantee to call fn before retrieving the next item by the reader; it just makes more sense. 2012-02-26 Shiro Kawai * lib/rfc/http.scm (send-headers): Try to send headers in one chunk, for some http servers prefer headers coming in a single packet. * src/compile.scm (quasiquote): Fixed a broken hygienity bug in unquote-splicing handling used within hygiene macros. * src/vminsn.scm (NUMIDIV2), src/libnum.scm (/.), src/number.c (scm_div): There was an overflow issue in NUMIDIV2 and /. when both the dividend and the divisor are too big to be coerced to double, but the result can be representable in double. We shouldn't coerce the arguments to inexact beforehand. To address this, we delegate exact / exact -> inexact case into Scm_DivInexact C routine. Now, Scm_DivInexact has been used for the backward compatibiltiy of `inexact-/' (compat.norational) but its behavior is different from `/.'. We changed Scm_DivInexact to match the behavior of `/.', and added Scm_DivCompat to support `inexact-/'. The compatibility behavior will be removed in 1.0. 2012-02-22 Shiro Kawai * ext/tls: Added TLS/SSL support module based on Cameron Rich's axTLS. The binding is originally written by Kirill Zorin. If building of axTLS fails, configure with --enable-tls=none to suppress building it. * lib/rfc/http.scm: Repleaced TLS/SSL support with ext/tls, from the previous ad-hoc stunnel-based one. 2012-02-21 Shiro Kawai * ext/peg/peg.scm: Rewrote using lazy sequences instead of specialized streams for input. Also simplified API (e.g. dropped $do* and $do distinction, for they are more a performance hack rather than a benefit for users.) This may degrade the performance. We rely on future compiler improvements to address the performance issue. Do not count on the current API; they're still subject to change. 2012-02-20 Shiro Kawai * src/Makefile.in: Fixed install process to call makeverslink before using gauche-install; the latter depends on the installed libgauche.so to be properly symlinked. 2012-02-19 Shiro Kawai * lib/gauche/generator.scm (consume): Added. 2012-02-18 Shiro Kawai * src/liblist.scm (map, for-each), src/proc.c (Scm_Map, Scm_ForEach): Define these in Scheme. The C API is obsoleted; they are just calling Scheme version now, and will be gone in 1.0. 2012-02-17 Shiro Kawai * lib/gauche/generator.scm (glet*, glet1): Added convenience macors that captures the monadic pattern frequently appear in generator code. 2012-02-14 Shiro Kawai * src/load.c, src/libeval.scm (load, find-load-file): Moved Scm_VMLoad and Scm_FindFile functions from C to Scheme. C API Scm_VMLoad() remains for the backward compatibility. Scm_FindFile() is deleted, for it was never made public. (%add-load-path-hook!, %delete-load-path-hook!): *EXPERIMENTAL* Added a mechanism to trigger a hook function when *load-path* includes a regular file instead of a directory. The hook function allows the application to load files from archive files (e.g. zip fie). See libeval.scm for the details. 2012-02-12 Shiro Kawai * src/libsys.scm, lib/gauche/fileutil.scm (file-exists?), (file-is-regular?, file-is-directory?): Moved these from fileutil to libsys.scm because of the dependency. * src/autoloads.scm: Changed accordingly. 2012-02-11 Shiro Kawai * src/gauche.h (SCM_BIND_PROC): Introduced a macro to capture the common pattern in calling a Scheme procedure from C. The macro can be used to ensure a C variable is initialized by the value of the named Scheme variable (so it isn't restricted to 'PROC', but in practice using it for something other than procedure doesn't make much sense.) * src/load.c, src/vm.c, src/system.c: Changed accordingly. 2012-02-10 Shiro Kawai * src/system.c (Scm__InternalCondWait): Fixed a hazard when timeout occurs. Also fixed the handling of cond->mutex so that it is safe to call CondSignal and CondBroadcast without holding the related mutex (although it's not recommended). 2012-02-07 Shiro Kawai * ext/sxml/*: Fixed a problem that out-of-source-tree build generated some Scheme files into srcdir instead of builddir. * src/compile.scm (pass1/open-include-file), src/gauche/vm.h (SCM_COMPILE_INCLUDE_VERBOSE), src/main.c (-finclude-verbose): Add a new compile-time flag to report 'include' operation to stderr. It is separated from -fload-verbose, since 'include' works in compile-time and 'load' works in runtime (although typically they are interleaved). * src/libio.scm (open-input-file): Allow ":encoding #t" to make open-input-file wrap the iport with a coding-aware port. It's convenient to process source files that may have coding comment. 2012-02-06 Shiro Kawai * src/vm.c (Scm_AttachVM, Scm_DetachVM): Protect active VMs explicitly from GC. Thread-specific area may not be scanned by GC. 2012-02-05 Shiro Kawai * ext/net/net.c (Scm_MakeSocket): Fix Windows/MinGW problem that sockets can't be used with threads. Thanks to SAITO Atsushi for tracking this down. 2012-02-03 Shiro Kawai * src/liblist.scm (iota): Fixed a bug in the case of inexact number sequence (thanks to Toshihiro Morisaki). 2012-01-31 Shiro Kawai * lib/gauche/lazy.scm: More lazy sequence utilities. * doc/modgauche.texi: Documented gauche.lazy. 2012-01-29 Shiro Kawai * lib/util/stream.scm (stream-count): Bug fix (thanks to KOGURO Naoki). 2012-01-27 Shiro Kawai * Makefile.in, wirebuildlibs, configure.ac, gc/configure.ac, */Makefile.in, ext/xlink, */tset.scm, src/main.c: Re-enable out-of-source-tree build. Just call top configure from any directory and it should build and install with make & make install. 2012-01-25 Shiro Kawai * src/class.c (Scm_MethodApplicableForClasses), lib/gauche/procedure.scm (applicable?): Added applicable?. * src/autoloads.scm, doc/corelib.texi, test/object.scm: Changed accordingly. 2012-01-23 Shiro Kawai * src/gauche/pthread.h: Fix for cygwin pthread: Real-time signals are not available on cygwin, so we use SIGPWR for inter-thread communication. Nees to be documented. * src/Makefile.in: Exclude unnecessary object files in gc/ to be linked to libgauche.so. * configure.ac, src/Makefile.in, src/gauche.h: The previous trick, committed for Win32 thread support, to extract GC thread config settings and adding it to gauche/config.h, doesn't work. The extra code won't be executed by running ./config.status. So we changed the strategy---at build time, we generate gauche/config_threads.h from the GC's thread configuration. 2012-01-21 Shiro Kawai * src/port.c (Scm__SetupPortsForWindows): Made implicit AllocConsole() thread-safe for gosh-noconsole. * test/win-noconsole-threads.scm: Manual test for the above feature. * ext/threads/threads.scm (gauche-thread-type): Returns 'win32 on Windows/MinGW threads support. 2012-01-20 Shiro Kawai * configure.ac, src/gauche/wthread.h, src/system.c, src/vm.c, src/core.c, ext/threads/*, ext/util/queue.scm: Added support of Windows thread on MinGW. Run ./configure --enable-threads=win32 to enable the support. Unit tests pass, but needs more test with actual applications. * src/load.c (Scm_Require): Fix a hazard in parallel require case; the loop around condition variable wait wasn't actually looped due to the bug. Thanks to Kirill Zorin for tracking this down. * src/core.c (finalizable): Fix to protect in the case that GC is run before Gauche is fully bootstrapped. 2012-01-18 Shiro Kawai * doc/*: Documented basic lazy sequence operations. * lib/gauche/lazy.scm (lappend): Added. Will add more lazy sequence utilities. 2012-01-08 Shiro Kawai * lib/gauche/generator.scm (grxmatch, port->char-generator) (port->byte-generator): Added stream regexp match generator grxmatch, and a couple of convenience procedures to read from an input port. 2012-01-07 Shiro Kawai * lib/gauche/generator.scm (gcons*, gappend): Changed gcons -> gcons*, for it's more general. Modified gappend to delay autocoercing the arguments, so that gappend can be used as a lightweight lazy sequence concatenation. 2012-01-06 Shiro Kawai * src/class.c (method_more_specific): Don't panic if method-more-specific? gets two methods that can't be ordered; It may be just an erroneous MOP code. Now we throws an error with descriptive messages. 2012-01-03 Shiro Kawai * lib/gauche/generator.scm: Allows generator operations to take collections, which are implicitly coerced to generators, for the convenience. 2011-12-27 Shiro Kawai * lib/util/list.scm, src/liblist.scm, src/libdict.scm, lib/gauche/common-macros.scm, src/autoloads.scm: Obsoleted util.list; entries are moved to liblist, libdict and common-macros. The module is kept for the backward compatibility, but its officially removed from the document. 2011-12-26 Shiro Kawai * src/gauche/wthread.h, src/gauche/vm.h, src/vm.c, src/signal.c, ext/threads/mutex.c, ext/threads/threads.c, configure.ac: Start adding Windows thread support on Gauche/MinGW, and improved thread-terminate! semantics. On POSIX, if real-time signal is available, we reserve one signal (GAUCHE_PTHREAD_SIGNAL) to notify termination request. With the signal, the terminated thread can shut itself down gracefully. We also use vm->stopRequest mechanism to terminate the thread. 2011-12-25 Shiro Kawai * lib/gauche/cgen/cise.scm (.if): Make sure '#if' stars from the fresh line. * src/libsys.scm: The fd range check added recently was invalid on Windows/MinGW (see the comment). Conditionalized. * gc/*: Updated to gc7.2-alpha6. * src/compile.scm (quasiquote): Fixed to recognize unquote and unquote-splicing hygienically. * lib/control/job.scm: Added 'cancellable' job flavor, which may not be waitable but job-mark-killed! can be used on. We need mutex if we allow threads other than the job runner to change the job status. See the comment for the details. * lib/control/thread-pool.scm: Use cancellable jobs, for we might want to kill them. * ext/threads/mutex.c, ext/threads/threads.scm: (mutex-locker, mutex-unlocker): Added. (with-locking-mutex): rewrite using above, and made it inline. This change prevents with-locking-mutex from making closures at runtime. 2011-12-24 Shiro Kawai * lib/gauche/generator.scm: Extended API * doc/modgauche.texi: Documeted gauche.generator. 2011-12-23 Shiro Kawai * src/port.c (Scm_FdReady), src/libsys.scm (sys-fdset-ref, sys-fdset-set!): Check if fd is in the valid range. 2011-12-22 Shiro Kawai * src/string.c (Scm_MaybeSubstring): Allow #f as start or end arguments, for the convenience. * src/liblist.scm, libsrc/srfi-1.scm, lib/util/list.scm: Moved take-right, drop-right, take!, drop-right!, take*, drop*, take-right*, drop-right* and split-at* to the core. 2011-12-21 Shiro Kawai * lib/gauche/generator.scm (generate): Added coroutine-based generator. * doc/modgauche.texi: Start adding generator documents. 2011-12-20 Shiro Kawai * src/main.c: Added '-m module' option to specify the module where the 'main' procedure is looked for when a script is loaded. * test/scripts.scm: Added a test for the above. Eventually we can add more tests for command-line options of gosh. 2011-12-18 Shiro Kawai * src/string.c (Scm_StringBodyPosition): Deprecate Scm_StringPosition since it is difficult to use in MT-safe way. Introduced safer Scm_StringBodyPosition. 2011-12-10 Shiro Kawai * lib/control/job.scm (job-wait): fixed a bug that it looked result where it should've looked status. (job-run!, job-mark-killed!): Called condition-variable-broadcast! with a wrong argument. Patch for this and above bugs are from ayatoy. 2011-11-28 Shiro Kawai * configure.ac, src/gauche/config.h.in (HAVE_CRT_EXTERNS_H), src/system.c (Scm_Environ): Newer OSX doesn't allow to access global environ variable directly; we should use _NSGetEnviron(). * lib/gauche/cgen/cise.scm: Added .undef macro * src/libsys.scm: Fix for mingw. * configure.ac: Enable HAVE_SELECT on Windows/mingw, altohugh on it select() can only be used on sockets. * src/system.c, src/port.c: Changed accordingly. 2011-11-26 Shiro Kawai * src/*, ext/auxsys, lib/*, doc/*, libsrc/*: Code reorganization: src/*.stub and src/*.scm files are merged, and then splitted accodring to each function's feature instead of the module it belongs. This keeps related code together and eases maintenance. The new sources are named as src/lib*.scm. By this change, we hide some internal routines into gauche.internal; which we couldn't do before, since each *.stub file could be associated to one module. Now we can switch the modules inside precompiled scm files as we like. We also merged ext/auxsys into core (mostly in libsys.scm), for we no longer need them to be in an extension module. We've already moved some list utilities from srfi-1 into core; by this commit we do so more, and updated the document accordingly. We also removed SCM_DEBUG_HELPER conditional; we've never had it turned off, so we can just always keep those debug routines. NB: Those debug dump routines (%*-dump) are now in gauche.internal module. * lib/gauche/cgen/precomp.scm: *Experimental*: Allow define-cproc to appear as the toplevel form. It is easier to read than always putting them in inline-stub. I might change my mind later, for it may be confusing as well. 2011-11-24 Shiro Kawai * src/code.c (Scm_CompiledCodeDump): Fixed a bug that can cause infinite loop when printing lifted procedures. * src/compile.scm (subst-lvars): The traversal of $LET didn't update lvar-initval, causing the following passes to fail to do some closure elimination. (pass1/define-inline): Wrong check of `closed' value caused all define-inline'd procedures to go through the slower pass. The above to bugs prevented the procedures defined in define-inline from being optimized enough. Notably, local tail-calls didn't get optimized to loops. 2011-11-20 Shiro Kawai * src/genconfig (gauche-config): Emit usage message to stderr instead of stdout. By this, feeding gauche-config output to sh wouldn't confuse sh if you give incorrect option. * lib/gauche/cgen/stub.scm (): Fix the problem that cproc's binding isn't inserted into the tmodule at the time of define-cproc, but at the time of the final rendering. * lib/gauche/cgen/precomp.scm: Fixed a similar bug. * src/scmlib.scm (generator->lseq): Renamed from lseq to make it more descriptive, since it turned out this function wouldn't be used frequent enough to demand a short name. 2011-11-19 Shiro Kawai * src/regexp.c (rc1_parse, rc3_rec): Fixed regexp parser and code generateor to recognize BOL/EOL assertions within (?=...), (?!...), (?<=...), (?...). For '^' and '$, we should parse these constructs as if they are stand-alone, no matter where they appear. That is, '^' appearing at the beginning of these constructs are BOL assertions and '$' at the end are EOL. This is consistent to Perl and Oniguruma. NB: The code that counted on the previous (buggy) behavior may break by this change. 2011-11-11 Shiro Kawai * lib/gauche/vm/debugger.scm, src/autoloads.scm: Export debug-print-(pre|post) and set them to be autoloaded. These symbols are inserted by debug-print macro. If such a source is pre-compiled, gauche.vm.debugger won't be autoloaded at execute time unless we make debuf-print-(pre|post) autoloaded too. This is not an ideal solution, for those procs are internal. 2011-11-06 Shiro Kawai * lib/gauche/cgen/tmodule.scm (, all-tmodules): Use a parameter instead of a class slot to record tmodules encountered during precompilatoin. Class slots are global and fragile for multiple invocation of cgen-precompile and/or MT. (with-tmodule-recording): A macro to initialize the module list. * lib/gauche/cgen/precomp.scm, lib/gauche/cgen/stub.scm: Changed accordingly. 2011-11-04 Shiro Kawai * lib/gauche/common-macros.scm (values->list): Support a common pattern. CL's multiple-value-list. * src/autoloads.scm (values->list): changed accordingly. 2011-10-29 Shiro Kawai * src/lazy.c (Scm_ForceLazyPair): Fixed a bug that the second value from the generator could have leaked out. 2011-10-28 Shiro Kawai * ext/util/queue.scm (make-mtqueue, enqueue/wait!, dequeue/wait!): Added support of zero-length mt-queue. Zero-length queue cannot hold any values, but can be used to synchronize producers and consumers---a thread can directly hand a value to another thread. THIS IS AN INCOMPATIBLE CHANGE: It used to be that zero max-length meant to be unlimited length. Now you have to give #f to max-length to make the mtqueue unlimited length. * ext/threads/test.scm: Tests added for zero-length queue. * lib/control/thread-pool.scm: Changed accordingly. * lib/rfc/http.scm (http-proxy): Added a parameter to specify the default http proxy. * libsrc/file/util.scm (touch-file, touch-files): Extended to take :time, :type and :create options; these are similar switches the touch(1) command has. Also, touch-files hasn't been exported although the manual has its entry. * ext/file/test.scm: Added tests accordingly. 2011-10-24 Shiro Kawai * src/regexp.h (ScmRegexpRec), src/regexp.c (rc3, Scm_RegExec): Improved unanchored regexp search by skipping the input. We calculate a set of characters that can possibly match at the beginning of the regex (lookahead set, or laset). When we advance the input pointer, we check the character and if it isn't in the laset we can skip matching from that position. We also adopt a strategy that when /A+B/ fails to match, where A is a char or charset, and A and B has distinct laset, then we can skip the input as long as it matches A. These strategy improves the performance greatly in commonly occurring patterns, especially when the input is long. * test/regexp.scm, src/extlib.stub: Added some tests. 2011-10-17 Shiro Kawai * src/scmlib.scm (make-case-lambda), src/intlib.stub (make-case-lambda-dispatcher), src/compile.scm (case-lambda): Changed case-lambda info vector for better diagnostics; the first element now contains the procedure name if available. NB: Eventually we intend to change case-lambda to be a special object instead of the current hack with subr. The current way of using info slot is temporary. * lib/gauche/procedure.scm (disasm): Adapted to the above change. 2011-10-16 Shiro Kawai * lib/gauche/regexp.scm (regexp-unparse): Handles '|' and control characters properly. 2011-10-15 Shiro Kawai * src/regexp.c (rc3_rec): Fixed the bug that (regexp-compile '(alt)) gets Bus Error. Now we allow empty altenation. Although such AST never happens as a result of parsing string regexp, it may be produced in programmatically generated AST. An empty alternation always fails. * lib/gauche/regexp.scm (regexp-unparse): When converting empty alternation to a string, we use negative lookahead assertion (?!), since such alternation can't be represented using '|' operator. Also fixed a bug when converting empty assert/nassert nodes. 2011-10-05 Shiro Kawai * lib/rfc/json.scm (print-string): Fixed string writer bug that didn't handle ASCII control characters and chars between [U+80,U+fff]. 2011-09-30 Shiro Kawai * src/lazy.c (Scm_ForceLazyPair): Added check of recursive forcing to prevent self-deadlock. 2011-09-28 Shiro Kawai * lib/gauche/lazy.scm (lfilter): Added for the convenience. * lib/gauche/generator.scm (grange): Added grange for the convenience. 2011-09-16 Shiro Kawai * src/lazy.c (Scm_DecomposeLazyPair), src/extlib.stub (%lazy-snoc), src/scmlib.scm (%lcons), lib/gauche/common-macros.scm (lcons): Added support of lcons, a primitive to write corecursive code. 2011-09-12 Shiro Kawai * src/gauche.h (SCM_PAIRP), src/lazy.c (Scm_PairP, Scm_ForceLazyPair, Scm_MakeLazyPair), src/class.c (SCM_CLASS_OF), src/extlib.stub (%lazy-cons), src/scmlib.scm (lseq, lrange), lib/gauche/lazy.scm: Added lazy sequence support. * lib/gauche/cgen/stub.scm, src/vm.c, src/gauche/vm.h, src/vmcall.c, src/vminsn.scm: Modifications to make lazy sequences forced safely. * src/Makefile.in: Make sure *.stubs are reprocessed if gauche.cgen.stub is updated. It is crucial for this commit, since the *.c files generated by previous genstub aren't safe for lazy sequences. * test/primsyn.scm: force/delay tests are moved to test/lazy.scm. * test/lazy.scm, ext/gauche/test-lazy.scm: lazy evaluation tests. * test/lazy-performance.scm: some code for benchmarking. * src/vm.c (user_eval_inner): We no longer save the signal mask and restore it in case of the error. We don't see any reason to restore the mask. From the commit logs, this mask manipulation was originally kept in 2004-03-15 change; it says, without restoring the mask, a hang occurred on cygwin. We can no longer reproduce the hang, so we decided to drop this code. It has now become a major slowdown factor. 2011-08-25 Shiro Kawai * src/system.c (Scm_GetTimeSpec): Fixed a bug that didn't handles exact rationals properly (it was rounded down to the nearest integer). * ext/threads/test.scm: Improved thread-sleep! test. Thread-sleep! was affected by the above bug. 2011-08-23 Shiro Kawai * src/compile.scm (pass2/shrink-let-frame): A small optimization possibly replaces let to nested function call. 2011-08-22 Shiro Kawai * lib/gauche/common-macros.scm ($): Incorporated the chained apply macro into the core. Note that the semantics is slightly changed; we drop $* macro, and the $ and $* delimiters determines whether apply to be used for the procedure *before* the delimiter. * src/autoloads.scm: Changed accordingly. * lib/gauche/experimental/app.scm: Now this is just a placeholder. 2011-08-17 Shiro Kawai * src/gauche-package.in ("list"): "gauche-package list" now displays packages that are installed by other versions of Gauche, as far as it is abi-compatible to the current gauche version. 2011-08-11 Shiro Kawai * src/promise.c: Renamed to lazy.c * src/lazy.c (Scm_Force): Made force thread-safe. Now more than one thread can call force simultaneously. * ext/threads/test.scm: Added tests for thread-safe force. 2011-08-10 Shiro Kawai * src/compile.scm (lazy): Directly generates $ASM node, eliminating the need of $PROMISE IFrom node. We have to keep $PROMISE node throughout 0.9.x series for the compatibility of precompiled files in earlier 0.9.x versions, but it will go away in 1.0. * lib/gauche/cgen/literal.scm (): Handle unintered symbols. * src/code.c (Scm_CompiledCodeDump): The disassembler now shows the closures lifted to the toplevel procedures. 2011-08-08 Shiro Kawai * src/number.c (Scm_Quotient): Fixed a bug in the path of inexact quotient calculation. The path is used by div and mod, relvealing the bug. 2011-08-05 Shiro Kawai * release 0.9.2. 2011-08-02 Shiro Kawai * libsrc/srfi-1.scm: Export procedures that are defined in the gauche core. They are not exported from the gauche module, but they should be exported from srfi-1. * lib/rfc/uri.scm (uri-merge): Fix a bug when base-path is empty and rel-path is relative. 2011-08-01 Shiro Kawai * configure.ac, src/gauche/arith_x86_64.h: Added inline assembly of fullword numberic operations for x86_64. * src/bignum.c: Some routines used incorrect type (long vs int) as the argument for arith macros. On ILP32 machines it didn't matter, but on LP64 it does. * src/number.c (scm_mul): The previous version of overflow detection of multiplying two longs depended on C's undefined behavior. clang-llvm does certain optimizations as if the calculation never overflows, and that's valid, since once calculation overflows the result can be anything. Fixed to use SMULOV macro in gauche/arith.h which detects overflow reliably (but the portable fallback is expensive). 2011-07-31 Shiro Kawai * test/multibyte.scm, test/char.scm: Splitted multibyte tests and char-only tests. Character case mappings can be tested separately, and we need more tests focused on characters anyway. * src/stdlib.stub (char-ci-cmp): Use foldcase to compare case-insensitive character comparison, and support more than 2 arguments a la r6rs. (char-cmp): support more than 2 args. 2011-07-30 Shiro Kawai * doc/modgauche.texi: Documented gauche.cgen; now the API for cgen.unit, cgen.literal and cgen.type are official. * lib/gauche/cgen/unit.scm: Dropped :pre-decl and automatic insertion of "#include ". If we let the module user to insert "#include ", then we don't need pre-decl stuff and it's conceptually simpler. * lib/gauche/cgen/stub.scm, lib/gauche/cgen/precomp.scm, src/autoloads.scm, src/builtin-syms.scm: Changed accordingly. * lib/gauche/type.scm: Some integer stub types used SCM_EXACTP for checking exact integers; that's an old convention. After we have ratnums, it must be checked with SCM_INTEGERP. Fixed. 2011-07-27 Shiro Kawai * lib/gauche/generator.scm: Added gauche.generator experimentally. API may change later. * ext/gauche/test-generator.scm: Tests for gauche.generator. * src/gauche/symbol.h (ScmSymbolRec), src/symbol.c (make_sym): Changed 'interned' field to 'flags' field for future extension. See the comment in symbol.h about the binary compatibility. * src/builtin-syms.scm: Changed accordingly. 2011-07-26 Shiro Kawai * lib/gauche/cgen.scm: Include gauche.cgen.cise too. * configure.ac (ipv6): Turn on --enable-ipv6 by default. To compile on a platform that doesn't have getaddrinfo etc, say --disable-ipv6 explicitly. 2011-07-25 Shiro Kawai * lib/gauche/cgen/precomp.scm, lib/gauche/cgen/stub.scm, lib/gauche/cgen/tmodule.scm: Dropped the dependency on an implicitly defined local variable 'mod' in the init function. In the precomp- generated C source, a local variable ScmModule *mod used to be defined to hold the module of the compiled source. It's ugly to depend on such implicit names, and also it was awkward to handle the situation when multiple modules are defined in the precompiled source. Now, if you want to refer to the module inside init functin, you can call Scm_CurrentModule(). * ext/sparse/sparse.scm, ext/threads/threads.scm, ext/text/unicode.scm: Changed accordingly. * configure.ac (multibyte): If --enable-multibyte is given without ENCODING, assume utf-8 instead of euc-jp. * ext/net/addr.c: Allow comparing socket addresses based on the content; that is, (equal? x y) => #t if x and y represents the same address, even they are different instances. * configure.ac, ext/auxsys/auxsysconf.h.in: Check for clearenv() * ext/auxsys/auxsyslib.stub, ext/auxsys/auxsys.scm (sys-clearenv): Support clearenv(3). If we don't have it but have sys-unsetenv, we define sys-clearenv using it. To check availability, use (or gauche.sys.clearenv gauche.sys.unsetenv) in cond-expand. (sys-setenv): Fixed a bug that you couldn't omit the overwrite optional argument. * src/autoloads.scm: Changed accordingly. * lib/rfc/cookie.scm (construct-cookie-string): Recognize :http-only cookie attribute introduced in RFC6265. * src/write.c (format_proc): Allow ~* to position at the next to the last argument. (patch from leque.) * gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h, gc/configure.ac, gc/Makefile.in, configure.ac: Fix for MacOSX Lion (patch from KOGURO Naoki). 2011-07-24 Shiro Kawai * winnt/wix/* : Support Windows installer based on WiX. This will replace NSIS-based installer. * src/mingw-dist.sh: Changed to make wix installer instead of nsis installer. 2011-07-20 Shiro Kawai * src/char.c, src/char_attr.c, src/gauche/char_attr.h: Added character category and case mapping tables according to Unicode character database. New/revised APIs: Scm_CharGeneralCategory, Scm_CharAlphabeticP, Scm_CharUppercaseP, Scm_CharLowercaseP, Scm_CharTitlecaseP, Scm_CharNumericP, Scm_CharUpcase, Scm_CharDowncase, scm_CharTitlecase, Scm_CharFoldcase. * src/gauche/char_utf_8.h, src/gauche/char_euc_jp.h, src/gauche/char_sjis.h, src/gauche/char_none.h: Some new encoding- specific routines to handle the above functionality. * src/stdlib.stub: Changed char-alphabetic?, char-numeric?, char-upper-case?, char-lower-case?, char-upcase and char-downcase to use the new APIs. * src/extlib.stub: Added char-title-case?, char-titlecase, char-foldcase, char-general-category. * src/gen-unicode.scm: A script to generate character attribute tables from Unicode character database. The generated files are checked in to repos, so developers don't need to run this script regularly. Tables need to be regenerated only when Unicode is updated. To run this script, go down to src/ and do 'make char-data' and follow the instructions. * ext/text/unicode.scm, ext/text/unicode_attr.h: text.unicode module provides unicode-defined operations, including unicode encoding conversions, grapheme-cluster and word segmentation, and string-upcase, string-downcase, string-titlecase and string-foldcase. * doc/corelib.texi, doc/modsrfi.texi, doc/modutil.texi: Added description of new case handling scheme, text.unicode module, and relation to srfi-13 string-upcase etc. * test/chars-strings.scm: Renamed from test/mb-chars.scm and added more tests. 2011-07-13 Shiro Kawai * src/compile.scm (pass4/scan): Fixed a bug that unnecessarily marked dissolved lambda in pass4, confusing the later passes. 2011-07-09 Shiro Kawai * lib/gauche/procedure.scm, src/compile.scm, src/scmlib.scm: Moved case-lambda handling into the core. This is the initial step towards aggresive inlining of case-lambda. * src/autoloads.scm: changed accordingly. * lib/util/queue.scm: changed to use case-lambda; we couldn't use it because of inter-module dependency. now case-lambda is in core and we can use it here. 2011-06-30 Shiro Kawai * lib/rfc/json.scm (print-value, construct-json): Should handle with empty list. Patch from leque. 2011-06-27 Shiro Kawai * lib/gauche/redefutil.scm, test/object.scm: Fixed change-class on class metaobjects to work. * src/class.c, src/gauche.h, src/objlib.scm: Added a mechanism to 'seal' the core slots of class metaobjects that are essential for object system to work; for example, changing num-instance-slots after some instances are created would cause disaster. Now these core slots can only be set during class initialization. 2011-06-11 Shiro Kawai * src/port.c (coding_port_recognize_encoding): Fixed a bug in the state machine of encoding magic comment; the lines weren't counted correctly for \r-only or \r\c line endings. 2011-06-10 Shiro Kawai * src/extlib.stub (integer-length): Fixed a bug in the edge case on the boundary of fixnum/bignum switch. 2011-05-31 Shiro Kawai * libsrc/file/util.scm (create-directory-tree): Fixed a bug to treat content-less file spec. Thanks to teppey for the fix. 2011-05-30 Shiro Kawai * lib/control/thread-pool.scm (worker): Fixed a hazard that the worker flagged it was done before queueing the result. Thanks to enami for spotting this. * lib/rfc/json.scm (print-string): Fixed a bug that generates incorrect json string if it contains double-quotes. 2011-05-28 Shiro Kawai * lib/srfi-60.scm: Added srfi-60 support. Most of APIs are just aliases or re-exports of Gauche's builtin bitwise operators. There are also several new APIs. * doc/concepts.texi, doc/corelib.texi, doc/modsrfi.texi: Adjusted accordingly. * test/srfi.scm: Tests for srfi-60 additional procedures. 2011-05-27 Shiro Kawai * src/extlib.stub (logand, logior, logxor): Allows zero and one argument a la SRFI-60. (integer-length): Moved here, for we now have Scm_BitsHighest* API and we can efficiently implement integer-length. * src/autoload.scm, lib/gauche/logical.scm: Removed integer-length. * src/number.c (Scm_LogNot, Scm_LogAnd, Scm_LogIor, Scm_LogXor): The argument check was incorrect (probably a leftover from the time we didn't have rationals), allowing rational numbers to passed to bignum routines, causing crash. 2011-05-25 Shiro Kawai * lib/gauche/common-macros.scm (ecase): Added CL's ecase. * src/autoloads.scm: set ecase to be autoloaded. 2011-05-18 Shiro Kawai * lib/rfc/uri.scm (uri-parse): Added a procedure to resolve relative URI. Originally written by teppey. 2011-05-15 Shiro Kawai * src/read.c (read_list_int): Fixed a bug regarding a dot followed by non-space delimiting characters. 2011-04-29 Shiro Kawai * src/compile.scm (pass1/extended-lambda): Dropped the support of obsoleted keyword argument spec (var keyword init), in favor of formally supported ((keyword var) init). The former spec was never supported officially, and the latter is supported officially since 0.9, so this change shouldn't affect the user code. * lib/gauche/cgen/precomp.scm (cgen-precompile), lib/rfc/http.scm (http-request): Changed accordingly. * src/list.c (Scm_Reverse, Scm_ReverseX), src/stdlib.stub (reverse), src/extlib.stub (reverse!): Experimentally added 2-argument reverse. The rationale: If we consider (reverse xs) == (fold cons '() xs), then definining (reverse xs tail) == (fold cons tail xs) looks a natural extension. * libsrc/srfi-1.scm (append-reverse, append-reverse!): These are effectively the same as 2-arg reverse and reverse!, so define them accordingly. * src/list.c (Scm_MonotonicMerge1), src/extlib.stub (monotonic-merge): Cleaned up API of Scm_MonotonicMerge, and monotonic-merge (the Scheme proc is undocumented; the C API is kept during 0.9.x for the ABI compatibility.) * test/list.scm, test/TESTS: Added more tests to list.scm and included it in the standard tests. * src/objlib.scm (%expand-define-method): Support extended argument specifications (:optional etc.) in define-method. 2011-04-28 Shiro Kawai * src/scmlib.scm (map*): Added. * test/procedure.scm: Added tests for map*. 2011-04-22 Shiro Kawai * src/string.c (substring): Fixed a bug that the range check didn't take byterange into account. 2011-04-21 Shiro Kawai * libsrc/file/util.scm (with-lock-file): Fixed stealing logic. 2011-04-19 Shiro Kawai * libsrc/file/util.scm (with-lock-file): Added file-based inter-process locking utility. * ext/file/test.scm: Added test for with-lock-file. 2011-04-10 Shiro Kawai * src/compile.scm (quasiquote): Added support for zero or multi- argument unquote/unquote-splicing. They are R6RS compatible. 2011-03-30 Shiro Kawai * src/compile.scm (pass3/optimize-call): Fixed a bug that may introduce infinite loop in the compiler. 2011-03-24 Shiro Kawai * ext/threads/thread.scm (atom, atomic, atomic-update!, atom-ref): Added atom, a convenience wrapper for thread-safety. 2011-03-21 Shiro Kawai * src/system.c (Scm_SysExec): Support SCM_EXEC_DETACHED flag to detach the exec'ed process from the parent's process group. Useful for starting a daemon process. * src/syslib.stub (sys-exec, sys-fork-and-exec), lib/gauche/process.scm (run-process): Support :detached keyword argument. * test/system.scm: Added tests for :detached #t. 2011-03-15 Shiro Kawai * libsrc/util/match.scm (gen): Reverting the change in 2010-05-29 to avoid exponential growth of expansion time. It turned out that the change can introduce exponential growth of compilation time in certain patterns. (We still keep the change of 2011-03-06, though). 2011-03-14 Shiro Kawai * lib/gauche/time.scm (time-this, time-these, time-these/report): Dropped with-times introduced blow, and instead added comprehensive benchmarking utilities inspired by Perl's Benchmark module. 2011-03-13 Shiro Kawai * src/compile.scm (pass1/define-inline-finish): Fixed a bug that affects inline expansion during precompilation. See the comment for the details. The code since commit d6f23ad1 (2011-03-05) until this fix should not be used to compile Gauche itself, since it yields a corrupt compiler. 2011-03-12 Shiro Kawai * lib/gauche/time.scm (with-times): Added a new procedure to treat the result of 'time' macro programatically. 2011-03-07 Shiro Kawai * src/compile.scm (pass4/lift): Set lifted $lambda name comprehensively as possible. Since lifted lambdas don't have a link to parent code, the scheme of deriving hierarchical name in Scm_CompiledCodeFullName doesn't work. Instead we give the list ( ) in each lifted $lambda node, where is the node's original name if any, or gensym'ed name. * src/main.c (cleanup_main): Fixed -pload option; the original code failed if gauche.vm.profile wasn't loaded. Since we autoload profiler-show-load-stats, we can evaluate it in the gauche module and we don't need FIND_MODULE(gauche.vm.profile). 2011-03-06 Shiro Kawai * libsrc/util/match.scm (inline-let, gen): Removed inline-let, since it does the duplicate work with Gauche's compiler. Also made length>= as a global definition instead of local, since Gauche can inline it anyway. 2011-03-05 Shiro Kawai * lib/gauche/vm/profiler.scm (entry-name): Workaround a problem when case-lambda generates an output that can't be read back. * src/gauche/vm.h, src/intlib.stub, src/main.c: Added a compiler flag -fno-lambda-lifting-pass (SCM_COMPILE_NO_LIFTING) to turn off pass4 for troubleshooting. Also renamed SCM_COMPILE_NO_PASS2OPT to SCM_COMPILE_NO_POST_INLINE_OPT, for the pass numbers can be changed (and indeed they were changed). * src/compile.scm (pass4): Revised pass4 to lift closures for obvious cases (independent, and self-recursive calls). We no longer have compile-toplevel-lambda, since a single toplevel lambda can be compiled into multiple definitions because of lifted lambdas. * src/precomp.scm (handle-define-macro): Changed not to use compile-toplevel-lambda. * lib/gauche/listener.scm (listener-read-handler): Fixed a bug that referenced undefined variable. * lib/gauche/cgen/stub.scm (process-body-spec): ditto. * ext/dbm/gdbm.scm (dbm-open), ext/dbm/ndbm.scm (dbm-open), ext/dbm/odbm.scm (dbm-open): ditto. * src/extlib.stub (method-code), lib/gauche/procedure.scm (disasm): Support disassembling generic functions and methods. 2011-02-28 Shiro Kawai * Repository moved to git. * src/system.c (time_print): Fixed display when time-second is negative. 2011-02-27 Shiro Kawai * src/string.c (Scm_StringCmp): It is supposed to return either -1, 0 or 1 if we want to use the value for generic compare, but it could return values as if only its sign matters. * src/gauche/number.h (Scm_VMExactToInexact): Fixed a bug introduced on 2010-06-19 that breaks the binary compatibility from 0.9. 2011-02-25 Shiro Kawai * lib/gauche/package.scm (get-all-version-paths): Fixed a bug that caused an error if *load-path* contains a nonexistent path. 2011-02-24 Shiro Kawai * ext/threads/threads.c (Scm_ThreadStop): Fixed a bug that prevented timeout from working. 2011-02-23 Shiro Kawai * lib/gauche/test.scm (test-one-of, test-check): Added 'one-of' type test result match. Also add optional arg to test-check so that one can customize fallback comparison procedure. * test/process.scm: Use test-one-of in checking exit status of "cat", for it differs on Solaris. Also make sure we execute the same commands of ls, cat and grep to compare the results, by finding absolute paths for them. 2011-02-22 Shiro Kawai * configure.ac: Added special handling of CFLAGS on Solaris. See http://practical-scheme.net/chaton/gauche/a/2011/02/22#entry-4d6439f9-a10fb 2011-02-18 Shiro Kawai * lib/gauche/interactive/info.scm, lib/text/info.scm: Support bzip2-ed info files. 2011-02-10 Shiro Kawai * lib/util/combinations.scm (combinations): Substituted for an optimized version written by Teranishi-san ( http://practical-scheme.net/wiliki/wiliki.cgi/teranishi ). * rfc/http.scm (with-connection, reset-http-connection): Added tentative support of persistent connection. Currently it doesn't handle the case when the server abandons the connection---we should detect it and retry. Besides, the connection should be reset if an error occurs during handling the communication. Use with care, and do not assume this is the final behavior. (receive-body): Changed the handling of the case when response size is unknown. Now we pass the receive handler #f in that case. The receive handler should read as much data as it want and need to call the retriever thunk again. The predefined *-receivers are adjusted accordingly. 2011-02-05 Shiro Kawai * lib/srfi-42.scm (%replace-keywords): Made it hygiene. The previous versions failed when the inserted srfi-42-* symbols were not imported. 2011-02-02 Shiro Kawai * src/number.c (algorithmR): Correct error estimation at the normalized/denormalized boundary. This avoids the infinite loop while reading 2.2250738585072012e-308. 2011-01-17 Shiro Kawai * lib/binary/ftype.scm, ext/binary/io.scm, ext/binary/test.scm: Splitted foreign type stuff into separate module. API naming is still undecided. 2011-01-12 Shiro Kawai * libsrc/gauche/parameter.scm (%parameterize): Fixed another bug that appear when the outer binding of a parameter object (not the value of the parameter object) is altered during execution of the body. * lib/gauche/portutil.scm (port->string, port->string-list): Fixes a bug that these procs return prematurely if the input contains an illegal octed sequence for the internal encoding. Now they return incomplete string(s). * src/stdlib.stub (numcmp): Fixed a bug that handles more than four arguments incorrectly. 2011-01-09 Shiro Kawai * src/system.c (Scm_NormalizePathname): Support '~' expansion on Windows native platform. * libsrc/file/util.scm (home-directory): Use the above feature to obtain the home directory. 2011-01-08 Shiro Kawai * lib/rfc/json.scm (construct-json): Allow optional output port, for the consistency. * lib/control/thread-pool.scm: (): Added shut-down slot. (): A new condition raised by add-job!. (thread-pool-results, thread-pool-shut-down?): External API. (add-job!): Raises if the pool is shut down. (termiante-all): Added cancel-queued-jobs keyword argument. marks executing jobs to be killed when terminating threads forcibly. 2011-01-07 Shiro Kawai * lib/control/thread-pool.scm (add-job!): Added timeout optional argument, and made the default timeout behavior from returning immediately to wait indefinitely. (wait-all): Added timeout optional argument before check-interval optional argument. THESE ARE INCOMPATIBLE CHANGES. 2011-01-06 Shiro Kawai * lib/binary/pack.scm (make-number-pack-dispatcher): Fixed a bug that used peek-char to see if input reached at end. As of 0.9.1, the return value of peek-char is unspecified if the next input is an invalid char, and the current impelemntation happened to return # in such case. * libsrc/gauche/parameter.scm: Fixed a bug that the filter procedure was called unintentionally when the old value was restored upon exitting parameterize. Also fixed another bug that appear when the parameterize body is reentered. See the added test in ext/gauche/test-parameter.scm. 2011-01-02 Shiro Kawai * src/gauche/load.h, src/gauche/vm.h, src/load.c, src/vm.c: Moved load-time dynamic environment stuff (load_history, load_next, load_port out of ScmVM structure, and manage them by the parameter slots. It is inconvenient to have these thread-specific dynamic enviornment within ScmVM, since we can't change them freely because of the binary compatibility. (We keep dummy slots in place of these slots of ScmVM during 0.9.x series for binary compatibility, though.) New APIs in load.h: Scm_CurrentLoadHistory(), Scm_CurrentLoadNext(), Scm_CurrentLoadPort(), to access these dynamic values. Also start adding SCM_LOAD_MAIN_SCRIPT flag support (not functional yet.) * src/stdlib.stub (load), src/extlib.stub (load-from-port, current-load-history, current-load-next, current-load-port): Changed accordingly. A new keyword argument :main-script is added to load and load-from-port to turn on SCM_LOAD_MAIN_SCRIPT flag during loading. * src/module.c (Scm_FindBinding): Fixed a mpl search bug reported by Ryo Akagi. This is a quick fix, and may have negative impact on Scm_FindBinding performance. Need to come back later to evaluate it. * test/module.scm: Added regression tests for the above bug. 2010-12-31 Shiro Kawai * src/compile.scm (pass4): Some more preparation of lambda lifting. The feature is not completed yet, so pass4 is basicaly no-op for the time being. 2010-12-24 Shiro Kawai * ext/binary/io.scm, ext/binary/binarylib.scm: Experimentally adding foreign struct infrastructure. API is still fluid, so do not count on the current state. * lib/gauche/record.scm (compute-get-n-set): Fixed a bug that the slot index was calculated incorrectly when inheritance was used. It didn't affect if you only uses record accessors, but it became visible when you tried to access the record with slot-ref and slot-set!. See the added tests in ext/gauche/test-record.scm. 2010-12-23 Shiro Kawai * ext/uvector/uvlib.stub.tmpl (uvector-copy!): Added generic copy procedure. * configure.ac, src/gauche/config.h.in (HAVE_LONG_LONG): Added check for long long. 2010-12-22 Shiro Kawai * src/vm.c (Scm_NewVM): Fixed not to copy vm->cstack from proto vm; they may contain a bogus stack value from a different thread. 2010-12-21 Shiro Kawai * ext/util/queue.scm (list->queue): Fixed a bug that prevented list->queue from working for any arguments. :rest arguments shouldn't have default value, since its default value is () by definition. (But it should be reported as syntax error.) 2010-12-19 Shiro Kawai * src/compile.scm: Renamed pass4 -> pass5, and created pass4 for free variable scanning for lambda lifting. free-lvars procedure is removed. (The transition isn't completed yet.) * src/vminsn.scm (LOCAL-ENV-CLOSURES): Allow literal closure to appear in the operand. 2010-12-16 Shiro Kawai * src/compile.scm (pass3/optimize-call): Fixed an optimizer bug that caused reset-lvars to be called on the same set of lvars more than once, screwing up lvar counts. See the added test in test/primsyn.scm. 2010-12-15 Shiro Kawai * lib/gauche/cgen/precomp.scm: Allow toplevel closure to be a compile-time literal. * src/vm.c (Scm_VMEval): Fixed a bug that made "eval"-ed expression to be executed under the caller's local environment, instead of toplevel environment. Compilation was done in toplevel env, so it didn't affect meaning of the program; however, closures created at runtime got unnecessary environment. * src/compile.scm: Renamed Pass 3 to Pass 4, and Pass 2p to Pass 3, since Pass 2p was actually a separate pass. 2010-12-14 Shiro Kawai * src/gauche.h (ScmBox), src/vminsn.scm (BOX), src/box.c: Added 'box' object for mutable local variable optimization. * src/compile.scm, src/vminsn.scm: Changed pass3 to use boxes for mutable local variables. * lib/gauche/regexp.scm (rxmatch-case): Allow (else => proc) form, just like 'case'. 2010-12-12 Shiro Kawai * release 0.9.1 (repackaging): The gauche-config bug will be huge annoyance, so we repackage 0.9.1. * src/genconfig.in: The directory structure change wasn't reflected in gauche-config --pkg{inc|lib}dir. * DIST (doc): Needs some tweaking. Maybe texi2html has changed. * doc/ja-init.pl: Turned off USE_UNICODE. Somehow the original code started produce incorrect encoding in the titles only I don't know if this is a correct fix, but it seems working. 2010-12-11 Shiro Kawai * release 0.9.1 2010-12-10 Shiro Kawai * src/system.c (Scm_SysExec): Honor the directory argument on Windows-native code path as well. * src/scmlib.scm: Modify *load-path* to include pre-0.9.1 directory structure for the backward compatibility. * src/makeverslink.in: Create a symlinc from libgauche.so to libgauche-0.9.so for the backward compatibility; extensions compiled for 0.9 refers to libgauche.so, and they need to be working after installation of 0.9.1. * configure.ac, */Makefile.in, src/genconfig.in: Changed library installation directory from ${datadir}/gauche to ${datadir}/gauche-${ABI_VERSION}. This is also for the consistency with architecture-dependent libraries. * test/scripts.scm: Kludge to make gauche-package work during tests without installed Gauche. 2010-12-09 Shiro Kawai * rfc/json.scm: Renamed API procedures for the consistency: ->json to construct-json (cf. rfc.cookie), the base procedures now take a port, and *-string version takes string. 2010-12-08 Shiro Kawai * src/vmcall.c: Detect the attempt to invoke a method directly without using a generic function, and make it an error. 2010-12-07 Shiro Kawai * lib/Makefile.in: Install rfc.json. * ext/peg/*, ext/Makefile.in, configure.ac: Enabled parser.peg. It is only to expose rfc.json officially. The API of parser.peg is still unofficial, and it is very likely to be changed before the final version. Do not directly use it. 2010-12-04 Shiro Kawai * test/scripts.scm, test/TEST, test/TEST2: More tests for utility scripts. It uses extension modules, so moved to TEST2. * ext/template.configure.ac, ext/template.Makefile.in, examples/mqueue-cpp/{Makefile.in,configure.ac}, examples/spigot/{Makefile.in,configure.ac}: Take care of the case when Gauche is installed under pathnames with spaces. 2010-12-03 Shiro Kawai * configure.ac, src/genconfig.in: Reverted -I and -L *not* to quote the pathnames. Since quote processing is done before parameter substitution, we cannot include quoted pathnames for the output to be used in `command` and $parameter substitutions. In fact, there's no way to have pathnames with whitespaces in it to be used with `gauche-config -I` magic. Instead, --incdirs and --archdirs options are added that returns (semi)colon-separated list of directories to be used for -I and -L option. `gauche-config -I` and `gauche-config -L` are kept for backward compatibility. * lib/gauche/package/compile.scm: Changed to use --incdirs and --archdirs instead of -I and -L, so that it can handle pathnames with spaces correctly. 2010-12-01 Shiro Kawai * libsrc/gauche/collection.scm (call-with-builder): Fixed builder that barfed about :size keyword argument. 2010-11-29 Shiro Kawai * src/read.c (read_char): Fixed a bug that recognized character names only when prefix matches, e.g. #\spa. It wasn't a design to allow arbitrarily abbreviated names. 2010-11-26 Shiro Kawai * src/main.c: We don't need event_loop here; it is more natural for Windows script to code event loop within it. 2010-11-25 Shiro Kawai * examples/windows/*: Start adding some crude examples for windows-specific scripting. 2010-11-24 Shiro Kawai * ext/windows/*, ext/configure.in, configure.ac: Added os.windows module to provide Windows specific procedures. Windows Console functions previously defined in gauche.termios are also moved here. * ext/termios/termiolib.stub, ext/termios/termios.scm: Moved Windows Conosle functions to ext/windows/console.stub. 2010-11-23 Shiro Kawai * configure.ac, src/Makefile.in: Renamed windows no-console binary to more descriptive gosh-noconsole.exe. This is something users do not type manually, so long name is ok. * src/number.c (Scm_IsInf): Added extra volatile to suppress gcc to be too clever; gcc-4.5.0 on MinGW seems to optimize away the inifinity check without this. Won't affect to platforms that provides isinf(). * src/port.c (Scm__SetupPortsForWindows): Added a hack for Windows no-console application. If Scheme program attempts to write to stdout or stderr, a new console is allocated and the output will be redirected to it. API should be reconsidered to abstract away platform-dependence. * src/main.c (main): Refactored away some platform-specific stuff from main(). * src/gauche/win-compat.h: Explicitly support Windows 2000 or later by defining WINVER before including windows.h. * src/extlib.stub (standard-*-port), src/port.c (Scm_SetStd*): Allow standard-input-port etc to be altered by the optional argument. 2010-11-22 Shiro Kawai * src/genconfig.in: Quote pathnames in -I and -L option. They may have spaces in them. Note: For other options that directly returns pathnames, it's up to the caller to properly quote them, since the tool doesn't know who is calling it. * winnt/nsis/setup.nsi.in: Adds $INSTDIR\bin to the PATH on installation. * src/main.c (init_console): Adapted to windows non-console mode. * src/winmain.c: A kludge to compile non-console binary for windows. On windows, we create gosh.exe and gish.exe, where the former is a console application and the latter is a non-console application. * configure.ac, src/Makefile.in: Changed accordingly. * winnt/nsis/setup.nsi.in: Install gish.exe as well, and create an association from .scm suffix to gish.exe---so that Scheme script starts with non-console mode by double-clicking. * winnt/nsis/Makefile, winnt/README.txt, DIST: Adapted for MinGW+MSYS build. We no longer need cygwin. Also allow Gauche-gl to be included in the installer. 2010-11-21 Shiro Kawai * src/paths.c (Scm_GetRuntimeDirectory), src/paths.h src/core.c (Scm__RuntimeDirectory), src/gauche.h, src/extlib.stub (%gauche-runtime-directory): A quick hack to expose runtime directory on limited platforms. Needed to fix gauche.config on windows. Not for general use. * src/genconfig.in (gauche-config): The gauche-config procedure in gauche.config to replace '@' prefix included in the return value, on Windows. The return value now matches what you get with the command-line version. * lib/gauche/package/util.scm (run): Fixed so that the build commands can be run on Windows (MinGW+MSYS). Now gauche-package works on it. 2010-11-20 Shiro Kawai * libsrc/file/util.scm (console-device): Added. * libsrc/gauche/parameter.scm (setter): Added generalized setter for parameters; suggested by KOGURO, Naoki. * lib/gauche/process.scm (%setup-iomap): Use sys-tmpdir to decide the location of temporary file when needed. * libsrc/file/util.scm (temporary-directory): Also uses sys-tmpdir as the default value. * src/system.c (Scm_TmpDir), src/syslib.stub (sys-tmpdir): Added for the consistent treatment of temporary directories across platforms. * src/system.c (Scm_Mkstemp): Fixed PRNG for tmp file name; the lower bits has low entropy. * lib/rfc/http.scm (http-secure-connection-available?): Exported for general use. * doc/motutil.texi (rfc.http): Officially document :secure option. * ltmain.m4, gc/acinclude.m4, gc/aclocal.m4, gc/libtool.m4: Updated. Note: now it requires autoconf-2.65 or later. 2010-11-19 Shiro Kawai * depcomp, compile, config.guess, config.sub, mkinstalldirs, missing, install-sh, aclocal.m4: Updated to catch up to the recent autotools. * src/compile.scm (pass2/check-constant-asm): Added constant folding for $asm nodes with ASSQ, ASSV, VEC-REF, VEC-LEN and NEGATE insns. If these weren't inlined to VM instructions, constant expression using these would be precomputed because corresponding SUBRs are constant function. However, inlining to VM instructions is done at pass1, where constant folding with SUBRs are done in pass2, so the compiler failed to fold constant expressions using these functions. Eventually we want some means to integrate implementation of SUBRs and optimization of corresponding $asm nodes. 2010-11-12 Shiro Kawai * lib/rfc/http.scm: Changed receiver and sender interface to make them simpler and composable. For receiver we use partial continuation to make it work like coroutine. The predefined receivers and senders are updated. * lib/control/thread-pool.scm (terminate-all!): Make force-timeout keyword arg. We might add more keyword args to tweak behavior of termination. 2010-11-11 Shiro Kawai * lib/gauche/process.scm (run-process): Added support of '<<<', '<&' and '>&' in :redirects argument. Allow uniform vector for '<<' redirection. 2010-10-15 Shiro Kawai * ext/sxml/src/sxpath.scm (sxpath): Reflected sxpath bug fix on namespace alist from upstream. Fix from teppey. * ext/sxml/test.scm: A test added for the above fix. 2010-10-06 Shiro Kawai * lib/rfc/ftp.scm (): Documented but not exported. Fix from Masatake YAMATO. * ext/sxml/src/txpath.scm (sxml:parse-function-call): Fix txpath's 'contains' operator. The upstream fix http://ssax.cvs.sourceforge.net/viewvc/ssax/sxml-tools/txpath.scm?r1=1.6&r2=1.7 Fix from teppey. 2010-09-18 Shiro Kawai * ext/srfi/srfi-19.scm (tm:leap-second-table): Updated to reflect new leap seconds. 2010-09-12 Shiro Kawai * lib/dbm/dump, lib/dbm/restore: Added utility scripts. * lib/dbm.scm (dbm-type->class): Added a utility procedure to load and use specific dbm at run-time. 2010-09-04 Shiro Kawai * src/signal.c (Scm_SetSignalHandler): Represent the status of signal handler that "Gauche does not handle the signal" by #. It used to be #f, but it is also used to represent SIG_DFL and caused an unwanted alteration of signal handlers by with-signal-handler. The original fix is provided by enami. * lib/rfc/http.scm: More rubust support of external stunnel handling for https connection. * lib/gauche/process.scm (run-process): Generalized I/O redirection handling to allow more flexible redirection, closer to shell. 2010-08-23 Shiro Kawai * libsrc/file/util.scm (home-directory): Added support for Windows. (null-device): Added. 2010-08-04 Shiro Kawai * lib/rfc/mime.scm (): Fixed typo (Patch from Hayashi Masahiro). * lib/rfc/http.scm (http-compose-form-data): Respect content-transfer- encoding keyword argument. (Patch from Hayashi Masahiro). 2010-08-01 Shiro Kawai * lib/gauche/dictionary.scm (call-with-iterator): Implemented minimum collection protocol for bimap. Need to think more about bulders and other shortcuts, but this one fills the needs for the time being. * test/dict.scm: Added bimap collection test. 2010-07-01 Shiro Kawai * lib/gauche/cgen/precomp.scm (handle-define, handle-define-macro): Escape strings in C-comment properly. 2010-06-30 Shiro Kawai * lib/gauche/numerical.scm (%exact-integer-sqrt): Fixed a bug when the given arg is too large to coerce to double. 2010-06-19 Shiro Kawai * src/number.c (Scm_Numerator, Scm_Denominator): Bug fix for inexact arguments. (Scm_Exact, Scm_Inexact, Scm_VMInexact): We're naming Scm_InexactToExact etc.; they are more concise without loss of meaning. To keep binary compatibility, shorter names are macros during 0.9.x. In 1.0 we'll switch macros and instances. * src/write.c, src/number.c, src/vminsn.scm, src/stdlib.stub, src/extlib.stub: Modified according to the above change. * lib/gauche/numerical.scm (div, mod, div0, mod0, div-and-mod) (div0-and-mod0): Added R6RS integer divisions. 2010-06-17 Shiro Kawai * lib/gauche/numerical.scm (inexact, exact, real-valued?) (rational-valued?, integer-valued?): Added for R6RS compatibiltiy. * src/stdlib.stub (rational?): Exclude +inf.0, -inf.0 and +nan.0 from the set of rational numbers. These are the only numbers that are real but not rational. * lib/gauche/numerical.scm (exact-integer-sqrt): Added. (sqrt): Revised so that it returns exact number if the argument is a square of exact real number. * src/autoloads.scm (exact-integer-sqrt): Added. 2010-06-16 Shiro Kawai * src/compile.scm (pass2/check-constant-asm): Fold numeric operation $ASMs on constant arguments. 2010-06-08 Shiro Kawai * src/write.c (write_ss_rec): Fixed an infinite recursion problem when attempting to print (cdr #1='#1#). 2010-06-07 Shiro Kawai * ext/template.DIST: Exclude .git from being included to distribution tarball. 2010-05-29 Shiro Kawai * libsrc/util/match.scm (gen): For certain patterns, this function can be called exponential times, taking very long for expansion. This fixes exponential expansion time by avoiding calling gen on the same patterns. 2010-05-28 Shiro Kawai * lib/rfc/http.scm (http-request): Committing tentative SENDER protocol. NB: I'm going to try a different protocol, so take this version with a grain of salt. * ext/uvector/uvlib.stub.tmpl (uvector-size): Allow start and end optional arguments, for the consistency with write-block. Also documented this function. 2010-05-26 Shiro Kawai * lib/rfc/http.scm (http-request): Revised RECEIVER protocol; now it takes the total response size in the third arg. It allows the retriever to track the progress. 2010-05-23 Shiro Kawai * lib/rfc/http.scm (http-request): Changed main API of rfc.http. High-level APIs are consolidated to http-request, instead of having separate calls for each request method, since method is often parameterized. SINK and FLUSHER arguments to handle response is deprecated and superseded by RECEIVER argument for flexibility. 2010-05-19 Shiro Kawai * lib/gauche/parseopt.scm (build-option-parser): Let let-args raise an error of condition type for invalid arguments, so that the program can capture this particular type of runtime error. 2010-05-13 Shiro Kawai * src/compile.scm (define-syntax, let-syntax, letrec-syntax) (syntax-rules, pass1/eval-macro-rhs): Generalize syntactic binding as evaluating rhs in compile-time environment. The syntactic keyword is bound to the resulting macro transformer. This is the first step to open up variations of macro transfomers other than syntax-rules. Now syntax-rules are implemented as first-class compile-time syntax, and eventually will become just one of ordinary macro transformers. (compile): Enable to take CENV as the second argument. (pass1): Adjusted to expect resolution of local syntactic bindings be #. This happens when let-syntax etc. are used to add aliases, e.g. (let-syntax ((xif if)) (xif ...)). * src/macro.c (Scm_CompileSyntaxRules): allow NAME to be #f for it may be so when syntax-rules is used stand-alone. * src/intlib.stub (syntax?): Added. Note: The name syntax? may be renamed, for it is confusing with syntax-case's use of "syntax". * src/port.c (Scm_MakePortWithFd): Set seeker if the given fd is seekable. For example, Scm_SysMkstemp calls this function on an fd associated to a file, so it is natural to be seekable. OTOH, sys-pipe passes pipe fd, which isn't seekable. * src/objlib.scm (ref, (setter ref)): Added generic slot reference with fallback, and setter to list, for consistency. Patch from Masatake YAMATO. 2010-05-12 Shiro Kawai * ext/net/netaux.scm (make-server-sockets): If the system defaults v6 sockets to be dual-stack (i.e. IPV6_V6ONLY is off by default), the current strategy fails since v6 socket tries to bind both v4 and v6 addresses. The default is system-dependent, so we adopt a heuristic: First we bind v6 addresses, and then we try v4 ones; if v4 one fails with EADDRINUSE, we just ignore it. 2010-05-11 Shiro Kawai * src/vm.c (POP_CONT): fixed a bug that refers wrong pointer. * src/port.c (register_buffered_port): Fixed a race condition accessing the active port vector. Pointed by enami. * src/vm.c (user_eval_inner, Scm_VMCallPC): src/intlib.stub (%call/pc): lib/gauche/partcont.scm: Experimentally added partial (delimited) continuation support. A partial continuation is marked by ep->cstack == NULL. Its 'root' is cut by %call/pc. It is executed on the cstack where it is invoked. When execution of a partial continuation ends, popping continuation frame yields vm->cont == NULL, which caused run_loop() to return to user_eval_inner, which in turn hands the control over the latest continuation delimited by reset(). Note that reset() operator is simply Scm_VMApplyRec0---user_eval_inner implicitly delimits the continuation. No partial continuation frames should include c stack frames in it. 2010-05-10 Shiro Kawai * src/vm.c (user_eval_inner, throw_continuation): Allow execution of "ghost continuations", the continuations whose dynamic extent of C stack is effectively expired. For example, if a continuation is captured within the callback function from C, and the callback has already returned to C, then the continuation becomes a ghost. Ghost continuation cannot return to C at its bottom, for it is not allowed in C to return from already expired stack frame. We used to raise an error when ghost continuation is invoked. However, the Scheme portion of a ghost continuation is still effective and executable. This change allows a ghost continuation to be executed on the current C stack. If the continuation tries to return to C, an error is signalled. 2010-05-04 Shiro Kawai * src/char.c (Scm_CharSetComplement): Fixed to handle complement correctly for the cases that the range touches the lower bound, or the range has one-character gap. 2010-05-03 Shiro Kawai * ext/util/queue.scm (any-in-queue, every-in-queue): added. * lib/gauche/common-macros.scm (unwind-protect): Allow multiple handlers, as in CL. * src/module.h (origin, prefix): Added these slots to support wrapper module with prefix. Modules are not statically allocated, so this shouldn't affect ABI. * src/module.c (Scm__MakeWrapperModule): An implicit module inserted to support prefixed symbols. This obsoletes the change on 2009-09-23, using module and prefix pair in the import list. (Scm_FindBinding): Consider prefix from the wrapper module Dropped support of (# . prefix) in the import list. (Scm__InitModulePost): Made module information visible as slots. We should call Scm_InitStatiClassWithMeta in module.c, but that needs to be done after the class system is initialized. Scm__InitModule needs to be called before Scm__InitClass, so we need another initialize function, which is called after Scm__InitClass. * src/core.c (Scm_Init), src/class.c (Scm__InitClass): Changed accordingly. * src/compile.scm (process-import): Support :rename. Rewrote :only and :except support to use wrapper modules. 2010-05-02 Shiro Kawai * lib/control/job.scm, lib/control/thread-pool.scm: Added. * test/TESTS2, Makefile.in, src/Makefile.in: Set up some tests to be run after ext/* tests. * test/control.scm: Added. * ext/util/queue.scm (mtqueue-room): Added. 2010-05-01 Shiro Kawai * ext/net/test.scm: Fix test failure on ipv6 enabled host. * src/gauche-init.scm (use): Allow options that can be passed to import. * doc/modgauche.tex (gauche.mop.propagate): Made it officially documented. * lib/gauche/mop/propagate.scm: Enable initialization of propagated slot via init-keyword. 2010-04-30 Shiro Kawai * src/compile.scm (pass1/define, pass1/lambda): Defines R5RS version and Gauche version of define and lambda separately; Gauche version supports extended formals, R5RS version not. For those who want vanilla versions for whatever reason, say (extend scheme). 2010-04-25 Shiro Kawai * src/compile.scm (pass1/define-inline): Revamp inlining mechanism of lambdas with closed environment. The new scheme doesn't require separate form such as %inlinable-lambda. I check in the current state, which works on basic cases but needs more refinement for the practical cases. This change shouldn't affect the existing valid code (that is, the path to inline lambdas with no closed enviornment isn't changed). Also reverting the change on 2010-03-28 about the packed information of inlinable procedure (the info in $lambda-flag). With this new scheme we can just use packed IForm; no need to keep extra info. * src/intlib.stub (%insert-binding): Allow optional flags. 2010-04-21 Shiro Kawai * ext/bcrypt: Change module name from gauche.bcrypt to crypt.bcrypt, for it represents the module better. 2010-04-20 Shiro Kawai * src/Makefile.in: Re-adding $(LIBS) to link gauche-config, for it is needed on mingw. 2010-04-19 Shiro Kawai * configure.ac, src/gauche/config.h.in: Added GNU/kfreebsd and GNU/Hurd support. Patch from NIIBE Yutaka. * lib/gauche/treeutil.scm (tree-map-map, tree-map-for-each): Added. * src/autoloads.scm, doc/corelib.texi: Modified accordingly. * src/Makefile.in: Fix linking gauche-config; patch from Debian build, by YAEGASHI Takeshi. * configure.ac: Support for arm-unknown-linux-gnueabi and arm-unknown-linux-gnulp architecture. Patch from NIIBE Yutaka. * src/number.c (Scm_NumLE, Scm_NumLT, Scm_NumGE, Scm_NumGT): Added these APIs that handles NaN properly. Scm_NumCmp alone is not suitable to handle comparison involving NaNs. * src/number.h: ditto. * src/vminsn.scm ($w/numcmp): Use above APIs to handle NaNs. * src/stdlib.stub (=, <, <=, >, >=): Use above APIs to handle NaNs. * test/number.scm: Added tests of numeric comparison involving NaNs. * src/gauche/float.h (SCM_HALF_FLOAT_IS_NAN, SCM_HALF_FLOAT_CMP): Recognizes and handles NaN bitpattern of ScmHalfFloat. * src/vector.c (compare_f16vector): ditto. * ext/uvector/test.scm: Added tests for uvector comparison. 2010-04-18 Shiro Kawai * src/gauche/vector.h (struct ScmVectorRec): The 'size' field must have the same length as ScmObj, otherwise vector literals allocated in ScmObj[] by precompiler doesn't work on big-endian machines. Patch from Stephen Lewis. 2010-04-13 Shiro Kawai * lib/srfi-98.scm, lib/Makefile.in: Added srfi-98 support. * src/core.c: Made cond-expand aware of srfi-98, srfi-99. * doc/concepts.texi, doc/corelib.texi, doc/modsrfi.texi: srfi-98. 2010-04-11 Shiro Kawai * src/compile.scm (dynamic-wind): Fixed a bug that leaves lvar's refcounts wrong after inline transformation. 2010-04-08 Shiro Kawai * src/vm.c (save_env): Revised the previous fix to make it clearer, based on the analysis of NIIBE Yutaka. 2010-04-07 Shiro Kawai * src/vm.c (save_env): Avoid copying ScmEnvFrame header as an array of ScmObj*. Doing so apparently violates the strict aliasing rule and results unintended compilation on some architectures (gcc on ia64 confirmed). Patch contribution from NIIBE Yutaka. 2010-03-30 Shiro Kawai * doc/*.texi: Moved 'coding: utf-8' to the end of the file, since texinfo-multiple-files-update seems to blindly assume the first line of a file is a node command. 2010-03-28 Shiro Kawai * src/compile.scm (pass1/inlinable-lambda, pass1/expand-inliner etc): Changed inlining info in $LAMBDA node to allow closed lvars plus future extensions, from a simple vector of packed IForm. Changed places that uses info, though currently they only deal with the case that no lvars are closed. This affects the dumped format of precompilation; the old format is still recognized and supported, but will be dropped in the next major release. 2010-03-25 Shiro Kawai * lib/gauche/record.scm: Added support of vector-backed pseudo record. The procedure returned by rtd-accessor has a setter if the field is mutable. 2010-03-22 Shiro Kawai * libsrc/util/match.scm: Fixed a bug that caused match-let* fail (required identifiers are not defined). 2010-03-09 Shiro Kawai * src/compile.scm (iform-copy): Fixed a bug that yielded a wrong optimization when flagged closure is inlined. Thanks to Michael Campbell for the detailed report. 2010-02-27 Shiro Kawai * lib/www/cgi.scm (get-mime-parts): Fixed a bug that didn't parse option values in content-disposition header are unquoted. * ext/threads/threads.scm, ext/threads/Makefile.in: Integrated thrlib.stub into threads.scm. 2010-02-24 Shiro Kawai * src/gauche/vm.h, src/vm.c, src/gauche/pthread.h, src/gauche/uthread.h: Abstract thread handle type as ScmInternalThread. 2010-02-23 Shiro Kawai * src/gauche/win-compat.h (struct timespec), src/system.c (nanosleep): Added nanosleep emulation on Windows. * src/syslib.stub (sys-nanosleep): Enable on windows as well. 2010-02-23 Shiro Kawai * most sources: Removed $Id...$ from most of the sources. We have moved away from CVS, so it is no longer relevant. It may even cause confusion, since it's not updated anymore. (It is left to the source taken from outside; in which case the line shows which version we've taken from). * ext/util/queue.scm (with-mtq-mutex-lock): Made mutex locking cancellation safe. 2010-02-22 Shiro Kawai * src/regexp.c (rc1_lex_minmax): Changed to treat re{,M} as re{0,M} in the regexp parser, which is compatible to Oniguruma. This is, strictly speaking, an INCOMPATIBILE CHANGE; the previous version is compatible to Perl, which makes {,M} to match the string literally. It should be written \{,M} now. * lib/gauche/fileutil.scm (make-glob-fs-fold): Fixed a bug in glob that fails if an intermediate directory in the fully-specified path is searchable but unreadable. * src/gauche/regexp.h, src/regexp.c: Added 'ast' field in ScmRegexp to save parsed AST. * lib/gauche/regexp.scm (regexp-unparse): An utility to reconstruct string representation of regexp from AST. * src/extlib.stub, src/scmlib.scm (regexp->string): Changed regexp->string so that if the 'pattern' field of ScmRegexp is #f (i.e. the regexp is directly created from AST), it uses regexp-unparse to reconsturct the string representation. The constructed string is set to the 'pattern' field so that the subsequent call of regexp->string will use it. * src/autoloads.scm: Mark regexp-unparse autoload. 2010-02-21 Shiro Kawai * lib/rfc/http.scm (request-response): Exclude keyword arguments for the receiver from request headers. * src/scmlib.scm (delete-keywords, delete-keywords!): Added. 2010-02-20 Shiro Kawai * src/char.c (charset_print): Fixed char-set writer that violated read/write invariance if the set includes '^' as the first character. 2010-02-19 Shiro Kawai * test/system.scm: Exclude sys-wait test on cygwin, since sigmask doesn't seem to work reliably on cygwin 1.7. * INSTALL.in: switched to utf-8. 2010-02-12 Shiro Kawai * src/system.c: Do not treat '\\' as a directory separator on non-windows platforms (On GAUCHE_WINDOWS, we still treat both '/' and '\\' as a separator.) 2010-02-06 Shiro Kawai * src/objlib.scm (slot-pop!): Added for the consistency with other *-push!/pop! API pairs. * src/treemap.c (core_bound), test/treemap.scm: Fixed a bug that tree-map-pop-min! didn't update num_entries. Patch from Masatake YAMATO. 2010-02-05 Shiro Kawai * doc/*.texi: Switched from euc-jp to utf-8. * doc/extract: Changed accordingly. * doc/gauche-install.1.in, doc/gauche-package.1.in, doc/gauche-cesconv.1.in: Added these manpages based on the ones provided by Jens Thiele. * doc/gosh.1.in, doc/gauche-config.1.in: Updated. * configure.ac: Changed to process the added manpages. 2010-02-02 Shiro Kawai * ext/util/queue.scm (enqueue/wait! etc.): Implemented synchronizing operations. * ext/threads/test.scm: Added tests of interacting between threads using mtqueue. * doc/modutil.texi: Extended descriptions of util.queue. 2010-01-21 Shiro Kawai * libsrc/gauche/collection.scm, lib/gauche/mop/instance-pool.scm: Remove dependency to util.queue; it caused build problem. * ext/util/queue.scm, lib/util/queue.scm: Rewrote util.queue partly using C, in order to support thread-safe queue efficiently. * ext/util/Makefile.in, ext/Makefile.in, test/util.scm, ext/util/test.scm: Changed accordingly. 2010-01-18 Shiro Kawai * lib/rfc/http.scm: Experimentally added https support, using stunnel as an external agent to handle SSL. Pass :secure #t to http-get etc. Needs more test to become 'official'. (Current problem: There seems to be no way to get erroneous condition in stunnel side). 2010-01-17 Shiro Kawai * src/objlib.scm, lib/gauche/procedure.scm, src/autoloads.scm, lib/gauche/experimental/ref.scm (~): Integrated '~' into the core (currently autoloaded from gauche/procedure.scm). Now it's officially supported. 'ref*' became an alias of '~', but it's only for the backward compatibility and will fade out. * doc/corelib.texi (Combinators): formally account '.$' as an altenative name of 'compose'. 2010-01-16 Shiro Kawai * src/compile.scm (transparent?/rec): Treat $GREF of inlinable bindings as referentially trasparent. 2010-01-15 Shiro Kawai * src/link-dylib: Adjust install_name according to the ABI version (patch from Tatsuya BIZENN). * src/compile.scm (pass1/define-inline, pass1/inlinable-lambda): Factored out the part to save intermediate IForm to $lambda node. This is to prepare for further aggressive inlining. * lib/gauche/record.scm: Added srfi-99/srfi-9 compatible record type. * src/class.c (Scm__AllocateAndInitializeInstance), src/objlib.scm (%make-record,%make-recordv,%record-ref,%record-set!): Auxiliary internal procedures to support record type efficiently. * lib/srfi-9.scm: Just extend gauche.record. 2010-01-10 Shiro Kawai * ext/Makefile.ext.in (GAUCHE_ARCHDIR etc): Reverted not to use gauche-config, for it caused problem on MinGW, on which gauche-config returns a pathname relative to the executable. 2010-01-09 Shiro Kawai * doc/coresyn.texi: officially document extended lambda formals, ^, and ^c. * src/compile.scm (pass1/extended-lambda): If :optional spec is given but not :key nor :rest, and given arguments exceeds maximum number of optional arguments, signals an error. It is consistent to SUBR with :optional args, and also to Common Lisp. NB: The error message needs to be improved. Thinking to change that when we adopt better compilation strategy for optiona arguments. 2010-01-08 Shiro Kawai * src/scmlib.scm (let-keywords*): Grace period expires; raises an error if unknown keyword is given (see 2007-01-21). 2010-01-07 Shiro Kawai * src/scmlib.scm (let-keywords, let-keywords*): Allow single variable without default value, for the consistency with let-optionals*. * lib/gauche/common-macros.scm (^ ^a ...), lib/gauche/experimental/lamb.scm, src/autoloads.scm: Moved ^ and ^x macro from experimental to built-in. * src/autoloads.scm: Allow multiple symbols in :macro entry, for conciseness. 2010-01-05 Shiro Kawai * libsrc/file/util.scm (temporary-directory): Make this a parameter, for sometimes it is useful to change the temporary directory. * src/compile.scm (pass1/open-include-file): Check the platform at run-time instead of compile-time, since compile.scm is likely to be pre-compiled on a machine different from the one actually runs it. * src/genconfig.in: Use unique name for temporary file to avoid race condition when make is run in parallel. 2010-01-04 Shiro Kawai * configure.ac, */Makefile.in, src/genconfig.in, src/makeverslink.in, src/gauche/config.h.in: Adopted the new installation directory strcture to keep binary compatibility for the same ABI version. Bumped to 0.9.1_pre1. * src/scmlib.scm: Added a temporary workaround to use extension modules compiled for 0.9 to work with 0.9.x series. * Gauche.spec: Fix rpm build problem caused by missing micro version. This is peculiar to the new minor version up; remember to revert it upon 0.9.1 release. 2010-01-03 Shiro Kawai * ext/bcrypt: Added crypt_blowfish binding. We chose to include it in the main distribution instead of providing it as an external package, in order to encourage users to use a modern password hashing scheme rather than relying on crypt(3) or rolling their own. 2009-12-30 Shiro Kawai * src/compile.scm: (id->bound-gloc): Refactored. (cenv): Added 'source-path' slot to support include. (pass1/body): Factored out the recursive parts as pass1/body-rec. (syntax/include): Added 'include'. 2009-12-29 Shiro Kawai * src/scmlib.scm (current-load-path): Added. It is going to be more reliable and convenient to obtain the path than via current-load-port. * src/compile.scm (dynamic-wind): Added builtin inliner for dynamic-wind. This expansion uses PUSH-HANDLERS and POP-HANDLERS instructions. 2009-12-28 Shiro Kawai * src/compile.scm (pass2p/precompute-constant): Support the case when the precomputation procedure returns multiple values (for now, we give up optimization if the proc returns more than one value. will be fixed in future.) 2009-12-22 Shiro Kawai * src/vminsn.scm (PUSH-HANDLERS): Fixed: the order of arguments is reversed; "before" comes first (hence in the stack) and "after" follows (hence in VAL0). 2009-12-21 Shiro Kawai * src/compile.scm (pass1/call): Expand immediate lambda here, too, for such a form can appear as a result of macro expansion. Elimiating lambda here helps later pass to optimize clsures. 2009-12-16 Shiro Kawai * src/vmcall.c: Pass the actual # of args in the stack via VAL0 to Scheme-defined procedures/methods. This info will be used for efficient optional argument handling. * src/intlib.stub (gloc-ref, gloc-bound?): Fix a bug that gloc-ref potentially leaks out # to the Scheme world. Now gloc-ref raises an error if it doesn't have a binding. You can give a fallback value to avoid an error. Also provides gloc-bound? to check if the gloc has a value. * src/compile.scm: Changed accordingly to avoid dereferincing unbound glocs. * src/compile.scm (pass2p/optimize-call): Added some heuristics to deduce result of built-in predicate from what we know about its argument. (lvar-const-value): Factored out the common usage to get initval of lvar if it is a constant binding. 2009-12-15 Shiro Kawai * lib/text/parse.scm: Rewritten to take advantage of the new compiler optimization. * libsrc/srfi-13.scm: Avoid creation of closure by %get-char-pred. * ext/sxml/sxml-ssax.scm.in, ext/sxml/trans.scm, ext/sxml/adaptor.scm: Make some global bindings constant so that the compiler can perform more optimization. * src/gauche.h (ScmProcedure): Added 'constant' bit. See the comment for the details. (SCM_DEFINE_SUBRX): A new macro to specify 'constant' bit. This macro is mainly for autogenerated C code. Other procedure initializer macros are adjusted accordingly. * src/proc.c (proc-constant): Added accessor for 'constant' bit. * lib/gauche/cgen/stub.scm (define-cproc): Added a support for flag :constant, that turn on the constant bit of SUBR and make the SUBR inlinable. This allows the compiler to precalculate constant values using buiting procedures. * src/stdlib.stub, src/extlib.stub: Added :constant flags to cprocs when applicable. * src/compile.scm (pass2p/optimize-call): Enables constant folding involving procedures marked as 'constant'. (pass2, pass2p/$IF, pass2p/optimize-call): If IForm structure is changed significantly during pass2 post, repeat pass2 post again for further optimization. (pass2, compile-p2): Added dump? argument for troubleshooting. (initval-list-cdr): Fixed a bug that creates invalid $LIST node. (%attach-inline-er-transformer): Preserve inliner info attached by define-inline, so that we can set a compiler macro on procedures defined by define-inline. (pp-iform): Include identifier's module info. * src/intlib.stub (identifier-module): Removed after all. Speed is no so critical, so we can use (slot-ref id 'module) instead. 2009-12-14 Shiro Kawai * src/scmlib.scm (let-optionals*): Improved not to emit unnecessary code to advance a pointer in the last of optional argument. * src/compile.scm (pp-iform): Slightly changed output format for better readability. (pass2/$IF, pass2p/$IF): Moved $if-$it optimization to the pass2p, for it won't affect main pass2 optimization, but it introduces shared node and makes later pass cumbersome. (pass2/$ASM, pass2p/$ASM, pass2/check-constant-asm): Perform $ASM-node constant folding in pass2 main as well. This benefits other pass2 main optimization. (reset-lvars): Re-adjust lvar reference count after pass2 main, for the pass may prune subtree from IForm. (pass2p/$CALL): Another call optimization. At this point we know a lot about $CALL node, so we can perform some more optimization. (pass2p/$SEQ): Eliminate dead code if we know it is safe to do so. * src/intlib.stub (identifier-module): Added to be used in pass2p/inlinable-gref? in compile.scm. 2009-12-13 Shiro Kawai * src/compile.scm (unpack-iform): Recover lvar's initvals after unpacking. Missing initvals prevented some optimizations. (transparent?): Check circular/shared reference of $LABEL node. (pass2p): Passing labels table to avoid recursing into circular/ shared $LABEL node. * src/main.c (-fno-post-inline-pass), src/gauche/vm.h (SCM_COMPILE_NO_PASS2POST), src/intlib.stub (vm-compiler-flag-no-pass2-post?), src/compile.scm (pass2): Added a new compiler flag to skip post-pass2 optimization, mainly for troubleshooting. * src/intlib.stub (vm-compiler-flag-noinline-locals?): Bug fix: Missing 'result' caused this function always return false. * src/compile.scm (transparent?): More sophisticated check to see if we can safely move around or eliminate subtree of IForm. (pass2/remove-unused-lvars): If an lvar became unused and its initval is transparent, we eliminate the initval expr (previously we only eliminate if initval is $const or $lambda). (pass2p/$IF): If the test becomes a constant due to prior optimization, expands then or else node directly. (pass2p/$ASM): Partially evaluate some assemblers if we know enough about the arguments. 2009-12-12 Shiro Kawai * src/compile.scm (pass2/local-call-embedder): Bug fix: It could generate an embed $call node without inserting $label node in its child's $lambda. Pass3 assumes there's always a $label node, thus fails in such a case. This bug has been covered by the another bug fixed below: (pass2/remove-unused-lvars): Bug fix: It didn't decrement lvar ref count when $lref is removed from the inits of the $let. This didn't cause a malfunction but caused slightly inefficient code, and covered up the aforementioned bug. ($const?, $lref?, $it?): Added for conciseness. (pass2p/$CALL): Do not recurse if the call is marked 'jump, since its body is shared by other call nodes. * src/scmlib.scm (every), libsrc/srfi-1.scm: Make 'every' built-in, for it is used in compile.scm now. * src/compile.scm (adjust-arglist): Emit ($CONST ()) for the restarg instead of ($LIST). This allows further constant elimination. (pp-iform): Fix missing close paren in $LIST, $LIST* and $VECTOR branch. Also replaced ';' by ':' for Emacs-friendliness. (pass2): Introduced extra pass after pass2 to do further optimizations that are made available by closure optimization. When closures are inlined, we have a good chance to partially evaluate the original body, since some of the provided arguments can be constants. 2009-12-11 Shiro Kawai * lib/gauche/procedure.scm (make-dispatcher): Attach a compiler macro to case-lambda so that if we know # of args at the call site we can skip dispatcher. * src/compile.scm (%attach-inline-er-transformer) (%bind-inline-er-transformer), src/intlib.scm (%mark-binding-inlinable!), src/scmlib.scm (define-compiler-macro): Added tentative compiler- macro API. This is still a kind of stub; don't expect it to work universally (esp. it is unlikely to go well with precompilation.) * ext/uvector/uvutil.scm: Adjusted TAGvector-ref expander to the above API. * src/gauche/gloc.h, src/gloc.c (Scm_GlocInlinableSetter, Scm_GlocMark): Laying out the base to support proper inlining behavior. * src/module.c (Scm_MakeBinding): Added support of inlinable bindings. * src/compile.scm (pass1/define-inline, pass3/$DEFINE): Ditto. Define-inline will create an inlinable binding. * src/vminsn.scm (DEFINE): Support creating inlinable bindings. * lib/gauche/cgen/stub.scm (cgen-emit-init, variable-parser-common): Add inlinable flag to the bindings of cprocs inlinable to vm insn. * src/intlib.stub (gloc-inlinable?): added. 2009-12-10 Shiro Kawai * src/gauche/module.h, src/module.c (Scm_MakeBinding): A generic API to insert global binding. Eventually it will supersede Scm_Define. * src/stdlib.stub (+, *): Fixed these by removing SCM_NUMBERP checks, since they should be handled in Scm_Add and Scm_Mul. It can be legal to pass non-numbers to them, because of object-+ and object-* hooks. (This bug haven't surfaced easily, since inlied version of '+' and '*' handles it correctly.) 2009-12-09 Shiro Kawai * src/intlib.stub (make-case-lambda-dispatcher): Put the dispatch vector in the procedure info, so that disasm and other introspection routines can dig into the body of the case-lambda. The format in which the info is stored is tentative and may be changed later. * lib/gauche/procedure.scm (disasm): Allow disassembling case-lambda, using the info available by the above change. 2009-12-04 Shiro Kawai * src/gauche/bytes_inline.h: Added swap_*_t for the union types commonly used in the swapping operations. * ext/binary/binary.c: Changed to use above types. * ext/uvector/uvector.c.tmpl, ext/uvector/uvector.h.tmpl, ext/uvector/uvectorP.h, ext/uvector/uvgen.scm, ext/uvector/uvlib.stub.tmpl: Changed uvector-swap-bytes and uvector-swap-bytes! to deal with ARM's mixed endian, by taking optional argument. Also changed read-block! and write-block to deal with ARM mixed endian, and obey default-endian parameter if endian argument is omitted. 2009-11-30 Shiro Kawai * src/gauche/bytes_inline.h, src/binary.c: Factored out byte swapping macros. * src/core.c (Scm_Init), src/parameter.c (Scm__InitParameter): Removed InitParameter, since all we need is statically initialize mutex. This alleviates headache of ordering Scm__Init* routines to satisfy dependencies. * ext/binary/binary.c, src/number.c, src/gauche/number.h (Scm_DefaultEndian, Scm_NativeEndian, Scm_SetDefaultEndian): Move the default-endian parameter from to the core, for it will be used in all binary i/o consistently. binary.c reflects the change below to check ARM_LITTLE_ENDIAN at runtime. * ext/binary/binary.h, ext/binary/io.scm: changed accordingly. * src/extlib.stub (native-endian): added. * src/parameter.c (Scm_ParameterSet): Make it return the previous value, for the consistency to Scheme-level parameter behavior. 2009-11-29 Shiro Kawai * src/gauche/float.h: Moved ScmIEEEDouble definition to src/number.c. Since ARM's double endian needs special care, it's no longer casually usable. * src/number.c (check_armendian): On ARM, checks double's endian at runtime. (decode_double, Scm__EncodeDouble): Enclose ARM special handling in these. (Scm_DecodeFlonum, Scm_DoubleToHalf): No longer touches ScmIEEEDouble directly. * src/bignum.c (Scm_BignumToDouble): No longer touches ScmIEEEDouble directly. * configure.ac, src/gauche/config.h.in: Comment adjusted to reflect above changes. 2009-11-28 Shiro Kawai * ext/sxml/Makefile.in (SCMCOMPILE): Needs to add "provide" expr in command line, since we removed explicit provides, but autoprovide doesn't work in this particular case. * src/gauche.h (SCM_ALIGN8): Constrains some Scheme objects to be aligned in 8-byte boundary using __attribute__. See the comment for the details. * Many files: Removed (provide "...") idioms, for it is no longer necessary with the autoprovide feature. * lib/rfc/822.scm (date->rfc822-date): Added the reverse operation of rfc822-date->date for the convenience. 2009-11-25 Shiro Kawai * lib/rfc/http.scm (request-response): When server returns status code 204 or 304, we should not try to retrieve the message body, otherwise the function hangs waiting for the body. 2009-11-23 Shiro Kawai * lib/gauche/cgen/literal.scm, lib/gauche/cgen/literal-uv.scm: Merged literal-uv.scm into literal.scm. 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