Commit graph

6 commits

Author SHA1 Message Date
Alex Shinn
9f239534b4 rewriting string->number in C to fix the error catching problem (should return #f)
this calls sexp_read_number directly passing the base, so the
C implementation is shorter than the Scheme implementation,
much faster, and as an opcode generates smaller bytecode per use.
2010-04-03 11:31:11 +09:00
Alex Shinn
a89956fc16 new primitives API
Primitives now have a signature of prim(ctx, self, n, args ...)
instead of just prim(ctx, args ...).  This allows for variadic
primitives, should help clean up exception handling, and will
allow primitives generated from Scheme->C or JIT compilation.

The primitives sometimes used as utility functions from C such as
sexp_memq have been renamed with a "_op" suffix (e.g. sexp_memq_op)
and a macro sexp_memq has been provided filling in the self and n
args automatically.  The self is passed as NULL in these macros,
but will be probably replaced with a reference to the opcode later.
2010-03-24 19:58:50 +09:00
Alex Shinn
9897107d53 replacing SEXP_OPC_ACCESSOR with separate getter & setter opcode classes 2010-03-16 15:19:46 +09:00
Alex Shinn
5002f796d8 backing out the zero-arity option to - and / 2010-03-01 13:54:57 +09:00
Alex Shinn
325007d2b9 Removing SEXP_OP_NEGATIVE and SEXP_OP_INVERSE - these are compiled
directly by generate_opcode_app now.  Zero arity cases now supported:
(-) => 0, (/) => 1, equivalent to the zero arity + and * cases.
2010-03-01 13:15:06 +09:00
Alex Shinn
d954819775 adding (chibi io) w/ interface to fgets, fread, fwrite, etc. 2009-12-31 00:24:19 +09:00