2022-06-25 Shiro Kawai * Release 0.9.12 2022-06-21 Shiro Kawai * src/number.c (read_number): Support srfi-169, underscores in numbers. Technically this introduces incompatibility: - Tokens such as 1_2_3 is now read as a number 123, instead of a symbol. - Underscores in prefexed numeric literals must obey srfi-169 instead of simply being ignored. #x_dead_beef_ was ok before, but no longer. 2022-06-19 Shiro Kawai * ext/uvector/uvlib.scm.tmpl (@vector-segment): Check arg to avoid infinite loop. https://github.com/shirok/Gauche/issues/828 2022-06-06 Shiro Kawai * lib/srfi-232.scm: Add srfi-232 Flexible curried procedures. 2022-06-05 Shiro Kawai * src/compile-4.scm (pass4/scan): Fix incorrect free-variable propagation in $clambda node. https://github.com/shirok/Gauche/issues/826 2022-06-04 Shiro Kawai * src/liblist.scm (num-pairs): Added. 2022-05-30 Shiro Kawai * test/net.scm: Recover gauche.net test 2022-05-29 Shiro Kawai * src/list.c (Scm_LastPair): Detect circular list. It is not required in the spec (last and last-pair), but doing so is cheap and it's something nice to have. 2022-05-28 Shiro Kawai * src/libvec.scm (make-s8vector etc.), ext/uvector/uvlib.scm.tmpl: Move constructors to the core. 2022-05-21 Shiro Kawai * lib/gauche/connection.scm, lib/gauche/netutil.scm: Moved connection protocol implementation to gauche.net. Keep gauche.connection just for the backward compatibility. 2022-05-20 Shiro Kawai * ext/net, src/libnet.scm, src/net.c, src/netaddr.c, src/netdb.c: Move ext/net into core. Sometimes it's handy for the extension modules to be able to call net-related C functions. 2022-05-16 Shiro Kawai * ext/tls/tls.ac: Do not compile axtls by default. Preparing to drop axtls support in future releases. 2022-05-10 Shiro Kawai * src/signal.c (Scm_SigWait): Avoid using signal number 0 for sigismember/sigdelset. This causes failure on OSX Monterey. 2022-04-21 Shiro Kawai * ext/srfi/srfi-19.scm: Define object-compare for . 2022-04-20 Shiro Kawai * lib/util/temporal-relation.scm: Added. 2022-04-18 Shiro Kawai * configure.ac: 0.9.12_pre1 2022-04-17 Shiro Kawai * src/liblist.scm (list-ref): Better error message. (See comments in https://github.com/shirok/Gauche/issues/814) 2022-04-16 Shiro Kawai * src/libmacro.scm (push-unique!): Added, finally. CL's pushnew. I've been resisting the temptation to add this, for most of the times it doesn't bother me much to write out the logic explicitly. However, I hit the cases where this makes code much cleaner enough times. 2022-04-07 Shiro Kawai * src/main.c (main): Noticed *program-name* and *argv* aren't defined when gosh invoked as REPL. Although they are of little use in REPL, leaving them undefined may cause some inconvenience. We just define "" as *program-name* and () as *argv*. 2022-04-06 Shiro Kawai * ext/tls/tls.c: Fix fd leak in https://github.com/shirok/Gauche/issues/817 2022-03-21 Shiro Kawai * lib/control/thread-pool.scm (wait-all): Fix race condition ( https://github.com/shirok/Gauche/issues/812 ) 2022-03-16 Shiro Kawai * src/system.c (Scm_StrfTime): MinGW's strftime() returns a multibyte string in system's language settings, so its handling is tricky. We introduced a compatibility layer. * src/libsys.scm (sys-setlocale): Allow #f for locale argument (corresponding to passing NULL in C API). It can be used to obtain the current locale. 2022-03-10 Shiro Kawai * src/write.c, src/libfmt.scm: If string is truncated within double quotes, add '"...' (instead of ' ..."' as before). The normal truncation is ' ...' (a whitespace before dots), so it gives a clue that the string is truncated. We also support the same format in Scm_Printf(). 2022-03-09 Shiro Kawai * lib/gauche/cgen/precomp.scm: Revert commit #f5577697cf - this appears no longer needed to inline procedures within the same compilation unit during precompilation. 2022-03-06 Shiro Kawai * src/write.c (vprintf_pass2): Fix truncation of %S and %A - it looked like we were in the middle of the change and then forgot to pick it up. 2022-03-05 Shiro Kawai * src/libfmt.scm (chop-and-out): Make 'truncation' format directive recognize an open double quote and close it properly even if the content is truncated. This will prevent font colorlizer (e.g. Emacs Scheme mode) from being messed up by unclosed double quotes caused by truncation. 2022-02-26 Shiro Kawai * src/compile-2.scm (pass2/$LET): Lift component closures of locally defined case-lambda into the same level of environment. Expecting the later stage of case-lambda optimization to become easier. Note that this changes ordinary let frame to letrec frame (since the newly introduced variable is referred to by the case-lambda construction in the same environment). We expect such conversion would occur rarely (if local case-lambda is introduced by internal defines, the frame is already letrec*.) 2022-02-21 Shiro Kawai * src/libalpha.scm (case-lambda-decompose): Rename from case-lambda-info (too vague). Use new %case-lambda-info so that it can have definite info, instead of relying procedure-info slot. This procedure hasn't been public, so name change shouldn't affect existing code. We may come up a better name later. 2022-02-20 Shiro Kawai * src/compile-1.scm, src/libalpha.scm: Global case-lambda inliner. Now case-lambda procedure can be define-inline'd, and if the call site knows the number of arguments, it preselects the apprpricate branch and direclty inlines it. 2022-02-15 Shiro Kawai * src/libalpha.scm (make-case-lambda): No longer look at 'formals' argument; the info can be extracted from closures. 2022-02-14 Shiro Kawai * src/number.c (Scm_NumCmp): Make sure '=' transitivity is kept in exact v inexact comparison. https://github.com/shirok/Gauche/issues/805 2022-02-12 Shiro Kawai * text/line-edit.scm: Add whitespace after the completed word if the completion returns a single definite result. It is indicated by the lister callback returning a string, rather than a list. Note that we need to distinguish the case when there's only one candidate but further search is possible (e.g. completing a directory name when searching the actula file). 2022-02-11 Shiro Kawai * data/ulid.scm: Added. Port from https://github.com/shirok/scheme-ulid 2022-02-10 Shiro Kawai * gc: Bumped bdwgc 8.0.6 2022-02-09 Shiro Kawai * lib/gauche/libutil.scm (library-fold): Rewrote on top of glob-fold. This allows extended glob pattern such as {} and **. * lib/gauche/fileutil.scm (glob-fold): Add prefix keyword arg. 2022-02-02 Shiro Kawai * src/read.c (Scm_CharWordConstituent), src/libio.scm (char-word-consituent?): Expose these for they are generally useful to write something that deal with Scheme names. 2022-01-30 Shiro Kawai * libsrc/text/gap-buffer.scm (gap-buffer-contains, gap-buffer-looking-at?): Added. * src/libstr.scm (opt-substring): Rename %maybe-substring opt-substring and officially support it in #. It is generally useful. 2022-01-23 Shiro Kawai * libsrc/text/line-edit.scm: Some improvement of completion. Now if there're multiple candidate and TAB is typed twice, the candidate list is displayed. * lib/text/multicolumn.scm: Added 2022-01-21 Shiro Kawai * lib/srfi-227.scm: Added srfi-227. 2022-01-18 Shiro Kawai * lib/gauche/editable-reader.scm: Implement a rudimental symbol completion. We'll experiment for a while to see what's best in REPL. 2022-01-16 Shiro Kawai * libsrc/text/line-edit.scm: Add a hook for completion. * libsrc/text/gap-buffer: Drop gap-buffer-gap-start and gap-buffer-gap-end. They reveals internals unnecessarily. They weren't documented, and have only been used for testing. (gap-buffer-pos-at-end?): Added. 2022-01-13 Shiro Kawai * src/compile-1.scm (case-lambda): Change case-lambda handling. Instead of expanding to the call for make-case-lambda in pass1, we create $CLAMBDA node and carry it up to pass5. This will allow more optimizations. 2022-01-05 Shiro Kawai * src/mmap.c (Scm_SysMmapWX): Separate writable pages and executable page if PaX MPROTEXT is active. 2022-01-04 Shiro Kawai * src/list-ext-objects.sh: Allow to take extra directories to scan object files to archive. * src/Makefile.in, tools/tls/Makefile.in: If --with-tls=mbedtls-internal, scan tools/tls to archive mbed object files in the static library. Cf. https://github.com/shirok/Gauche/issues/802 2021-12-28 Shiro Kawai * Release 0.9.11-p1: A "patch" release fixing mbedtls-internal issue. * ext/tls/tls.ac: Fix build defect when internal mbedtls is used https://github.com/shirok/Gauche/issues/799 2021-12-23 Shiro Kawai * Release 0.9.11 2021-12-16 Shiro Kawai * src/libsys.scm (sys-mmap, ): Improve mmap API. size argument needs to be mandatory (there's no reasonable default). Expose fields of for introspection. 2021-12-14 Shiro Kawai * ext/tls/tls-mbed.c: Support MbedTLS 3.0. This is a partial support: we need tls-bind to allow TLS-enabled server. But at least this one works as a client. 2021-12-03 Shiro Kawai * src/libio.scm (%write-walk-rec): Handle circular reference through boxes. https://github.com/shirok/Gauche/issues/787 2021-12-01 Shiro Kawai * check-build-version, configure.ac, Makefile.in: Before generating files by BUILD_GOSH, check if it is the latest release. With this, the user who accidentally try to compile from the repo using older Gauche will be told so upfront, instead of getting an misterious error in the middle of building. The required BUILD_GOSH version is kept in configure.ac, right below the AC_INIT line. Don't forget to update when you make a new release. 2021-11-23 Shiro Kawai * lib/gauche/cgen/precomp.scm (handle-define-inline): Fix that define-inline'ed procedures weren't expanded within the same compilation unit. We need to let the compiling enviornment know about the inlined procedures. 2021-11-22 Shiro Kawai * src/libmacro.scm (cond-expand): EXPERIMENTALLY add 'package' clause to test package existence and its version. A special package name 'gauche' can be used to check running Gauche version. Let's see how it goes. 2021-11-15 Shiro Kawai * src/gauche.h (ScmProcedure), src/proc.c (Scm__CopyProcedure): Use the reserved slot of ScmProcedure as tags-alist. We can keep srfi-229 procedure tag there, and more in future. INCOMPATIBLE CHANGE: We make Scm_CopyProcedure private, moved to priv/procP.h and renamed to Scm__CopyProcedure. Use code shouldn't need to use it, for procedures are immutable entity and copying shouldn't make difference. It is only used internally to do certain bookkeeping. * lib/srfi-229.scm: Added. 2021-11-11 Shiro Kawai * lib/gauche/cgen/stub.scm (make-array-getter-setter): Support treating u8int_t array in cstruct as . Eventually we'll extend it to other uniform vectors, and this is the first step. (define-cproc): Allow '_ in the arguments to indicate unused args. * lib/gauche/cgen/cise.scm: (define-cenum): Added. This has been in Gauche-gl for a while. 2021-11-10 Shiro Kawai * lib/gauche/cgen/cise.scm: Allow '_' as an unused argument in define-cfn, so that we don't need a dummy cast expression to suppress 'unused argument' warnings. We also need the similar stuff for define-cproc and define-cmethod, but the handling of arguments differ a lot. So, maybe later. 2021-11-07 Shiro Kawai * lib/gauche/cgen/stub.scm: Rename define-type to declare-stub-type. Make it clear that it is merely a hint to the stub generator, only effective during a single stub file processing. (define-cclass): Let it handle declare-stub-type, even if it needs custom c-predicate name or unboxer name. (define-cstruct): Incorporated define-cstruct, an easier stub interface for C struct. 2021-11-05 Shiro Kawai * src/libtype.scm (ScmNativeType): Let it keep C type name as well. The long-term plan is to integrate stub types to the built-in type system, though we'll still keep some info outside of the built-in types (e.g. C notation of boxer/unboxer won't be used except stub generators, so no need to carry it around in the ). * lib/gauche/cgen/type.scm: Keep reference to the actual Scheme type in the stub type. Changed API of make-cgen-type. 2021-10-27 Shiro Kawai * lib/rfc/http.scm: Use new tls-connect interface that lets TLS module opens the socket. This allows proper use of mbedTLS. * ext/*/Makefile.in: Adjust GENERATED and CONFIG_GENERATED macros to the src/*. The 'distcclean' target removes CONFIG_GENERATED (e.g. Makefile), and 'maintainer-clean' removes GENERATED as well. Before this change, a build after distclean caused an error while building ext/gauche, for unicode-attr.scm is removed by distclean but not regenerated since src/char_attr.c exists. Also, renamed GENERATED -> PREGENERATED to avoid confusion. * lib/rfc/http (start-connection): When no TLS module is available, raise an error saying so, rather than letting rfc.tls module throw an obscure error. Cf. https://github.com/shirok/Gauche/issues/784 NB: rfc.tls is loaded by cond-expand gauche.net.tls, so we don't bother to make it autoload. 2021-10-24 Shiro Kawai * ext/digest/sha2.c (SHA1_End): Fix strict aliasing violation. The original code yields incorrect binary with gcc 11.2 when compiled with -O2. 2021-10-03 Shiro Kawai * src/gauche/priv/bignumP.h: Make bignum.h private. It was never intended for public use. Technically this is compatiblity-breaking, but if the user code directly uses bignum API, there's something wrong. 2021-09-28 Shiro Kawai * lib/data/random.scm (random-data-random-source): A parameter to keep the current random source. Previous random-state thingy was awkward and not compatible to srfi-194. * ext/mt-random: Add mt-random-get-seed 2021-09-07 Shiro Kawai * src/gauche/vm/debugger.scm, src/read.c: Experimentally implemented per-thread debug logging. #?@=expr records evaluation of expr like #?=, but the output goes to per-thread file, with timestamp. This prevents logs to be mixed up. * ext/threads/threads.scm (latch-clear!): Added. 2021-09-03 Shiro Kawai * lib/gauche/interactive.scm (describe): Add (describe ). * src/libnum.scm (ratnum?): Added. 2021-09-01 Shiro Kawai * ext/threads/threads.scm (thread-try-start!): Added. A thread can be terminated before it is started. thread-start! raises an error when it is applied on such a thread. However, we may want to just ignore such case. 2021-08-29 Shiro Kawai * lib/gauche/interactive.scm (describe): Add (describe ) to describe flonum. * ext/threads/threads.c (Scm_TerminateThread): Add flags argument, and allow to choose forcible/non-forcible termination. * ext/threads/threads.scm (thread-terminate!): Make non-forcible termination default. Forcible termination has no guarantee the process state is sane afterwards, so it should be reserved for absolutely desperate situation. We expect non-forcible termination shows little difference from forcible termination, for the program will go on anyways---the only difference should be the hanged thread remains in the process. 2021-08-28 Shiro Kawai * src/gauche-cesconv.in: Add --in-place option. 2021-08-24 Shiro Kawai * src/boolean.c (Scm_EqvP): Let (eqv? -0.0 0.0) #f. The spec of eqv? has been changed since R5RS; in R7RS, it must return #f if two objects are numbers and it yields different results with Scheme's standard arithmetic operations. Subsequently, (equal? -0.0 0.0) also returns #f. * src/numebr.c: Make sure integer divisions and roundings never return -0.0. It complicates things when the result is compared to 0.0 with equal?. 2021-08-22 Shiro Kawai * src/number.c (scm_abs): Fix: (abs -0.0) returned -0.0. Oops. * ext/srfi/srfi-19.scm: Define object-equal? on . 2021-08-15 Shiro Kawai * lib/srfi-69.scm (hash-table-hash-function): The returned procedure's second argument is now optional, for the compatibility with srfi-128. https://github.com/shirok/Gauche/issues/777 2021-08-11 Shiro Kawai * lib/srfi-197.scm: Added (reference implementation) 2021-08-06 Shiro Kawai * lib/gauche/test/diff.scm (test*/diff): Renamed from test*-diff. Use unified diff instead of context diff. Handle the case when the result isn't a string. 2021-08-05 Shiro Kawai * lib/util/lcs.scm (lcs-edit-list/unified), lib/text/diff.scm (diff-report/unified): Also added unified diff. 2021-08-03 Shiro Kawai * lib/gauche/cgen/stub.scm (cgen-genstub): Add output-directory keyword argument. 2021-08-02 Shiro Kawai * lib/gauche/test.scm: Save failure report procedure in *discrepancy-list* as well, so that we can report in the same format in the test summary. test-fail++ is enhanced to take the optioanl report procedure; it's optional to keep the backward compatibility. Note the report procedure output is slightly changed. The prefix "ERROR: GOT " and the last newline is printed by the test framework now, so the report procedure only need to display the content. (prim-test): Change the optional argument order. 'hook' argument will be rarely used (it's to adapt other test frameworks to Gauche), so it will make more sense to have it last. 2021-08-01 Shiro Kawai * lib/text/diff.scm (diff-report/context): Added. * lib/util/lcs.scm (lcs-edit-list/context): Add 'context diff' functonality. 2021-07-29 Shiro Kawai * lib/gauche/test/diff.scm (test*-diff): Add a utility that reports diff of expected and actual results. It's a lot easier to spot what went wrong than the default output. 2021-07-28 Shiro Kawai * lib/gauche/test.scm (test-report): Add an optional 'report' arg to prim-test, test and test*, to customize failure reporting. 2021-07-27 Shiro Kawai * lib/gauche/test.scm (test-remove-files, test-with-temporary-directory): Added. test-remove-files is effectively the same as remove-files in file.util, and only for the tests that can't rely on file.util. test-with-temporary-directory is generally useful. 2021-07-24 Shiro Kawai * src/gauche/priv/nativeP.h (SCM_ALIGNOF): Added. 2021-07-23 Shiro Kawai * src/libtype.scm: Change -> . It'll be the basis of FFI type system. 2021-07-22 Shiro Kawai * ext/srfi/srfi-19.scm (describe): Let (describe