summaryrefslogtreecommitdiff
path: root/module/rnrs
AgeCommit message (Collapse)AuthorFilesLines
2023-06-08Implement R6RS custom textual portsAndy Wingo1-13/+7
* module/ice-9/textual-ports.scm (custom-textual-port-read+flush-input): (custom-textual-port-write): (custom-textual-port-seek): (custom-textual-port-close): (custom-textual-port-random-access?): (make-custom-textual-input-port): (make-custom-textual-output-port): (make-custom-textual-input/output-port): New procedures. * doc/ref/api-io.texi (Ports): Update docs. * doc/ref/r6rs.texi (rnrs io ports): Mention custom textual port interfaces. * module/rnrs/io/ports.scm: Re-export custom textual port interfaces from (ice-9 textual-ports). * test-suite/tests/r6rs-ports.test: Add minimal tests for textual ports.
2023-01-14Add 'bytevector-slice'.Ludovic Courtès1-0/+24
* module/rnrs/bytevectors/gnu.scm: New file. * am/bootstrap.am (SOURCES): Add it. * libguile/bytevectors.c (scm_bytevector_slice): New function. * libguile/bytevectors.h (scm_bytevector_slice): New declaration. * test-suite/tests/bytevectors.test ("bytevector-slice"): New tests. * doc/ref/api-data.texi (Bytevector Slices): New node.
2021-03-09Write a proper vector-map and vector-for-each for (rnrs base)Linus1-5/+76
* module/rnrs/base.scm (vector-map vector-for-each): Rewrite to not be slow. * NEWS: Update.
2021-01-12Finish call-with-port cleanupAndy Wingo1-9/+0
* module/rnrs/io/ports.scm (call-with-port): Remove local definition. * module/system/repl/server.scm (system): Call-with-port is imported via (ice-9 ports).
2020-01-21rnrs: Export '&assertion' from (rnrs conditions).Ludovic Courtès1-2/+2
Fixes <https://bugs.gnu.org/39210> Reported by Ricardo Wurmus <rekado@elephly.net>. * module/rnrs/conditions.scm (rnrs): Import '&assertion-failure' as '&assertion', not '&assertion-violation'.
2020-01-12Fix typos in previous commit.Andy Wingo1-1/+1
* module/ice-9/boot-9.scm (record-modifier): * module/rnrs/records/procedural.scm (make-record-type-descriptor): Fix typos.
2020-01-12Optionally allow duplicate field names in core recordsAndy Wingo1-1/+2
* NEWS: Update. * doc/ref/api-data.texi (Records): Update docs. * module/ice-9/boot-9.scm (make-record-type): Add #:allow-duplicate-field-names? keyword argument. (record-accessor, record-modifier): Allow passing indexes to identify fields. * module/rnrs/records/procedural.scm (make-record-type-descriptor): Allow duplicate field names. Fixes #38611.
2020-01-10Re-implement `guard'Andy Wingo1-18/+2
* module/ice-9/exceptions.scm (guard): Add guard definition that re-propagates from original continuation, runs consequents in tail position in guard continuation, and doesn't rewind the stack. * module/srfi/srfi-34.scm: * module/rnrs/exceptions.scm (guard): Re-export from (ice-9 exceptions).
2019-11-05Move adapter between "throw" and "raise" exceptions into coreAndy Wingo1-227/+3
* module/ice-9/exceptions.scm (&guile): (default-guile-exception-converter): (guile-common-exceptions): (convert-guile-exception): (&raise-object-wrapper): (make-raise-object-wrapper): (raise-object-wrapper?): (raise-object-wrapper-obj): (raise-object-wrapper-continuation): (raise-exception): (raise-continuable): (with-exception-handler): (exception-printer): (format-exception): (format-simple-exception): (%exception): (guile-syntax-error-converter): (guile-lexical-error-converter): (guile-assertion-failure-converter): (guile-undefined-variable-error-converter): (guile-implementation-restriction-converter): (guile-external-error-converter): (guile-system-error-converter): (guile-exception-converters): (set-guile-exception-converter!): Move here, from (rnrs exceptions). * module/rnrs/exceptions.scm: Re-export bindings from (ice-9 exceptions).
2019-11-03Add (ice-9 exceptions) moduleAndy Wingo1-116/+56
* module/ice-9/exceptions.scm: New file, derived from (rnrs conditions). Perhaps unadvisedly, in this file I've renamed a number of the identifiers. I have never found that the R6RS identifiers made sense to me. For now this is an internal module that R6RS and SRFI-35 will be based on. * module/Makefile.am (SOURCES): Add the new file. * module/rnrs/conditions.scm (rnrs): Export renamed identifiers from (ice-9 exceptions).
2019-10-30Remove circularity in r6rs by rebasing conditions on core recordsAndy Wingo4-202/+121
* module/rnrs/conditions.scm: Use core record facilities to define the base condition types, define-condition-type, and the standard condition hierarchy. (simple-condition?): Rename from condition-internal?. * module/rnrs/exceptions.scm: Move `raise' definition here, out from the procedural records layer. (format-simple-condition): Reimplement in a simpler way, hopefully producing the same output. * module/rnrs/records/procedural.scm: * module/rnrs/records/inspection.scm: Import the exceptions and conditions modules, and use the normal raise function.
2019-10-29Rebase R6RS records on top of core recordsAndy Wingo3-254/+169
* module/ice-9/boot-9.scm (record-type-uid): New accessor. (make-record-type): Record UID in record type properties. * module/rnrs/conditions.scm (define-condition-type): Fix invalid invocation of make-record-type. * module/rnrs/records/inspection.scm: Rewrite to use core record inspection facilities. * module/rnrs/records/procedural.scm: Rewrite to use core make-record-type. Incidentally the result is that instances of derived R6RS record types are now flat instead of nested. * test-suite/tests/r6rs-records-procedural.test ("make-record-type-descriptor"): Relax a couple condition type checks, while we redo the exception system.
2019-09-27Deprecate passing a non-zero size to make-moduleAndy Wingo1-1/+1
* module/ice-9/boot-9.scm (make-module): Issue a deprecation warning if users pass a non-zero size. (nested-define-module!, make-modules-in, beautify-user-module!) (resolve-interface, make-autoload-interface, %cond-expand-table): * module/ice-9/popen.scm (port/pid-table): * module/ice-9/session.scm (make-fold-modules): * module/language/ecmascript/function.scm (*program-wrappers*): * module/scripts/api-diff.scm (read-api-alist-file): * module/srfi/srfi-10.scm (reader-ctors): Update callers. Also remove some make-hash-table sizes.
2019-09-12Define top-level bindings for aux syntax: else, =>, _, ...Andy Wingo1-2/+2
* module/ice-9/boot-9.scm (else, =>, ..., _): New definitions. These are specified by the r6rs and the r7rs. * module/ice-9/sandbox.scm (core-bindings): Include the aux syntax definitions. * module/rnrs/base.scm: * module/rnrs.scm: Re-export aux syntax.
2019-08-02Merge from stable-2.2Andy Wingo1-5/+13
2019-06-18Fix documentation of R6RS 'binary-port?' to reflect reality.Mark H Weaver1-5/+13
* doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of 'binary-port?' and 'textual-port?'. * module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the docstrings.
2018-08-07Fix R6RS call-with-{input,output}-file to open textual ports.Mark H Weaver1-3/+3
Fixes <https://bugs.gnu.org/32329>. Reported and diagnosed by Göran Weinholt <goran@weinholt.se>. * module/rnrs/io/simple.scm (call-with-input-file) (call-with-output-file): Use 'open-{input,output}-file' to open the port in textual mode. Previously 'open-file-{input,output}-port' was used, which opened the port in binary mode.
2018-08-02Fix R6RS call-with-{input,output}-file to open textual ports.Mark H Weaver1-3/+3
Fixes <https://bugs.gnu.org/32329>. Reported and diagnosed by Göran Weinholt <goran@weinholt.se>. * module/rnrs/io/simple.scm (call-with-input-file) (call-with-output-file): Use 'open-{input,output}-file' to open the port in textual mode. Previously 'open-file-{input,output}-port' was used, which opened the port in binary mode.
2017-09-23Replace "pr" struct fields with "pw" fieldsAndy Wingo1-4/+4
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field. * module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are writable. (<parameter>): "pw" fields. * module/oop/goops.scm (<class>, %compute-layout): <read-only> fields are "pw" underneath. * module/rnrs/records/procedural.scm (record-type-vtable) (record-constructor-vtable, make-record-type-descriptor): Use "pw" fields in vtables. * module/srfi/srfi-35.scm (%condition-type-vtable) (struct-layout-for-condition): "pw" fields in vtables. * test-suite/tests/goops.test: * test-suite/tests/structs.test: Use "pw" fields only. * benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail, to use pw fields, and also to remove useless tests that the compiler would optimize away. * doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial permissions character and update documentation. (Structure Basics, Meta-Vtables): Update examples. * libguile/hash.c (scm_i_struct_hash): Remove code that would handle opaque/self fields. * libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields. * libguile/struct.c (scm_struct_init): Simplify check for hidden fields. * libguile/values.c (scm_init_values): Field is "pw".
2017-09-22Merge stable-2.2 into masterAndy Wingo1-18/+19
This commit resolves conflicts by removing the deprecated make-struct.
2017-09-20Use make-struct/no-tail instead of make-structAndy Wingo1-18/+19
* module/ice-9/boot-9.scm: * module/language/cps/effects-analysis.scm: * module/language/elisp/falias.scm: * module/language/tree-il.scm: * module/language/tree-il/primitives.scm: * module/rnrs/records/procedural.scm: * module/srfi/srfi-35.scm: * module/system/base/syntax.scm: Change uses of make-struct to make-struct/no-tail.
2017-09-14remove self field of vtablesAndy Wingo1-10/+12
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT, scm_vtable_index_self): Remove "self" field. Renumber the other fields. * module/oop/goops.scm (<self-slot>): Remove. (fold-class-slots): Adapt for "self" slot removal. Adapt all users. (class-redefinition): Now that there is no "self" slot to update, use %modify-instance instead of %modify-class. * libguile/goops.c (class_self): Remove. (scm_sys_modify_class): Remove. * libguile/goops.h (scm_sys_modify_class): Remove. * module/rnrs/records/procedural.scm: Import vtable-offset-user. Renumber rtd indexes using vtable-offset-user. * module/srfi/srfi-35.scm (%condition-type-vtable): Remove mention of vtable fields. * module/system/base/types.scm (address->inferior-struct): Adapt for different vtable field layout.
2017-03-01Flush when getting string from r6rs string output portAndy Wingo1-1/+5
* module/rnrs/io/ports.scm (open-string-output-port): Calling the get-string proc should flush the buffer and reset the file position. * test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Add tests. Thanks to Freja Nordsiek for the report.
2016-08-04Implement R6RS custom binary input/output portsAndy Wingo1-0/+1
* NEWS: Add new feature. * doc/ref/r6rs.texi (rnrs io ports): * doc/ref/api-io.texi (Custom Ports): Document new procedure. * libguile/r6rs-ports.h: * libguile/r6rs-ports.c (make_custom_binary_input_output_port) (scm_make_custom_binary_input_output_port) (custom_binary_input_output_port_random_access_p) (initialize_custom_binary_input_output_ports) (scm_init_r6rs_ports): Implement custom binary input/output ports. * module/rnrs/io/ports.scm (rnrs): * module/ice-9/binary-ports.scm (ice-9): Export make-custom-binary-input/output-port.
2016-06-21Add R6RS bytevector->string, string->bytevectorAndy Wingo1-0/+31
* module/rnrs/io/ports.scm (string->bytevector): (bytevector->string): New procedures. * module/rnrs.scm: Export new procedures. * test-suite/tests/r6rs-ports.test: Add string->bytevector and bytevector->string tests.
2016-06-21Export &i/o-decoding, &i/o-encoding from (rnrs)Andy Wingo1-4/+4
* module/rnrs/io/ports.scm (&i/o-decoding, &i/o-encoding): Rename from &i/o-decoding-error and &i/o-encoding-error, to conform to R6RS. * module/rnrs.scm (rnrs): Export &i/o-decoding, &i/o-encoding, their accessors and constructors.
2016-06-21Implement R6RS output-port-buffer-modeAndy Wingo1-2/+17
* module/rnrs/io/ports.scm (r6rs-open): Set buffer-mode on new port. (output-port-buffer-mode): Implement and export. * module/rnrs.scm (rnrs): Export output-port-buffer-mode * test-suite/tests/r6rs-ports.test (test-output-file-opener): Add tests.
2016-06-21(rnrs hashtables): Hash functions of eq? and eqv? hashtablesTaylan Ulrich Bayırlı/Kammer1-7/+15
Also pinging this thread with a (very slightly) updated patch. :-) [2. text/x-diff; 0001-Hashtable-hash-function-returns-f-on-eq-and-eqv-tabl.patch] From 17599f6ce7ba0beb100e80455ff99af07333d871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= <taylanbayirli@gmail.com> Date: Tue, 21 Jun 2016 00:23:29 +0200 Subject: [PATCH] Hashtable-hash-function returns #f on eq and eqv tables. * module/rnrs/hashtables.scm (r6rs:hashtable)[type]: New field. (r6rs:hashtable-type): New procedure. * test-suite/tests/r6rs-hashtables.test: Add related tests.
2016-06-21(rnrs hashtables): Mutation of immutable hashtable ignoredTaylan Ulrich Bayırlı/Kammer1-2/+3
Pinging this thread with a (very slightly) updated patch. :-) [2. text/x-diff; 0001-Hashtable-set-errors-on-immutable-hashtable.patch] From 7f35d515d711e255bba5a89a013d9d92034edf41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= <taylanbayirli@gmail.com> Date: Tue, 21 Jun 2016 00:25:19 +0200 Subject: [PATCH] Hashtable-set! errors on immutable hashtable. * module/rnrs/hashtables.scm (hashtable-set!): Raise an assertion violation error when the hashtable is immutable. * test-suite/tests/r6rs-hashtables.test: Fix accordingly.
2016-06-21Fix fixnum-range changes in R6RS fixnum bitopsAndy Wingo1-3/+25
* module/rnrs/arithmetic/fixnums.scm (fxcopy-bit, fxbit-field) (fxcopy-bit-field, fxarithmetic-shift) (fxarithmetic-shift-left, fx-arithmetic-shift-right) (fxrotate-bit-field, fxreverse-bit-field): Enforce range on amount by which to shift. Fixes #14917. * test-suite/tests/r6rs-arithmetic-fixnums.test ("fxarithmetic-shift-left"): Update test to not shift left by a negative amount.
2014-04-25Merge branch 'stable-2.0'v2.1.0Mark H Weaver1-3/+10
Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c
2014-03-19Fix (rnrs io simple) to open file ports in textual mode.Mark H Weaver1-3/+10
Fixes <http://bugs.gnu.org/17044>. Reported and diagnosed by Xin Wang <dram.wang@gmail.com>. * module/rnrs/io/simple.scm (open-input-file, open-output-file): Pass missing buffer-mode argument to open-file-{input,output}-port. Previously, (native-transcoder) was incorrectly passed as the buffer-mode argument, so no transcoder was provided, thus creating a binary port.
2013-11-28Merge commit '8571dbde639e0ee9885bad49c9e180474bd23646'Andy Wingo1-15/+145
Conflicts: libguile/procprop.c
2013-11-18Convert guile exceptions to R6RS conditions in R6RS exception handlers.Mark H Weaver1-15/+145
* module/rnrs/exceptions.scm (&guile): New condition type. (guile-condition-converters): New variable. (convert-guile-condition, default-guile-condition-converter, set-guile-condition-converter!, guile-common-conditions, guile-lexical-violation-converter, guile-syntax-violation-converter, guile-assertion-violation-converter, guile-system-error-converter, guile-undefined-violation-converter, guile-error-converter, guile-implementation-restriction-converter): New procedures. (with-exception-handler): Catch all exceptions, not just R6RS exceptions. Convert native Guile exceptions to R6RS conditions, preserving the original Guile exception information in the &guile condition object. (raise): If the condition includes a &guile condition, use 'throw' to throw the original native guile exception instead of raising an R6RS exception. * test-suite/tests/r6rs-exceptions.test ("guile condition conversions"): Add tests.
2013-08-11Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-13/+2
2013-08-09Fix numerator and denominator handling of signed zeroes and infinities.Mark H Weaver1-13/+2
* libguile/numbers.c (scm_numerator, scm_denominator): Handle signed zeroes and infinities in accordance with the corresponding R6RS flonum procedures. * module/rnrs/arithmetic/flonums.scm (flnumerator, fldenominator): Remove special handling of infinities. * test-suite/tests/numbers.test (numerator, denominator): Add tests. Convert existing tests to use 'pass-if-equal'. * test-suite/tests/r6rs-arithmetic-flonums.test (flnumerator): Fix broken test of (flnumerator -0.0).
2013-08-07String ports use UTF-8; ignore %default-port-encoding.Mark H Weaver1-4/+2
* libguile/strports.c (scm_mkstrport): Use UTF-8; ignore %default-port-encoding. Rename 'str_len' and 'c_pos' to 'num_bytes' and 'c_byte_pos'. Interpret 'pos' argument as a character index instead of a byte index. * module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-6 to the list of core features. * module/srfi/srfi-6.scm (open-input-string, open-output-string): Simply re-export these, since the core versions are now compliant. * doc/ref/api-io.texi (String Ports): Remove text that describes non-compliant behavior of string ports with regard to encoding. * doc/ref/srfi-modules.texi (SRFI-0): Add srfi-6 to the list of core features. (SRFI-6): Remove text that mentions non-compliant behavior of core string ports. * module/ice-9/format.scm (format): * module/ice-9/pretty-print.scm (truncated-print): * module/rnrs/io/ports.scm (open-string-input-port, open-string-output-port): * test-suite/test-suite/lib.scm (format-test-name): * test-suite/tests/chars.test ("combining accent is pretty-printed", "combining X is pretty-printed"): * test-suite/tests/ecmascript.test (eread, eread/1): * test-suite/tests/rdelim.test: * test-suite/tests/reader.test (read-string): * test-suite/tests/regexp.test: * test-suite/tests/srfi-105.test (read-string): Don't set %default-port-encoding before creating string ports. * benchmark-suite/benchmarks/ports.bm (%latin1-port): Use 'set-port-encoding!' to set the string port encoding. (%utf8/ascii-port, %utf8/wide-port, "rdelim"): Don't set %default-port-encoding before creating string ports. * test-suite/tests/r6rs-ports.test ("lookahead-u8 non-ASCII"): Don't set %default-port-encoding before creating string ports. ("put-bytevector with UTF-16 string port", "put-bytevector with wrong-encoding string port"): Use 'set-port-encoding!' to set the string port encoding. * test-suite/tests/print.test (tprint): Use 'set-port-encoding!' to set the string port encoding. ("truncated-print"): Use 'pass-if-equal'. * test-suite/tests/ports.test ("encoding failure leads to exception", "%default-port-encoding is honored", "peek-char [latin-1]", "peek-char [utf-8]", "peek-char [utf-16]"): Remove tests. ("%default-port-encoding is ignored", "peek-char"): Add tests. ("suitable encoding [latin-1]", "suitable encoding [latin-3]", "wrong encoding, error", "wrong encoding, substitute", "wrong encoding, escape"): Use 'set-port-encoding!' to set the string port encoding. ("%default-port-encoding, wrong encoding"): Rewrite to use a file port instead of a string port.
2013-08-06Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-59/+22
Conflicts: libguile/numbers.c libguile/vm-i-scheme.c
2013-07-21Optimize R6RS bitwise operators.Mark H Weaver1-59/+22
* module/rnrs/arithmetic/bitwise.scm (bitwise-if, bitwise-length, bitwise-first-bit-set, bitwise-bit-field, bitwise-reverse-bit-field): Replace these with aliases to the identical SRFI-60 operators 'bitwise-if', 'integer-length', 'first-set-bit', 'bit-field', and 'reverse-bit-field'. (bitwise-copy-bit, bitwise-copy-bit-field, bitwise-rotate-bit-field): Reimplement these based upon the similar SRFI-60 operators 'copy-bit', 'copy-bit-field', and 'rotate-bit-field'. * test-suite/tests/r6rs-arithmetic-bitwise.test (bitwise-copy-bit): Fix test to conform to the specification, which requires the third argument to be either 0 or 1. * test-suite/tests/r6rs-arithmetic-fixnums.test (fxcopy-bit): Fix test to conform to the specification, which requires the third argument to be either 0 or 1.
2013-07-18Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver3-6/+14
2013-07-16Fix R6RS 'fixnum-width'.Mark H Weaver1-2/+5
Fixes <http://bugs.gnu.org/14879>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/fixnums.scm (fixnum-width): Rewrite to avoid inexact arithmetic, and correct the off-by-one error. * test-suite/tests/r6rs-arithmetic-fixnums.test (fixnum-width): Add tests.
2013-07-16Update copyright dates of recently-changed R6RS bitwise/flonums files.Mark H Weaver2-2/+2
* module/rnrs/arithmetic/bitwise.scm: module/rnrs/arithmetic/flonums.scm: test-suite/tests/r6rs-arithmetic-bitwise.test: test-suite/tests/r6rs-arithmetic-flonums.test: Add 2013 to the copyright dates.
2013-07-16Fix 'fxbit-count' for negative arguments.Mark H Weaver1-2/+7
Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/fixnums.scm (fxbit-count): If the argument is negative, return the 'bitwise-not' of the result of 'logcount', as per R6RS. Previously, 'fxbit-count' was identical to 'logcount'. * test-suite/tests/r6rs-arithmetic-fixnums.test (fxbit-count): Add test.
2013-07-16Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-23/+34
Conflicts: libguile/numbers.c
2013-07-16Flonum operations always return flonums.Mark H Weaver1-13/+26
Fixes <http://bugs.gnu.org/14871>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/flonums.scm (ensure-flonum): New procedure. (fllog): Rewrite using case-lambda. Handle negative zeroes. Use 'ensure-flonum'. (flatan): Rewrite using case-lambda. (flasin, flacos, flsqrt, flexpt): Use 'ensure-flonum'. * test-suite/tests/r6rs-arithmetic-flonums.test (fllog, flasin, flacos, flsqrt, flexpt): Add tests.
2013-07-16flfinite? applied to a NaN returns false.Mark H Weaver1-1/+1
Fixes <http://bugs.gnu.org/14868>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/flonums.scm (flfinite?): If the argument is a NaN, return false. * test-suite/tests/r6rs-arithmetic-flonums.test (flfinite?): Add test.
2013-07-16flonum? returns false for complex number objects.Mark H Weaver1-1/+1
Fixes <http://bugs.gnu.org/14866>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/flonums.scm (flonum?): Use 'real?' instead of 'number?'. * test-suite/tests/r6rs-arithmetic-flonums.test (flonum?): Add tests.
2013-07-16Allow fl+ and fl* to accept zero arguments.Mark H Weaver1-8/+6
Fixes <http://bugs.gnu.org/14869>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/flonums.scm (fl+, fl*): Accept zero arguments. * test-suite/tests/r6rs-arithmetic-flonums.test (fl+, fl*): Add tests.
2013-07-16Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-1/+5
Conflicts: libguile/keywords.c libguile/vm.c
2013-07-14Fix 'bitwise-bit-count' for negative arguments.Mark H Weaver1-1/+5
Fixes <http://bugs.gnu.org/14864>. Reported by Göran Weinholt <goran@weinholt.se>. * module/rnrs/arithmetic/bitwise.scm (bitwise-bit-count): If the argument is negative, return the 'bitwise-not' of the result of 'logcount', as per R6RS. Previously, 'bitwise-bit-count' was identical to 'logcount'.