Official chibi-scheme repository
Find a file
ilammy 8329ee9fd6 Do not lose carry bit in addition edge case
Previous code was losing the carry bit in 'all ones' case, when adata[i]
= bdata[i] = SEXP_UINT_T_MAX, and carry = 1 too. In this case expression
(SEXP_UINT_T_MAX - bdata[i] - carry) overflows and yields an incorrect
value SEXP_UINT_T_MAX which results into carry being incorrectly set to
0 after addition.

We need to avoid the second overflow when calculating the new value of
the carry bit. One way to do this is at first check for the overflow in
(adata[i] + bdata[i]), and then throw in the (previous) carry bit.

I have also given "n" more expressive name and added a comment about
the reason why we need that temporary variable.
2015-03-26 02:30:48 +02:00
benchmarks Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
build-lib/chibi/char-set Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
contrib Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
data Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
doc Removing uneeded trailing /. 2015-02-15 11:22:11 +09:00
examples Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
include/chibi Avoid overflow when doing sexp_fx_abs() 2015-03-26 02:30:48 +02:00
lib Updating submodule. 2015-03-22 23:17:14 +09:00
opt Committing removed files. 2015-02-08 16:02:50 +09:00
tests Do not lose carry bit in addition edge case 2015-03-26 02:30:48 +02:00
tools removed snow-chibi tool moved to submodule 2015-03-17 22:06:10 +09:00
.gitignore Ignoring generated tarballs. 2015-03-22 17:15:25 +09:00
.gitmodules added submodule for removed chibi-snow 2015-03-17 21:53:47 +09:00
.hgignore Emscripten support by default. Patch from Marc Nieper-Wi?kirchen. 2015-02-22 16:10:30 +09:00
AUTHORS Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
bignum.c Do not lose carry bit in addition edge case 2015-03-26 02:30:48 +02:00
chibi-scheme.pc.in Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
chibi-scheme.vcproj Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
COPYING Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
eval.c s/abs/labs for long argument 2015-02-06 10:46:43 +09:00
fedora.spec Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
gc.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
main.c Fixing typo in emscripten code. 2015-03-03 08:15:57 +09:00
Makefile fixing install target for snow-chibi 2015-03-17 22:09:32 +09:00
Makefile.detect Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
Makefile.libs Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
mkfile Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
opcodes.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
plan9.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
README Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
README.libs Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
RELEASE Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
sexp.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
simplify.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
TODO Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
VERSION changes go to the 0.7.3 release 2015-03-22 17:02:41 +09:00
vm.c Adding an abort facility to exit the vm without any exception handling. 2015-02-05 22:09:45 +09:00

                             Chibi-Scheme
                            --------------
                                   
    Minimal Scheme Implementation for use as an Extension Language

              http://synthcode.com/wiki/chibi-scheme/

Chibi-Scheme is a very small library intended for use as an extension
and scripting language in C programs.  In addition to support for
lightweight VM-based threads, each VM itself runs in an isolated heap
allowing multiple VMs to run simultaneously in different OS threads.

The default language is the R7RS (scheme base) library.

Support for additional languages such as JavaScript, Go, Lua and Bash
are planned for future releases.  Scheme is chosen as a substrate
because its first class continuations and guaranteed tail-call
optimization makes implementing other languages easy.

To build on most platforms just run "make && make test".  This will
provide a shared library "libchibi-scheme", as well as a sample
"chibi-scheme" command-line repl.  You can then run

  sudo make install

to install the binaries and libraries.  You can optionally specify a
PREFIX for the installation directory:

  make PREFIX=/path/to/install/
  sudo make PREFIX=/path/to/install/ install

By default files are installed in /usr/local.

If you want to try out chibi-scheme without installing, be sure to set
LD_LIBRARY_PATH so it can find the shared libraries.

For more detailed documentation, run "make doc" and see the generated
"doc/chibi.html".