Commit graph

2950 commits

Author SHA1 Message Date
Alex Shinn
ecbaa9939a require proof of the presence of synclos before stripping them with quote (issue #464) 2018-04-01 21:38:21 +09:00
Alex Shinn
f67f63d570 fixing number->string for numbers within an ulp of round numbers 2018-04-01 21:01:58 +09:00
Alex Shinn
060cfd550e
Merge pull request #465 from jimrees/master
changes from jim rees
2018-04-01 15:32:32 +09:00
Alex Shinn
502a011b18 Merge branch 'master' of https://github.com/ashinn/chibi-scheme 2018-04-01 10:47:02 +09:00
Alex Shinn
757b8969dd
Merge pull request #463 from katterjohn/master
Avoid placing duplicate feature identifiers in the features list
2018-04-01 10:46:51 +09:00
Kris Katterjohn
5e80cb2c2b In my last commit, make the feature variable a gc variable 2018-03-31 20:23:00 -05:00
Kris Katterjohn
dc80bf4f04 Avoid placing duplicate feature identifiers in the (features) list
In my case "bsd" was present twice on my *BSD boxes
2018-03-31 14:19:18 -05:00
Alex Shinn
731c544872
Merge pull request #462 from katterjohn/master
Check for valid "rest" parameters in parameter lists
2018-03-29 18:45:23 +09:00
Kris Katterjohn
439e35da61 Check for valid "rest" parameters in parameter lists
Checks for invalid parameter names and duplicate parameters were
being performed on parameter lists, but these checks were not
considering any rest parameters.  This means that

  ((lambda (x . x) x) 'foo 'bar)   =>  foo
  ((lambda (x . 0) x) 'foo 'bar)   =>  foo
  ((lambda (x . #t) x) 'foo 'bar)  =>  foo
  ((lambda 0 'foo))                =>  foo
  ((lambda #t 'foo))               =>  foo

and so on.  Now these all produce errors.
2018-03-28 21:11:33 -05:00
Jim Rees
9b72412e4e Added additional show-tests which demonstrate recent bugs & fixes. 2018-03-27 14:47:14 -04:00
Jim Rees
b3100857fd Fixed escaped to support the documented double-quoting functionality
when esc-char is #f.
2018-03-26 06:44:37 -04:00
Jim Rees
88e8d89460 Fixed integer-log-base to use exact arithmetic so rounding doesn't cause
a wrong result to things like (numeric (- (* 36 36 36) 1) 36).

Fixed a bug in numeric that caused comma-sep and dec-sep to get
initialized wrongly.

Fixed maybe-trim-zeros to leave behind at least a ".0" on
inexact numbers that otherwise would have been output without
the decimal point.  This is for consistency with number->string
which is used when the radix is 10.

In gen-general, fixed a bug in the digit-generating loop for the
whole part of the number.  Previously, an integer that should
have looked like 5003 would be emitted as 5300.

Switched the order of application of maybe-round and
maybe-trim-zeros so that a number that should round to
.0000000000000001 doesn't get emitted as 0.1.

In gen-positive-real, fixed the ratio case to not call
number->string with a radix that might not be in {2,8,10,16}.

Also in gen-positive-real, fixed the call to number->string to
include the radix which was missing previously.

Fixed wrap-sign to correctly handle the case of -0.0.

In numeric/si, always emit the supplied separator even if the
number is too small for an SI-suffix to be emitted.  The
examples in the SRFI document depend on this.
2018-03-23 12:22:03 -04:00
Jim Rees
17eb19e43d Changed sexp_double_to_bignum to extract "digits" in base-16 rather
than base 10 so no round-off errors occur at each step.  This is
assuming FLT_RADIX is 2,4,8 or 16.
2018-03-23 10:50:15 -04:00
Jim Rees
b25e46b11b Introduced a second version of sexp_double_to_ratio, named
sexp_double_to_ratio_2, which converts without introducing
round-off errors the way sexp_double_to_ratio does when it
multiplies by 10.

Changed sexp_inexact_to_exact to use this new function when
a non-zero fractional part of the input exists.
2018-03-22 22:19:39 -04:00
Jim Rees
406aacf4dd try-fitted2/output* calls output on the argument string if it's
determined the string will not exceed the column width.  But
output is the caller environment's output state variable.  A
better choice is output-default.

In two places (length+ form) is replaced with (or (length+ form) +inf.0)
so that arithmetic can be performed on the result.

To support cyclic structures in pretty-simply (wrapped with
trimmed/lazy), the call-with-output form in pp-with-indent needs to be
wrapped with an appropriate trimmed/lazy.

In pp-pair, call (pp (car ls)) instead of (pretty (car ls)).

In pretty-simply, don't use call-with-output, that prevents
(trimmed/lazy n (pretty-simply ...)) from working at all on cyclic
input.
2018-03-22 11:06:55 -04:00
Jim Rees
b947e4ef47 Fixed trivial bug in padded/both where the "odd space" was being emitted
on the left rather than the right as specified.

Fixed trivial bug in padded/left where a string longer than the provided
width would result in a call to make-string with a negative length.

Fixed trivial bug in trimmed/lazy around an fn-binding for the output
state variable.
2018-03-22 10:41:52 -04:00
Jim Rees
ece2d470c3 Fixed from-file so that it produces more than just one line of output. 2018-03-22 09:50:34 -04:00
Alex Shinn
098d50d4e4 Merge branch 'master' of https://github.com/ashinn/chibi-scheme 2018-03-17 17:01:42 +09:00
Alex Shinn
933aeb5654 tests which expect an inexact value can accept an equivalent exact value 2018-03-17 16:50:41 +09:00
Alex Shinn
d0b63109e8
Merge pull request #461 from jacius/remainder_inf
Regression tests for remainder with infinity
2018-03-16 22:40:32 +09:00
John Croisant
fe85ccc94a Add regression tests for remainder with infinity. 2018-03-15 21:48:19 -05:00
John Croisant
3c41f9d3e2 Add "test-division" Makefile target.
Runs tests/division-tests.scm. The "test-all" target now also runs
test-division.
2018-03-15 21:43:21 -05:00
John Croisant
c5345a5b48 Fix errors in tests/division-tests.scm.
Import (scheme base) to get the basic division procedures.

The "centered" procedures were renamed to "balanced" in commit
975dc690a1.

Also cleaned up some trailing whitespace.
2018-03-15 21:37:08 -05:00
Alex Shinn
d167f90802
Merge pull request #460 from jacius/remainder_inf
Raise type error if remainder called with infinity.
2018-03-15 21:46:25 +09:00
John Croisant
e5d9ccb69f Raise type error if remainder called with infinity.
To prevent an infinite loop, raise a type error if the remainder
procedure is called with +inf.0 or -inf.0 as either argument.
2018-03-15 02:42:26 -05:00
Alex Shinn
f0c9f0e705 adding chibi-version variable to (chibi ast) 2018-03-11 23:47:33 +09:00
Alex Shinn
e4cc2dd33c default comparator compares numbers with = (issue #459) 2018-03-10 11:11:59 +09:00
Alex Shinn
d07170d6c3 Documenting sexp_register_c_type and sexp_make_cpointer. 2018-02-18 09:19:36 +09:00
Alex Shinn
e5f6c1bbba adding better debugging for zero-sized object warning 2018-02-16 17:01:21 +09:00
Alex Shinn
dc76aee1d6 s/sexp_init/sexp_scheme_init/ 2018-02-15 10:15:26 +09:00
Alex Shinn
1658cf66d6 adding sexp_init() (noop by default) to C example in docs 2018-02-15 10:13:18 +09:00
Alex Shinn
7ae96fdba5 typo in vector-select! 2018-02-01 15:43:46 +09:00
Alex Shinn
13a8c50373 install (srfi 135 kernel8) 2018-01-25 11:40:53 +09:00
Alex Shinn
1a2c504c5f typo, make cleaner should remove versioned so's 2018-01-25 01:27:18 +09:00
Alex Shinn
ea2e3d7e0a updating install files 2018-01-25 01:24:41 +09:00
Alex Shinn
cd0b6e32af fixing test-build 2018-01-25 01:07:49 +09:00
Alex Shinn
351e6562a0 updating trace in oom tests 2018-01-25 00:11:44 +09:00
Alex Shinn
5b5ca24a15 add repl to red image 2018-01-25 00:08:53 +09:00
Alex Shinn
5023e88897 don't include-shared hash multiple times 2018-01-24 23:58:30 +09:00
Alex Shinn
eb38a5836a extending (scheme red) 2018-01-24 23:54:09 +09:00
Alex Shinn
ab88f53e48 adding srfi 113 2018-01-24 23:47:28 +09:00
Alex Shinn
7cd26b9823 advanced repl should use (scheme small) by default 2018-01-16 21:23:21 +09:00
Alex Shinn
03544833dc rename (chibi show) update! to with! as in srfi 159 2018-01-16 21:15:54 +09:00
Alex Shinn
309c591d66 adding doc link to (srfi 159) 2018-01-16 19:55:39 +09:00
Alex Shinn
73734c7010 adding (srfi 159) wrapper around (chibi show) 2018-01-16 19:54:59 +09:00
Alex Shinn
f6f470c3e5 adding (srfi 135) 2018-01-16 01:14:40 +09:00
Alex Shinn
bd9ea1d3ac adding (srfi 134) 2018-01-16 00:00:48 +09:00
Alex Shinn
0c27921f51 adding (srfi 101) 2018-01-15 23:51:16 +09:00
Alex Shinn
b91022afea adding (srfi 127) 2018-01-15 23:15:14 +09:00
Alex Shinn
f8cc1402c2 adding (srfi 41) 2018-01-14 00:22:14 +09:00