1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

3386 commits

Author SHA1 Message Date
Marius Vollmer
8dd6dfdcd2 New files with implementations of dirent and uname for Win32. 2001-11-01 23:23:41 +00:00
Mikael Djurfeldt
d245ce231d * unif.c (scm_uniform_array_read_x, scm_uniform_array_write):
Don't apply scm_uniform_vector_length on arrays.
2001-10-28 11:13:35 +00:00
Dirk Herrmann
8ea4624953 * eval.c (scm_lookupcar, scm_m_letstar, scm_m_do, iqq,
scm_m_define, scm_m_letrec1, scm_m_let, scm_m_expand_body,
scm_macroexp, unmemocopy, scm_eval_args, scm_deval_args,
SCM_CEVAL, scm_map, scm_init_eval):  When building lists, prefer
scm_list_<n> over scm_cons[2]?.

(scm_unmemocar, scm_m_cond, scm_m_letstar, scm_m_letrec1,
scm_m_let, scm_m_atbind, unmemocopy, SCM_CEVAL, SCM_APPLY):  Use
SCM_C[AD][AD]R instead of explicit form.

(scm_m_set_x, scm_m_cond, scm_m_letstar, scm_m_do):  Reordered
comparison parameters.

(scm_m_case, scm_m_cond, scm_m_letstar, scm_m_do, SCM_CEVAL):  Use
!SCM_NULLP instead of SCM_NIMP.

(scm_m_case):  Don't copy the form.  Renamed proc to clause and
minimized its scope.  Renamed x to clauses.  Removed side
effecting operation from macro call.

(scm_m_cond):  Don't copy the form.  Renamed arg1 to clause and
minimized its scope.  Renamed x to clauses.  Minimized the scope
of variable 'len'.  Make sure the else clause is treated specially
even in case of '=>' occurences.  Don't change the else to #t in
order to be able to distinguish this case in the evaluator.  Leave
type checking of the recipient to the evaluator.

(scm_c_improper_memq):  Made the comment somewhat clearer.

(scm_m_lambda):  Renamed proc to formals.  Removed unnecessary
test for SCM_IM_LET at the place of the formal parameters.
Simplified the formal parameter checking.

(scm_m_letstar):  Added Comment.  Renamed proc to bindings.
Renamed arg1 to binding and minimized its scope.  Eliminated
unnecessary consing.

(scm_m_do):  Renamed proc to bindings.  Minimized the scope of
variable 'len'.

(build_binding_list):  New static function.

(unmemocopy):  Don't use SCM_TYP7 on pairs (it's unclean).
Further, split up the 'letrec' unmemoizing code to the
corresponding parts for 'do', 'let' and 'letrec', adding comments
to each form.  Cleanup the handling of the do form (This removes
some *real* code :-).

(SCM_CEVAL):  Removed side effecting operation from macro call.
Handle the 'else clause of the 'cond form specially - the symbol
'else is not replaced with #t any more.
2001-10-18 21:38:04 +00:00
Gary Houston
8186c4f536 * version.c (scm_version): use sprintf instead of snprintf,
for portability.  thanks to Bill Schottstaedt.
2001-10-14 21:28:23 +00:00
Mikael Djurfeldt
89759084ab * read.c (scm_lreadr): When user-defined hash procedure returns
SCM_UNSPECIFIED: Fall back to standard handling instead of raising
an exception.  (This prevents parsing of uniform vectors from
interfering with parsing of numbers.)

* arrays.scm (read:uniform-vector): Return *unspecified* instead
of raising an exception if hash extend character isn't followed by
the array list. (This prevents parsing of uniform vectors from
interfering with parsing of numbers.)
2001-10-14 16:05:04 +00:00
Marius Vollmer
9c7ce56302 *** empty log message *** 2001-10-13 15:42:52 +00:00
Marius Vollmer
143883dd3f (EXTRA_libguile_la_SOURCES): Added "mkstemp.c". 2001-10-13 15:42:07 +00:00
Marius Vollmer
4110fa69b0 (display_backtrace_file_and_line): Only use scm_basename when POSIX
support is compiled in.  Thanks to Chris Cramer.
2001-10-13 15:41:40 +00:00
Marius Vollmer
311f67823d (scm_m_atbind): First try to find the variable without defining it
locally; when it has not been found, define it locally.
2001-10-13 15:41:12 +00:00
Marius Vollmer
dc187f33fd (module_variable): Pass over variables that exist but are unbound. 2001-10-13 15:40:29 +00:00
Marius Vollmer
3756da52d9 Set NO_PREPRO_MAGIC when defining our version of PTRDIFF_MIN. Thanks
to Ken Raeburn.
2001-10-13 15:39:53 +00:00
Dirk Herrmann
1fe5e088ff * numbers.c (mem2uinteger): Return number read so far when coming
across a hexdigit after having read a # or if not reading a hex
value.  This will enable the calling code to correctly handle
forms like 1e2.  (The background is, that the exponent markers d,
e and f are also hexdigits.)  Thanks to Mikael Djurfeldt for
providing this patch.

(mem2complex):  Fix erroneous double-negation.  Now, numbers like
1-i will be read correctly.
2001-10-13 12:39:26 +00:00
Mikael Djurfeldt
aa5e5d63eb * debug.c (scm_mem_to_proc): Fixed typo in previous change. 2001-10-12 09:02:03 +00:00
Mikael Djurfeldt
68665a9708 * validate.h (SCM_VALIDATE_DOUBLE_DEF_COPY): New macro. 2001-10-12 08:55:05 +00:00
Dirk Herrmann
d5cf5324a3 * print.c (scm_print_state_vtable, print_state_pool):
Initialize.  These variables are now registered as gc roots.

(scm_current_pstate):  Update documentation.

(scm_current_pstate, scm_make_print_state, scm_free_print_state,
scm_prin1, scm_init_print):  print_state_pool is registered as a
gc root and thus does not need to be protected by a surrounding
pair any more.

(make_print_state):  The car of print_state_pool no longer holds
the scm_print_state_vtable.

(scm_current_pstate, scm_make_print_state, print_circref,
scm_iprin1, scm_prin1, scm_iprlist):  Prefer !SCM_<foo> over
SCM_N<foo>.

(scm_prin1):  When building lists, prefer scm_list_<n> over
scm_cons[2]?.

(scm_iprlist):  Removed a redundant SCM_IMP test.

(scm_simple_format):  Use SCM_EQ_P to compare SCM values.
2001-10-11 23:20:52 +00:00
Dirk Herrmann
37c56aecf8 * debug.c (scm_make_iloc): Prefer !SCM_<foo> over SCM_N<foo>.
(scm_memcons, scm_mem_to_proc):  When building lists, prefer
scm_list_<n> over scm_cons[2]?.

(scm_mem_to_proc):  Prefer SCM_CONSP over SCM_NIMP.

(scm_procedure_name):  Use SCM_CADR instead of explicit form.

(debugobj_print):  Coerce scm_intprint arg 1 to long, not int.
Thanks to Rob Browning for the patch (see log entry 2001-09-21) -
for some reason his patch didn't make it into the cvs.
2001-10-11 22:26:25 +00:00
Dirk Herrmann
79d34f68e7 * numbers.c (mem2decimal_from_point): Cleaned up the parsing a
little bit - should even be somewhat more accurate now.
2001-10-09 20:56:36 +00:00
Rob Browning
d918965272 * gc.c: support ia64 register backing store.
(SCM_MARK_BACKING_STORE): new macro.
2001-10-09 03:33:16 +00:00
Rob Browning
766c5eaf49 * continuations.h: support ia64 register backing store.
(struct scm_t_contregs): add ia64 register backing store.
2001-10-09 03:33:06 +00:00
Rob Browning
193297d8b5 * continuations.c: support ia64 register backing store.
(continuation_mark): mark ia64 register backing store.
(continuation_free): free ia64 register backing store.
(scm_make_continuation): capture ia64 register backing store.
(copy_stack_and_call): copy ia64 register backing store.
2001-10-09 03:32:20 +00:00
Rob Browning
5e137c657b *** empty log message *** 2001-10-09 03:32:12 +00:00
Dirk Herrmann
ee083ac29f * hashtab.c (scm_hash_fn_create_handle_x): The result of assoc_fn
is known to be #f if no entry is found.  Thus, use !SCM_FALSEP
instead of SCM_NIMP to test for that case.

* strings.h (SCM_SET_STRING_LENGTH):  Cast the length to
scm_t_bits instead of long.
2001-10-08 21:23:00 +00:00
Marius Vollmer
ce191a26e6 Correct cut and paste error: use SCM_POSFIXABLE for unsigned types. 2001-10-06 20:49:10 +00:00
Marius Vollmer
c0060c9589 Corrected definition of SCM_MOST_POSITIVE_FIXNUM. Boy was I confused. 2001-10-06 20:48:27 +00:00
Marius Vollmer
71dcdbf9a0 *** empty log message *** 2001-10-06 20:01:36 +00:00
Marius Vollmer
801ba33101 (INTEGRAL2NUM): Let the preprocessor test
whether the integral type fits in a fixnum, not the compiler.
This removes a spurious compiler warning.  Also, honor the
NO_PREPRO_MAGIC flag to suppress any preprocessor tests.  This is
needed for `long long's.
2001-10-06 20:00:43 +00:00
Marius Vollmer
dcb6a296dc Define NO_PREPRO_MAGOC when including
num2integral.c.i for `long long' and `signed long long'.
2001-10-06 19:58:24 +00:00
Marius Vollmer
004c0902ff * tags.h (SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
SCM_T_SIGNED_BITS_MIN): New.
* numbers.h (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM):
Use them to make these macros computable by the preprocessor.
2001-10-06 19:58:02 +00:00
Mikael Djurfeldt
152812c057 * coop.c (mother_awake_p): New variable.
(coop_create): Set mother_awake_p before creating or signalling
mother; wait until mother is going to sleep before returning.
(mother): Reset mother_awake_p before going to sleep.
2001-10-06 16:30:20 +00:00
Dirk Herrmann
11d49f5489 * options.c (protected_objects, scm_init_options): The content of
protected_objects is now protected from garbage collection using
scm_gc_register_root instead of scm_permanent_object.

(get_option_setting):  New static function that	computes an option
setting as it was formerly done in the function scm_options.

(get_documented_option_setting):  New static function that
returns option documentation as it was formerly done in the
function scm_options.  Note that documentation C strings are no
longer precomputed into SCM objects.  Instead, they are converted
into SCM strings every time get_documented_option_setting is
called.

(change_option_setting):  New static functions that modifies the
option setting as it was formerly done in the function
scm_options.  The function is now exception safe, i. e. won't
cause a memory leak when interrupted.  Further, only non-immediate
option values are added to the protection list.

(scm_options):  This function now has only the purpose to dispatch
to to get_option_setting, get_documented_option_setting or
change_option_setting, depending on the arguments given to
scm_options.

(scm_init_opts):  Don't convert documentation C strings into SCM
strings.  Further, don't protect any object values:  They _must_
be immediate values, otherwise there is no guarantee that they
have not been collected before anyway.

* options.[ch] (scm_t_option):  Made type unsigned, name into a
constant char* and val into a scm_t_bits type.

(scm_options, scm_init_opts):  The number of options is guaranteed
to be larger or equal to zero.  Thus, the type is changed to
unsigned.
2001-10-05 20:18:30 +00:00
Dirk Herrmann
3dbacabc55 * num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about
testing an unsigned value for being >= 0.
2001-10-05 18:26:46 +00:00
Dirk Herrmann
14282d0f5c * numbers.h: Removed old comment about using SCM_CAR to access
non-pair cells.

(SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM):  Make sure
the return value is signed.  Thanks to Brian Crowder for the bug
report.

(SCM_SRS):  Avoid unnecessary casting and don't unpack input
values.  With this patch, SCM_SRS can be safely used for other
types than scm_t_signed_bits.  However, it should still better be
an internal macro and thus be renamed to SCM_I_SRS.

(SCM_MAKINUM, SCM_INUM):  Use proper casting.
2001-10-05 17:43:49 +00:00
Gary Houston
2dbec7b5fc * continuations.h, unif.h: in the descriptions of the bit patterns
of the heap cells, make bit 0 the least significant.
2001-10-03 20:45:44 +00:00
Thien-Thi Nguyen
cf4ee84106 *** empty log message *** 2001-09-26 03:15:44 +00:00
Thien-Thi Nguyen
f5dd4f5419 (SCM_MAKE_CHAR): Use scm_t_bits' instead of intptr_t'.
Thanks to Golubev I. N.
2001-09-26 03:14:15 +00:00
Gary Houston
4a151b3da9 * ports.c (scm_drain_input): extended the docstring. thanks to
Alex Schroeder and Thien-Thi Nguyen.
2001-09-25 22:46:13 +00:00
Mikael Djurfeldt
581ded70a3 * validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE,
SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY): New
macros. (The NUM names might soon change.)

* numbers.h: Added missing declarations.
2001-09-23 21:25:26 +00:00
Mikael Djurfeldt
5437598b36 * Makefile.am: Distribute num2float.i.c.
* num2float.i.c: New file, multiply included by numbers.c, used
to "templatize" the float <-> num conversion routines.

* numbers.c: New functions: scm_num2float, scm_float2num,
scm_num2double, scm_double2num.
2001-09-22 21:39:42 +00:00
Rob Browning
0b073f0f14 *** empty log message *** 2001-09-21 17:58:04 +00:00
Rob Browning
b469bd68a6 * .cvsignore: really add version.h 2001-09-21 17:57:07 +00:00
Rob Browning
f6b115d97e * chars.h (SCM_MAKE_CHAR): coerce value to intptr_t. 2001-09-21 17:56:39 +00:00
Rob Browning
1aaa208e93 * numbers.c (scm_gcd): change "k" to a long from an int.
Otherwise it fails on the alpha.  However, we might rather choose
this size conditionally.
2001-09-21 17:56:31 +00:00
Rob Browning
27070f900d * strings.h (SCM_SET_STRING_LENGTH): coerce "l" to a long.
Otherwise it fails on the alpha.  However, we might rather choose
this size conditionally.
2001-09-21 17:56:17 +00:00
Mikael Djurfeldt
2830fd91c6 * numbers.c (scm_integer_expt): Accept inexact integer in second
argument.  (Thanks to Bill Schottstaedt.)
2001-09-20 18:53:32 +00:00
Rob Browning
c13f0a90f4 *** empty log message *** 2001-09-20 16:48:02 +00:00
Rob Browning
3143f1093d * version.c
(scm_major_version): support integer *_VERSION macros.
(scm_minor_version): support integer *_VERSION macros.
(scm_micro_version): support integer *_VERSION macros.
(scm_version): support integer *_VERSION macros.
2001-09-20 16:47:01 +00:00
Rob Browning
c8333bc59d * version.h: renamed to version.h.in. 2001-09-20 16:46:52 +00:00
Rob Browning
d2836a7db6 * version.h.in: renamed from version.h.
(SCM_GUILE_MAJOR_VERSION): new public macro.
(SCM_GUILE_MINOR_VERSION): new public macro.
(SCM_GUILE_MICRO_VERSION): new public macro.
2001-09-20 16:46:37 +00:00
Rob Browning
b1bdf8ec8a * versiondat.h.in: removed (obsolete). 2001-09-20 16:46:25 +00:00
Mikael Djurfeldt
a7f54aed6a * error.c, error.h: Made error keys globally accessible.
Applications might want to test for these or use them in a direct
call to scm_error.
2001-09-20 08:18:26 +00:00