2024-04-23 Shiro Kawai * Release 0.9.15 * tools/tls/Makefile.in: Downgraded MbedTLS-internal version to 3.5.2, since 3.6.0 has an issue on MinGW. See https://github.com/shirok/Gauche/issues/1021 * tools/tls/process-config.sh: Need to tweak MinGW i686 build. * lib/gauche/configure.scm (cf-call-with-cpp): Added. * src/genconfig.in: Add --cpp and --cppflags for C preprocessor configration. Useful for 'configure' script. 2024-04-17 Shiro Kawai * src/libnum.scm (sin etc.): Let them always return inexact numbers. Previously we had (sin #e0) => #e0 etc., but it's not necessary, and diverging from real-sin etc. isn't desirable. (atan): Fix the special case when both args are zero. 2024-04-16 Shiro Kawai * ext/tls/tls-mbed.c (Scm_Init_rfc__tls__mbed): Add missing psa_crypto_init() to fix TLS handshake error. https://github.com/shirok/Gauche/issues/1018 * tools/tls/Makefile.in (include/mbedtls): Bumped MbedTLS version to 3.6.0 to fetch with --with-tls=mbedtls-internal. 2024-04-15 Shiro Kawai * src/system.c (Scm_SysExec), src/libsys.scm (%sys-escape-windows-command-line): When a BAT file is run via CreateProcess, Windoes uses different rules to parse the command line, causing a security risk. We reject 'unsafe' characters in the command line arguments if BAT file is the program to run. See CVE-2024-3566 https://nvd.nist.gov/vuln/detail/CVE-2024-3566 2024-04-10 Shiro Kawai * DIST, test/standalone.scm: Run build-standalone with the installed Gauche during DIST self-host-test. This can catch the issue like https://github.com/shirok/Gauche/issues/1013 * src/gauche.h: Do not include gauche/priv/configP.h, even if it is #ifdef'ed. It is simply wrong to include a private header from a public header. Instead, it should be included from each individual source files. Cf. https://github.com/shirok/Gauche/issues/1013 2024-04-08 Shiro Kawai * ext/sxml/sxml-tools.scm.in (sxml:sxml->xml): Replace original proc to handle namespaces. 2024-04-07 Shiro Kawai * src/libnum.scm (*, +): When used as unary operators on non-number object, delegate it to object-* or object-+. For the practical purposes, they should return the argument as is; their existence is the assertion that such opeartion is valid. We used to return the argument as is, but that may miss errors. Just in case if existing code depends on the old behavior, we issue a warning and return the argument if there's no unary method defined on the argument's class. https://github.com/shirok/Gauche/issues/1012 2024-04-05 Shiro Kawai * src/libbox.scm (unbox, unbox-value): Associate setters. Now you can say (set! (unbox ) ) etc. * lib/gauche/cgen/cise.scm (): Use box for decls. Since a new inner env may be created during recursion, we need an indirection so that decls pushed into the inner env won't be lost. 2024-04-04 Shiro Kawai * src/string.c (string_putc): Buffer size too short. Fix from NIIBE Yutaka. * src/gauche/priv/arith.h (SADDOV): Avoid undefined behavior of signed integer overflow. Fix from NIIBE Yutaka. 2024-04-03 Shiro Kawai * src/list.c: Ensure statically allocated ExtendedPairDescriptor is aligned in 8 byte boundary. It should be treated the same as ScmClass because of tagged pointer. Original fix from NIIBE Yutaka. * lib/srfi/238.scm: Added. 2024-04-01 Shiro Kawai * lib/srfi/64.scm: Changed integration to gauche.test. Instead of having a specific runner to bridge to gauche.test, we now bridge regardless of the test runner. This actually reveled some bugs that have been overlooked (because it was reported only by the srfi-64 test runner and not by gauche.test). https://github.com/shirok/Gauche/issues/1010 * test/include/srfi-194-zipf-test.scm: Loosened tolerance of chi^2 test a bit. It is statistical tests and we need some more room of statistical deviation. * lib/scheme/mapping.scm (%mapping-cmp), lib/scheme/mapping/hash.scm (%hashmap-cmp): When given mappings have different comparators, we should return #f, instead of "cannot compare" error. * lib/srfi/235.scm (disjoin): Fix when a predicate created with disjoin is given no arguments. It is actually not specified in SRFI text. The test in srfi repo returns #t for it. 2024-03-29 Shiro Kawai * lib/gauche/test/generative.scm: Removed in favor of upcoming srfi-252. 2024-03-27 Shiro Kawai * src/core.c (Scm_Init): Explicitly start marker threads. Recent bdwgc delays marker thread creation until the user creates the first thread, by default. See the discussion at https://sourceforge.net/p/gauche/mailman/gauche-devel/thread/87r0fvd5bl.fsf%40karme.de/ * ext/sxml/sxml-tools.scm.in: Fix sxml:attr->html and sxml:sxml->html to handle HTML's diversion from XML properly. Specifically, - Do not treat colons in attribute names as namespace prefix - Do not emit self-closing tag for non-void elements with empty content. https://github.com/shirok/Gauche-makiki/issues/11 2024-03-25 Shiro Kawai * Bumped version number to 0.9.14-p1 We're not quite ready for prerelease of next version (presumably 1.0_pre1), but we have enough changes since the last release so we want to distinguish HEAD from the offical release. * lib/data/random.scm (reals-between$): Fix overflow and precision loss https://github.com/shirok/Gauche/issues/1000 2024-03-24 Shiro Kawai * ext/sxml/sxml-tools.scm.in (sxml:attr->xml, sxml:attr->html): Override to fix shortcomings of the original sxml that attribute values are not quoted. Related: https://github.com/shirok/Gauche-makiki/issues/11 2024-03-23 Shiro Kawai * src/gauche-package.in (compile): Support --c++ option. This tells precomp to generate *.cpp file. Later, we may switch precomp mode to support C++ specific stuff. * lib/gauche/cgen/unit.scm (): Add 'language slot; now it generate *.cpp if the language is 'c++. * src/libtype.scm (): Replace and with . With this word, we can use the same type for the union of singletons, eliminating the need to have separate 'set' type. Cf. https://github.com/shirok/Gauche/issues/906 2024-03-22 Shiro Kawai * src/gauche.h, src/gauche/float.h: Ensure include complex.h outside of extern "C" linkage. OSX clang doesn't like otherwise if we include gauche.h to C++ source. https://github.com/shirok/Gauche/1006 2024-03-21 Shiro Kawai * src/gauche-package.in (compile), lib/gauche/package/compile.scm (gauche-package-compile): Add --srcdir option for out-of-tree compilation. * libsrc/file/util.scm (build-path): Allow #f in the path components (interpreted as ".") for the convenience. 2024-03-20 Shiro Kawai * lib/gauche/cgen/stub.scm (.include): Split .include in stub toplevel and CiSE .include. Stub .include is emitted to decl section, while CiSE .include is emitted in place (body section). This may be potentially confusing, and good documentation is desired. See https://github.com/shirok/Gauche/issues/1003 for the background of this change. 2024-03-19 Shiro Kawai * lib/gauche/cgen/cise.scm (cise-omit-source-line): Change the parameter cise-emit-source-line to cise-omit-source-line, flipping the logic. This aligns better with the options (e.g. --no-line of `gauche-package compile`). * lib/data/range.scm (%appended-range-index): Bug in binary search. Patch from @gengar https://github.com/shirok/Gauche/pull/1004 2024-03-18 Shiro Kawai * lib/gauche/cgen/precomp.scm: Take the default value of omit-line-directives keyword arg from the parameter cise-emit-source-info, so that the parameter settings by the the higher layer (e.g. 'gauche-package compile') is reflected. 2024-03-16 Shiro Kawai * lib/gauche/listener.scm (listener-read-handler): Fixed a bug revealed by the last fix. string-incomplete->complete is used in a meaningless way. * src/string.c (Scm_StringRefCursor): Fix a bug that leaked # to the Scheme world when an incomplete string is given. It could be exhibited by this: (let1 z #**"\xe1;" (string-ref z (string-index->cursor z 0))) Now it properly raises an error. 2024-03-15 Shiro Kawai * lib/srfi/215.scm: Supported. Contribution from Antero Mejr. 2024-03-12 Shiro Kawai * lib/data/random.scm (reals-power-law$): Added. 2024-03-11 Shiro Kawai * lib/data/random.scm (finite-flonums$): Added. 2024-03-10 Shiro Kawai * doc/Makefile.in: Use install-info if it's available, and DESTDIR is not used. https://github.com/shirok/Gauche/issues/988 2024-03-09 Shiro Kawai * examples/mqueue-cpp: Update to use modern way (no stub file). * ext/windows: Replace *.stub for *.scm. 2024-03-08 Shiro Kawai * lib/gauche/cgen/cise.scm: Handle C++ new and delete as operators. (cise-render-identifier): Allow C++ namespace qualified identifiers. 2024-03-05 Shiro Kawai * src/libnum.scm (greatest-positive-flonum): Add. Also renamed flonum-min-normalized and flonum-min-denormalized to least-positive-normalized-flonum and least-positive-flonum. They are consistent with {greatest|least}-fixnum. We added 'positive' for clarity. We dropped 'denormalized', since the platform may not support denormalized flonums, and the procedure returns normalized flonum in that case. 2024-03-04 Shiro Kawai * lib/gauche/package/compile.scm: Revert the idea of *.scm.c for generated C files. It messes up Makefile inference rules (make thinks foo.scm should be regenerated if foo.scm.o is newer). For the name conflicts, we can name the stub definition file as foolib.scm, much like we've done with foolib.stub. Now we can do so because we split module definition file from stub definition file. * lib/gauche/cgen/precomp.scm: Add support of in-module form. For now, this form is valid only for precompilation; normal compiler ignores it with warning. It allows to switch modules during precompilation like select-module, but the module doesn't need to exist at the moment (it is created implicitly then). It suppors precompiling sources with stubs separately from the module definintion file. Cf. https://github.com/shirok/Gauche/issues/993 2024-03-02 Shiro Kawai * lib/gauche/package/compile.scm: When 'gauche-package compile' receives *.scm file, we create intermediate C file as *.scm.c, instead of *.c, for a module may already have *.c with the same name. 2024-03-01 Shiro Kawai * examples/spigot: Update for modern way---no *.stub file, and *.scm file to be precompiled. * lib/gauche/package/compile.scm (gauche-package-compile): Make sure to pass DSO filename when '*.scm' is compiled with 'gauche-package compile'. Without this fix, generated '*.sci' file can't have a proper dynamic-load call. 2024-02-29 Shiro Kawai * src/compile-1.scm, src/compile-5.scm, src/libcode.scm, src/libtype.scm: Carry procedure type of closures in $lambda-meta, instead of pair attribute of the source form---using pair attr was a kludge. The type is carried as . It is eventually stored in #signature-info, and retrieved by compute-procedure-type (which is called from procedure-type). This allows argument type information of closures to be reflected to its procedure-type. 2024-02-27 Shiro Kawai * src/libtype.scm (type?): Added. 2024-02-25 Shiro Kawai * lib/lang/asm/regset.scm: Added. 2024-02-20 Shiro Kawai * src/vm.c, src/libeval.scm: Remove Scm_VMInsnOffsets and %vm-get-insn-offsets. Add Scm_VMInsnAddress and %vm-get-insn-address. This is an undocumented API change. 2024-02-18 Shiro Kawai * src/libexc.scm (print-additional-error-heading): Split auxiliary info reporting from print-default-error-heading, so that it can be used from other error reporters. * src/main.c (error_exit): When we exit during with -l or -e option, use print-additional-error-heading to print additional information (but not a stack trace). 2024-02-14 Shiro Kawai * lib/gauche/vm/insn-core.scm, src/code.c: Add 'obj+native' instruction type, for JIT support. 2024-02-13 Shiro Kawai * src/code.c, src/vminsn.scm: Change operand type 'addr' to 'label', to avoid confusion with the oncoming enhancement. (This is an API change, though it hasn't been documented). 2024-02-12 Shiro Kawai * lib/gauche/cgen/cise.scm (asm): Add asm cise macro to generate gcc inline assembly. 2024-02-10 Shiro Kawai * lib/srfi/247.scm: Add SRFI-247 2024-02-07 Shiro Kawai * libsrc/gauche/collection.scm (size-of): Missing size-of method defintion specialized for hashtables and treemaps, causing size-of on these objects O(n). Cf. https://github.com/shirok/Gauche/issues/987 2024-02-04 Shiro Kawai * lib/rfc/uri.scm (uri-decompose-query, uri-compose-query), lib/rfc/http.scm (http-compose-query), lib/www/cgi.scm (cgi-parse-parameters): Provide basic url query utilities in rfc.uri, and define existing utils on top of them. * src/liblist.scm: Change optional argument order of new alist-* procs. It is easier to have key= argument first, to handle variations. 2024-02-03 Shiro Kawai * src/liblist.scm (alist-merge): Added. (alist-ref, alist-key, alist-adjoin, alist-update-in): Renamed assoc-ref, rassoc-ref, assoc-adjoin, and assoc-update-in. Old names are kept for the backward compatibility. https://github.com/shirok/Gauche/issues/985 2024-02-02 Shiro Kawai * libsrc/gauche/collection.scm (group-collection->alist): Added. 2024-01-31 Shiro Kawai * libsrc/rfc/822.scm (rfc822-header-ref*, rfc822-header-put): Added. 2024-01-29 Shiro Kawai * src/gauche-package.in: Add 'populate' subcommand. * lib/text/multicolumn.scm (layout-multicolumn): Fix the edge case when the string list is empty. 2024-01-25 Shiro Kawai * Release 0.9.14 2024-01-23 Shiro Kawai * ext/charconv/jconv.c (jconv_open): If input and output encoding are the same but not supported natively, use pass-through transcoder instead of delegating it to iconv. Some verion of iconv doesn't seem to like it. https://github.com/shirok/Gauche/issues/979 * src/number.c (double_precision): Fix ratnum->flonum failure when when either denominator or numerator is 2^(64n-1). https://github.com/shirok/Gauche/issues/981 2024-01-22 Shiro Kawai * src/libnum.scm (real-ln): Fix precision loss of taking log on a large bignum. https://github.com/shirok/Gauche/issues/980 2024-01-21 Shiro Kawai * lib/data/priority-map.scm: Allow any comparator as key-comparator; we switch hashtable and treemap internally. Then dict->priority-map can take the given dictionary's key-comparator. 2024-01-20 Shiro Kawai * lib/data/priority-map.scm (dictionary->priority-map), (alist->priority-map): Added. * lib/text/multicolumn.scm (display-multicolumn): Add indent keyword arg. 2024-01-19 Shiro Kawai * src/gauche-package.in ("info"): Add 'gauche-package info' command. 2024-01-16 Shiro Kawai * lib/data/random.scm: Switch the handling of current random source. Now the procedures consistently captures the value of the current random source at the time of creation of generators. This is technically an incompatible change. https://github.com/shirok/Gauche/issues/977 2024-01-15 Shiro Kawai * lib/srfi/194.scm, lib/srfi/194/*.scm: Completing srfi-194 support. 2024-01-12 Shiro Kawai * src/compile-5.scm (pass5/$DYNENV): Fixed a bug that when KEY or VALUE of with-continuation-mark is a procedure call, its result becomes the result of with-continuation-mark. * lib/data/random.scm (reals-between$): The range calculation was broken. 2024-01-09 Shiro Kawai * src/libfmt.scm (format-internal), src/libmacro.scm: Experimentally introduce formatter cache. The compiler determines "potentially cacheable" call of `format`, and the runtime takes advantage of it if possible. The drawback is that the compiler macro now inserts reference to `format-internal`. It's embedded in the precompiled code and We can't change its API across versions. 2024-01-08 Shiro Kawai * src/libfmt.scm (formatter-parse): Support conditional directive (tilde left-bracket). 2023-12-30 Shiro Kawai * src/error.c (Scm_MessageConditionPrint): Extend the error message truncation limit so that unexpected exception can give more info. 2023-12-29 Shiro Kawai * ext/tls/tls-mbed.c (mbed_write): If the data is big, single mbedtls_ssl_write may return with partial write, so we need to retry to send the rest of the data. 2023-12-28 Shiro Kawai * 0.9.14_pre1. Preparing another release to make TLS addition available. 2023-12-17 Shiro Kawai * libsrc/file/util.scm (build-path): Allow 'cwd and 'cld as base-path argument, for current workding directory and current loading directory, respectively. We've seen enough of this pattern, especially the latter, so it's worth having it. 2023-12-10 Shiro Kawai * ext/charconv: Support utf8bom encoding, which drops the optional BOM at the beginning of utf8 stream. We simply implement utf8bom->utf8 internal routine, and use autosynthesis of other conversions. We don't support utf8bom as an output encoding, at least for now (see the discussion in the issue). https://github.com/shirok/Gauche/issues/966 * src/librx.scm (%regexp-replace): Avoid rebinding current-output-port during replacing, for the substitution procedure may output and it's confusing that it is mixed into the result. https://github.com/shirok/Gauche/issues/967 2023-12-06 Shiro Kawai * src/string.c (string_putc): Make 'write' escape control characters in strings so that it's easier if hard-to-see characters are there, e.g. Zero-width no-break space. 2023-12-03 Shiro Kawai * src/libthr.scm (run-once): Added. (, , ): Export these. Class names are not in SRFI-19, but now that threads are in the core, other parts of core may refer to them. (Notably, precomp now needs them). 2023-11-29 Shiro Kawai * src/gencomp: Removed. This is an ancient script, superseded by precomp long ago. 2023-11-25 Shiro Kawai * src/system.c (Scm_ToTimeSpec): More general interface that takes the base time (t0) when relative time is given. Passing NULL to t0 uses the current time. Scm_GetTimeSpec() is defined on top of it. We thought to drop it, but this API may have been used from other extensions, so we may keep it. 2023-11-24 Shiro Kawai * src/builtin-sym.scm: Rearranged predefined symbols. It's been for long time since we made builtin-syms.h private, so no external code should depend on the order of them anymore. * src/system.c (Scm_GetTimeSpec): Allow negative real number for relative time specification. For the timeout argument, we don't need that, but for general time operation it is useful. Also support relative time specification with time-duration time. 2023-11-21 Shiro Kawai * lib/control/pmap.scm (run-map): Terminate threads when timeout reaches with fully-concurrent-mapper. https://github.com/shirok/Gauche/issues/964 * src/libsys.scm (absolute-time): Added. Handy to canonicalize 'timeout' argument. 2023-11-20 Shiro Kawai * lib/gauche/cgen/unit.scm (): Initialize cgen-current-unit with a dummy instance which issues error message saying isn't set up properly. It is better than 'object of class #> doesn't have such slot'. 2023-11-19 Shiro Kawai * src/libmod.scm (module-exports?, module-binds?, module-binding-ref): Introduced new names in place of global-variable-visible?, global-variable-bound? and global-variable-ref. See https://github.com/shirok/Gauche/issues/963 2023-11-18 Shiro Kawai * src/libmod.scm (global-variable-visible?): Added. https://github.com/shirok/Gauche/issues/936 * ext/tls/tls.scm (tls-connect, tls-bind): Make proto argument optional. DTLS is not very usable now, so there's little point to allow users to specify udp here. * ext/tls: Add tls-poll 2023-11-17 Shiro Kawai * ext/tls: Support get self/peer address, option to not verify certificate. 2023-11-15 Shiro Kawai * doc/: Support epub generation from @qykth-git https://github.com/shirok/Gauche/pull/959 2023-11-14 Shiro Kawai * ext/tls: Support TLS server connection. 2023-11-10 Shiro Kawai * ext/tls: Remove AxTLS support. * src/module.c (Scm__InitModule): Remove obsoleted code to create built-in srfi modules. Now it is done in auto-generated libsrfi.scm so they're no longer needed, but had been harmless until we switch srfi-N to srfi.N naming convention. * lib/slib.scm (slib:features): Exclude srfi-0 from slib:features to prevent slib initializer to load all available srfis, especially srfi.29. It is mentioned in the comment immediately above, but I seem to have reverted the change when I updated slib.scm based on a newer template. https://github.com/shirok/Gauche/issues/960 2023-11-03 Shiro Kawai * libsrc/file/util.scm (remove-directory*): Add :if-does-not-exit argument 2023-10-27 Shiro Kawai * src/system.c (Scm__WinFastLockLock): Fast lock implementation for Windows (by @Hamayama, https://github.com/shirok/Gauche/pull/955) 2023-10-26 Shiro Kawai * src/bignum.c (bignum_mul_si): Optimize special case when bignum muliplied by y=2^n (y is fixnum). 2023-10-24 Shiro Kawai * lib/r7rs-setup.scm (open-binary-*-file): Even though Gauche doesn't distinguish textual and binary ports, opening file as binary may have an observable difference on Windows ('binary' mode). 2023-10-22 Shiro Kawai * src/core.c (Scm_ObjToExitCode): Consolidate exit code translation to be shared between 'exit', 'sys-exit', and 'emergency-exit'. https://github.com/shirok/Gauche/issues/947 * src/libeval.scm (exit), lib/r7rs-setup.scm (emergency-exit), src/libsys.scm (sys-exit): Allow to take #f as code, which is mapped to exit code 1. 2023-10-21 Shiro Kawai * lib/srfi/74.scm: Fix blob-*-set! procedures. * lib/check-script, lib/tools/check-script: Move check-script to tools subdirectory. 2023-10-15 Shiro Kawai * Drop eucjp, sjis and none internal CES support. We use utf8 exclusively from now on. 2023-10-14 Shiro Kawai * Various files: Remove code with GAUCHE_API_VERSION < 98 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