2023-10-11 Shiro Kawai * Release 0.9.13 2023-10-07 Shiro Kawai * Rename gauche-default-encoding -> default-file-encoding 2023-10-05 Shiro Kawai * src/char.c (Scm_DefaultEncodingName, gauche-default-encoding), src/libio.scm (open-input-file, open-output-file), ext/charconv/convaux.scm (%open-input-file/conv), (%open-output-file/conv): Add support fo gauche-default-encoding, the encoding to be used when no :encoding option is given when performing I/O. https://github.com/shirok/Gauche/issues/944 2023-10-04 Shiro Kawai * src/core.c (init_cond_features): Define feature identifier 'full-unicode' only when Gauche is compiled with utf8 encoding. 2023-10-03 Shiro Kawai * src/gauche/priv/writerP.h (SCM_WRITTEN_ELLIPSIS): Revert using Unicode ellipsis to three dots for truncated output. Windows terminals may not be able to handle Unicode ellipsis (U+2026) depending on the OS default codepage, and it triggers an error. 2023-10-01 Shiro Kawai * lib/rfc/json.scm (print-instance): If :json-name slot definition option is #t, use slot's name as the key. 2023-09-26 Shiro Kawai * libsrc/text/console.scm, lib/text/console/windows.scm: Allow console to cache screen size. query-screen-size may return cached results, unless the optional clear-cache argument is true. reset-terminal clears the cache so that next query-screen-size takes the actual screen size. * libsrc/text/line-edit.scm: Consider screen size to show completion candidates. The screen size may be cached, but updetad by refresh-display. 2023-09-24 Shiro Kawai * src/libexc.scm, src/libthr.scm: Expose thread exception API from gauche.threads module to match the document. It was defined in gauche module before, but that doesn't make sense. * src/liblazy.scm (make-promise), lib/r7rs-setup.scm: Move R7RS make-promise into scheme.lazy, and make built-in make-promise compatible to SRFI-226. This is technically an incompatible change, but we've only documented make-promise under scheme.lazy, so no code should be affected. 2023-09-22 Shiro Kawai * lib/srfi/226/parameter.scm (parameterize-srfi-226): If you use srfi.226, 'parameterize' is strictly limited to the srfi-226 compatible parmeters. 2023-09-20 Shiro Kawai * lib/gauche/cgen/literal.scm (literal-value=?): Optimized. * src/port.c: Reduce overhead of string port creation. A significant one is to omit registering finalizers, for they're not needed for string ports. Also a couple of micro-optimizations. 2023-09-19 Shiro Kawai * src/parameter.c: Fix semantics of thread parameter. To conform SRFI-226, mutation of dyncamically bound thread parameter shoudln't be visible from other threads. Thus we need a fresh thread local for every dynamic scope. On the other hand, legacy parameters only requires thread locals for the global scope. * src/threadlocal.c: Allow thread locals to be GC-ed and reused. Each thread local storage keeps 'generation' along its value. The generation is incremented when a thread local is GC-ed. The next thread local which happens to use the same slot has a different generation, so it can detect the slot is uninitialized, even its value is not SCM_UNBOUND. 2023-09-14 Shiro Kawai * src/proc.c (proc_print): Allow a procedure to have a custom printer. Scheme abstracts some kind of special constructs as proceudres, e.g. parameters and continuations. It is nice if we have a specialized printer to display info specific to such construct, rather than the generic procedure printer which can only show procedure-info. 2023-09-13 Shiro Kawai * src/write.c (write_object_fallback): If base class has print() function pointer and derived class doesn't have write-object method, we use base class's print() func instead of the default printer. 2023-09-12 Shiro Kawai * src/parameter.c, src/libparam.scm (make-legacy-parameter): Added. See https://github.com/shirok/Gauche/issues/935 2023-09-10 Shiro Kawai * libsrc/gauche/process.scm (do-process): Add :exit-code option to :on-abnormal-exit keyword arg https://github.com/shirok/Gauche/issues/928 2023-09-09 Shiro Kawai * libomega.scm: Add additional report for unbound variable error - list modules that exports the name. It may help the user to import necessary module. 2023-09-08 Shiro Kawai * libexc.scm, libomega.scm: Rename report-mixin-condition to report-additional-condition, so that non-mixin condition can also have customized error report. 2023-09-07 Shiro Kawai * src/error.c (Scm_MakeUnboundVariableError): Let evaluator throw error for unbound variable. 2023-09-06 Shiro Kawai * lib/tools/docprep: Renamed from preprocess-info. The plan is to make it handle common doc preparation tasks. 2023-08-31 Shiro Kawai * lib/tools/get-cacert: Moved from ext/tls/tls/get-cacert.scm, for it's a runnable tool. * tools/preprocess-info: Support '@c DEPRECATED' to mark deprecated APIs. 2023-08-29 Shiro Kawai * src/port.c, src/gauche/priv/portP.h: Fix the issue that port finalizer causes access to already collected object. It was the cause of https://github.com/shirok/Gauche/issues/900 Note that a custom port's flusher and closer are no longer called from the port finalizer if the custom structure is already collected. If the custom port requires guaranteed cleanup, it should attach its own finalizer to the custom port's heap allocated object. In general, port's finalizer should be regarded as a fail-safe mechanism, and explicit closing is recommended. 2023-08-27 Shiro Kawai * ext/gauche/bitvector.scm (bitvector-pad, bitvector-pad-right): Fix to handle the case length argument is smaller than the length of the given bitvector. For the consistency with string-pad, the bitvector should be truncated. https://github.com/shirok/Gauche/issues/922 2023-08-26 Shiro Kawai * lib/rfc/hmac.scm: Revise API to suit for typical usage. 2023-08-25 Shiro Kawai * lib/rfc/base64.scm, lib/rfc/quoted-printable.scm: Revise API. The encoder now can take both string and u8vector, and renamed to *-encode-message to reflect the generic nature. The decoder now takes target class, and renamed to *-decode-string-to. The latter is consistent with message digest framework. The existing APIs are kept for the backward compatibility. * src/libmacro.scm (typecase, etypecase): Added. * lib/rfc/digest.scm: Allow digest-string-to to take predefined encoding targets, e.g. base64 or hex. * lib/rfc/base64.scm: Implement Base32, Base32hex and Base16 as specified in RFC4648. 2023-08-24 Shiro Kawai * lib/rfc/hmac.scm, lib/util/digest.scm: Add API to return digest result as . * src/libio.scm (%write-walk-rec): Avoid recursing into write-object when obj is a . This doesn't change the result, but saves time. 2023-08-22 Shiro Kawai * lib/rfc/json.scm (): A convenient mapping from Gauche instance to JSON. * lib/rfc/base64.scm (base64-encode): Added omit-padding keyword arg. Some protocol asks to do so, e.g. JWS (rfc7515). * src/Makefile.in (clean-to-regenerate): Add a new target just to clean Gauche-generated files. Useful to regenerate them, but no need to start from reconfigure. 2023-08-17 Shiro Kawai * lib/gauche/cgen/precomp.scm: Use packed debug info in the precompiled C code. This reduces compiled *.o files about 10-20%. 2023-08-11 Shiro Kawai * doc/modutil.texi: Start documenting text.info. It is not particulary featureful, but having been used for quite a while and may be worth documenting. 2023-08-09 Shiro Kawai * src/memo.c (Scm_MemoTablePutv): Workaround for table extension failure. https://github.com/shirok/Gauche/issues/914 2023-08-07 Shiro Kawai * lib/control/scheduler.scm (scheduler-reschedule!): Allow to change only time or duration argument, leaving the other intact. 2023-08-04 Shiro Kawai * src/compile-1.scm (pass1/extended-lambda-body): Expand :optional handling hygienically. 2023-08-01 Shiro Kawai * lib/rfc/cookie.scm (construct-cookie-string): Catch up to RFC6265. We no longer need Version attribute, and both Expires and Max-Age are honored unconditionally. https://github.com/shirok/Gauche/issues/911 2023-07-23 Shiro Kawai * src/libio.scm, src/string.c, lib/gauche/interactive.scm: Add string-length slot to , which can limit the display length of strings. https://github.com/shirok/Gauche/issues/908 * src/libstr.scm (string-ellipsis), lib/gauche/pputil.scm, etc.: EXPERIMENTAL: If native CES is utf-8, use Unicode ellipsis (U+2026) instead of three periods when the output is truncated. We hope it makes easier to distinguish whether the output is actually truncated, or there is indeed an ellipsis in the data. 2023-07-20 Shiro Kawai * src/port.c, src/portapi.c: Remove port terminal mode; it was a wrong abstraction, for multiple ports can be connected to a terminal. The actual issue https://github.com/shirok/Gauche/issues/877 has been addressed with termios. 2023-07-19 Shiro Kawai * libsrc/text/console.scm (call-with-console), src/portapi.c: Fix port terminal mode handling. 2023-07-16 Shiro Kawai * src/portapi.c: (Scm_Putc, Scm_Puts, Scm_Putz): Honor port terminal mode. * ext/termios/termios.scm: Switch port terminal mode along the actial terminal state changes. 2023-07-15 Shiro Kawai * src/port.c (Scm_GetPortTerminalMode, Scm_SetPortTerminalMode): Added. This is to address managing output while editable REPL is active. https://github.com/shirok/Gauche/issues/877 * tools/make-export-list: Added. 2023-07-14 Shiro Kawai * src/libnum.scm (logset+clear): Added. 2023-07-06 Shiro Kawai * src/hash.c, src/libdict.scm (%current-recursive-hash), src/module.c, src/libomega.scm (object-hash): Make %current-recursive-hash a proper parameter. https://github.com/shirok/Gauche/issues/879 NB: This commit drops Scm_CurrentRecursiveHash(). It has only been used from libdict.scm. Technically this is incompatible change, but we bet nobody else depend on this. 2023-07-04 Shiro Kawai * lib/rfc/uuid.scm (parse-uuid): Add if-invalid keyword argument to return #f for invalid uuid format, rather than raising an error. 2023-07-03 Shiro Kawai * doc/extract.scm, lib/tools/preprocess-info: Rename extract script and make it avaialble as a tool script. 2023-06-20 Shiro Kawai * lib/srfi/216.scm, src/srfis.scm: Support SRFI-216, SICP prerequisites. 2023-06-12 Shiro Kawai * src/libvec.scm, ext/uvector/uvector.scm: Move string <-> uvector conversion routines to core, to avoid dependency issues. 2023-06-11 Shiro Kawai * src/genstub, lib/tools/genstub: Move genstub to tools subdir. * lib/gauche/parseopt.scm: Allow omitting whitespace between single-letter option and its argument. https://github.com/shirok/Gauche/issues/904 2023-06-09 Shiro Kawai * src/precomp, lib/tools/precomp: Start moving standard scripts to tools/ namespace, e.g. one will say 'gosh tools/precomp ...' instead of 'gosh precomp ...'. https://github.com/shirok/Gauche/issues/891 2023-06-07 Shiro Kawai * src/precomp, lib/gauche/cgen/precomp.scm: Add --omit-debug-source-info option to drop debug-source-info from the generated compiled-code literals. This can be used for: (1) The generated C file gets too big, or (2) user wants to hide the source info for application distribution. * src/Makefile.in: Use --omit-debug-source-info to generate compile.c for now. Adding source info makes compile.c too big to compile on memory-tight machines. Note: We may be able to revert this once we split compile.c. * ext/uvector/Makefile.in: Ditto for gauche--uvector.c 2023-06-06 Shiro Kawai * src/precomp, lib/gauche/cgen/precomp.scm: Rename omit-source-info keyword arg to omit-line-directives. We'll add option to omit debug source info in the output, so the previous name is too confusing. Although this flag is in the output of 'usage' of precomp command, it has never been implemented as a command-line option; the flag can be turned on via an environment variable, which is not documented. So we blatantly change the name without caring the backard compatibility. * src/code.c (Scm_CompiledCodeFinishBuilder): Revive NOSOURCE compiler flag (it's been ineffective after some big compiler rewrite). For now, we handle source-info just the same and discard them at the last moment of the code generation. We may as well ignore source-info in earlier stage, but we expect using this option is relatively rare so it may not worth doing so. Let's see. 2023-06-05 Shiro Kawai * lib/gauche/procedure.scm: Renamed to procutil.scm for the consistency. 2023-06-04 Shiro Kawai * gc/: bumped bdwgc 8.2.4 2023-06-02 Shiro Kawai * lib/gauche/cgen/precomp.scm (serializable-debug-info): Attach debug info to the precompiled codes. * src/vm.c (Scm_VMTakeSnapshot): Added. Since VMDump calls high-level output routine that may call back to Scheme code, the dump routine itself may change VM state during dumping. To prevent that, we take snapshot of VM before dumping. 2023-05-29 Shiro Kawai * lib/gauche/numerical.scm, lib/gauche/logical.scm, lib/gauche/signal.scm: Renamed to numutil.scm, logutil.scm and sigutil.scm, respectively, for the consistency of autoloaded files. 2023-05-23 Shiro Kawai * src/thread.c (Scm_ThreadTerminate): Support SCM_THREAD_TERMINATE_SCHEDULE flag. * src/libthr.scm (thread-schedule-terminate!): Added. * lib/r7rs-setup.scm, src/libexc.scm, src/liblazy.scm: Move raise-continuable and make-promise to the core, for they are exported from srfi.226 as well. 2023-05-22 Shiro Kawai * lib/rfc/base64.scm (base64-decode): Add :strict keyword argument. 2023-05-20 Shiro Kawai * lib/gauche/mop/typed-slot.scm: Added experimentally. 2023-05-19 Shiro Kawai * libsrc/gauche/sequence.scm (inverse-permuter, unpermute): Added. The names can be better. Let's see. 2023-05-16 Shiro Kawai * src/libio.scm (port-case-fold): Drop port-case-fold-set! (previously undocumented) and replace (setter port-case-fold), for the API consistency. A few references to the old name in the source tree are updated. NB: lib/gauche/cgen/precomp.scm is used to compile 0.9.13, so it needs to work on both old and new gosh. For now, we use an ugly kludge for transition. Also put port-case-fold in gauche.internal. case-fold flag has global effect and accidentally changing it can cause a wreak havoc. There are already scope-delimited way to change the mode (#!fold-case directive, or include-ci form). * 0.9.13_pre4, because of the above change. 2023-05-09 Shiro Kawai * ext/package-templates/configure-compat: Remove compatibility hack. Let's assume new modules are developed for 0.9.10 and later. 2023-05-08 Shiro Kawai * src/main.c, src/libeval.scm (%invoke-other-version): Extend -v option so that -v:VERSION tries to run VERSION, but if it can't find one, falls back to the current version. * lib/gauche/fileutil.scm, src/libsys.scm: Move glob to libsys.scm. Before, '%invoke-other-version' triggered autoload of fileutil, but that caused some issue when the user use gosh -vVERSION from the uninstalled source tree. 2023-05-01 Shiro Kawai * src/libnum.scm: Dropped hidden real-only versions of elementary functions, e.g. %sin, replacing with SRFI-94 real-sin etc. They were never documented. Now we document real-* version. * lib/compat/real-elementary-functions: Compatibility module to provide the old names such as %sin etc. 2023-04-17 Shiro Kawai * src/lazy.c (Scm_VMForce): Fix a race condition; there was a hazard when one thread reads promise's state and goes to evaluate thunk, while another thread changes them simultaneously. 2023-04-14 Shiro Kawai * ext/gauche/unicode.scm (string-east-asian-width, string-take-width) (string-drop-width): Added. 2023-04-13 Shiro Kawai * src/class.c: Changed my mind. Say :immutable instead of :init-once, for the option is exacly for immutable slots. Besides, init-once is weird, for 'initialization' occurs once regardless of slot's immutablility. (Set-once would probably have been closer.) 2023-04-12 Shiro Kawai * src/class.c: Support :init-once slot option. This limits slot-set! to a slot that's previously unbound. If the slot already has a value, an error is signaled. This effectively works as an immutable slot. Note that the slot initialization calls the internal setter, so we need to allow the first set!. * ext/threads, src/thread.c, src/mutex.c, src/libthr.scm, src/gauche/thread.h: Move ext/threads into core. Cf. https://github.com/shirok/Gauche/issues/893 2023-04-09 Shiro Kawai * lib/rfc/base64.scm (base64-encode-bytevector), (base64-decode-bytevector): Added. They depend on gauche.vport, and their tests are done separately in ext/vport. 2023-04-05 Shiro Kawai * src/compile-i.scm, src/vminsn.scm, src/vector.c: Allow uvector-ref to be inlined. UVEC-REF can now handle generic uvector. 2023-04-04 Shiro Kawai * lib/math/simplex.scm: Allow any sequence to be b an c vectors; we copy them internally anyway. 2023-03-27 Shiro Kawai * 0.9.13_pre3 2023-03-25 Shiro Kawai * lib/rfc/base64.scm: Allow :digits keyword argument to specify alternative digits. * src/vector.c (Scm_ReadUVector): Preliminary support of SRFI-207 string-notated bytevectors. 2023-03-20 Shiro Kawai * lib/math/simplex.scm: Added. There are lots of room of optimization, though it's working. * ext/uvector/matrix.scm (array-vector-mul, vector-array-mul): Add (u)vector and array multiplication, for they appear frequently. We may make array-mul to accept vector arguments, but it can be done later. 2023-03-15 Shiro Kawai * src/lazy.c (Scm_VMForce): Allowing multiple threads to force a promise simultaneously, as SRFI-226 semantics. We only guarantee that the force value is always the same - the first delivered result takes precedence. * src/compile-1.scm (delay): Support mv-delivering delay. 2023-03-11 Shiro Kawai * src/lazy.c (Scm_MakePromise, Scm_VMForce): Run delayed thunk in the parameterization of the time the promise is created. This is for SRFI-226, but divergence from R7RS. Note that this change breaks the current implementation of SRFI-155 in a subtle way. Once SRFI-226 is adopted, however, SRFI-155 semantics is supported natively. For now, we just suppress the test that relies on the broken implementation. 2023-03-10 Shiro Kawai * lib/gauche/cgen/stub.scm (if, when): Warn when these obsoleted stub toplevel forms are used. These are never officially documented and we switched to .if/.when for years ago, but just in case we keep them a bit more. 2023-03-09 Shiro Kawai * lib/gauche/cgen/cise.scm (.error): Add CiSE macro to generate #error cpp directive. See libsys.scm for the use case. * src/compile-0.scm (define-simple-struct): Define macros and cise-exprs that expands into slot offset. This allows the CiSE code to use slot offset without relying on literal numbers. (See LVAR_* macros in compile.scm for the use case). 2023-03-07 Shiro Kawai * src/libsys.scm (seconds+): Added (srfi-226) 2023-03-01 Shiro Kawai * lib/srfi/235.scm: Start adding. 2023-02-28 Shiro Kawai * src/libproc.scm (constantly): Allow to return multiple values, adopting SRFI-235. * lib/gauche/procedure.scm (flip, swap): Added a couple of SRFI-235 procedures. 2023-02-27 Shiro Kawai * src/libparam.scm (temporarily): 'with' -> 'temporarily', according to srfi-226 revision. 2023-02-25 Shiro Kawai * lib/control/plumbing.scm (plumbing): Add generic utility. Simplify make-pump etc. just to take oports (without options). If the user wants to specify options, they can use 'plumbing'. 2023-02-23 Shiro Kawai * lib/math/const.scm: Add greek identifiers (π). UTF-8 has become ubiquitous and we don't need to hesitate using them. 2023-02-20 Shiro Kawai * lib/control/plumbing.scm: Allow optional names to inlets/outlets so that ports can be extracted from a plumbing by name. NB: API of add-outlet-output-port! has changed. We'll likely to change convenience utilities to accept names as well. 2023-02-19 Shiro Kawai * lib/srfi/239.scm: Add srfi-239 (documented). 2023-02-18 Shiro Kawai * src/libsys.scm (time-comparator): Added. Although