Commit graph

186 commits

Author SHA1 Message Date
Alex Shinn
c4625e1c86 fixnum/integer naming cleanup
Replacing sexp_make_integer, sexp_integerp, etc. with sexp_make_fixnum,
sexp_fixnump, etc.  Defining the old names as variants handling either
fixnums or bignums, or just as aliases for the new terms when compiled
without bignum support.  sexp_make_integer needs to take a context now
in case it generates a bignum.
2009-11-02 23:39:42 +09:00
Alex Shinn
5b14a3a19d adding todo list 2009-11-02 01:31:23 +09:00
Alex Shinn
576a20b3bc simplifying gc variable preservation
Adding sexp_gc_var1..6 and corresponding _preserve/release1..6
referring to fixed preservation variable names, to substantially
reduce the boilerplate on C functions which produce temporary sexp
values.  The fixed variable names are safe because we never nest
them within the same C function.  The original macros are still
available for manual naming, block local variables and cases of
more than 6 gc vars.

Consider combining var+preserve into a single macro, since splitting
them is rare.
2009-11-01 19:48:30 +09:00
Alex Shinn
445f8e9fa4 adding bignum support for 64-bit machines
using gcc 128-bit register extensions to hold the result of
multpliying two 64-bit integers.
2009-11-01 18:53:32 +09:00
Alex Shinn
91efc04852 fixes for 64-bit machines 2009-11-01 17:17:06 +09:00
Alex Shinn
e50950316f commenting out name used for debugging stack references into the heap 2009-10-14 10:42:10 +09:00
Alex Shinn
62c390d68e initial module system 2009-10-13 18:29:18 +09:00
Alex Shinn
6376198e92 additions in preparation for module system 2009-10-11 18:45:32 +09:00
Alex Shinn
34a9b15645 adding reader support for infinities 2009-08-24 22:48:33 +09:00
Alex Shinn
386a1cdb0a working on 9p support 2009-08-24 22:41:54 +09:00
Alex Shinn
d36e70f6bf fixing various numeric operations 2009-08-24 22:41:33 +09:00
Alex Shinn
df5b916640 adding initial 9p interface 2009-08-11 01:15:29 +09:00
Alex Shinn
8ba102c5c4 adding initial untyped "cpointer" data type 2009-08-11 01:14:39 +09:00
felix
c6499c8b62 diff should get -b on windows to ignore line-terminator differences; SEXP_API is redundantly redefined in sexp.c 2009-07-19 16:18:30 +02:00
felix
605a8dc87b resolved conflicts 2009-07-19 16:10:44 +02:00
Alex Shinn
1de49b46ce initial plan9 extensions 2009-07-17 01:58:04 +09:00
Alex Shinn
9951c8e921 adding extended numeric tests and fixes for the bignum bugs it turned up 2009-07-15 23:56:51 +09:00
Alex Shinn
4ba0705f05 fixing trunc for real now
(hopefully... getting sleepy)
2009-07-14 01:45:16 +09:00
Alex Shinn
e780c122c0 fixing definition of trunc for plan9 2009-07-14 01:36:37 +09:00
Alex Shinn
fba75390b7 fixing the mk test target to test with $O.out 2009-07-14 01:09:59 +09:00
Alex Shinn
e8b2cb872b don't free() manually buffered input ports
since they point to gc managed memory.
2009-07-14 00:42:36 +09:00
Alex Shinn
5d94079e4a more cleanup and portability fixes
Using <u.h> and <libc.h> for plan9, no need for separate .i file
construction.  Also mkfile now simplified and using /sys/src/cmd/mkone
(thanks to Charles Forsyth).
2009-07-14 00:34:23 +09:00
Alex Shinn
6d709264bd Cleanup for more pedantic C.
Notably no longer converting from function pointers <-> void*.

Remaining --pedantic warnings:

  * ISO C90 does not support 'long long'
  * ISO C90 does not support the 'z' printf length modifier
  * ISO C90 does not support flexible array members
  * ISO C90 forbids mixed declarations and code
  * ISO C90 forbids specifying subobject to initialize
  * anonymous variadic macros were introduced in C99
  * invalid use of structure with flexible array member

The first one is only used when optional bignums are enabled,
and I have no intention of supporting bignums on systems w/o
long long (although it's not guaranteed two words fit in a
long long - I need to fix this).

The 'z' modifier is necessary for long types (you'd get
warnings the other way without it).

The next 4 are intentional - they make the code cleaner,
and all of these extensions are supported by Plan 9.

The last one is tricky.  I think it refers to the fact
that not only am I using flexible array members, but I'm
using them as non-final alternates in a union.  I'll have
to double check the semantics of this.
2009-07-12 23:46:27 +09:00
Alex Shinn
ba187ed4ae Reverting order of close and free for closing Linux memstreams.
Freeing first causes a segfault when closing a string port.
This closes issue 3: http://code.google.com/p/chibi-scheme/issues/detail?id=3
2009-07-12 20:40:00 +09:00
Alex Shinn
f2e79c3028 off by one error in sexp_bignum_mul
need an extra digit to fit carries
2009-07-12 19:06:38 +09:00
Alex Shinn
821546244a plan9 fixes - can't use #if preprocessor statements inside macros.
also, no log2() by default, defining it in terms of log().
2009-07-12 18:36:37 +09:00
Alex Shinn
41f54a7f41 initial windows mingw support patch from felix winkelmann 2009-07-07 19:58:28 +09:00
Alex Shinn
e8985cd84c Reporting a more sensible error when the initialization
file isn't found, per issue #2:
http://code.google.com/p/chibi-scheme/issues/detail?id=2
2009-07-07 19:36:59 +09:00
Alex Shinn
b1c0ea895b committing initial bignum support, still needs more thorough testing.
can disable with USE_BIGNUMS=0 - the interactions between this and
USE_FLONUMS are messy, so they will likely be merged into a single
option in the near future (i.e. you either have only fixnums, or a
full range of numeric types).
adding rationals based on this would be easy and is a likely future
feature.  adding native support for complex numbers is unlikely.
2009-07-07 19:16:23 +09:00
felix
7df9ff823a merged with upstream commits 2009-07-01 18:30:13 +02:00
felix
cf9ec69fd3 more mingw fixes in Makefile 2009-06-30 09:54:28 +02:00
felix
bf598f6ee5 basic mingw support 2009-06-30 09:50:32 +02:00
Alex Shinn
fc04f16b1d merging plan9 work 2009-06-30 13:45:47 +09:00
Alex Shinn
55a8a38e62 DESTDIR patch from sladegen 2009-06-30 11:38:05 +09:00
Alex Shinn
78ceffdee4 making literals immutable 2009-06-28 19:07:19 +09:00
Alex Shinn
343303f408 cleaning up plan9 mkfile and providing install target 2009-06-28 17:46:37 +09:00
Alex Shinn
f1e7c3a2db reporting source file and line number for compile-time errors 2009-06-28 14:52:52 +09:00
Alex Shinn
ab2cbe12f7 gc preserving read errors 2009-06-28 13:19:12 +09:00
Alex Shinn
cca8727354 fixing hex char and number syntax, adding support for n/d numbers
as floats
2009-06-28 13:10:34 +09:00
Alex Shinn
e40fdb3b73 using a separate sexp_free_list type, so we don't need the
overhead of the sexp tag and should thus fit in any aligned
block on 64bit architectures.  this also removes a lot of
ugly casts, making the code more readable.
2009-06-28 02:31:11 +09:00
Alex Shinn
69ab0d02d9 using names from type specs for unreadable objects in sexp_write 2009-06-28 02:05:13 +09:00
Alex Shinn
63b8f63fec need to close string ports 2009-06-28 01:48:12 +09:00
Alex Shinn
baa8b07d63 don't want -l in link rule for chibi-scheme 2009-06-27 23:54:48 +09:00
Alex Shinn
32838c1f9b only using our own buffering for string ports 2009-06-27 23:46:03 +09:00
Alex Shinn
d4f97c40d5 initial plan9 work 2009-06-27 20:28:04 +09:00
Alex Shinn
86ce8fbc15 hygiene fix for nested macros, still need to clean this up 2009-06-24 00:47:49 +09:00
Alex Shinn
09114aa45d using -fPIC on object files, running ldconfig on install if available 2009-06-24 00:45:54 +09:00
Alex Shinn
ddf866ee27 adding basic call/cc tests 2009-06-23 11:53:06 +09:00
Alex Shinn
6941ada64f Was unintentionally using the same name 'sexp_types' for the sexp
type definitions and for the sexp type enum.  They shouldn't conflict,
since the enum is in the enum namespace, but apparently they do in
mscv.  Chaging the defs to sexp_type_specs.
2009-06-23 11:49:26 +09:00
Alex Shinn
956b451cdd Updating resume/cc needs to jump to the start of the procedure
bytecode plus the offset on the stack (not directly to the offset
on the stack).  Need to add a call/cc test to the r5rs-tests to
catch this next time.
2009-06-23 11:46:56 +09:00