Alex Shinn
58e9715c2b
handle non-positive numbers in numeric/si (fixes issue #801 )
2021-12-25 10:55:58 +09:00
Marc Nieper-Wißkirchen
232dc6ef20
Fix SRFI 227 exports
2021-12-11 14:27:20 +01:00
Alex Shinn
9a17254536
guard against opcodes
2021-12-03 08:33:28 +09:00
Alex Shinn
9a48a110b8
add bounds check
2021-12-02 22:07:57 +09:00
Alex Shinn
0da288d053
implement (srfi 229)
2021-12-02 22:03:58 +09:00
Daphne Preston-Kendal
427629a43e
Add support for SRFI 227
2021-11-24 10:24:21 +01:00
Jeronimo Pellegrini
ce97808201
Add missing constants to SRFI-144
...
The following constants were missing from Chibi's SRFI-144
implementation:
fl-1/e
fl-e-pi/4
fl-1/log-2
fl-log-3
fl-log-pi
fl-1/log-10
fl-2pi
fl-pi-squared
fl-degree
fl-gamma-1/2
fl-gamma-1/3
fl-gamma-2/3
2021-09-29 00:57:31 -03:00
Alex Shinn
22e89b168a
fix array-tile
2021-08-19 19:22:29 +09:00
Alex Shinn
57e4652ea6
Assert same domains in array-for-each, as per the spec and implicitly
...
depended on by the implementation.
2021-08-16 20:28:03 +09:00
Alex Shinn
6cafda8916
Decouple syntax-case from the Chibi core.
...
This restores third-party (ab)users of the Chibi macro system such
as in https://gist.github.com/baguette/2632464 , while allowing us
to break those uses in more interesting ways.
It also keeps the core slightly smaller (both in C and Scheme)
and speeds up the macro expansion process.
2021-08-10 23:19:35 +09:00
Alex Shinn
73da0a88d4
scan for appropriate 2nd element to take the mean with when calling vector-find-median on an even length vector (issue #754 )
2021-06-29 21:09:41 +09:00
Alex Shinn
5207bdfde2
Defining list->u8vector (issue #749 ).
2021-06-18 13:04:20 +09:00
Alexei Lozovsky
6f35aa75f4
Fix usage of signbit() in SRFI 144
...
C standard defines signbit() as a macro returning "non-zero value" for
negative arguments (see 7.12.3.6 of C11 standard). SRFI 144's flsign-bit
is defined to return exactly 1.
Make sure to convert the result of signbit() call into "boolean int"
which is either 0 or 1.
This is not a theoretical issue. This causes SRFI 144 test suite to fail
on many architectures that are not x86_64.
GCC on x86_64 compiles signbit() as
movmskpd %xmm0, %eax
andl $1, %eax
which indeed returns either 0 or 1. movmskpd extracts 2-bit sign mask
from the FP value in src register and stores that in low-order bits of
the dst register. Then the unneded extra bit is masked out, leaving only
the lowest bit set or unset.
However, other architectures don't have such conveniences and go with
more direct approach. For example, GCC on ARMv7 produces this:
sub sp, sp, #8
vstr.64 d0, [sp]
ldr r0, [sp, #4 ]
and r0, r0, #0x80000000
add sp, sp, #8
bx lr
which effectively returns either 0 or -1. Generated code masks out
everything but the sign bit and returns the result as is. The value
0x80000000 is the representation of -1.
Even on i386 signbit() is compiled as
fldl 4(%esp)
fxam
fnstsw %ax
fstp %st(0)
andl $512, %eax
ret
which effectively returns either 0 or 512: fxam sets C1 bit FPU status
word to the sign of FP value, then the status word is extracted, the
"sign bit" is masked out, and left as is.
2021-06-06 13:49:44 +09:00
Alex Shinn
037a7b24fc
exporting array-coeffs
2021-05-10 22:56:36 +09:00
Alex Shinn
3eab7bf226
package SRFI 179
2021-05-10 17:49:02 +09:00
Alex Shinn
6e5278b7a1
separating out SRFI 179 base library
2021-05-07 22:39:53 +09:00
Alex Shinn
ca47a41ccf
array simplification and performance tweaks
2021-05-07 16:15:48 +09:00
Alex Shinn
12ad1d37d8
add docs and tests for assert, unify with SRFI 145
2021-05-06 20:34:03 +09:00
Alex Shinn
e3083062fa
Flattening indexing further.
...
We can pre-subtract each coeff times its lower bound from the
base coefficient in SRFI 179 indexers.
2021-04-30 14:25:39 +09:00
Alex Shinn
d11106b2f7
Fix upper bounds checks in u64vectors.
2021-04-30 14:02:29 +09:00
Alex Shinn
3c138dc808
Fix validation on specialized-array-reshape.
2021-04-30 13:38:53 +09:00
Alex Shinn
76284f79f0
flattening array indexers
2021-04-28 22:53:16 +09:00
Alex Shinn
cd5bf03537
Merge pull request #740 from lassik/219
...
Add SRFI 219: Define higher-order lambda
2021-04-18 18:58:39 +09:00
Lassi Kortela
7178d22928
Add SRFI 219: Define higher-order lambda
2021-04-18 12:21:32 +03:00
Alex Shinn
d0510bebe6
simplify array-reduce
2021-04-16 23:35:16 +09:00
Alex Shinn
c8f5f49890
add initial SRFI 179 implementation
2021-04-16 19:53:51 +09:00
Alex Shinn
487ea21d77
check value domains on uvector-set! ops
2021-04-16 10:13:37 +09:00
Alex Shinn
fc6e5da915
make-u1vector takes an optional fill
2021-04-15 17:02:44 +09:00
Alex Shinn
e74614d4b3
removing redundant uvector definitions
2021-04-14 17:06:34 +09:00
Alex Shinn
8b27ce9726
add proper grammar support to srfi 130 string-split
2021-04-02 13:51:02 +09:00
Alex Shinn
adec61993b
adding domain checks on uvector accessors
2021-03-26 17:34:25 +09:00
Lassi Kortela
fa52b4987a
Add SRFI 193 Scheme library
...
This was accidentally left out of the previous commit.
2021-02-05 14:08:31 +02:00
Alex Shinn
9f0ed1a869
Revert "Implement SRFI 193: Command lines"
2021-01-24 19:57:55 +09:00
Alex Shinn
751675c6b2
Merge pull request #619 from lassik/command-lines
...
Implement SRFI 193: Command lines
2021-01-24 16:44:35 +09:00
Alex Shinn
0597ea68a5
save a char and a beta reduction
2020-11-25 14:39:49 +09:00
Marc Nieper-Wißkirchen
306dbd470a
Fix and-let* so that it allows bodies according to SRFI 2.
2020-10-22 15:13:04 +02:00
Marc Nieper-Wißkirchen
251464eade
Translate assume to a noop when assumptions are disabled
2020-08-29 11:11:46 +02:00
Marc Nieper-Wißkirchen
043e4c2214
Fix generator-find
2020-08-29 10:25:23 +02:00
krzygorz
9067c8b5d5
text attribute resetting fix
2020-08-24 13:52:29 +02:00
Alex Shinn
d75ae9304f
forgot to export make-state-variable from composite library
2020-08-17 22:02:15 +09:00
Alex Shinn
6be0e8d059
exporting make-state-variable in SRFI 166 (issue #683 )
2020-08-17 21:56:57 +09:00
Alex Shinn
5ee7ad0230
allow start/end args to uvector->vector conversions (issue #682 )
2020-08-16 08:06:22 +09:00
Arvydas Silanskas
cf40f1aca1
add fl-epsilon to srfi 144
2020-08-11 21:26:42 +03:00
Alex Shinn
31c2adf8bf
hash raw bytes of bignums
2020-08-11 11:12:04 +09:00
Alex Shinn
dc524feabc
add missing trailing ? on SRFI 144 inequality ops
2020-08-11 10:37:23 +09:00
Alex Shinn
5616d2fb87
adding uvector-segment test
2020-08-11 10:36:52 +09:00
Alex Shinn
a8e35f90fa
s/max/max in vector-segment (issue #677 )
2020-08-08 16:20:01 +09:00
Alex Shinn
ffeb960997
fixing uvector-reverse-copy (issue #676 ); ungeneralize unfold to take exactly one seed
2020-08-08 16:14:57 +09:00
Alex Shinn
90f0425c37
fixing distribution of random bignums, adding uniformity tests on the results (issue #675 )
2020-08-07 12:40:07 +09:00
Alex Shinn
449312d3bd
restoring hashing of trailing data for uvectors
2020-08-04 18:31:20 +09:00