2004-08-11 Marius Vollmer * gc.c, procprop.c (scm_init_storage, scm_stand_in_procs, scm_stand_in_proc): Use a hastable for scm_stand_in_procs instead of an alist. Thanks to Matthias Koeppe! 2004-08-10 Marius Vollmer * strings.h, deprecated.h (SCM_STRING_COERCE_0TERMINATION_X): Moved from string.h to deprecated.h. * deprecated.c, deprecated.h (SCM_CHARS, SCM_LENGTH): Removed. * strings.h, strings.c (SCM_MAKE_STRING_TAG): Renamed to SCM_I_MAKE_STRING_TAG, changed all uses. (SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Renamed to SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_LENGTH respectively. For a short time, the old names are still there as aliases. Not all uses have been changed yet, but the ones in strings.c have. (SCM_STRING_MAX_LEN): Do not hardcode to 24 bits, compute from SCM_T_BITS_MAX. (scm_is_string, scm_from_locale_string, scm_from_locale_stringn, scm_take_locale_string, scm_take_locale_stringn, scm_to_locale_string, scm_to_locale_stringn, scm_to_locale_stringbuf): New. (scm_c_string2str, scm_c_substring2str): Deprecated by moving to deprecated.[hc]. Implemented in terms of the new functions above. (scm_take_str, scm_take0str, scm_mem2string, scm_str2string, scm_makfrom0str): Reimplemented in terms of the new functions from above. They will be discouraged shortly. (scm_substring): Do not use scm_mem2string. (scm_i_allocate_string_pointers, scm_i_free_string_pointers): New, to replace similar code from posix.c, simpos.c, and dynl.c. (scm_string_append): Use memcpy instead of explicit loop. Do not use register keyword. Use plain 'char' instead of 'unsigned char'. * strports.c (scm_mkstrport): Use SCM_I_STRING_UCHARS instead of SCM_STRING_UCHARS. Use SCM_I_STRINGP instead of SCM_STRINGP. * strop.c (scm_i_index): Replaced SCM_STRINGP, SCM_STRING_CHARS, and SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and SCM_I_STRING_LENGTH, respectively. Pass string object directly, not as a pointer. Use scm_remember_upto_here_1 to protect it. * read.c (scm_input_error): Use a SCM value for 'fn', not a C string. This avoids a conversion round-trip. * gh_data.c: Replaced SCM_STRINGP, SCM_STRING_CHARS, and SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and SCM_I_STRING_LENGTH, respectively. (gh_scm2newstr): Implement in terms of scm_to_locale_string. * environments.c: Instead calling scm_puts on the SCM_STRING_CHARS of a string, call scm_display on the string itself. * dynwind.c, dynwind.h (scm_frame_free): New. * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c, net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c: Replaced uses of SCM_STRING_CHARS with proper uses of scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string. Replaced scm_mem2string with scm_from_locale_string. * simpos.c, posix.c (allocate_string_pointers, environ_list_to_c): Removed, replaced all uses with scm_i_allocate_string_pointers. * load.h, load.c (scm_internal_parse_path): Removed. (scm_parse_path): Use scm_string_split to do the work. (scm_init_load_path): Use scm_parse_path instead of scm_internal_parse_path. (scm_search_path): Rewritten string handling part of the code in terms of scm_to_locale_stringbuf and so that it is thread safe. * error.c (scm_error_scm): Throw directly instead of calling scm_error, this avoids the back and forth conversion of SUBR and MESSAGE and also plugs a memory leak. (scm_error): Call scm_error_scm. * backtrace.c: Replaced SCM_STRINGP with scm_is_string. (display_header): Print FNAME when it is true, not merely when it is a string. * strings.h (SCM_SET_STRING_LENGTH, SCM_SET_STRING_CHARS): Removed unceremoniously. They were unused by Guile itself, and external use should stop immediately. 2004-08-10 Marius Vollmer * numbers.h, number.c, deprecated.h, deprecated.c (scm_round, scm_truncate): Renamed to scm_c_round and scm_c_truncate; deprecated versions installed in deprecated.h and deprecated.c. Changed all uses. 2004-08-06 Rob Browning * net_db.c (scm_resolv_error): don't cause an exception while trying to throw an exception -- call scm_misc_error with correct arguments. The previous arguments needed a format escape that wasn't in any of the format strings. 2004-08-06 Kevin Ryde * ramap.c (scm_array_fill_x): For byvect char fill, force signed char so as not to depend on signedness of plain char. For byvect range check, throw out-of-range rather than wrong-type-arg. * unif.c (scm_uniform_vector_ref, scm_array_set_x): For byvect, force signed byte range checks by using scm_to_schar and scm_from_schar, don't want to depend on signedness of C char. 2004-08-05 Kevin Ryde * arbiters.c (scm_try_arbiter): Use scm_i_misc_mutex instead of SCM_DEFER_INTS. (scm_release_arbiter): Use scm_i_misc_mutex so return value can be guaranteed if multiple threads compete to unlock. Update docstrings per doc/ref/api-scheduling.texi. * filesys.c (scm_copy_file): Use fstat on the input fd rather than stat on the filename, to be certain a file rename can't mean we get info on one filesystem object but open another. This fstat usage is similar to Emacs copy-file. * posix.c (scm_setgroups): Enhance docstring, per doc/ref/posix.texi. * simpos.c (scm_system_star): Change scm_from_long to scm_from_int on SIGINT and SIGQUIT, since those values are ints. 2004-08-03 Marius Vollmer * num2integral.i.c, num2float.i.c: Removed. * Makefile.am (noinst_HEADERS): Updated. * numbers.h. numbers.c (scm_make_ratio): Renamed to scm_i_make_ratio and made static, replaced uses with scm_divide. (scm_complex_p): New, export as "complex?" to Scheme. (scm_number_p): Export as "number?" to Scheme. (scm_is_complex, scm_is_number): New. (scm_c_make_rectangular, scm_c_make_polar): New. (scm_make_rectangular, scm_make_polar): Use above. (scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle): New. (scm_make_complex): Discouraged by moving to discouraged.h and discouraged.c. Replaced all uses with scm_c_make_rectangular. * discouraged.h, discouraged.c, numbers.c, numbers.h (scm_is_rational): New. (scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big): Removed prototypes. (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num): Discouraged by moving to discouraged.h and discouraged.c. Replaced all uses with scm_from_double. (scm_num2float, scm_num2double): Discouraged by moving prototype to discouraged.h and rewriting in terms of scm_to_double. Replaced all uses with scm_to_double. (scm_to_double): Do not implement in terms of scm_num2dbl, use explicit code. (scm_from_double): Do not implement in terms of scm_make_real, use explicit code. 2004-08-02 Marius Vollmer * init.c (scm_init_guile_1): Call scm_i_init_discouraged. * gen-scmconfig.h.in (SCM_I_GSC_ENABLE_DISCOURAGED): New. * gen-scmconfig.c (SCM_ENABLE_DISCOURAGED): Emit based on above. * eval.c (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR): Renamed to SCM_I_* in order to avoid collisions with the versions defined in deprecated.h. * discouraged.h, discouraged.c: New files. * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P, SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being deprecated to being discouraged by moving to discouraged.h. * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num, scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long): Discouraged by moving to discouraged.h and discouraged.c and reimplementing in terms of scm_from_* and scm_to_*. Changed all uses to the new scm_from_* and scm_to_* functions. * numbers.h, numbers.c: Removed GUILE_DEBUG code. (scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big, scm_i_ptrdiff2big): Removed. (scm_i_long2big, scm_i_ulong2big): New, explicit definitions. * conv-integer.i.c, conv-uinteger.i.c: Use them instead of explicit code. 2004-08-02 Kevin Ryde * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Add comments about past and current usage and migration. 2004-07-31 Kevin Ryde * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since it's not thread safe. (scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take advantage of this. * fports.c (scm_open_file): Use scm_strerror likewise. * filesys.c (scm_stat, scm_lstat): Ditto. * filesys.c (scm_copy_file): Avoid fd leak when destination file cannot be opened. * symbols.c (scm_gensym): Use scm_i_misc_mutex around gensym_counter update, for thread safety. (gensym_counter): Move into scm_gensym which is its only user. (scm_init_symbols): No need to explicitly initialize gensym_counter. 2004-07-29 Marius Vollmer * numbers.h (scm_to_schar, scm_to_uchar, scm_to_char, scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long, scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax, scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar, scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort, scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong, scm_from_long_long, scm_from_ulong_long, scm_from_intmax, scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer defined in terms of scm_to_signed_integer, etc, but in terms of scm_to_int8, etc. * gen-scmconfig.c (SCM_SIZEOF_INTMAX, SCM_SIZEOF_SIZE_T): New. * gen-scmconfig.h.in: Removed SCM_I_GSC_*_LIMITS macros, they are no longer used. * __scm.h (SCM_I_UTYPE_MAX, SCM_I_TYPE_MAX, SCM_I_TYPE_MIN, SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX): New. * __scm.h, gen-scmconfig.c (SCM_I_LLONG_MAX, SCM_I_LLONG_MIN, SCM_I_ULLONG_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT8_MAX, SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT16_MAX, SCM_T_INT32_MIN, SCM_T_INT32_MAX, SCM_T_UINT32_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX, SCM_T_UINT64_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX, SCM_T_UINTMAX_MAX): Moved definition into __scm.h, using new SCM_I_TYPE_MIN, etc. * conv-integer.i.c, conv-uinteger.i.c: New files, used to generate the functions below. * Makefile.am (noinst_HEADERS): Added conv-integer.i.c and conv-uinteger.i.c. * numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64, scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64, scm_from_uint64): Turned from macros into proper functions. (scm_to_signed_integer, scm_to_unsigned_integer, scm_from_signed_integer, scm_from_unsigned_integer): Generate via conv-integer.i.c and conv-uinteger.i.c, as well. * number.h (scm_to_ssize_t, scm_to_size_t): Use the new SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX, and SCM_I_SIZE_MAX macros for the limits. Those are always defined. 2004-07-29 Kevin Ryde * posix.c (scm_ttyname): Use scm_i_misc_mutex for thread safety. 2004-07-28 Kevin Ryde * posix.c (scm_ctermid): Use an L_ctermid buf on the stack, for thread safety. * unif.c (scm_array_set_x): For svect, use scm_num2short for consistency with other vector types and to get arg and func name into error message. 2004-07-27 Marius Vollmer * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL): Reimplement using scm_is_false, scm_is_true, scm_is_bool, and scm_from_bool, respectively. (SCM_NINUMP): Added. * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into deprecated.h. Replaced all uses with scm_is_eq. 2004-07-24 Kevin Ryde * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX. * posix.c (scm_crypt): Use it to protect static data in crypt(). 2004-07-23 Marius Vollmer * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP, SCM_INUM): Deprecated by renaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate. * dynwind.c (scm_i_dowinds): Removed unused code that would call the unexisting scm_cross_dynwind_binding_scope for inums on the windlist. 2004-07-10 Marius Vollmer * socket.c (ipv6_net_to_num, scm_from_ipv6): Renamed ipv6_net_to_num to scm_from_ipv6, for converting from an IPv6 byte-wise address to a SCM integer. Changed all uses. (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to scm_to_ipv6 and added type and range checking, for converting from an IPv& byte-wise address to a SCM integer. Changed all uses. (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function is now done by scm_to_ipv6. * numbers.c (scm_to_signed_integer, scm_to_unsigned_integer): dot not accept inexact integers. * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY, SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF, SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE, SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the fixnum/bignum distinction visible. Changed all uses to scm_to_size_t or similar. 2004-07-09 Marius Vollmer * cpp_cnvt.awk: Use scm_from_int instead of SCM_MAKINUM. 2004-07-10 Kevin Ryde * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather than size>=0, since 0<=hash * numbers.c (scm_is_signed_integer, scm_is_unsigned_integer): Rewritten using the same logic as scm_to_signed_integer and scm_to_unsigned_integer, respectively, which is better(tm). Also, use CHAR_BIT instead of hardcoding 8. (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Removed and used SCM_I_LLONG_MIN etc. instead. * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to SCM_I_MAKINUM and changed all uses. * deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated. * gen-scmconfig.c (SCM_I_LLONG_MIN, SCM_I_LLONG_MAX, SCM_I_ULLONG_MAX): Instead of hard-coding the numbers, compute them by assuming twos-complement. 2004-07-07 Marius Vollmer * gen-scmconfig.h.in: Added all the new SCM_I_GSC_*_LIMITS that configure now produces. * gen-scmconfig.c: Use them to output SCM_T_INT8_MIN, etc definitions, giving the limits of the integer types defined by Guile. Also, output a hard coded SCM_I_LLONG_MIN, etc since LLONG_MIN or LONG_LONG_MIN is hard to get at. * numbers.h (scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not SHORT_MIN. (scm_to_size_t): Use SIZE_MAX instead of cooking our own. (scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8, scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax, scm_from_long_long, scm_from_ulong_long, scm_from_int8, scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax, scm_from_uintmax): New. 2004-07-06 Marius Vollmer * tags.h (scm_is_eq): New. * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL, SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. * boolean.h (scm_is_bool): Fix bug in prototype. (scm_from_bool): The argument is "x" not "f", stupid. * boolean.c (scm_is_bool): Fix typo. * numbers.h, numbers.c (scm_is_integer, scm_is_signed_integer, scm_is_unsigned_integer, scm_to_signed_integer, scm_to_unsigned_integer, scm_to_schar, scm_to_uchar, scm_to_char, scm_to_short, scm_to_ushort, scm_to_long, scm_to_ulong, scm_to_size_t, scm_to_ssize_t, scm_from_schar, scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort, scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong, scm_from_size_t, scm_from_ssize_t, scm_is_real, scm_to_double, scm_from_double): New. 2004-07-05 Marius Vollmer * boolean.h, boolean.c (scm_is_true, scm_is_false, scm_from_bool, scm_to_bool): New. 2004-06-27 Dirk Herrmann * backtrace.c (display_expression, display_frame): Call scm_i_unmemoize_expr for unmemoizing a memoized object holding a single memoized expression. * debug.c (memoized_print): Don't try to unmemoize the memoized object, since we can't know whether it holds a single expression or a body. (scm_mem_to_proc): Removed check for lambda expression, since it was moot anyway. Whoever uses these functions for debugging purposes should know what they do: Creating invalid memoized code will cause crashes, independent of whether this check is present or not. (scm_proc_to_mem): Take the closure's code as it is and don't append a SCM_IM_LAMBDA isym. To allow easier debugging, the memoized code should not be modified. * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed scm_unmemoize from public use, but made scm_i_unmemoize_expr available as a guile internal function instead. However, scm_i_unmemoize_expr will only work on memoized objects that hold a single memoized expression. It won't work with bodies. * debug.c (scm_procedure_source), macros.c (macro_print), print.c (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body, i. e. a list of expressions. * eval.c (unmemoize_exprs): Drop internal body markers from the output during unmemoization. * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr, scm_i_unmemocopy_body): Removed scm_unmemocopy from public use, but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available as guile internal functions instead. scm_i_unmemoize_expr will only work on a single memoized expression, while scm_i_unmemocopy_body will only work on bodies. 2004-06-21 Dirk Herrmann * eval.c (unmemoize_exprs): Handle semi-memoized code. (scm_cons_source, scm_primitive_eval): Prefer higher level predicate SCM_FALSEP over SCM_IMP. 2004-06-15 Rob Browning * script.c (scm_shell_usage): minor phrasing change. * gc_os_dep.c: update ifdefery for macosx. (scm_get_stack_base): separate result initialization from declaration to slience warnings with macosx and hp-ux using gcc 3.3. Thanks to Andreas Vögele. 2004-06-13 Han-Wen Nienhuys * eval.c (unmemoize_exprs): use SCM_CONSP for the loop condition. 2004-06-06 Dirk Herrmann * list.[ch] (scm_i_finite_list_copy): New internal function to copy lists that are known to be finite (though not necessarily proper). * debug.c (scm_procedure_source): Don't have scm_unmemocopy treat a closure's argument list like an expression of a body. * eval.c (unmemoize_expression, unmemoize_exprs, unmemoize_and, unmemoize_begin, unmemoize_case, unmemoize_cond, unmemoize_delay, unmemoize_do, unmemoize_if, unmemoize_lambda, unmemoize_let, unmemoize_letrec, unmemoize_letstar, unmemoize_or, unmemoize_set_x, unmemoize_apply, unmemoize_atcall_cc, unmemoize_at_call_with_values, unmemoize_future, sym_atslot_ref, unmemoize_atslot_ref, sym_atslot_set_x, unmemoize_atslot_set_x, unmemoize_builtin_macro): New static functions and symbols. (scm_unmemocopy): Rewritten in terms of the above. scm_unmemocopy now has a slightly different meaning: The memoized form that is receives as its argument is now interpreted as a sequence of expressions from a body. (unmemocar, scm_unmemocar): Since the whole functionality of unmemocar and scm_unmemocar is not needed any more, scm_unmemocar has its old content back and is deprecated, while unmemocar has been removed. (SCM_BIT7): Removed. (CEVAL): For unmemoizing a single expression, call unmemoize_expression instead of scm_unmemocopy, which now expects a sequence of body expressions. Eliminated unnecessary empty environment frame when executing let* forms. Eliminated unmemoization step from evaluator. 2004-06-02 Marius Vollmer * eval.c (scm_macroexp, macroexp): Renamed scm_macroexp to macroexp and made static. Added new version of scm_macroexp that emits a deprecation warning and then calls macroexp. (scm_m_undefine): Issue deprecation warning. 2004-05-30 Dirk Herrmann * eval.c (lookup_global_symbol, literal_p, try_macro_lookup): Modified to make set! work on symbols that represent syntactic keywords. 2004-05-26 Han-Wen Nienhuys * gc.h (SCM_CELL_OBJECT_LOC): use SCM_GC_CELL_OBJECT to prevent compound expression as lvalue errors. 2004-05-24 Marius Vollmer * dynwind.c (winder_mark): Use SCM_PACK to correctly convert the WINDER_DATA to a SCM. 2004-05-24 Dirk Herrmann * goops.c (compute_getters_n_setters, create_standard_classes, scm_add_slot): Compute closures by calling scm_i_eval_x on a lambda expression rather than creating them with scm_closure. 2004-05-22 Dirk Herrmann * eval.c (s_macro_keyword, scm_m_set_x): Remove checking for misplaced syntactic keywords. This will not work unless guile's defmacro feature is deprecated. (scm_m_case): Fixed a bug that caused the list of labels to grow with every case form. 2004-05-19 Kevin Ryde * numbers.c (scm_round_number): For inum and big, just return x. For real, use scm_round for 2^54-1 etc problems covered there. * numbers.c (trunc): Remove #define to scm_truncate when the C library doesn't provide trunc. This was for when `truncate' was done as a scm_tc7_dsubr, no longer required. * threads.c (scm_threads_mark_stacks) [SCM_STACK_GROWS_UP]: Correction to stack marking call, two parameters and no cast on t->base. 2004-05-18 Marius Vollmer * hashtab.c (rehash_after_gc): Bug fix: properly link the processed hashtables back into the weak_hashtables list. Thanks to Bill Schottstaedt! 2004-05-16 Dirk Herrmann * eval.c (unmemoize_quote): New static function. (scm_m_quote, scm_m_atslot_ref, SCM_CEVAL): Changed the byte code representation of 'quote' and '@slot-ref' to an improper list. This reduces execution time, the number of cells used to hold the memoized code, and thus also reduces garbage collection time. (scm_unmemocopy): Use unmemoize_quote for quote expressions. (SCM_CEVAL): Changed macro handling to also work with macros that return improper lists. Added an assertion, that the code returned by a macro transformer will not lead to cycles in the memoized code. 2004-05-15 Dirk Herrmann No functional change, just rearrangements of functions within the file. * eval.c (scm_ilookup, scm_unbound_variable_key, error_unbound_variable, scm_lookupcar1, scm_lookupcar): Moved to the definitions used for execution, since that's where they will belong to later. 2004-05-15 Dirk Herrmann * numbers.h (SCM_SLOPPY_FRACTIONP): Removed. It was not used throughout guile, has not been part of an official release yet, and the concept of sloppy predicates has never been a good idea. (SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR, SCM_FRACTION_SET_DENOMINATOR): Simplified. 2004-05-15 Dirk Herrmann * throw.c (SETJBJMPBUF, SCM_SETJBDFRAME): Add cast to scm_t_bits to make explicit what happens. 2004-05-15 Dirk Herrmann * dynl.c (SET_DYNL_HANDLE): Add cast to scm_t_bits to make explicit what happens. * guardians.c (TCONC_IN): Use SCM_SET_CELL_OBJECT_x rather than SCM_SET_CELL_WORD_x when writing scheme objets to cell elements. 2004-05-11 Marius Vollmer * scmsigs.c (scm_sigaction_for_thread): Validate that the handler is indeed a procedure when it isn't a number. 2004-05-10 Marius Vollmer Convert floating point numbers into strings with an arbitrary radix. Thanks to Richard Todd! * numbers.c (FLOBUFLEN): Increase so that radix 2 strings will fit. (fx): Removed. (scm_dblprec, fx_per_radix, init_dblprec, init_fx_radix, number_chars): New, to support variable radices. (idbl2str): Use above instead of the old base-10 only tables. (iflo2str): Pass on new RADIX argument to idbl2str. (scm_number_to_string): Pass radix to iflo2str. (scm_print_real, scm_print_complex): Explicitly pass radix 10 to iflo2str. (scm_init_numbers): Call init_dblprec and init_fx_radix for all possible radices. 2004-05-10 Kevin Ryde * numbers.c (scm_logbit_p): Correction to test above the end of an inum. Reported by Jan Konecny. 2004-05-06 Marius Vollmer * gc.h (scm_t_cell): Fields are now of type SCM instead of scm_t_bits. Updated all users. (SCM_GC_CARD_SIZE_MASK): Use SCM_GC_SIZEOF_CARD instead of duplicating the code. (SCM_CELL_OBJECT_LOC): New. (SCM_CARLOC, SCM_CDRLOC): Use it instead of SCM_CELL_WORD_LOC. (SCM_CELL_WORD_LOC): Moved to "deprecated.h". * smob.h (SCM_SMOB_DATA_2, SCM_SMOB_DATA_3, SCM_SMOB_FLAGS, SCM_SET_SMOB_DATA_2, SCM_SET_SMOB_DATA_3, SCM_SET_SMOB_FLAGS, SCM_SMOB_OBJECT, SCM_SMOB_OBJECT_2, SCM_SMOB_OBJECT_3, SCM_SET_SMOB_OBJECT, SCM_SET_SMOB_OBJECT_2, SCM_SET_SMOB_OBJECT_3, SCM_SMOB_OBJECT_LOC, SCM_SMOB_OBJECT_2_LOC, SCM_SMOB_OBJECT_3_LOC): New. * smob.c (scm_i_set_smob_flags): New function. * dynl.c, dynwind.c, eval.h, fluids.h, futures.h, hashtab.h, hooks.h, keywords.h, macros.h, macros.c, mallocs.c, mallocs.h, random.h, regex-posix.h, root.h, srcprop.h, srcprop.c, threads.h: Use SCM_SMOB_* instead of SCM_CELL_* as appropriate. Use SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS instead of accessing the zeroth word directly. Use SCM_SMOB_PREDICATE as appropriate. * numbers.h (SCM_I_BIG_MPZ): Use SCM_CELL_OBJECT_LOC instead of taking the address of SCM_CELL_WORD_1, the latter being no longer an lvalue. * variable.h (SCM_VARIABLE_LOC): Use SCM_CELL_OBJECT_LOC instead of casting SCM_CELL_WORD_LOC. 2004-05-02 Kevin Ryde * eval.c (scm_macroexp): Add prototype, since it's not in eval.h under --disable-deprecated. Reported by Andreas Vögele. * filesys.c (_POSIX_C_SOURCE): Define to 199506L to get readdir_r (in particular on HP-UX). Reported by Andreas Vögele. * list.c (varargs.h): Remove, leave just stdarg.h which is all the code has support for. Fixes building with AIX cc, which is ansi but doesn't define __STDC__. Reported by Keith Crane. (var_start): Remove macro, this variation no longer required. (scm_list_n): Use va_start directly. 2004-05-01 Kevin Ryde * continuations.c (scm_dynthrow): Use >= instead of SCM_PTR_GE which is now gone. Reported by Andreas Vögele. 2004-04-28 Kevin Ryde * backtrace.c (display_frame_expr), numbers.c (XDIGIT2UINT, mem2uinteger, mem2decimal_from_point, mem2ureal): Cast char to int for ctype.h tests, to avoid warnings from gcc on HP-UX about char as array subscript. Reported by Andreas Vögele. Also cast through unsigned char to avoid passing negatives to those macros if input contains 8-bit values. * num2integral.i.c (NUM2INTEGRAL): Under non-BIGMPZ_FITSP case, corrections to range check for signed numbers. Remove scm_remember_upto_here_1(num) from these checks, since num is used subsequently anyway. * num2integral.i.c (NUM2INTEGRAL): Test BIGMPZ_FITSP with "!= 0" to avoid warning from gcc 3.4. Reported by Hyperdivision. * numbers.c (scm_bit_extract): Use min instead of MIN. (MIN): Remove, this conflicts with similar macro defined by limits.h on HP-UX. Reported by Andreas Vögele. * stime.c (_POSIX_C_SOURCE): Define to 199506L to get gmtime_r (in particular on HP-UX). Reported by Andreas Vögele. * threads.c (scm_threads_mark_stacks): Correction sizet -> size_t. Reported by Andreas Vögele. * threads-plugin.h (SCM_MUTEX_MAXSIZE): Increase to 25*sizeof(long), for the benefit of hpux11 where pthread_mutex_t is 88 bytes. Reported by Andreas Vögele. 2004-04-22 Dirk Herrmann * eval.c (s_macro_keyword): New static identifier. (scm_m_define): Change order to first create binding and evaluating the expression afterwards. (scm_m_set_x): Memoize complete set! expression. Only leave symbols if no binding exists at memoization time. Throw error if assigning to a syntactic keyword. (lazy_memoize_variable): New function. (CEVAL): When execution set!, perform lazy memoization if unmemoized symbol is detected. * modules.c (module_variable): Return variables with unbound value. * tags.h: Fix comment. 2004-04-25 Kevin Ryde * chars.c (scm_char_upcase, scm_char_downcase, scm_c_upcase, scm_c_downcase): Use ctype.h toupper and tolower. This will be useful in 8-bit locales, and ensures consistency with char-upper-case? and char-lower-case? which already use ctype.h. (scm_c_upcase_table, scm_c_downcase_table, scm_lowers, scm_uppers): Remove. * chars.c, chars.h, init.c (scm_tables_prehistory): Remove. * socket.c (VALIDATE_INET6): Correction to bignum_in_ipv6_range_p call. Reported by Hyperdivision. * threads.c (scm_yield): Correction, actually call scm_thread_yield. Reported by Hyperdivision. * unif.c (s_scm_make_uve): Remove unused local variable. Reported by Hyperdivision. 2004-04-22 Dirk Herrmann Hide the implementation of ilocs and isyms in eval.c. * deprecated.h (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST, SCM_ICDRP), eval.c (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST, SCM_ICDRP), eval.h (SCM_ICDR, SCM_IFRINC, SCM_IFRAME, SCM_IDIST, SCM_ICDRP): Deprecated and added to deprecated.h. Moved from eval.h to eval.c. * deprecated.c (scm_isymnames), deprecated.h (scm_isymnames, SCM_ISYMNUM, SCM_ISYMCHARS), eval.c (SCM_ISYMNUM, isymnames, scm_unmemocopy, CEVAL), print.c (scm_isymnames), tags.h (SCM_ISYMNUM, scm_isymnames, SCM_ISYMCHARS): Deprecated scm_isymnames, SCM_ISYMNUM and SCM_ISYMCHARS and added to deprecated.[hc]. Moved scm_isymnames from print.c to eval.c and renamed to isymnames. Moved SCM_ISYMNUM from tags.h to eval.c and renamed to ISYMNUM. * eval.c (scm_i_print_iloc, scm_i_print_isym), eval.h (scm_i_print_iloc, scm_i_print_isym), print.c (scm_iprin1): Extracted printing of ilocs and isyms to guile internal functions scm_i_print_iloc, scm_i_print_isym of eval.c. 2004-04-22 Kevin Ryde * numbers.c (scm_bit_extract): Use SCM_SRS for signed right shift. * numbers.c (scm_round): Test for x already an integer, to avoid bad rounding in x+0.5 when x is a big value already an integer. In certain hardware rounding cases x+0.5 can give an adjacent integer, leading to that as the result, when we really just wanted x itself. 2004-04-19 Dirk Herrmann * eval.c (scm_unmemocopy): Fixed unmemoization of let*. (deval_args, CEVAL): Minor improvements: Reduced variable scopes, added const qualifiers, cast intentionally unused expressions to void for emphasis, improved comment. 2004-04-18 Dirk Herrmann * tags.h (scm_tags, scm_tc8_tags, scm_tc9_flag, scm_tc8_flag, scm_tc8_isym): Renamed scm_tags to scm_tc8_tags. Renamed scm_tc9_flag to scm_tc8_flag. Introduced new identifier scm_tc8_isym. Defined tc8-tags relative to scm_tc3_imm24. Defined the tc8-tag for flags to be 0x04, which will mean that SCM_BOOL_F will also have the value 0x04 instead of 0x013c. Due to the reduced number of bits and the simpler bit pattern for SCM_BOOL_F, certain machines may be able to use more efficient processor instructions to deal with SCM_BOOL_F. (SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA): Removed. These have never been defined in a released version, thus no need to deprecate them. (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Flags now use tc8 instead of tc9 tags. (SCM_ISYMP, SCM_MAKISYM, SCM_ISYMNUM): Isyms now use tc8 instead of tc9 tags. (SCM_MAKSPCSYM): Removed. It is almost impossible that user code could have used this definition. (SCM_IM_AND, SCM_IM_BEGIN, SCM_IM_CASE, SCM_IM_COND, SCM_IM_DO, SCM_IM_IF, SCM_IM_LAMBDA, SCM_IM_LET, SCM_IM_LETSTAR, SCM_IM_LETREC, SCM_IM_OR, SCM_IM_QUOTE, SCM_IM_SET_X): Now encoded as isyms, as special isyms don't exist any more. 2004-04-18 Kevin Ryde * filesys.c (scm_readdir): Use readdir_r when available, for thread safety. * numbers.c (scm_max, scm_min): For big/real, use SCM_SWAP rather than explicit swapping code. 2004-04-15 Kevin Ryde * cpp_sig_symbols.in: Add SIGSYS. * list.c (scm_append_x): Use iterative style, to avoid non-tail recursion. * numbers.c (scm_max, scm_min): For inum/frac, frac/inum, big/frac, frac/big and frac/frac, use scm_less_p for exact comparison. * numbers.c (scm_gcd): For inum/big, use mpz_gcd_ui by sharing code with big/inum. * numbers.c (xisinf): Add a comment about solaris 7 lacking isinf. 2004-04-06 Han-Wen Nienhuys * inline.h (scm_cell): use SCM_GC_CELL_WORD for checking tag. * chars.h (scm_init_chars): change scm_{upcase,downcase} to scm_c_{up,down}case. (SCM_MAKE_CHAR): add (unsigned char) cast. This prevents havoc when hi-bit ASCII is subjected to SCM_MAKE_CHAR(). 2004-04-06 Kevin Ryde * numbers.c (scm_ash): Remove stray "}" in docstring. * numbers.c (scm_make_ratio): For inum/bignum integer detection, use x==SCM_MOST_NEGATIVE_FIXNUM explicitly, for clarity and to avoid calling mpz_cmp_ui in most cases. * numbers.c (scm_quotient, scm_remainder): In inum/big, use mpz_cmp_ui for big == abs(most-negative-fixnum) special case. (abs_most_negative_fixnum): Remove, no longer used. * scmsigs.c (scm_sigaction_for_thread): Correction to signum range test, avoids SCM_VECTOR_REF outside bounds of signal_handlers on calling (sigaction NSIG). * simpos.c (scm_system_star): Fix execargv memory leak, merge parent and fork error cases to do this. 2004-04-03 Dirk Herrmann * eval.c (CEVAL): Don't distinguish between short and long instructions when dispatching - just always dispatch on the instruction code, which is common for short and long instructions. Further, removed unnecessary goto statements and added comment. 2004-04-03 Dirk Herrmann * eval.c (scm_unmemocopy): Don't distinguish between short and long instructions when dispatching - just always dispatch on the instruction code, which is common for short and long instructions. Further, removed unnecessary goto statements, fixed indentation and replaced SCM_IMP predicates by SCM_NULLP. 2004-04-03 Dirk Herrmann * eval.c (scm_lookupcar1, CEVAL): Use SCM_ILOCP instead of comparison with SCM_ILOC00. In CEVAL, eliminate goto-label 'checkmacro'. 2004-03-31 Kevin Ryde * simpos.c: Include for SIG_IGN and friends. 2004-03-29 Dirk Herrmann Introduce scm_debug_mode_p as a replacement for scm_debug_mode and SCM_DEBUGGINGP: * debug.h (scm_debug_mode_p, scm_debug_mode, SCM_DEBUGGINGP), eval.c (scm_debug_mode_p): Deprecated scm_debug_mode and SCM_DEBUGGINGP. Provided scm_debug_mode_p instead, to have one single interface that also matches the naming conventions. Probably scm_debug_mode_p should be part of the private interface anyway. * debug.h (scm_debug_mode_p), backtrace.c (display_error_body), eval.c (SCM_APPLY, scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Change uses of scm_debug_mode or SCM_DEBUGGINGP to scm_debug_mode_p. Deprecate direct access to scm_ceval, scm_deval and scm_ceval_ptr: * eval.h (scm_ceval, scm_deval, scm_ceval_ptr), debug.h (scm_ceval_ptr): Deprecated. Moved declaration of scm_ceval_ptr from debug.h to eval.h. * debug.h (SCM_RESET_DEBUG_MODE): Don't access scm_ceval_ptr any more, just leave it with setting scm_debug_mode_p, which is equivalent for practical purposes. * deprecated.h (SCM_XEVAL, SCM_XEVALCAR): Call scm_i_eval_x instead of *scm_ceval_ptr. Leave all evaluating to scm_i_eval_x. * gdbint.c (gdb_eval): Call scm_i_eval_x instead of scm_ceval. * eval.c (ceval, deval, scm_ceval, scm_deval): Made scm_ceval static and renamed it to ceval throughout. Provide a new exported but deprecated function scm_ceval as a wrapper for backwards compatibility. The same is done for the deval/scm_deval pair of functions. * eval.c (CEVAL, SCM_CEVAL): Renamed SCM_CEVAL to CEVAL throughout. Defined CEVAL to ceval or deval, based on compilation phase. * eval.c (SCM_XEVAL, SCM_XEVALCAR): Dispatch on scm_debug_mode_p to ceval and deval instead of calling *scm_ceval_ptr. * eval.c (dispatching_eval): New deprecated static function. * eval.c (scm_ceval_ptr): Initialized to dispatching_eval in order to emulate its old behaviour as closely as possible. Change the evaluator such that only expressions for which pair? is true are passed to CEVAL, and such that all other expressions are evaluated outside of CEVAL: * eval.c (EVAL): New, provided in analogy to EVALCAR. Evaluate an expression that is assumed to be memoized already. All but expressions of the form '(
...)' are evaluated inline without calling an evaluator. * eval.c (SCM_XEVAL, SCM_XEVALCAR, EVALCAR): Evaluate all but expressions of the form '( ...)' inline without calling an evaluator. * eval.c (scm_i_eval_x, scm_i_eval, scm_ceval, scm_deval): Handle the special case of unmemoized symbols passed on the top level. * eval.c (CEVAL): Change calls to CEVAL to EVAL, except where it is known that the expression passed to CEVAL is of the form '( ...)'. Remove handling of the tc7-objects, since now it is known that the input expression of CEVAL is a pair. 2004-03-29 Dirk Herrmann * eval.c (is_self_quoting_p): New static function. (scm_m_quote): Use is_self_quoting_p. (copy_tree): Corrected typo in comment. 2004-03-28 Han-Wen Nienhuys * eval.c (s_scm_copy_tree): idem. * list.c (s_scm_filter): remove "pointer" from doc string. * gc.h (SCM_GC_CELL_TYPE): SCM_GC_CELL_TYPE uses SCM_GC_CELL_OBJECT. * goops.h (SCM_NUMBER_OF_SLOTS): don't SCM_UNPACK the result. * backtrace.c ("display_backtrace_body"): SCM_PACK before SCM_EQ_P (display_frame): idem. (display_backtrace_file_and_line): idem. * tags.h (SCM_UNPACK): stricter typechecking on SCM_UNPACK arguments. 2004-03-26 Kevin Ryde * filesys.c (scm_getcwd, scm_readlink): Avoid memory leak on errors. * numbers.c (scm_modulo): For inum/big and big/big, remove test of big==0 since that never occurs. * numbers.c, numbers.h (scm_modulo_expt): Renamed from scm_modular_expt, matching scheme level name `modulo-expt'. * numbers.c (scm_modular_expt): Return a negative remainder for a negative divisor, the same as `modulo' does. 2004-03-26 Eric Hanchrow * numbers.c, numbers.h (scm_modular_expt): New function. 2004-03-25 Kevin Ryde * numbers.c (scm_min, scm_max): Correction to big/real and real/big, return inexact as required by r5rs. 2004-03-24 Dirk Herrmann * eval.c: Separated some definitions relevant for execution from the memoization part of the file. (copy_tree): New static function (scm_copy_tree): Rewritten to fix two kinds or bugs: First, cyclic structures are detected now and will lead to an exception instead of forcing guile to run in an endless loop, using up all the system's memory. Second, arrays in the cdr of an improper list are now copied. See the new test cases in eval.test. 2004-03-24 Dirk Herrmann * posix.c (scm_gethostname): Make sure len is initialised before it is used. Restructured to (hopefully) represent possible configurations more clearly in the code. Added unwind handler. 2004-03-23 Kevin Ryde * posix.c (scm_gethostname): Use sysconf(_SC_HOST_NAME_MAX) and/or MAXHOSTNAMELEN when available. 2004-03-21 Marius Vollmer * read.c (skip_scsh_block_comment): Also recognize '\r' as a line terminator. Rewritten the logic as a state machine, I must have been doing too much VHDL lately... * eval.c (scm_ceval, scm_deval): Explicitely evaluate ports to themselves. Thanks to Han-Wen Nienhuys! * list.c: Changed docstrings so that they no longer talk about returning 'pointers' to something. 2004-03-20 Han-Wen Nienhuys * gc.c: remove set_debug_cell_accesses! when SCM_DEBUG_CELL_ACCESSES is not defined. Scheme source code should use (if (defined? 'set-debug-cell-accesses!) .. ) to switch on debugging conditionally. 2004-03-21 Kevin Ryde * stime.c (scm_gmtime): Use gmtime_r when available, for thread safety. 2004-03-20 Kevin Ryde * posix.c (scm_gethostname): Preserve errno across free() call. 2004-03-18 Han-Wen Nienhuys * gc-card.c (sweep_card): use SCM_GC_SET_CELL_WORD for setting free cells. 2004-03-14 Kevin Ryde * stime.c: Define _GNU_SOURCE for strptime prototype from glibc. (strptime): Use HAVE_DECL_STRPTIME for when to give own prototype. 2004-03-07 Kevin Ryde * stime.c (scm_gmtime): Return bd_time->tm_zone when available, rather than "GMT" always. (filltime): Make zname parameter "const". 2004-03-03 Mikael Djurfeldt * threads.c, threads.h (scm_c_scm2thread): New function. 2004-02-29 Kevin Ryde * numbers.c (guile_ieee_init): Use C99 INFINITY and NAN when available. Test HAVE_DINFINITY and HAVE_DQNAN for those globals, in particular don't assume "defined (__alpha__) && ! defined (linux)" means OSF. Remove "SCO" code, which was not really SCO specific and which John W. Eaton advises should be long past being needed. * posix.c (scm_execl, scm_execlp, scm_execle): Avoid memory leak under error throw. 2004-02-24 Kevin Ryde * posix.c (scm_cuserid): Use a private result buffer, for thread safe. 2004-02-22 Kevin Ryde * numbers.c (scm_max, scm_min): For one arg, dispatch to generic for complex, same as for two args. (Handle only inum, big, real, frac). 2004-02-21 Kevin Ryde * posix.c (scm_crypt): Use new HAVE_CRYPT. (): Remove HAVE_LIBCRYPT condition. Reported by Andreas Voegele. 2004-02-20 Neil Jerram * list.c (scm_list_n): Add #if SCM_DEBUG_CELL_ACCESSES_P around validation. * read.c (scm_lreadparen): Removed. (scm_lreadparen1): Renamed scm_i_lreadparen. 2004-02-20 Han-Wen Nienhuys * list.c (scm_list_n): validate non-immediate arguments; this will catch forgotten a SCM_UNDEFINED. 2004-02-18 Marius Vollmer * gc.h (scm_gc_cells_collected): Removed duplicated declaration. Thanks to Bill Schottstaedt! * socket.h (scm_gethost): Removed prototype it is already in "net_db.h". Thanks to Bill Schottstaedt! 2004-02-18 Kevin Ryde * num2integral.i.c (INTEGRAL2BIG): WORDS_BIGENDIAN not right for word order parameter to mpz_import, in fact with just one word there's no order to worry about at all. * numbers.c (scm_num_eq_p): For real==frac, complex==frac, frac==real and frac==complex, make an exact comparison rather than converting with fraction2double. * posix.c, putenv.c, stime.c (environ): Use _NSGetEnviron in Darwin shared library, since environ is not directly available there. * script.c (scm_shell_usage): Print to stdout for --help, per GNU standard. * stime.c (scm_localtime, scm_gmtime, scm_mktime): Provide a default errno EINVAL in case localtime and gmtime don't set it. (scm_mktime, scm_strptime): Forcibly use errno EINVAL for our SCM_SYSERROR, since mktime and strptime generally don't set errno. 2004-02-16 Kevin Ryde * gc-malloc.c (scm_done_malloc, scm_done_free): Allow negative sizes, which were permitted in the past for these. * num2float.i.c (NUM2FLOAT): Expand isfinite to !xisinf, as per previous change to numbers.c. * script.c (scm_shell_usage): Print bug-guile email address, as per GNU standard. Reported by Han-Wen Nienhuys. 2004-02-13 Mikael Djurfeldt * unif.c (scm_make_uve): Removed local variable and simplified code in order to avoid compiler used uninitialized warnings. * hashtab.c, hashtab.h (scm_hash_map_to_list): Renamed from scm_hash_map. (scm_hash_fold): Use scm_call_3 directly in the call to scm_internal_hash_fold instead of going via fold_proc (which is now removed). (scm_hash_for_each): Use a trampoline + scm_internal_hash_for_each_handle. (scm_internal_hash_for_each_handle, scm_hash_for_each_handle): New functions. 2004-02-12 Kevin Ryde * ports.c (scm_port_line): In docstring, note first line is 0. (scm_set_port_line_x): In docstring, note first line is 0. (scm_port_column): In docstring, there's no default to current input port, and remove shared port-line @defun. (scm_set_port_column_x): In docstring, there's no default to current input port, note first column is 0, remove shared set-port-line! @defun. * ramap.c (scm_array_fill_x): For fvect and dvect, use scm_num2dbl to convert args the same way that array-set! does. * unif.c (scm_make_uve, scm_array_p): Allow fraction 1/3 as prototype for dvect. (scm_array_p): Add missing "break"s in switch, fix llvect test look for "l" not "s", fix dvect to be false for singp(prot) since such a value is for fvect. (scm_array_prototype): Return 1/3 for dvect, rather than 0.33..33. (exactly_one_third): New variable. (scm_init_unif): Initialize it. 2004-02-10 Neil Jerram * read.c (scm_read_opts): Change `escaped-parens' to `elisp-strings'. 2004-02-08 Neil Jerram * read.c (scm_read_opts): New opts `elisp-vectors' and `escaped-parens'. (s_vector): New. (scm_lreadr): Use scm_lreadparen1 instead of scm_lreadparen. Make handling of elisp vector syntax dependent on SCM_ENABLE_ELISP and `elisp-vectors' option instead of SCM_ELISP_READ_EXTENSIONS. Allow "\(" and "\)" in strings when SCM_ENABLE_ELISP defined and `escaped-parens' option set. (scm_read_token): If elisp vector syntax active, disallow [ and ] in tokens. (scm_lreadparen): Rewrite as interface to scm_lreadparen1. (scm_lreadparen1): New. * read.h: Remove conditionally compiled last arg to scm_lreadparen. (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P): New. 2004-01-23 Han-Wen Nienhuys * eval.c (m_expand_body): remove stray variable new_body. 2004-01-22 Marius Vollmer * eval.c (m_expand_body): Rewrite the expression in place (by overwriting FORMS) also when a letrec is constructed, not only when no definitions are found. Do not return rewritten expression to emphasize the in-place rewriting. Changed all users. 2004-01-19 Han-Wen Nienhuys * gc.c: add protected_object_count, a number that is dumped from gc_stats() 2004-01-11 Marius Vollmer * dynwind.h, dynwind.c (scm_frame_unwind, scm_frame_unwind_handler): Renamed and changed all uses. (scm_frame_rewind, scm_frame_rewind_handler): Likewise. 2004-01-11 Kevin Ryde * unif.c (scm_bit_count, scm_bit_position, s_scm_bit_set_star_x, s_scm_bit_count_star, s_scm_bit_invert_x): Clarify docstrings, as per changes made to scheme-compound.texi. 2004-01-10 Marius Vollmer * print.c (scm_print_symbol_name): Handle #{`foo}#, #{,foo}#, #{.}#, and all numeric strings specially. Thanks to Paul Jarc! * guile-snarf.in: Use mkdir to create a unique temporary directory that we can safely use. Thanks to Stefan Nordhausen! 2004-01-07 Marius Vollmer * dynwind.h, dynwind.c (scm_i_dowinds): Removed 'explicit' argument since it is always zero now. Changed all callers. Removed code for handling fluids. * fluids.c (scm_c_with_fluids): Use frames instead of adding to the wind chain explicitely. Use scm_c_with_fluid for the common case of only one fluid. (scm_with_fluid): New. (scm_c_with_fluid): Use frames instead of scm_c_with_fluids. * fluids.h, fluids.c (scm_frame_fluid): New. (scm_with_fluid): New. (scm_i_swap_fluids, scm_i_swap_fluids_reverse): Removed. * dynwind.c (scm_frame_end): Do not use scm_i_dowinds. Instead, do the unwinding directly. It is simple enough. * dynwind.h, dynwind.c: Did the following renamings: scm_begin_frame -> scm_frame_begin, scm_end_frame -> scm_frame_end, scm_on_unwind -> scm_frame_unwind, scm_on_rewind -> scm_frame_rewind, scm_on_unwind_with_scm -> scm_frame_unwind_with_scm, scm_on_rewind_with_scm -> scm_frame_rewind_with_scm. Changed all uses. * aync.h, async.c: Did the follwing renamings: scm_with_blocked_asyncs -> scm_frame_block_asyncs, scm_with_unblocked_asyncs -> scm_frame_unblock_asyncs. Changed all uses. * ports.h, ports.c: Did the follwing renamings: scm_with_current_input_port -> scm_frame_current_input_port, scm_with_current_output_port -> scm_frame_current_output_port, scm_with_current_error_port -> scm_frame_current_error_port. Changed all uses. 2004-01-07 Kevin Ryde * numbers.c (s_bignum): Remove, not used since gmp bignums. Reported by Richard Todd. * threads-plugin.h (SCM_MUTEX_MAXSIZE): Increase to 12*sizeof(long), for the benefit of powerpc-apple-darwin5.5. Reported by Richard Todd. * unif.c (scm_aind): Test SCM_CONSP rather than !SCM_NULLP while traversing the args list, fixes segv if an improper list is given. Reported by Rouben Rostamian. 2004-01-06 Marius Vollmer * ports.c (swap_ports, scm_with_current_foo_port): Do not allocate swap_data on stack, use a 'malloc obj'. * fluids.h, fluids.c (scm_make_initial_fluids, scm_copy_fluids, scm_swap_fluids, scm_swap_fluids_reverse): Renamed to scm_i_... since they are internal. Changed all uses. * dynwind.c (frame_print): Removed, use the default printer. (WINDER_F_MARK, WINDER_MARK_P, winder_mark): New. (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New. Use above to protect SCM values. * dynwind.h (SCM_F_WIND_EXPLICITELY, SCM_F_WIND_EXPLICITLY): It's "explicitly" not "explicitely", damn. Changed all uses. (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New. 2004-01-05 Marius Vollmer * ports.h, ports.c (scm_with_current_input_port, scm_with_current_output_port, scm_with_current_error_port): New. * async.h, async.c (scm_with_blocked_asyncs, scm_with_unblocked_asyncs): New. 2004-01-03 Marius Vollmer * dynwind.h, scm_dynwind.c (scm_t_frame_flags, scm_t_wind_flags, scm_begin_frame, scm_end_frame, scm_on_unwind, scm_on_rewind): New. (scm_dowinds, scm_i_dowinds): scm_dowinds has been renamed to scm_i_dowinds and extended to handle frames and to invoke a 'turn' function when the outermost wind point has been reached. The latter is used to copy a continuation stack at the right time. scm_dowinds remains available. (SCM_GUARDSP, SCM_BEFORE_GUARD, SCM_AFTER_GUARD, SCM_GUARD_DATA, tc16_guard, guards_print): Removed. (scm_internal_dynamic_wind): Reimplemented using frames. * continuations.c (copy_stack): New, do only the stack copying part of copy_stack_and_call. (copy_stack_and_call): Copy the stack after unwinding and before rewinding. (scm_dynthrow): Do not call scm_dowinds, this is now done by copy_stack_and_call. 2004-01-04 Kevin Ryde * numbers.c (scm_less_p): Don't convert frac to float for compares, can give bad results due to rounding. * stime.c (scm_current_time, scm_gettimeofday): Add a comment about setzone/restorezone protection for DOS. 2003-12-26 Marius Vollmer * gen-scmconfig.h.in, gen-scmconfig.c: Arrange for scm_t_intmax and scm_t_uintmax to be defined in scmconfig.h 2003-12-03 Kevin Ryde * numbers.c (scm_less_p): Remove spurious xisnan from frac+big case. * numbers.c (scm_make_ratio): Check for numerator equal to SCM_MOST_NEGATIVE_FIXNUM and bignum denominator the negative of that, giving integer -1. * numbers.c (scm_real_part): Return fraction unchanged rather than converting to flonum. 2003-11-30 Dirk Herrmann * modules.c (module_variable): Fixed (and thus simplified) the definition of SCM_BOUND_THING_P to reflect the fact that since after the 1.4 series of guile, obarrays only hold variable objects. 2003-11-30 Marius Vollmer * numbers.c (scm_logand): It's "#b...", not "#\b...". From Paul Jarc: * read.c (scm_lreadr): Signal an error for invalid escape sequences in strings. Code cleanups too. * print.c (scm_iprin1): use \xNN hexadecimal sequences when writing control characters in strings. 2003-11-21 Marius Vollmer * ports.c (scm_drain_input): Bug fix: only access the port after checking that it indeed is one. 2003-11-22 Dirk Herrmann * eval.c (s_bad_define): New static identifier. (m_body): Fixed comment. (scm_m_define): Don't generate memoized code for definitions that are not on the top level. As a consequence, no memoized code at all is generated for definitions any more: Top level definitions are executed immediately during memoization and internal definitions are handled separately in m_expand_body. (scm_unmemocopy, unmemocopy): Removed code for unmemoizing definitions. Consequently, there is no unmemoizing code any more that might modify the environment. Thus, the old scm_unmemocopy is removed and the old unmemocopy is renamed to scm_unmemocopy. (SCM_CEVAL): The SCM_IM_DEFINE keyword can no longer occur in memoized code. Call EVALCAR for continuations. Prefer !SCM_NULLP over SCM_NIMP in places, where the argument is known to be part of a proper list. 2003-11-21 Kevin Ryde * numbers.c (scm_abs): Allocate a new real only for negatives, as done for bignums. * numbers.c (scm_bit_extract): Use mpz functions, rearrange inum case to share some shifting. * numbers.c (scm_integer_expt): Don't mpz_init after scm_i_clonebig or scm_i_mkbig, since they do so already. Don't mpz_clear a bignum SCM, since gc does this. 2003-11-19 Marius Vollmer * numbers.c (scm_make_ratio): Rewritten to have a simpler structure. Previously, not all cases with a negative denominator were covered. * numbers.c (mem2decimal_from_point): use scm_divide instead of scm_divide2real when forming the fractional part. This allows "#e1.2" to yield 6/5. * numbers.c (scm_i_fraction_equalp): Do not treat the return value of scm_equal_p as a C boolean, use SCM_FALSEP. Previously, all fractions were equal to each other regardless of value. Ooops. * numbers.c (scm_rationalize): Return an inexact result when given inexact arguments. * numbers.c (scm_exact_p, scm_inexact_p): Throw error for non-numbers. 2003-11-18 Marius Vollmer Support for exact fractions from Bill Schottstaedt! Thanks! * print.c (scm_iprin1): Handle fractions. * objects.h (scm_class_fraction): New. * objects.c (scm_class_fraction): New. (scm_class_of): Handle fractions. * hash.c (scm_hasher): Handle fractions. * numbers.c: New code for handling fraction all over the place. (scm_odd_p, scm_even_p): Handle inexact integers. (scm_rational_p): New function, same as scm_real_p. (scm_round_number, scm_truncate_number, scm_ceiling, scm_floor): New exact functions that replace the inexact 'dsubr' implementations. (scm_numerator, scm_denominator): New. * numbers.h (SCM_NUMP): Recognize fractions. (SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR, SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT, SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR, SCM_FRACTION_REDUCED): New. (scm_floor, scm_ceiling, scm_truncate_number, scm_round_number): New prototypes. (scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator, scm_rational_p): New prototypes. (scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp, scm_i_print_fraction): New prototypes. * goops.c (create_standard_classes): Create "" class. * gc-mark.c (scm_gc_mark_dependencies): Handle fractions. * gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a case in the switch, but do nothing for now. * eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions to doubles when calling 'dsubr' functions. * eq.c (scm_eqv_p, scm_equal_p): Handle fractions. 2003-11-18 Rob Browning * gen-scmconfig.c (main): remove public definition of SCM_SIZEOF___INT64 and SCM_SIZEOF_UNSIGNED___INT64 and add direct typedef of long_long and ulong_long inside deprecated block when appropriate. * deprecated.h: move long_long and ulong_long definitions to gen-scmconfig.c so that we don't need to add SCM_SIZEOF___INT64 and SCM_SIZEOF_UNSIGNED___INT64 to the public namespace. 2003-11-17 Marius Vollmer * hash.c (scm_string_hash): New hashing algorithm that takes the complete string into account. * eval.c (scm_m_generalized_set_x): Macroexpand the target when it is a list. This allows (@ ...) to work with set!. (scm_m_generalized_set_x): Use ASSERT_SYNTAX_2 instead of SCM_ASSYNT. * script.c (scm_compile_shell_switches): Use scm_c_read_string for the "-e" option instead of scm_str2symbol. This allows things like (@ ...) to be specified for the entry point. 2003-11-16 Dirk Herrmann * eval.c (scm_m_letstar): Create memoized code in place to minimize consing. 2003-11-16 Dirk Herrmann * eval.c (s_splicing): Commented and reformulated. (lookup_global_symbol, lookup_symbol): New static functions. (s_test, s_bindings, s_duplicate_bindings, s_variable): Removed. (try_macro_lookup, literal_p): Use lookup_symbol instead of creating a temporary pair for scm_lookupcar. (scm_unmemocar, unmemocar): Renamed scm_unmemocar to unmemocar, created deprecated wrapper function scm_unmemocar. (SCM_VALIDATE_NON_EMPTY_COMBINATION, scm_sym_else, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_enter_frame, scm_sym_apply_frame, scm_sym_exit_frame, scm_sym_trace, f_apply, undefineds, sym_three_question_marks): Moved around without modifications. * eval.c, eval.h (scm_macroexp, scm_unmemocar): Deprecated. 2003-11-15 Dirk Herrmann * eval.c (try_macro_lookup, expand_user_macros, is_system_macro_p, m_expand_body, scm_m_expand_body): Grouped together with m_body. No further modifications. 2003-11-15 Dirk Herrmann * eval.c (s_mixed_body_forms): New static identifier. (canonicalize_define, scm_m_define): The check for a bad expression is performed in canonicalize_define now. (try_macro_lookup, expand_user_macros, is_system_macro_p): New static helper functions for m_expand_body. (m_expand_body): Use ASSERT_SYNTAX to signal syntax errors. Only expand user defined macros. Fixed handling of the definition/ expression boundary. Fixed handling of definitions grouped with 'begin. Use canonicalize_define to expand definitions. 2003-11-13 Marius Vollmer * read.c (scm_lreadr): detect EOF after backslash, and interpret \xNN hexadecimal sequences. From Paul Jarc, thanks! * snarf.h (SCM_SMOB, SCM_GLOBAL_SMOB, SCM_SMOB_MARK, SCM_GLOBAL_SMOB_MARK, SCM_SMOB_FREE, SCM_GLOBAL_SMOB_FREE, SCM_SMOB_PRINT, SCM_GLOBAL_SMOB_PRINT, SCM_SMOB_EQUALP, SCM_GLOBAL_SMOB_EQUALP, SCM_SMOB_APPLY, SCM_GLOBAL_SMOB_APPLY): New macros from Paul Jarc. Thanks! * gc_os_dep.c (scm_get_stack_base): Provide a definition that return NULL when the machine type is unknown. Previously, gc_os_dep.c would refuse to compile. 2003-11-09 Dirk Herrmann * eval.c (scm_m_body, m_body, scm_m_lambda, memoize_named_let, scm_m_let, scm_m_letrec, m_expand_body): Renamed static function scm_m_body to m_body. 2003-11-09 Dirk Herrmann * eval.c, eval.h (scm_m_expand_body, m_expand_body): Deprecated public use of scm_m_expand_body in eval.h. In eval.c, renamed scm_m_expand_body to m_expand_body and made it static. Added deprecated wrapper scm_m_expand_body. (scm_eval_body, SCM_CEVAL, SCM_APPLY): Use m_expand_body instead of scm_m_expand_body. 2003-11-09 Kevin Ryde * dynl.c (scm_dynamic_unlink): Need scm_list_1 on error message argument. Reported by Mike Gran. 2003-11-08 Dirk Herrmann * eval.c (s_missing_body_expression): New static identifier. (s_body): Removed. (scm_m_expand_body): Fixed core dump when passing a body with defines, but without expressions (see additions to syntax.test). Use ASSERT_SYNTAX to signal syntax errors. 2003-11-02 Dirk Herrmann * eval.c (canonicalize_define): New static helper function. (memoize_define, canonicalize_define): Extract handling of function currying to canonicalize_define. 2003-11-02 Dirk Herrmann * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Make sure that error checking in debug mode is not worse than in standard mode. 2003-11-01 Dirk Herrmann * eval.c (scm_m_body, scm_m_lambda): Documentation strings are not handled in scm_m_body any more, but rather in scm_m_lambda. (scm_m_body, memoize_named_let, scm_m_let, scm_m_letstar, scm_m_letrec, scm_m_expand_body): Check for validity is done by calling functions of scm_m_body. (scm_m_lambda): Avoid unnecessary consing when creating the memoized code. 2003-11-01 Dirk Herrmann * eval.c (s_expression): Added comment. (s_empty_combination, error_unbound_variable): New static identifiers. (SCM_VALIDATE_NON_EMPTY_COMBINATION, SCM_EVALIM2, scm_lookupcar1): Use ASSERT_SYNTAX, syntax_error or error_unbound_variable to signal syntax errors. (SCM_CEVAL): Separated handling of evaluator bytecodes and other scheme objects. 2003-10-25 Dirk Herrmann * eval.c (unmemocar, sym_three_question_marks, scm_unmemocar): Grouped together with unmemocopy, without modifications. (build_binding_list, unmemocopy): Renamed names of list arguments and variables to reflect the actual order of the list elements. 2003-10-22 Dirk Herrmann * eval.c (s_defun): New static identifier. (scm_m_nil_cond, scm_m_atfop, scm_m_undefine): Add comments. Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. 2003-10-19 Kevin Ryde * numbers.c (scm_ash): Revise docstring as per recent update to manual. * numbers.c (scm_i_big2dbl): Rewrite, carefully rounding to "closest" in accordance with R5RS, which just mpz_get_d doesn't really give. 2003-10-18 Dirk Herrmann * eval.c (s_bad_slot_number): New static identifier. (scm_m_atslot_ref, scm_m_atslot_set_x): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. 2003-10-18 Dirk Herrmann * eval.c (scm_m_cont, scm_m_at_call_with_values, scm_m_generalized_set_x): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. (scm_m_generalized_set_x): Let scm_m_set_x handle the R5RS standard case. Make sure line and file information are copied to every created expression. 2003-10-18 Dirk Herrmann * eval.c (scm_m_set_x, scm_m_apply, scm_m_atbind): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. (scm_m_atbind): Reversed the order, in which the init expressions are stored and executed. The order of execution is now equal to the order in which the initializers of the let-forms are executed. Use check_bindings and transform_bindings. (SCM_CEVAL): Eliminated SCM_NIMP in favor of more appropriate !SCM_NULLP. Added some comments. 2003-10-18 Dirk Herrmann * eval.c: Sorted include files alphabetically. (scm_m_begin): Added comment. (scm_m_or): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. (iqq, scm_m_quasiquote, scm_m_quote): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. (scm_m_quote, unmemocopy): As an optimization, vector constants are now inserted unquoted into the memoized code. During unmemoization the quotes are added again to provide syntactically correct code. 2003-10-18 Dirk Herrmann * eval.c (scm_m_let, scm_m_letstar, scm_m_letrec, scm_m_expand_body, check_bindings): Extracted syntax checking of bindings to new static function check_bindings. (scm_m_let, memoize_named_let): Extracted handling of named let to new static function memoize_named_let. (transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid unnecessary consing when creating the memoized code. 2003-10-12 Dirk Herrmann * eval.c (s_bad_formals, s_bad_formal, s_duplicate_formal): New static identifiers. (s_clauses, s_formals, s_duplicate_formals): Removed. (scm_m_lambda): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Prepare for easier integration of changes for separated memoization. 2003-10-12 Dirk Herrmann * eval.c (s_duplicate_binding): New static identifier. (scm_m_case): Call scm_c_memq instead of implementing it inline. (scm_m_define): Added comment about how we check for duplicate formals. (scm_m_do): Added check for duplicate bindings. (scm_m_if): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. (scm_c_improper_memq, c_improper_memq, scm_m_lambda): Renamed scm_c_improper_memq to c_improper_memq, since it is not exported. (transform_bindings): Call scm_c_memq rather than scm_c_improper_memq. (SCM_CEVAL): Simplified handling of SCM_IM_IF forms. 2003-10-12 Dirk Herrmann * eval.c (s_bad_bindings, s_bad_binding, s_bad_exit_clause): New static identifiers. (scm_m_do): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid unnecessary consing when creating the memoized code, this way also making sure that file name, line number information etc. remain available. 2003-10-12 Dirk Herrmann * eval.c (memoize_as_thunk_prototype): New static function. (scm_m_delay, scm_m_future): Use memoize_as_thunk_prototype. Avoid unnecessary consing when creating the memoized code. 2003-10-12 Kevin Ryde * list.c (scm_append): Track argument number and use in error. 2003-10-11 Dirk Herrmann * eval.c (s_missing_expression, s_bad_variable): New static identifiers. (scm_m_define): Use ASSERT_SYNTAX to signal syntax errors. Prefer R5RS terminology for the naming of variables. Be more specific about the kind of error that was detected. Make sure file name, line number etc. are added to all freshly created expressions. Avoid unnecessary consing when creating the memoized code. 2003-10-11 Dirk Herrmann * eval.c (s_extra_expression, s_misplaced_else_clause, s_bad_cond_clause, s_missing_recipient): New static identifiers. (s_extra_case_clause): Removed. (scm_m_case, scm_m_cond): If a clause appears after an else clause, report a misplaced else clause. (scm_m_cond): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Handle bound 'else and '=>. Avoid unnecessary consing when creating the memoized code. (scm_m_cond, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize the syntactic keyword 'else and SCM_IM_ARROW to memoize the syntactic keyword '=>. 2003-10-11 Dirk Herrmann * eval.c (scm_m_case): Allow empty lists of case labels. 2003-10-11 Dirk Herrmann * tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes. * print.c (scm_isymnames): Add names for the new memoizer codes. * eval.c (s_missing_clauses, s_bad_case_clause, s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label, literal_p): New static identifiers. (scm_m_case): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Check for duplicate case labels. Handle bound 'else. Avoid unnecessary consing when creating the memoized code. (scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize the syntactic keyword 'else. 2003-10-10 Dirk Herrmann * eval.c (s_bad_expression, syntax_error_key, syntax_error, ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers. (scm_m_and): Use ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing when creating the memoized code. 2003-10-09 Kevin Ryde * numbers.c (scm_inexact_to_exact): Don't depend on what double->long cast gives for values bigger than a long, or for nan or inf. 2003-10-08 Dirk Herrmann * smob.h (scm_make_smob_type): Made the declaration match the definition. 2003-10-07 Marius Vollmer * goops.c, objects.h, smob.c, smob.h: Make type names char const * instead of char *. Thanks to Paul Jarc! 2003-10-02 Kevin Ryde * strports.c (scm_call_with_output_string): scm_get_output_string rather than scm_strport_to_string, so as to guard against the port having been closed by the called procedure. Reported by Nic Ferrier. 2003-09-18 Dirk Herrmann * numbers.h (SCM_INEXACTP): Removed uses of SCM_TYP16S. * tags.h, deprecated.h (SCM_TYP16S): Deprecated and moved from tags.h to deprecated.h. 2003-09-18 Dirk Herrmann This set of patches introduces a new tc7 code scm_tc7_number for numbers. Bignums, reals and complex numbers are turned from smobs into subtypes of scm_tc7_number. * tags.h (scm_tc7_number): New. * eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c (scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c (scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c (scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c (scm_class_of), print.c (scm_iprin1), smob.c (scm_smob_prehistory): Don't handle bignums, reals and complex numbers as subtypes of scm_tc7_smob any more. * numbers.h, tags.h (scm_tc16_big, scm_tc16_real, scm_tc16_complex): Moved definitions from tags.h to numbers.h. 2003-09-18 Dirk Herrmann * numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use sizeof (scm_t_complex) to determine the memory size of the malloc'd area for complex numbers. 2003-09-17 Dirk Herrmann * numbers.c (scm_bigequal): Fixed. 2003-09-16 Marius Vollmer * stime.c (scm_current_time): 'time' does not set errno so don't use SCM_SYSERROR for reporting errors. 2003-09-16 Dirk Herrmann This set of patches eliminates the dependency between the implementation of evaluator specific memoization codes and special constants like #f, '() etc. ('flags'), which are not evaluator specific. The goal is to remove definitions of evaluator memoization codes completely from the public interface. This will make it possible to experiment more freely with optimizations of guile's internal representation of memoized code. * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM. * print.c (iflagnames): New array, holding the printed names of guile's special constants ('flags'). (scm_isymnames): Now holds only the printed names of the memoization codes. (scm_iprin1): Separate the handling of memoization codes and guile's special constants. * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA, SCM_IFLAGNUM): new (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T, SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND, SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF, SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE, SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed values. (SCM_IFLAGP): SCM_IFLAGP now only tests for flags. (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the tc9 macros and scm_tc9_flag. 2003-09-15 Marius Vollmer * posix.c (scm_setgroups): Check that the gid list is not too long. Thanks to Paul Jarc! 2003-09-14 Dirk Herrmann * tags.h: Reduced the number of short instructions from 14 to 13. The typecode of the former 14th short instruction is now used to represent long instructions. Changed some comments to reflect this fact. (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was previously used by SCM_IM_DEFINE. (SCM_IM_DEFINE): Turned into a long instruction. * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long instruction. * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7 code that is separate from all instructions, one level of dispatch for long instructions can be eliminated. * print.c (scm_isymnames): Removed some commented code. 2003-09-12 Marius Vollmer * __scm.h (SCM_FENCE): Use __memory_barrier with the Intel compiler on IA64. * hashtab.h (scm_tc16_hashtable): Added "extern" declaration. * modules.c (scm_module_reverse_lookup): Check that the obarray really is a hashtable and do nothing if not. * inline.h: Use "extern inline" only with GCC. Use "static inline" else. 2003-09-06 Dirk Herrmann * numbers.h (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Removed uses of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP. * numbers.h, deprecated.h (SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP, SCM_SLOPPY_COMPLEXP): Deprecated and moved from numbers.h to deprecated.h. 2003-09-06 Dirk Herrmann * eq.c (scm_eqv_p, scm_equal_p): Removed uses of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP. * eq.c (scm_eqv_p, scm_equal_p): Reordered comparisons from 0.0==some_expression to some_expression==0.0. The latter is better readable. The former is preferred by some people, since it leads to a compiler error when confusing == with =. However, when using gcc, a warning will be issued if in an if-statement an assigment appears. Since many Guile developers are using gcc, such errors will not remain unnoticed anyway. We can therefore focus on better readability. 2003-09-04 Dirk Herrmann * tags.h: Added description of Guile's type system. Removed some old and misleading comments. 2003-09-04 Dirk Herrmann * unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP. 2003-09-04 Dirk Herrmann * numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int. (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Define in terms of the respective SLOPPY macro. 2003-09-04 Dirk Herrmann * eq.c (scm_equal_p): Use SCM_TYP7 to check if an object is of type string, not SCM_TYP7S. 2003-09-03 Kevin Ryde * numbers.c (scm_lognot): Correction to docstring, ones-complement not 2s-complement. * stime.c (scm_strptime): Add comment about glibc strptime %s and current timezone requiring SCM_DEFER_INTS. 2003-08-30 Neil Jerram * script.c (scm_compile_shell_switches): Make -s switch optional if file to be loaded does not begin with a `-'. (Thanks to Aaron VanDevender for the patch!) 2003-08-30 Kevin Ryde * numbers.c (scm_lognot): Rewrite using ~ and mpz_com, for directness and to have non-integer types rejected as per other logical funcs. 2003-08-28 Kevin Ryde * gc.h (scm_remember_upto_here_1): Revise comments on the asm form. 2003-08-23 Kevin Ryde * simpos.c (scm_system): Remove SCM_DEFER_INTS, system() should be thread safe, and could take a long time too. 2003-08-22 Kevin Ryde * numbers.c (scm_difference): Correction to bignum - negative inum. 2003-08-14 Kevin Ryde * gc.h (scm_remember_upto_here_1, scm_remember_upto_here_2) [__GNUC__]: Use volatile asm macros rather than a function call. * gc.c (scm_remember_upto_here_1, scm_remember_upto_here_2): Undefine macros while defining functions. * simpos.c (getenv): Use for prototype. (scm_system): In docstring, refer to status:exit-val rather than "functions above". 2003-08-09 Kevin Ryde * srcprop.c (scm_source_properties): Return plist from hash if it's a list set by source-properties! rather than an SRCPROPS object, 2003-07-29 Kevin Ryde * properties.c (scm_primitive_property_ref): In docstring, note parameters to not-found-proc, use hyphens rather than underscores for that parameter name. (scm_primitive_property_set_x): In docstring, VAL is the value parameter not CODE. 2003-07-27 Marius Vollmer * print.c (scm_print_symbol_name): handle more weird characters by escaping the symbol name properly. Thanks to Paul Jarc! * posix.h (scm_setgroups): New prototype. * posix.c (scm_setgroups): New. Thanks to Paul Jarc! (scm_getgroups): Handle groups ids that don't fit into a fixnum. Don't use SCM_WRITABLE_VELTS. * gc.h (SCM_GC_SET_CELL_BVEC): New. * gc-card.c (scm_i_init_card_freelist): Use it. Thanks to Matthias Koeppe! * __scm.h (SCM_C_INLINE_KEYWORD): New. * numbers.c: Use it in place of SCM_C_INLINE so that the code compiles when SCM_C_INLINE is undefined. 2003-07-24 Dirk Herrmann * __scm.h: Reformulated the architecture and compiler properties in terms of properties of scm_t_bits and SCM variables rather than in terms of c standard types. This is since it is not known which of the standard types scm_t_bits and SCM variables will be defined to. 2003-07-24 Kevin Ryde * numbers.c (scm_angle): Use scm_flo0 for non-negative inum, bignum and real. 2003-07-18 Kevin Ryde * numbers.c (scm_product): In complex * bignum, correction to REAL/IMAG fetch, x is the complex, not y. 2003-07-13 Mikael Djurfeldt * numbers.c (scm_odd_p, scm_even_p): Bugfix: Treat result of scm_inf_p test as Scheme values. (scm_sum): Bugfix: Normalize bignum created from a negative bignum and a positive inum. Use GNU indentation style. 2003-07-12 Dirk Herrmann * values.c (scm_values): Build lists of length 1 by using scm_list_1 instead of using scm_cons. 2003-07-10 Kevin Ryde * deprecation.c (scm_c_issue_deprecation_warning_fmt): Add va_end. * list.c (scm_list_n): Ditto. * gc-malloc.c (scm_gc_realloc): Define "ptr" at start of function. 2003-07-08 Matthias Koeppe * tags.h (scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for scm_t_bits and scm_t_signed_bits to avoid any chance of one and not the other using intptr_t. 2003-07-08 Kevin Ryde * numbers.c (scm_make_polar): Use sincos, when available. (scm_magnitude): Use hypot. * ports.c (scm_char_ready_p, scm_peek_char): In docstrings, don't use @footnote since it doesn't go through to guile-procedures.txt. * threads.c (scm_call_with_new_thread): In docstring, use "( )" outside @var to quieten makeinfo, and use @code. 2003-07-06 Han-Wen Nienhuys * gc-malloc.c (decrease_mtrigger): new function (increase_mtrigger): new function, separate debug registering and mtrigger administration. (scm_gc_realloc): bugfix: do mtrigger administration before the actual realloc, for the realloc might invalidate a GC-d segment of memory. Thanks to Sam Hocevar for pointing this out. (scm_gc_realloc): use scm_malloc_reregister instead of unregistering and registering in sequence. 2003-07-03 Han-Wen Nienhuys * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)" 2003-07-02 Han-Wen Nienhuys * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if clauses. 2003-06-29 Marius Vollmer * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops, scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array, scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA, RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY, SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from the release_1_6 branch. 2003-06-25 Stefan Jahn * continuations.c: Redeclaration of getcontext() via the __asm__ ("getcontext") directive. * continuations.h: Include instead of . 2003-06-21 Kevin Ryde * numbers.c (_GNU_SOURCE): #define, to get C99 things. (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh, $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when available. (scm_inexact_to_exact): Expand isfinite to its definition !xisinf. (isfinite): Remove, conflicts with C99 isfinite(). 2003-06-19 Marius Vollmer * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft, scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray, scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol, scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p, scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from the release_1_6 branch. 2003-06-14 Stefan Jahn * threads.h: Redefined scm_getspecific() and scm_setspecific() to be functions instead of macros. * threads.c: Conditionalized inclusion of and . (scm_getspecific, scm_setspecific): Made these two function real part of the API. * posix.c (s_scm_putenv): Added some code to make a (putenv "FOO="), i.e. setting an empty string, work also on Win32 systems. Thanks to Kevin Ryde for the proposal. 2003-06-12 Kevin Ryde * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add freebsd to comment about need to use unsetenv. 2003-06-02 Marius Vollmer * ports.c (scm_peek_char): Safe the column of the port around the getc/ungetc calls. Thanks to Dr. Peter Ivanyi! 2003-06-07 Kevin Ryde * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX and friends required by scm_t_bits setups. 2003-06-06 Dirk Herrmann * tags.h (scm_tc2_int): Added. * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of scm_tc2_int. * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct, scm_tcs_closures): Hard coded values replaced by symbolic ones. 2003-06-05 Dirk Herrmann * eval.c: Partially undid my patch from 2003-05-31. This patch caused the segfault referenced in the previous changelog entry. 2003-06-05 Dirk Herrmann * tags.h: Fixed comment about the immediate type code layout. * eval.c: Fixed handling of non-special instructions. Without this patch, guile will segfault on (#\0) and similar instructions. 2003-06-05 Kevin Ryde * numbers.c (scm_max, scm_min): For inum, bignum and real, if other operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d. * read.c (scm_input_error): Pass arg list parameter to scm_error_scm, rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr. 2003-06-04 Dirk Herrmann * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT, SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and generalized it to apply not only to C level functions but also to scheme level functions. * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?, scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?, scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p, respectively. * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK): Deprecated. The macro definitions are moved from eval.h into eval.c and a copy is placed into deprecated.h. * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed into eval.c. This definition was not part of the API in any officially released version of guile and thus does not need to go through a phase of deprecation. 2003-06-02 Dirk Herrmann * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable, scm_s_clauses, scm_s_formals): Deprecated. In eval.c the definitions are make static and renamed from scm_s_xxx to s_xxx. In deprecated.c the original definitions are copied. * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL, SCM_XEVALCAR): Deprecated. The macro definitions are moved from eval.h into eval.c and a copy (slightly modified to work in user code) is placed into deprecated.h. * eval.c: Use the local static s_xxx definitions instead of the scm_s_xxx definitions throughout. 2003-06-01 Dirk Herrmann This set of patches separates the representation of the cxr family of functions (car, cdr etc.) from the dsubr family of functions (i. e. functions that take a double precision floating point argument). Further, the algorithm for handling the cxr function is improved. * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor, ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh), objects.c (scm_class_of), procprop.c (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new typecode for the dsubr family of functions. * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to ramap_dsubr. * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c (scm_init_pairs): Make use of the (now usable) second cell element of a scm_tc7_cxr function to implement the cxr family of functions more efficiently. 2003-05-31 Dirk Herrmann * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Postpone error cases to the end of an if-else-if-sequence of checks. 2003-05-30 Dirk Herrmann * eval.c (SCM_CEVAL): Improved readability of call-with-values execution. Generalize apply_closure to apply_proc and use that for call-with-values. 2003-05-30 Dirk Herrmann * eval.c (SCM_CEVAL): Avoid one level of indirection when applying a non closure. 2003-05-30 Stefan Jahn * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV appropriately for mingw32 hosts. * numbers.h: Defining copysign(), isnan() and finite() to be prefixed by a single '_' for mingw32 hosts. 2003-05-30 Kevin Ryde * numbers.c (z_negative_one): New variable. (scm_init_numbers): Initialize it. (scm_logcount): Use it and mpz_hamdist to count zeros for negatives. 2003-05-29 Stefan Jahn * win32-dirent.c: Use malloc() instead of scm_malloc(). * stime.c (s_scm_strftime): Add a type cast to avoid compiler warning. * posix.c (s_scm_putenv): Disable use of unsetenv() for the mingw32 build. * modules.c (s_scm_module_import_interface): Renamed local variable interface to _interface. Seems like 'interface' is a special compiler directive for the mingw32 compiler. * mkstemp.c: Provide prototype to avoid compiler warning. * load.c (s_scm_search_path): Fixed absolute and relative path detections for native Windows platforms. * gc.h, threads.h: Export some more symbols using SCM_API (necessary to build on mingw32). * gc-freelist.c ("s_scm_map_free_list", "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME. * fports.c (fport_fill_input): Disable use of fport_wait_for_input() on Win32 platforms. * filesys.c (s_scm_basename): Fixed __MINGW32__ code. * Makefile.am: Modified some rules for cross compiling. 2003-05-25 Dirk Herrmann * eval.c (SCM_CEVAL): In case of an application, all checks for a proper function object and the correct number of arguments are now performed in the application part of SCM_CEVAL. (scm_badformalsp): Removed. 2003-05-25 Dirk Herrmann * deprecated.c (scm_read_and_eval_x): Fixed C99-ism. 2003-05-22 Mikael Djurfeldt * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional always being false by inserting preprocessor conditional. (Thanks to Bruce Korb.) * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through (void *) in order to avoid an aliasing warning; thanks to Bruce Korb.) * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR. * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use SCM_STACK_PTR. * threads.c (scm_threads_mark_stacks): Bugfix: Changed thread->base --> t->base. * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P. 2003-05-20 Marius Vollmer * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr, scm_variable_set_name_hint, scm_builtin_variable, scm_internal_with_fluids, scm_make_gsubr, scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x, scm_subr_entry, SCM_SUBR_DOC, scm_make_subr, scm_make_subr_with_generic, scm_make_subr_opt, scm_call_catching_errors, scm_make_smob_type_mfpe, scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str, SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6 branch. Some have been slightly rewritten. (scm_i_object_chars, scm_i_object_length): New, to support SCM_CHARS, SCM_UCHARS, and SCM_LENTH. 2003-05-19 Dirk Herrmann * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of names and inits in the memoized code of do. 2003-05-19 Mikael Djurfeldt * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng, yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug, yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get a compilation error if error-on-warning is enabled). 2003-05-17 Marius Vollmer * c-tokenize.lex: Gobble up complete lines after a '#'. This removes preprocessor directives from the snarfage that might otherwise confuse us. These directives appear when compiling with "-g3", for example. 2003-05-16 Han-Wen Nienhuys * ChangeLog: add my surname * srcprop.c (scm_finish_srcprop): use scm_gc_register_collectable_memory() (scm_make_srcprops): idem. 2003-05-14 Han-Wen Nienhuys * gc-malloc.c (scm_gc_register_collectable_memory): avoid wrap-around for scm_mtrigger (scm_gc_register_collectable_memory): abort on overflowing scm_mallocated(). 2003-05-13 Kevin Ryde * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't. (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it. 2003-05-12 Mikael Djurfeldt * backtrace.c (scm_display_error_message): Introduced fancy printing with max level 7 and length 10. (Purpose: avoid printing gigantic objects in error messages.) * print.c, print.h (scm_i_port_with_print_state): New function. * print.c (scm_iprin1, scm_printer_apply, scm_port_with_print_state): Use scm_i_port_with_print_state. (scm_simple_format): Modified not to destroy print states. (print_state_mutex): New mutex. (scm_make_print_state, scm_free_print_state, scm_prin1): Lock/unlock print_state_mutex. * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK): Use current names in definitions. 2003-05-10 Kevin Ryde * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d. * numbers.c (scm_integer_length): On negative bignums, adjust mpz_sizeinbase to account for it looking at absolute value where we want ones-complement. * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui since we're only using the ulong return value, and x might not fit. 2003-05-06 Dirk Herrmann * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to read. This will allow to make the definition in read.c static. 2003-05-06 Dirk Herrmann * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved from evalext to eval. This will allow to make some of the definitions in eval.c static. 2003-05-06 Kevin Ryde * numbers.c (scm_difference): In inum - bignum, handle negative inum. (scm_logcount): Use mpz_com, not mpz_neg. 2003-05-04 Dirk Herrmann The purpose of this patch is to make guile's internal memoizers distinguishable from memoizing macros created on the scheme level or from user provided primitive memoizing macros. The reason is, that the internal memoizers are the only ones that are allowed to transform their scheme input into memoizer byte code, while all other memoizing macros may only transform scheme code into new scheme code. To achieve this, a new macro type 'builtin-macro!' is introduced. Currently, 'builtin-macro!'s are handled as memoizing macros, but this will change when the memoizer and executor are separated. * macros.[ch] (scm_i_makbimacro): New. * macros.h (SCM_BUILTIN_MACRO_P): New. * macros.c (macro_print, scm_macro_type): Support builtin-macro!s. * eval.c, goops.c: All of guile's primitive memoizing macros are primitive builtin-macros now. * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive builtin-macros are handled equally to memoizing macros. 2003-05-04 Marius Vollmer * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to work around a bug in GCC 2.95.2 but is now a bug in itself. 2003-05-02 Marius Vollmer * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols): New. 2003-04-30 Marius Vollmer * deprecated.h, deprecated.c (scm_protect_object, scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR, SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP, SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module, scm_ensure_user_module, scm_load_scheme_module, scm_port, scm_ptob_descriptor, scm_port_rw_active, scm_close_all_ports_except): New. * ports.c (scm_c_port_for_each): New function, mostly copied from scm_port_for_each. (scm_port_for_each): Reimplemented using scm_c_port_for_each. * ports.h (scm_c_port_for_each): New prototype. 2003-04-28 Mikael Djurfeldt * eval.c (scm_m_atdispatch): Removed until actually needed. (This macro was introduced in anticipation of GOOPS method compilation code.) * goops.c: Removed binding of @dispatch. 2003-04-28 Dirk Herrmann * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the instructions that bind the macros on the scheme level back to goops.c in order to make sure again that the bindings go into the (oop goops) module and are not visible from the outside. 2003-04-27 Dirk Herrmann * eval.c: Non functional change: Separated R5RS and non-R5RS macros into different sections of the file and ordered the memoizers alphabetically. 2003-04-27 Dirk Herrmann * eval.c (scm_ilookup): Rewritten to improve readability. 2003-04-27 Dirk Herrmann * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2): Partially reverted patch from 2003-04-23 in oder to find a better compromise between readability and debuggability. 2003-04-25 Dirk Herrmann * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref, scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and definitions of the special goops memoizers from goops.[ch] to eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used throughout guile. 2003-04-24 Mikael Djurfeldt * ports.c, ports.h (scm_i_port_table_mutex): New mutex. * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex. * ports.c (scm_close_port, scm_flush_all_ports): Ditto. * ioext.c (scm_fdes_to_ports): Ditto. * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into lock/unlock scm_i_port_table_mutex. * strports.c (scm_mkstrport): Ditto. * ports.c (scm_void_port, scm_port_for_each): Ditto. * fports.c (scm_fdes_to_port): Ditto. 2003-04-23 Dirk Herrmann This set of patches contains no functional changes, only debatable minor stylistic ones. Still, in order to prepare a patch between my local copy and the CVS version, I decided to submit the changes below. Then, the patch will hopefully only contain relevant modifications :-) * eval.c (iqq): Added const specifier. * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Use NULL instead of 0 to indicate that a pointer is returned. Removed some misleading 'fall through' comments. * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2): Split up long expressions into smaller ones to be more debugging friendly. 2003-04-23 Dirk Herrmann * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value rather than casting to SCM. 2003-04-23 Dirk Herrmann * sort.c, pairs.h: Removed unnecessary includes. 2003-04-23 Dirk Herrmann * sort.c: Replaced hand-made trampline code by the new official mechanism from eval.c. This fixes a segfault in the new test file sort.test. (quicksort, compare_function, scm_restricted_vector_sort_x, scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x, scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x, scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort, scm_sort_list_x, scm_sort_list): Use trampoline mechanism from eval.c. (subr2less, lsubrless, closureless, applyless, scm_cmp_function, cmp_fun_t): Removed. (compare_function): Added. * sort.c (quicksort, SWAP, stack_node): Replaced pointer arithmetics with index arithmetics. Changed quicksort to work on an array of SCM values instead of an array of characters. Avoid bytewise copying of SCM elements. Avoid allocating memory on the stack with alloca. Fixed some comments. 2003-04-21 Dirk Herrmann * eval.c (EXTEND_ENV): Eliminated. (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of EXTEND_ENV. 2003-04-21 Dirk Herrmann * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option. * gc.card.c (scm_gc_marked_p): Fixed compiler warning when compiling with SCM_DEBUG==1 by moving definition behind prototype. * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell, scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec, scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell, scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed functions such that they check if the object is a non-immediate. Further, renamed identifiers to use the scm_dbg_ prefix and made their inclusion into the lib dependent of the SCM_DEBUG_DEBUGGER_SUPPORT compile time option. 2003-04-21 Dirk Herrmann * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS debug option. 2003-04-21 Dirk Herrmann * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include any calls to SCM_NCONSP any more. * unif.c (l2ra): Eliminate redundant check. 2003-04-21 Dirk Herrmann * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product, scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over SCM_NNULLP. Now, guile itself does not include any calls to SCM_NNULLP any more. 2003-04-21 Dirk Herrmann * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each, scm_copy_tree): Place assignment expressions which are part of other expressions into an expression of their own. 2003-04-21 Dirk Herrmann * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't compare SCM values with !=. 2003-04-20 Dirk Herrmann * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter, scm_m_generalized_set_x, scm_init_evalext): Move the declaration and definition of the memoizer for the generalized set! macro from evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to define the macro object. * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x, scm_m_generalized_set_x): Since now scm_s_set_x is only used in eval.c, it is made static and renamed to s_set_x. * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_ over SCM_N. 2003-04-20 Dirk Herrmann * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds, scm_init_eval): Made scm_undefineds static in eval.c, renamed it to undefineds and registered the object as a permanent object. * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply static in eval.c, renamed it to f_apply and registered the object as a permanent object. 2003-04-20 Dirk Herrmann * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate. 2003-04-20 Dirk Herrmann * numbers.c (scm_logtest): Fixed argument bug in the call to mpz_and, which showed up when compiling with SCM_DEBUG defined. 2003-04-20 Dirk Herrmann * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed type errors that showed up when compiling with SCM_DEBUG defined. 2003-04-20 Dirk Herrmann * continuations.c, continuations.h, eval.c, eval.h, extensions.c, gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h, throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to fix compile errors with --disable-deprecated. 2003-04-17 Rob Browning * numbers.c (scm_integer_expt): fix case where we were declaring vars in the middle of a statement block. Thanks to Thamer Al-Harbash. 2003-04-17 Mikael Djurfeldt * goops.c (TEST_CHANGE_CLASS): Update variable class after class change. * eq.c (scm_eqv_p): Turned into a primitive generic. 2003-04-16 Rob Browning * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support. Thanks to Boyd Gerber. Added check for __arm__ in addition to arm for LINUX and copied __s390__ defines from upstream libgc. Thanks to James Treacy for reporting the problems. * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT. * socket.c: use SCM_CHAR_BIT. * random.c (scm_c_random_bignum): use SCM_CHAR_BIT. * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT. 2003-04-16 Mikael Djurfeldt * feature.c (scm_init_feature): Always add threads feature. 2003-04-15 Mikael Djurfeldt * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of scm_at_assert_bound_ref. (We don't want the unbound check. See oop/goops/active-slot.scm.) 2003-04-14 Rob Browning * tags.h: scm_t_intptr should have been intptr_t. 2003-04-13 Rob Browning * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc" test. Instead use #if defined (sparc) || defined (__sparc__) || defined (__sparc) as gc_os_dep.c suggests is appropriate. * goops.c (prep_hashsets): make static to match prototype. (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert Chin. * c-tokenize.lex: remove trailing comma from enum. Thanks to Albert Chin. * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas Klausner. 2003-04-13 Mikael Djurfeldt * goops.c (scm_sys_prep_layout_x): Instance allocation is now indicated through extra fields in getters-n-setters. (scm_add_slot): Adapted to new format of getters_n_setters slot. (Thanks to Andy Wingo.) 2003-02-25 Han-Wen Nienhuys * gc-segment.c: add comment 2003-04-07 Rob Browning * debug.h: change "id" arg name to "info_id" to avoid objective-c clash. * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael and add regression test to standalone/. 2003-04-06 Rob Browning * strings.c (scm_mem2string): use memcpy rather than by-hand loop. Thanks to Dale P. Smith. * random.c: #include gmp.h. (scm_c_random_bignum): normalize result on return. * init.c: #include gmp.h. * numbers.h: remove the gmp.h #include (not needed now). * posix.h: change occurences of "id" to something else so we don't cause trouble when included via objective-c (can't hurt, might help). Still have usage in debug.h, though. 2003-04-06 Mikael Djurfeldt * random.c (scm_c_random_bignum): Don't generate a random number equal to m (the second argument of scm_c_random_bignum); only generate numbers in the range 0 <= r < m. (scm_c_default_rstate): Use SCM_VARIABLE_REF to access scm_var_random_state. * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then clause. 2003-04-05 Rob Browning * modules.c (scm_module_import_interface): move declaration of uses before any code. 2003-04-05 Mikael Djurfeldt * Makefile.am (scmconfig.h): Look for config.h in top_builddir, not top_srcdir. * hashtab.c (rehash_after_gc): Clear to_rehash list before processing it in order to avoid an infinite loop. * print.c (scm_prin1): Remember old state of pstate->writingp. 2003-04-05 Marius Vollmer * Changed license terms to the plain LGPL thru-out. 2003-04-04 Rob Browning * socket.c (FLIPCPY_NET_HOST_128): new macro. (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p): rewrite to handle GMP bignums. * random.c (scm_c_random_bignum): rewrite to handle GMP bignums. * ports.c (scm_getc): minor tweak. * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and rewrite to handle GMP bignums. * numbers.c: rewrite *many* functions to handle GMP bignums. * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG): handle GMP bignums. * num2float.i.c (NUM2FLOAT): handle GMP bignums. * init.c (check_config): remove SCM_BIGDIG conditionals. (scm_init_guile_1): test to make sure mpz_t fits in a double_cell. * gc-card.c ("sweep_card"): handle new mpz_t bignums. * eval.c: remove SCM_BIGDIG conditionals. * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp. 2003-03-31 Rob Browning * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks to Kevin Ryde.) 2003-03-27 Rob Browning * threads.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * threads.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * tags.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * stacks.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * stackchk.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * stackchk.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * sort.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * read.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * random.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * print.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * objects.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * numbers.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * null-threads.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * lang.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * lang.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * iselect.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * init.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * gh_data.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * gh.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * gen-scmconfig.c: change most new public symbols to be defined to 0 or 1 rather than being either 1 or undefined. * gc_os_dep.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef. * gc.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * gc-card.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * gc-mark.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * feature.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * evalext.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * eval.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * eval.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * eq.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * coop.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * coop-threads.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * coop-pthreads.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * coop-defs.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * convert.i.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * continuations.c: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. * _scm.h: fix various preprocessor usages of new public symbols to expect 0 or 1 values rather than 1 or undefined. i.e. change #ifdef to #if, etc. 2003-03-26 Marius Vollmer * init.c (scm_init_guile_1): Call scm_i_init_deprecated. * deprecated.c, deprecated.h: New files, to collect deprecated things in one place. * Makefile.am: Added them in all the right places. * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top". (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH builds work. (DOT_X_FILES): Removed "iselect.x". (DOT_DOC_FILES): Removed "iselect.doc". 2003-03-25 Rob Browning * win32-socket.h: #include "libguile/__scm.h". Replace usage of HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H. * win32-socket.c: #include if HAVE_CONFIG_H. * vports.c: #include if HAVE_CONFIG_H. * unif.c: #include if HAVE_CONFIG_H. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * threads.h: replace usage of struct timespect with scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in favor of scm_t_timespec from scmconfig.h. * threads.c: move libguile/_scm.h include to the top so we pick up any critical defines like _GNU_SOURCE early. Replace usage of struct timespect with scm_t_timespec. Replace usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS. * threads-plugin.h: replace usage of struct timespect with scm_t_timespec. * threads-plugin.c: #include if HAVE_CONFIG_H. Replace usage of struct timespect with scm_t_timespec. * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move HAVE_INTTYPES_H handling to scmconfig.h. #include "libguile/__scm.h". Rework handling for scm_t_bits, scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX, SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr, scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * symbols.c: #include if HAVE_CONFIG_H. * struct.c: #include if HAVE_CONFIG_H. * strports.c: #include if HAVE_CONFIG_H. * strop.c: #include if HAVE_CONFIG_H. * stime.h: move handling of time related headers to scmconfig.h. * stime.c: #include if HAVE_CONFIG_H. * stacks.c: replace usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP. * sort.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * socket.c: #include if HAVE_CONFIG_H. Replace usage of uint32 and HAVE_UINT_32 with scm_t_int32. * smob.c: #include if HAVE_CONFIG_H. * simpos.c: #include if HAVE_CONFIG_H. * script.c: #include if HAVE_CONFIG_H. * scmsigs.c: #include if HAVE_CONFIG_H. * scmconfig.h.top: new file -- preamble for scmconfig.h. * rw.c: #include if HAVE_CONFIG_H. * regex-posix.c: #include if HAVE_CONFIG_H. * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * rdelim.c: #include if HAVE_CONFIG_H. * random.c: #include if HAVE_CONFIG_H. Replace usage of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * ramap.c: replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * putenv.c: #include if HAVE_CONFIG_H. #include "libguile/scmconfig.h". * pthread-threads.c: #include if HAVE_CONFIG_H. * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * posix.c: #include if HAVE_CONFIG_H. * ports.c: #include if HAVE_CONFIG_H. * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * numbers.c: #include if HAVE_CONFIG_H. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF. * num2integral.i.c: #include if HAVE_CONFIG_H. * null-threads.h: replace usage of struct timespect with scm_t_timespec. * net_db.c: #include if HAVE_CONFIG_H. * mkstemp.c: #include if HAVE_CONFIG_H. #include "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of scm_t_uint64 and rename usages. * mallocs.c: #include if HAVE_CONFIG_H. * load.c: #include if HAVE_CONFIG_H. * iselect.h: move handling of time related headers to scmconfig.h. Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H. Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS. * iselect.c: #include if HAVE_CONFIG_H. Rename usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of USE_NULL_THREADS to SCM_USE_NULL_THREADS. * ioext.c: #include if HAVE_CONFIG_H. * inline.h: #include "libguile/__scm.h" at the top. Change code to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide what to do instead of creating a new public #define. Rename usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of USE_COPT_THREADS to SCM_USE_COPT_THREADS. * inline.c: rearrange handling -- now we just #define SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as appropriate, and we use that in inline.h along with the above define to determine how to respond. * init.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * guile.c: #include if HAVE_CONFIG_H. * gh_data.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details. * gen-scmconfig.c: new file -- see comments in file for details. * gdbinit.c: #include if HAVE_CONFIG_H. * gc_os_dep.c: #include if HAVE_CONFIG_H. Replace usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP. * gc.h: replace usage of SIZEOF_LONG with SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition since we handle that in scmconfig.h now. * gc.c: #include if HAVE_CONFIG_H. * gc-mark.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * gc-malloc.c: #include if HAVE_CONFIG_H. * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * fports.c: #include if HAVE_CONFIG_H. * filesys.c: #include if HAVE_CONFIG_H. * feature.c: #include if HAVE_CONFIG_H. Rename usage of USE_NULL_THREADS to SCM_USE_NULL_THREADS. * extensions.c: #include if HAVE_CONFIG_H. * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * eval.c: #include if HAVE_CONFIG_H. #include "libguile/__scm.h" rather than scmconfig.h. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * error.c: #include if HAVE_CONFIG_H. * eq.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". * deprecation.c: #include if HAVE_CONFIG_H. * coop.c: replace usage of struct timespect with scm_t_timespec. #include if HAVE_CONFIG_H. * coop-threads.c: #include "libguile/_scm.h" early. Replace usage of struct timespect with scm_t_timespec. Replace usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP. * coop-pthreads.c: #include "libguile/_scm.h" early. Replace usage of struct timespect with scm_t_timespec. Replace usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP. * coop-defs.h: move handling of time related headers to scmconfig.h. Add #include "libguile/__scm.h". Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct timespect with scm_t_timespec. * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * convert.c: #include if HAVE_CONFIG_H. Rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS. * continuations.c: move libguile/_scm.h include to the top so we pick up any critical defines like _GNU_SOURCE early. * backtrace.c: #include if HAVE_CONFIG_H. * async.c: #include if HAVE_CONFIG_H. * alloca.c: #include if HAVE_CONFIG_H. * _scm.h: #include if HAVE_CONFIG_H. Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS. * __scm.h: move libguile/scmconfig.h include up to the top, so we're sure to pick up any critical defines like _GNU_SOURCE early. #include removed in favor of scmconfig.h inclusion when appropriate. STDC_HEADERS based inclusion of stdlib.h, sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of scmconfig.h inclusion when appropriate. Various Win32 related definitions removed in favor of scmconfig.h inclusion when appropriate. (HAVE_UINTPTR_T): definition removed (see NEWS). (SIZEOF_PTRDIFF_T): definition removed (see NEWS). (HAVE_LONG_LONGS): definition removed (see NEWS). (HAVE_LONG_LONG): definition removed (see NEWS). (HAVE_PTRDIFF_T): definition removed (see NEWS). * Makefile.am: scmconfig.h is now generated by building and running gen-scmconfig.h and capturing its output. gen-scmconfig uses config.h and the configure.in generated gen-scmconfig.h to decide what to output. See gen-scmconfig.c for details. (noinst_PROGRAMS): add gen-scmconfig. (gen_scmconfig_SOURCES): new variable. (gen-scmconfig.$(OBJEXT)): new target - be careful to handle cross-compiling right. (scmconfig.h): build scmconfig.h from gen-scmconfig's output. (BUILT_SOURCES): add scmconfig.h. 2003-03-19 Marius Vollmer * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from Adrian Bunk. Thanks! 2003-03-19 Mikael Djurfeldt * goops.c (make_class_from_template): New fourth arg: applicablep. (scm_class_extended_generic_with_setter, scm_class_self): Fixed cpls. * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable. * goops.c, objects.c, objects.h (scm_make_extended_class): New second arg: applicablep. (scm_i_inherit_applicable): New function. * goops.c, goops.h (scm_class_applicable, scm_class_extended_accessor): New classes. 2003-03-18 Dirk Herrmann * procs.c (scm_procedure_documentation): Removed redundant SCM_NIMP test and replaced other calls to SCM_IMP by more explicit predicates. 2003-03-11 Mikael Djurfeldt * list.c, list.h (scm_filter, scm_filter_x): New functions. * modules.c (scm_module_import_interface): New function. * goops.c, goops.h (scm_class_accessor_method): Renamed from scm_class_accessor. (scm_class_accessor): New class. 2003-03-06 Mikael Djurfeldt * goops.c (scm_primitive_generic_generic): Enable primitive generic if not enabled. (scm_sys_goops_loaded): Setup unextended primitive generics. * goops.c, goops.h (scm_c_extend_primitive_generic): New function. * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New snarf macros. * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a testing example. All uses of SCM_GPROC should be converted.) * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of scm_assoc. * eq.c (scm_equal_p): Turned into a primitive generic. 2003-02-27 Rob Browning * Makefile.am (scmconfig.h): new target -- generate file from ../config.h. (modinclude_HEADERS): remove version.h. (nodist_modinclude_HEADERS): add version.h. 2003-02-24 Mikael Djurfeldt This fixes a serious GC bug, introduced during the latest reorganization of the GC, which disabled freeing of structs and GOOPS objects: * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to SCM_EOL. (scm_struct_prehistory): Move scm_free_structs to scm_before_mark_c_hook. * gc-card.c (sweep_card): Check that we haven't swept structs on this card before. That can happen if scm_i_sweep_all_segments has been called from some other place than scm_igc. 2003-02-19 Mikael Djurfeldt * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31 (since hash tables now adapt their size). * modules.c (scm_modules_prehistory): Changed from 2001 to 1533 (current number of prehistory bindings; hashtable code will select a prime which is greater than this value). * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139 (current number of initial symbols). * properties.c (scm_init_properties): Don't specify size of scm_properties_whash. * objprop.c (scm_init_objprop): Don't specify size of scm_object_whash. * keywords.c (scm_init_keywords): Don't specify a hash table size. * hooks.c (scm_c_hook_add): Fixed bug in append mode. The following changes introduce the use of resizable hash tables throughout Guile. It also renames the old *-hash-table* functions to *-alist-vector* and places them, together with the rest of the weak vector support, in the module (ice-9 weak-vector). We should probably introduce a new, better, API for weak references, for example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even look like and are used like ordinary pairs.) * environments.c (obarray_enter, obarray_retrieve, obarray_remove, leaf_environment_fold, obarray_remove_all): Use hashtable accessors. * gc.c (scm_init_storage): Moved hook initialization to scm_storage_prehistory. (scm_storage_prehistory): New function. (scm_igc): Added commentary about placement of scm_after_sweep_c_hook. * gc-mark.c (scm_mark_all): Use hashtable accessors. (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and SCM_WVECT_WEAK_VALUE_P. * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New functions. (scm_vector_to_hash_table, scm_c_make_resizing_hash_table): Removed. (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table): Moved here from weaks.c. * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added calls to scm_storage_prehistory and scm_hashtab_prehistory. * modules.c (module-reverse-lookup): Use hashtable accessors. * symbols.c, symbols.h (scm_i_hash_symbol): New function. * weaks.c, weaks.h (scm_make_weak_key_alist_vector, scm_make_weak_value_alist_vector, scm_make_doubly_weak_alist_vector): New functions. * weaks.c (scm_init_weaks_builtins): New function. * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE, SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P, SCM_WVECT_NOSCAN_P): New macros. * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P and SCM_WVECT_WEAK_VALUE_P. * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from allocate_weak_vector and exported. 2003-02-13 Mikael Djurfeldt * hashtab.c: Undid thread safety. (We decided that it's better to let the user explicitly protect the tables (or not) according what is suitable for the application.) 2003-02-12 Mikael Djurfeldt * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made thread safe and handle resizing tables. (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed SCM_DEFER/ALLOW_INTS. 2003-02-11 Mikael Djurfeldt * hashtab.c (scm_vector_to_hash_table, scm_c_make_resizing_hash_table, scm_make_hash_table): New functions. (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread safe and handle resizing tables. * weaks.c (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table): Size argument made optional. Return resizable table if not specified. 2003-02-10 Mikael Djurfeldt * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Fixed formals tests for closures. (Thanks to Kevin Ryde.) 2003-02-05 Mikael Djurfeldt * debug.c (scm_procedure_source): Handle all objects for which procedure? is #t. (Thanks to Bill Schottstaedt.) 2003-01-23 Mikael Djurfeldt * futures.c (mark_futures): Don't need to mark data of recycled futures. (scan_futures, cleanup_undead): Be smarter about marking futures---avoid unnecessary passes through future lists. * futures.h, futures.c: New files; Introduced recycling of futures. For fine-grained threading this lifts performance to another level. We can now use parallelization in inner loops of Guile programs without impossible overhead. * threads.h, threads.c: Moved futures to their own file. * Makefile.am (libguile_la_SOURCES): Added futures.c. (DOT_X_FILES): Added futures.x. (DOT_DOC_FILES): Added futures.doc. (modinclude_HEADERS): Added futures.h. * threads.c, threads.h (scm_i_create_thread): Renamed from create_thread and made global. * futures.c (scm_make_future): New procedure. * eval.c: #include "libguile/futures.h". * init.c: #include "futures.h" (scm_init_guile_1): Call scm_init_futures. * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK. * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here. * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New functions. * eval.c (scm_trampoline_1): Fixed arguments test for closures. 2003-01-22 Mikael Djurfeldt * threads.c (create_thread): Don't unwind dynwind chain of parent thread before creation. Just start the new thread with an empty dynwind chain. 2003-01-20 Mikael Djurfeldt * evalext.c, evalext.h (scm_self_evaluating_p): New function. 2003-01-10 Mikael Djurfeldt * threads.c (scm_timed_wait_condition_variable): Support timed waiting also for simple condition variables. * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead of calling the procedure change-object-class. 2003-01-09 Mikael Djurfeldt * ramap.c (scm_ramapc): Typo in error message. 2003-01-08 Mikael Djurfeldt * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for slots with instance allocation. * goops.c, goops.h (scm_class_extended_generic_with_setter): New class. (scm_compute_applicable_methods): Use scm_generic_function_methods. * goops.c (scm_generic_function_methods): Support extended generic functions. 2002-12-29 Mikael Djurfeldt * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future. Thanks to Neil for pointing this out! 2002-12-29 Neil Jerram * lang.h: Remove declarations matching definitions removed from lang.c (just below). 2002-12-28 Neil Jerram * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null, scm_m_while, scm_nil_eq): Remove definitions that were superfluous and already commented out. * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token, scm_lreadparen): Support reading vectors with Elisp syntax if SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS is not currently defined, and there isn't even a configure switch to enable it yet.) 2002-12-26 Marius Vollmer * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath builds work. (EXTRA_DIST): Added version.h.in. 2002-12-21 Mikael Djurfeldt This change makes it possible for one thread to do lazy sweeping while other threads are running. Now only the mark phase need to have all threads asleep. We should look further into this issue. Presently, I've put the locking of scm_i_sweep_mutex at "conservative" places due to my current lack of knowledge about the garbage collector. Please feel free to restrict these regions further to allow for maximal parallelism! * gc.c, gc.h (scm_i_sweep_mutex): New mutex. * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory): Substitute locking of scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep. (scm_igc): Lock sweep mutex here instead of in callers; Calls to scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate the single-thread section (which now only contains the mark phase). (scm_gc): Don't lock sweeo mutex here since scm_igc locks it; Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly. * threads.c (gc_section_mutex): Removed. 2002-12-19 Mikael Djurfeldt * threads.c (create_thread): Clear parent field in root state in order not to unnecessarily remember dead threads. * eval.c (call_subr2o_1, call_lsubr2_2): New functions. (scm_trampoline_1, scm_trampoline_2): Use them. 2002-12-18 Mikael Djurfeldt Partial introduction of real plugin interface. * Makefile.am (modinclude_HEADERS): Added threads-plugin.h. (EXTRA_DIST): Added threads-plugin.c. * threads-plugin.h, threads-plugin.c: New files. * threads.h: #include "libguile/threads-plugin.h". * threads.c: #include "libguile/threads-plugin.c". * pthread-threads.c: Temporarily remove debugging functions. * threads.c, threads.h (scm_yield): Added back. 2002-12-18 Mikael Djurfeldt * threads.c (really_launch): Detach before unlocking thread_admin_mutex in order not to risk being joined. (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep thread_admin_mutex locked during GC. * pthread-threads.c, pthread-threads.h: Improvements to debugging functions. 2002-12-16 Mikael Djurfeldt * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added support for debugging mutex operations. * threads.c (scm_thread): Removed filed joining_threads. (thread_print): Print thread number as well as address of thread structure. (scm_join_thread): Bugfix. (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex, scm_timed_wait_condition_variable, scm_signal_condition_variable, scm_broadcast_condition_variable): Use the low-level API. (scm_all_threads): Return copy of thread list (to prevent unintended destruction). (scm_threads_prehistory): Initialize heap_mutex of fake thread. * pthread-threads.c, pthread-threads.h, threads.c: Fixes to pthread "native" recursive mutex support. 2002-12-15 Mikael Djurfeldt * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions. Simply lock a thread C API recursive mutex. (SCM_NONREC_CRITICAL_SECTION_START, SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START, SCM_REC_CRITICAL_SECTION_END): Removed. * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with direct calls to scm_rec_mutex_lock / unlock around the three calls to scm_m_expand_body. * eval.c, eval.h (promise_free): New function. (scm_force): Rewritten; Now thread-safe; Removed SCM_DEFER/ALLOW_INTS. * pthread-threads.h: Added partially implemented plugin interface for recursive mutexes. These are, for now, only intended to be used internally within the Guile implementation. * pthread-threads.c: New file. * threads.c: Conditionally #include "pthread-threads.c". * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be thread-safe; * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX, SCM_GLOBAL_REC_MUTEX): New macros. * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section macros---use mutexes instead. * tags.h (SCM_IM_FUTURE): New tag. * eval.c (scm_m_future): New primitive macro. (SCM_CEVAL): Support futures. (unmemocopy): Support unmemoization of futures. * print.c (scm_isymnames): Name of future isym. * version.c: Unmade some changes to my private copy that got committed by mistake. 2002-12-11 Mikael Djurfeldt * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of 2002-12-10. * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists. * gc.c (scm_gc_sweep): Call it here instead, which is a more logical place. * threads.c (create_thread): Remember root object until the handle of the new thread is on all_threads list. * root.c (scm_make_root): Moved copying of fluids until after creation of root handle so that the fluids are GC protected. Also removed the critical section. 2002-12-10 Mikael Djurfeldt * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function. * gc-malloc.c (malloc_mutex): New mutex. (scm_gc_malloc_prehistory): Initialize it. (scm_realloc): Serialize call to realloc (scm_calloc): Same for calloc. Thanks to Wolfgang Jaehrling! (Now we have to make sure all calls to malloc/realloc are made through scm_malloc.) * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory. * threads.c (really_launch): Release heap (to prevent deadlock). (create_thread): Release heap before locking thread admin mutex. 2002-12-10 Mikael Djurfeldt * threads.c (scm_i_thread_invalidate_freelists): New function. * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists. * modules.c (scm_export): Inserted a return statement. 2002-12-10 Han-Wen Nienhuys * modules.c (scm_export): new function * gc-card.c: add a note about malloc()/free() overhead. 2002-12-10 Mikael Djurfeldt * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c in srcdir. 2002-12-10 Mikael Djurfeldt These changes remove scm_ints_disabled (which hasn't has any effect in Guile for quite some time). * async.c, error.h (scm_ints_disabled): Removed. * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1), root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK, SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled. (old_ints): Removed. * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive critical section. (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and SCM_ALLOW_INTS. 2002-12-09 Mikael Djurfeldt * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait): Removed accidental #if 0 around these functions. These changes are the start of support for preemptive multithreading. Marius and I have agreed that I commit this code into the repository although it isn't thoroughly tested and surely introduces many bugs. The bugs should only be exposed when using threads, though. Signalling and error handling for threads is very likely broken. Work on making the implementation cleaner and more efficient is needed. * __scm.h (SCM_ALLOW_INTS_ONLY): Removed. (SCM_NONREC_CRITICAL_SECTION_START, SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START, SCM_REC_CRITICAL_SECTION_END): New macros. (SCM_CRITICAL_SECTION_START/END): Defined here. * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around the three calls to scm_m_expand_body. * gc.h: #include "libguile/pthread-threads.h"; (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros. * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type scm_t_key; * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist access. * gc-freelist.c (scm_gc_init_freelist): Create freelist keys. * gc-freelist.c, threads.c (really_launch): Use SCM_FREELIST_CREATE. * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory): * gc.c (scm_i_expensive_validation_check, scm_gc, scm_gc_for_newcell): Put threads to sleep before doing GC-related heap administration so that those pieces of code are executed single-threaded. We might consider rewriting these code sections in terms of a "call_gc_code_singly_threaded" construct instead of calling the pair of scm_i_thread_put_to_sleep () and scm_i_thread_wake_up (). Also, we would want to have as many of these sections eleminated. * init.c (scm_init_guile_1): Call scm_threads_prehistory. * inline.h: #include "libguile/threads.h" * pthread-threads.h: Macros now conform more closely to the pthreads interface. Some of them now take a second argument. * threads.c, threads.h: Many changes. 2002-12-09 Mikael Djurfeldt * Makefile.am (version.h): Changed $^ --> $< in rule for version.h. 2002-12-08 Rob Browning * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now. (SCM_MINOR_VERSION): use @--@ substitution now. (SCM_MICRO_VERSION): use @--@ substitution now. (scm_effective_version): new function prototype. * version.c (scm_effective_version): new function, also add effective-version. * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION. (libpath.h): use GUILE_EFFECTIVE_VERSION to compute SCM_LIBRARY_DIR. (version.h): generate this here rather than configure.in. This approach tracks source edits better (i.e. more immediately). Might be worth considering for other .in files too. 2002-12-02 Marius Vollmer Reorganized thread package selection. A thread package now only implements a small set of pthread like functions and Guile implements the rest on top of that. Guile's implementation is what the "coop-pthreads" package has been previously. Support for "coop" threads has been removed until I get time to add it again. * Makefile.am (libguile_la_SOURCES): Removed iselect.c. (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c, null-threads.c, coop-pthreads.c. (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added pthread-threads.h. * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h. * threads.h: Do not include "libguile/coop-defs.h". Include "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed (previously deprecated) C level thread API prototypes. They are now in the thread package specific headers, "null-threads.h" and "pthread-threads.h". (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR): New. (scm_threads_init): Removed. (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END, SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter, SCM_I_THREAD_SWITCH_COUNT): Define here. (scm_single_thread_p): Removed. (scm_call_with_new_thread): Take two args directly instead of list of two args. (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA, SCM_SET_THREAD_LOCAL_DATA): Define here. * threads.c: Merged with "coop-pthreads.c". * null-threads.h: Implement pthread-like API as a set of macros. * pthread-threads.h: New, implement pthread-like API by deferring to pthread itself. * init.c (scm_init_guile_1): Do not call scm_init_iselect, which has been lost in the reorganization. 2002-12-01 Mikael Djurfeldt The following change makes it possible to move procedure application dispatch outside inner loops. The motivation was clean implementation of efficient replacements of R5RS primitives in SRFI-1. The semantics is clear: scm_trampoline_N returns an optimized version of scm_call_N (or NULL if the procedure isn't applicable on N args). Applying the optimization to map and for-each increases efficiency noticeably. For example, (map abs ls) is 8 times faster than before. * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types. * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions. * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions; (map, for-each): Handle also application on two args as a special case; Use trampolines. Other changes: * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o; (subr2oless): Removed. (scm_restricted_vector_sort_x): Use scm_return_first to keep the vector GC protected. * eval.c (check_map_args): Use scm_out_of_range_pos instead of scm_out_of_range. 2002-11-24 Dirk Herrmann * evalext.[ch] (scm_m_undefine, undefine): Deprecated. 2002-11-17 Mikael Djurfeldt * debug.c (scm_make_iloc): Added missing "return". 2002-11-17 Marius Vollmer * strports.c (scm_eval_string_in_module): Validate second arg to be a module. Thanks to Arno Peters! 2002-11-16 Dirk Herrmann * .cvsignore: remove goops.c 2002-11-16 Dirk Herrmann * modules.c (scm_env_top_level, scm_lookup_closure_module, module_variable, scm_module_lookup_closure, scm_module_transformer, scm_sym2var, scm_module_reverse_lookup, scm_system_module_env_p): Don't compare SCM values with C operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP over SCM_NFALSEP. 2002-11-16 Dirk Herrmann * eval.h (SCM_MAKE_ILOC): New macro. * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing the iloc bitpattern here. 2002-11-14 Mikael Djurfeldt * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be part of the API, otherwise it's difficult to write Guile extensions using non-blocking I/O => moved #include "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h. * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex --> s_unlock_mutex. 2002-11-10 Marius Vollmer * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They are defined in configure.in. * threads.c: Removed SCM_API from function definitions. SCM_API is only for declarations. 2002-11-07 Mikael Djurfeldt * coop-pthreads.h: Added support for thread specific data to the generic C API for the coop-pthreads case. * threads.c, threads.h (scm_cond_init): Undo unintentional API change. (scm_cond_broadcast): Added missing function. 2002-11-04 Marius Vollmer * coop.c (coop_next_runnable_thread): Removed, wich should have happened when GUILE_ISELECT was hard-wired. 2002-11-03 Marius Vollmer * Makefile.am (libguile_la_SOURCES): Added threads.c (DOT_DOC_FILES): Added threads.doc. (DOT_X_FILES): Added threads.x. (EXTRA_libguile_la_SOURCES): Removed threads.c. (noinst_HEADERS): Added coop-pthreads.c. (modinclude_HEADERS): Added coop-pthreads.h. * __scm.h (USE_THREADS, GUILE_ISELECT): Define when SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile. * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H. Thanks to Bill Schottstaedt! * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0. * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when SCM_COPT_THREADS is defined. (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS is defined. * coop-pthreads.c: Some harmless renamings of internal stuff. (create_thread): New, generalized version of scm_call_with_new_thread. (scm_call_with_new_thread): Use it. (scm_spawn_thread): New, use create_thread. 2002-11-02 Marius Vollmer * coop-pthreads.c, coop-pthreads.h: Redone completely, you might start testing it now. * _scm.h: Include * scmsigs.c (signal_cell_handlers, install_handler_data, scm_delq_spine_x, really_install_handler, install_handler): New scheme for triggering signal handlers, to simplify take_signal. (take_signal): Simplified, to avoid race conditions. (scm_sigaction_for_thread): Use new Scheme. Validate that thread hasn't exited yet. * async.c (scm_async_click): Reset pending_asyncs, handle signal_asyncs. Don't set cdr of a non-signal async to #f. (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue always. Set pending_asyncs. (scm_system_async_mark_for_thread): Check that thread has not exited. (scm_unmask_signals, decrease_block): Call scm_async_click after block_asyncs becomes zero. * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of active_asyncs. * root.h (scm_root_state): Added pending_asyncs and signal_asyncs fields. * root.c (root_mark): Mark them. (make_root): Initialize them. * iselect.c, iselect.h: Replaced GUILE_ISELECT with USE_COOP_THREADS. (scm_internal_select): Define one version for USE_COOP_THREADS and one for USE_NULL_THREADS. (scm_init_iselect): Likewise. * inline.h (scm_cell, scm_double_cell): Also allow USE_COPT_THREADS to not protect the slot initializers. * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is because threads need to be initialized before the stack, but gsubrs such as scm_timed_condition_variable_wait can only be created later. * threads.h: Include "coop-pthreads.h" when requested. (scm_threads_make_mutex, scm_threads_lock_mutex, scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were not implemented anyway. (scm_init_thread_procs, scm_try_mutex, scm_timed_condition_variable_wait, scm_broadcast_condition_variable, scm_c_thread_exited_p, scm_thread_exited_p): New prototypes. (struct timespec): Define if not already defined. (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init, scm_cond_wait, scm_cond_timedwait, scm_cond_signal, scm_cond_broadcast, scm_cond_destroy): Declarations moved here and deprecated. * threads.c: Include . Include "coop-pthreads.c" when requested. (scm_thread_exited_p): New. (scm_try_mutex, scm_broadcast_condition_variable): Newly registered procedures. (scm_wait_condition_variable, scm_timed_wait_condition_variable): Use the latter as the procedure for "wait-condition-variable", thus offering a optional timeout parameter to Scheme. (scm_wait_condition_variable): Implement in terms of scm_timed_wait_condition_variable. (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, scm_mutex_unlock, scm_mutex_destroy, scm_cond_init, scm_cond_wait, scm_cond_timedwait, scm_cond_signal, scm_cond_broadcast, scm_cond_destroy): Implement in terms of scm_make_mutex, etc, and deprecate. (scm_init_threads): Do not create smobs, leave this to scm_threads_init. Do not include "threads.x" file. (scm_init_thread_procs): New, include "threads.x" here. * null-threads.h (scm_null_mutex, scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock, scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init, scm_null_condvar_wait, scm_null_condvar_signal, scm_null_condvar_destroy): Removed. (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init, scm_cond_wait, scm_cond_signal, scm_cond_broadcast, scm_cond_destory): Do not define, they are now deprecated and handled by threads.{h,c}. * null-threads.c (scm_null_mutex, scm_null_cond): Define here. (scm_threads_init): Create smobs here, using the appropriate sizes. (block): Removed, now unused. (scm_c_thread_exited_p): New. (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock, scm_null_mutex_destroy, scm_null_condvar_init, scm_null_condvar_wait, scm_null_condvar_signal, scm_null_condvar_destroy): Removed and updated users to do their task directly. (scm_try_mutex, timeval_subtract, scm_timed_wait_condition_variable, scm_broadcast_condition_variable): New. (scm_wait_condition_variable): Removed. * coop-defs.h (coop_m): Added 'level' field. (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init, scm_cond_wait, scm_cond_timedwait, scm_cond_signal, scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not define. (coop_condition_variable_broadcast): New. * coop-threads.c (scm_threads_init): Create smobs here, using the appropriate sizes. (scm_c_thread_exited_p, scm_try_mutex, scm_timed_wait_condition_variable, scm_broadcast_condition_variable): New. (scm_wait_condition_variable): Removed. * coop.c (coop_new_mutex_init): Initialize level. (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain level. (coop_condition_variable_signal): Renamed to coop_condition_variable_broadcast and reimplemented in terms of that. Thus... (coop_condition_variable_broadcast): New. * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc. * coop-pthreads.h, coop-pthreads.c: New, but unfinished. 2002-10-21 Marius Vollmer * null-threads.c: Include . Also, use <...> for inclusion of system headers. * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE in lots of places to give better error messages. Thanks to Bill Schottstaedt! 2002-10-19 Dirk Herrmann * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed scm_definedp to scm_defined_p and deprecated scm_definedp. 2002-10-19 Dirk Herrmann * async.h, async.c (scm_system_async): Fixed deprecation to work correctly when deprecated features are excluded. 2002-10-16 Marius Vollmer * async.c (scm_system_async_mark_for_thread): Validate thread argument. * coop-threads.c (scm_i_thread_root): Do not validate argument. * feature.c (scm_init_feature): Don't add 'threads' for USE_NULL_THREADS. * inline.h (scm_cell, scm_double_cell): Also allow USE_NULL_THREADS to not protect the slot initializers. * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not "USE_THREAD". * Makefile.am (noinst_HEADERS): Added null-threads.c. (modinclude_HEADERS): Added null-threads.h. * threads.h: Include null-threads.h when !USE_COOP_THREADS. * threads.c: Include null-threads.c when !USE_COOP_THREADS. (scm_init_threads): Use generic type names scm_t_mutex and scm_t_cond instead of coop_m and coop_c. * null-threads.c, null-threads.h: New files. 2002-10-15 Marius Vollmer * Makefile.am: Replaced "$<" in non-pattern rules with its value. This is to support makes that know about "$<" only in pattern rules, like Sun's make. 2002-10-13 Marius Vollmer * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute substitution. Thanks to David Allouche! 2002-10-13 Dirk Herrmann * evalext.h: Replaced SCM_DEBUG_DEPRECATED with !SCM_ENABLE_DEPRECATED. 2002-10-11 Marius Vollmer * async.c (scm_system_async_mark_for_thread): Only call scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. * scmsigs.c (take_signal): Only call scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. (scm_sigaction_for_thread): Ignore THREAD argument when USE_THREADS is not defined. Also, move THREAD argument defaulting out of HAVE_SIGACTION section, which was a bug. 2002-10-10 Marius Vollmer * scmsigs.c (scm_sigaction_for_thread): Store original handler in signal_handlers, not the closure that is used as the async. The closure is stored in signal_handler_cells, as previously. 2002-10-10 Marius Vollmer * root.h (scm_root_state): Added 'block_async' slot. (scm_active_asyncs): Removed abbrev. * root.c (scm_make_root): Initialize 'block_asyncs' slot. * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs abbrev. * async.h (scm_call_with_blocked_asyncs, scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, scm_c_call_with_unblocked_asyncs): New prototypes. (scm_mask_signals, scm_unmask_signals): Deprecated. (scm_mask_ints): Turned into a macro. * async.c (scm_mask_ints): Removed. (scm_run_asyncs): Do not set scm_mask_ints while running an async. this should not be necessary. (scm_async_click): Test block_asyncs instead of scm_mask_ints. (scm_mask_signals, scm_unmask_signals): Deprecated. Emit deprecation warning and check for errornous use. Set block_asyncs instead of scm_mask_ints. (increase_block, decrease_block, scm_call_with_blocked_asyncs, scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, scm_c_call_with_unblocked_asyncs): New. * script.c (scm_compile_shell_switches): Do not set scm_mask_ints. Asyncs are enabled by default. 2002-10-09 Neil Jerram * vports.c (scm_make_soft_port): Allow vector argument to carry a 6th element: an input waiting thunk. (sf_input_waiting): New. 2002-10-05 Marius Vollmer * root.c (root_mark): Mark active_asyncs slot. * async.c (scm_async_click): Set the cdr of a executed handler cell to SCM_BOOL_F, not SCM_EOL. (scm_i_queue_async_cell): Queue the cell at the end of the list, and only if the handler procedure is not already present. (scm_system_async_mark_for_thread): Initialize cdr of handler cell with SCM_BOOL_F. * scmsigs.c (scm_sigaction_for_thread): Likewise. 2002-10-04 Rob Browning * guile.c (main): switch to scm_lt_dlset_preloaded_symbols; * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle, scm_lt_dlopenext, and scm_lt_dlerror. (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose, and scm_lt_dlerror. (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym, and scm_lt_dlerror. (sysdep_dynl_init): switch to scm_lt_dlinit(); * Makefile.am (libguile_la_LIBADD): switch to use libguile-ltdl.la. * numbers.c (scm_integer_expt): (expt 0 1) should be 1. 2002-10-04 Marius Vollmer * scmsigs.h (scm_sigaction_for_thread): New prototype. * scmsigs.c (got_signal): Removed. (signal_handler_cells, signal_handler_threads): New. (take_signal): Queue the cell of the signal for the specified thread. Reset the signal handler on systems that don't have sigaction. (sys_deliver_signals): Removed. (close_1): New. (scm_sigaction_for_thread): Renamed from scm_sigaction and extended to also set the thread of a signal and allocate a cell for it. Keep the Scheme name "sigaction". Check that signum is within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS. (scm_sigaction): Implement in terms of scm_sigaction_for_thread. (scm_init_scmsigs): Allocate signal_handler_cells and signal_handler_threads vectors. * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so that system asnycs and user asyncs are separated. Reimplemented system asyncs to work per-thread. * gc.c (scm_init_gc): Do not use scm_system_async. * async.h (scm_asyncs_pending, scm_set_tick_rate, scm_set_switch_rate, scm_system_async_mark_from_signal_handler): Removed prototypes. (scm_i_queue_async_cell): New. * __scm.h (scm_asyncs_pending_p): Removed. (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of scm_asyncs_pending_p. * async.h (scm_system_async_mark_for_thread): New prototype. * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code. * root.h (scm_root_state): Added new "active_asyncs" slot. * root.c (scm_make_root): Initialize it to SCM_EOL. * coop-defs.h (coop_t): Added new "handle" slot. * coop-threads.c (all_threads, scm_current_thread, scm_all_threads, scm_i_thread_root): New. (scm_threads_init): Add main thread to all_threads. (scheme_launch_thread): Remove thread from all_threads when it terminates. (scm_call_with_new_thread): Initialize handle slot of coop_t structure and add new thread to all_threads. (scm_spawn_thread): Likewise. * threads.h (scm_current_thread, scm_all_threads): New prototypes. * threads.c (scm_current_thread, scm_all_threads): Register as primitives. * dynl.c: Use scm_lt_ prefix for libltdl functions. 2002-09-29 Neil Jerram * script.c (scm_compile_shell_switches): Fix bad spelling of `explicitly' in comment. 2002-09-28 Neil Jerram * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid): Refer to provided? in doc string rather than deprecated feature?. 2002-09-24 Gary Houston * inline.h (scm_double_cell): prevent reordering of statements with any following code (for GCC 3 strict-aliasing). * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed the earlier version of the reordering prevention. 2002-09-19 Han-Wen Nienhuys * inline.h (scm_double_cell): move SET_GCMARK set out of if body. 2002-09-09 Han-Wen Nienhuys * gc-malloc.c (scm_gc_register_collectable_memory): more overflow protection. 2002-09-08 Han-Wen Nienhuys * inline.h: include stdio.h * smob.c (free_print): abort if scm_debug_cell_accesses_p is set 2002-09-05 Han-Wen Nienhuys * gc-segment.c (scm_i_make_initial_segment): check user settings for sanity. * gc-malloc.c (scm_gc_init_malloc): check user settings for sanity. * gc-freelist.c (scm_init_freelist): check user settings for sanity. * struct.h: change scm_structs_to_free to scm_i_structs_to_free * gc-malloc.c (scm_gc_register_collectable_memory): use floats; these won't ever wrap around with high memory usage. Thanks to Sven Hartrumpf for finding this. * gc-freelist.c: include * gc-malloc.c: add DEBUGINFO for mtrigger GCs. 2002-09-01 Marius Vollmer * vectors.h (SCM_VECTOR_REF): New. * snarf.h (SCM_DEFINE_PUBLIC): New. 2002-08-30 Marius Vollmer * socket.c (scm_addr_vector): Added size of address to arguments. Use it to avoid accessing a non-existent path in a sockaddr_un. Changed all callers. 2002-08-29 Han-Wen Nienhuys * gc.h: remove DOUBLECELL card flags. * gc-malloc.c (scm_calloc): try to use calloc() before calling scm_realloc(). * gc-segment.c (scm_i_initialize_heap_segment_data): remove card init loop; handle this from scm_init_card_freelist() * gc-card.c (scm_init_card_freelist): init bit vector here. * numbers.c (scm_make_real): prevent reordering of statements num2float.i.c (FLOAT2NUM): idem 2002-08-27 Han-Wen Nienhuys * eval.h: prepend libguile/ to include path 2002-08-26 Marius Vollmer * script.c (scm_compile_shell_switches): Added "2002" to Copyright years. Thanks to Martin Grabmüller! 2002-08-25 Han-Wen Nienhuys * gc-segment.c (scm_i_get_new_heap_segment): use float in stead of unsigned numbers for computing minimum heap increment. This prevents weird results when a a negative minimum increment is computed. 2002-08-24 Marius Vollmer * gc_os_dep.c: When we have __libc_stack_end, use that directly instead of the old tricks. * guile-snarf.in: Do not expect the input file to be the first argument after the optional "-o" option, just pass everything to the pre-processor without extracting the input file name. 2002-08-23 Han-Wen Nienhuys * gc-segment.c (scm_i_get_new_heap_segment): Oops. We want segment length *at* least SCM_MIN_HEAP_SEG_SIZE, not at most. 2002-08-22 Han-Wen Nienhuys * gc.h, gc.c: make scm_cells_allocated unsigned again. Thanks to Bill Schottstaedt for the bug report 2002-08-20 Marius Vollmer * print.c (scm_iprin1): Print primitives generics always as "primitive-generic" even when they have no primitive methods yet. 2002-08-17 Gary Houston * coop.c (coop_create): removed bogus 2nd argument in scm_malloc call. 2002-08-17 Han-Wen Nienhuys * ports.c (scm_add_to_port_table): small bugfix. * mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead of malloc. * gc-segment.c (scm_i_get_new_heap_segment): remove cluster cruft: only use SCM_MIN_HEAP_SEG_SIZE. * ports.c (scm_add_to_port_table): add backwards compatibility function * ports.h: use scm_i_ prefix for port table and port table size. 2002-08-15 Mikael Djurfeldt * vports.c (scm_make_soft_port): Initialize pt variable. 2002-08-13 Marius Vollmer * strports.h (scm_c_eval_string_in_module, scm_eval_string_in_module): New prototypes. * strports.c (scm_eval_string_in_module): New, but use "eval-string" as the Scheme name and make second parameter optional. (scm_eval_string): Implement using scm_eval_string_in_module. (scm_c_eval_string_in_module): New. Thanks to Ralf Mattes for the suggestion! 2002-08-09 Han-Wen Nienhuys * gc-card.c ("sweep_card"): remove SCM_MISC_ERROR messages: print message and abort. * gc-mark.c ("scm_gc_mark_dependencies"): idem. * ports.c ("scm_new_port_table_entry"): return a boxed SCM in stead of scm_t_port*. The function now takes a tag argument. 2002-08-08 Han-Wen Nienhuys * gc.h: add scm_debug_cells_gc_interval to public interface * gc-card.c ("sweep_card"): set scm_gc_running while sweeping. * gc.c (scm_i_expensive_validation_check): separate expensive validation checks from cheap ones. 2002-08-06 Han-Wen Nienhuys * read.c (scm_input_error): new function: give meaningful error messages, and throw read-error * gc-malloc.c (scm_calloc): add scm_calloc. 2002-08-05 Han-Wen Nienhuys * tags.h: remove GC bits documentation from the tags table. * read.c (INPUT_ERROR): Prepare for file:line:column error messages for errors in scm_lreadr() and friends. 2002-08-04 Han-Wen Nienhuys * gc-malloc.c (scm_malloc): use scm_realloc() (simplifies implementation). (scm_gc_calloc): new function 2002-08-04 Han-Wen Nienhuys * ports.c (scm_new_port_table_entry): init port entry to 0 completely. * ports.c (scm_new_port_table_entry): change function from scm_add_to_port_table. This prevents cells with null-pointers from being exposed to GC. * vports.c (scm_make_soft_port) strports.c (scm_mkstrport), fports.c (scm_fdes_to_port): Use scm_new_port_table_entry(). * gc.c (scm_gc_stats): add cell-yield and malloc-yield statistic to gc-stats. * numbers.c (big2str): return "0" for 0 iso. "" * gc-segment.c, gc-malloc.c gc-mark.c, gc-freelist.c, gc-card.c, private-gc.h: new file * gc.c: completely revised and cleaned up the GC. It now uses lazy sweeping. More documentation in workbook/newgc.text 2002-07-25 Marius Vollmer * random.c (rstate_free): Return zero. 2002-07-24 Dirk Herrmann * environments.c (remove_key_from_alist): Removed. (obarray_remove): Simplified. 2002-07-24 Stefan Jahn * continuations.h: ia64: Include before . 2002-07-21 Dirk Herrmann * modules.c (scm_sym2var): Don't compare SCM values with ==. 2002-07-21 Han-Wen Nienhuys * goops.c (scm_compute_applicable_methods): use scm_remember_upto_here_1 iso scm_remember_upto_here * macros.c: include deprecation.h * vectors.c (scm_vector_move_right_x): remove side effect in macro arg. (scm_vector_move_left_x): idem. * net_db.c, posix.c, socket.c: variable naming: change ans to result. * sort.c (scm_merge_vector_x): accept vector as argument iso. SCM*. This is needed for full GC correctness. * gc.h: undo previous undocumented changes related to #ifdef GENGC. 2002-07-20 Han-Wen Nienhuys * *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. 2002-07-15 Dirk Herrmann * eval.c (SCM_CEVAL), macros.c (macro_print, scm_makmacro, scm_sym_macro, scm_macro_type), macros.h (scm_makmacro): Deprecated the special kind of built-in dynamic syntax transformer that was inaccurately named "macro". Note: The built-in syntax transformers that are named "mmacro" or "memoizing-macro" still exist, and it is these which come much closer to what one would call a macro. 2002-07-13 Neil Jerram * eval.c (unmemocopy): Fix for 1001-local-eval-error-backtrace-segfaults (unmemoization crash with internal definitions and local-eval). 2002-07-12 Gary Houston * dynl.c: Don't define stub procedures if DYNAMIC_LINKING is not defined. They don't do anything useful, especially since the only case where DYNAMIC_LINKING is undefined seems to be when --with-modules=no is given to configure, which is basically requesting that the "dynamic linking module" be omitted. * Makefile.am (libguile_la_SOURCES): move dynl.c from libguile_la_SOURCES to EXTRA_libguile_la_SOURCES. * extensions.c (load_extension): check DYNAMIC_LINKING for scm_dynamic_call. * init.c (scm_init_guile_1): check DYNAMIC_LINKING for scm_init_dynamic_linking. 2002-07-10 Marius Vollmer * guile.c, iselect.h, net_db.c, posix.c, socket.c: No need to check for Cygwin when including , this is already check for by configure. Thus, revert change from 2002-07-07. 2002-07-10 Gary Houston * eq.c: include * dynl.c: docstring editing. 2002-07-09 Gary Houston * dynl.c (scm_dynamic_call): docstring editing. 2002-07-08 Rob Browning * gc_os_dep.c: HURD fixes. 2002-07-07 Marius Vollmer Crosscompiling and Cygwin fixes by Jan Nieuwenhuizen. Thanks! * Makefile.am: Override default rule for c-tokenize.$(OBJECT); this should be compiled for BUILD host. Override default rule for guile_filter_doc_snarfage$(EEXECT); this should run on BUILD host. Add missing $(EXEEXT) to guile_filter_doc_snarfage invocation. (snarf2checkedtexi): Use GUILE_FOR_BUILD instead of preinstguile. * guile.c, iselect.h, net_db.c, posix.c, socket.c: Do not include on Cygwin even when we have it. 2002-07-01 Dirk Herrmann * __scm.h (SCM_CAUTIOUS), eval.c (scm_eval_args, deval_args, SCM_CEVAL): Removed compile time option SCM_CAUTIOUS to clean up the code. Full number of arguments checking of closures is mandatory now. However, the option to disable the checking has most probably not been used anyway. 2002-06-30 Dirk Herrmann * __scm.h (SCM_RECKLESS), backtrace.c (SCM_ASSERT), debug.c (scm_debug_options), eval.c (scm_lookupcar, scm_lookupcar1, scm_badargsp, SCM_CEVAL, SCM_APPLY, scm_map, scm_for_each), feature.c (scm_init_feature), gsubr.c (scm_gsubr_apply), numbers.c (scm_logand, scm_logior, scm_logxor, scm_i_dbl2big), srcprop.c (scm_source_properties, scm_set_source_properties_x, scm_source_property): Removed compile time option SCM_RECKLESS to clean up the code. Full number of arguments checking of closures is mandatory now. However, the option to disable the checking has most probably not been used anyway. * srcprop.c (scm_source_properties, scm_set_source_properties_x, scm_source_property): Use !SCM_CONSP instead of SCM_NCONSP. 2002-06-30 Gary Houston * dynl.c: Removed all SCM_DEFER_INTS/SCM_ALLOW_INTS, which won't do anything useful. Added a comment about need for a mutex if pre-emptive threading is supported. * posix.c (scm_convert_exec_args), dynl.c (scm_make_argv_from_stringlist): static procs: 1) renamed both to allocate_string_pointers. 2) simplified: don't reallocate the strings, just make an array of pointers 3) avoid memory leaks on error 4) let the procedure report errors in its own name. Consequences: 1) the procedures now assume that SCM strings are nul-terminated, which should always be the case. 2) Since strings are not reallocated, it's now possible for strings passed to dynamic-args-call to be mutated. 2002-06-28 Dirk Herrmann * __scm.h, eval.c, eval.h: Removed compile time option MEMOIZE_LOCALS to clean up the code. Now, caching of local variable positions during memoization is mandatory. However, the option to disable the caching has most probably not been used anyway. 2002-06-18 Marius Vollmer * print.c (scm_simple_format): Print missing part of format before ~% control. Thanks to Daniel Skarda! 2002-06-01 Marius Vollmer * mkstemp.c: Added exception notice to license statement. 2002-05-22 Marius Vollmer * numbers.c (mem2ureal): When returning an inexact zero, make sure it is represented as a floating point value so that we can change its sign. From John W. Eaton * numbers.c (idbl2str): Don't omit sign when printing negative zero. 2002-05-14 Thien-Thi Nguyen * gc_os_dep.c: For I386/OPENBSD, allow for `__i386__' in addition to `i386'. Thanks to Dale P. Smith. 2002-05-08 Marius Vollmer * eq.c (real_eqv): New. (scm_eqv_p): Use it when comparing reals and complexes. * numbers.c: Include , for strncmp. (mem2complex): Do not create negative NaNs. (scm_leq_p, scm_geq_p): Explicitely return #f when comparing a NaN. (scm_inexact_to_exact): Signal error when converting a NaN. 2002-05-06 Marius Vollmer * posix.c (scm_putenv): Handle removing variables explicitely by calling unsetenv. From John W. Eaton. * numbers.h: Conditionally include floatingpoint.h, ieeefp.h, and nan.h. Provide declarations for scm_inf_p, scm_nan_p, scn_inf, and scm_nan. * numbers.c: [SCO && ! HAVE_ISNAN] (isnan): New function. [SCO && ! HAVE_ISINF] (isinf): New function. (xisinf, xisnan): New functions. (IS_INF): Delete. (isfinite): Define in terms of xisinf. (scm_inf_p, scm_nan_p): New functions. (guile_Inf, guile_NaN): New file-scope vars. (guile_ieee_init): New function. (scm_inf, scm_nan): New functions. (idbl2str): Handle Inf and NaN. Remove funny label and corresponding gotos. (ALLOW_DIVIDE_BY_ZERO): New macro. (scm_divide): Allow division by zero to occur if ALLOW_DIVIDE_BY_ZERO is defined. Handle bignums and ints as special cases. Additional stuff by me: numbers.c (mem2ureal): Recognize "inf.0" and "nan.xxx". (scm_even_p, scm_odd_p): Treat infinity as even and odd. (iflo2str): Don't output a '+' for negative numbers or for Inf and NaN. They will provide their own sign. (scm_divide): Only allow divides by inexact zeros. Dividing by exact zeros still signals an errors. 2002-04-22 Thien-Thi Nguyen * goops.h (scm_slot_exists_p): Rename from scm_slots_exists_p. * goops.c (scm_slot_exists_p): Rename from scm_slots_exists_p. (scm_slot_exists_p): Rename from scm_slots_exists_p. Thanks to Andreas Rottmann. 2002-04-20 Gary Houston * removal of unused fields in root state (thanks to Christopher Cramer for pointing out the disuse.) * root.h (scm_root_state): removed def_inp, def_outp, def_errp. (scm_def_inp, scm_def_outp, scm_def_errp): removed. * root.c (root_mark): don't mark them. (scm_make_root): don't set them to #f. * init.c (scm_init_standard_ports): don't initialise with the default ports. 2002-04-17 Marius Vollmer * Makefile.am (EXTRA_DIST): Added cpp_err_symbols.c and cpp_sig_symbols.c. 2002-04-16 Marius Vollmer * guile-snarf.in: Do not clean input file. This would write to the $(srcdir) during a VPATH build, which is not allowed. It also isn't needed since it only works when an output filename has been specified and in that case we don't need to clean the input file because the output file will already exist. 2002-03-31 Marius Vollmer * guile-snarf: Install the trap for removing $cleanfile only when the value of $cleanfile is actually known. 2002-04-10 Rob Browning * .cvsignore: add versiondat.h and *.c.clean.c. 2002-03-26 Dirk Herrmann * srcprop.[ch] (scm_c_source_property_breakpoint_p): New function, replaces macro SRCBRKP. (SRCBRKP): Deprecated. * eval.c (SCM_CEVAL): Replaced use of SRCBRKP by call to scm_c_source_property_breakpoint_p. Removed some use of arg1 as temporary variable. 2002-03-25 Dirk Herrmann * debug.h, eval.c: Deprecated CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT and removed all references to them. 2002-03-24 Dirk Herrmann * debug.h (scm_ready_p, debug_print): Removed declarations. * eval.c (EVALCELLCAR): Removed. (SCM_CEVAL): Eliminated label loopnoap. Removed side-effecting operation from condition. 2002-03-24 Marius Vollmer * guile-snarf.in: When the output filename is "-", write to stdout. When no "-o" option is given, use "-" as the output filename (i.e., stdout). Only 'clean' the inputfile or remove the output file on error when the output file name is not "-". Define the preprocessor macro SCM_MAGIC_SNARFER while snarfing. * Makefile.am (.c.x): Pass "-o $@" to guile-snarf. 2002-03-23 Dirk Herrmann * eval.c (SCM_CEVAL, SCM_APPLY): Eliminated labels wrongnumargs and the corresponding goto statements. Removed redundant code. 2002-03-21 Dirk Herrmann * eval.c (SCM_CEVAL): Minimized scope of variable arg2. Eliminated redundant SCM_IMP check. Exlined call to EVALCAR. Re-enabled handing of rpsubrs and asubrs. 2002-03-20 Dirk Herrmann * eval.c (SIDEVAL): Removed. (SCM_CEVAL): Minimized scope of variable orig_sym. Eliminated goto-labels cdrxnoap, cdrxbegin and nontoplevel_cdrxnoap. Changed argument checking order for set! to locals, variables and symbols. Improvements to control structure. Removed some uses of arg1 and arg2 as temporary variables. 2002-03-15 Thien-Thi Nguyen * guile-snarf.in: Remove "--compat=1.4" support. Add "-d" and "-D" support. (deprecated_list): New var. (compat_mode_clean_xxx): Delete. (grep_deprecated): New func. ("main"): If "-d" or "-D", call `grep_deprecated'. 2002-03-15 Neil Jerram * hooks.h: Change scm_t_c_hookype_t everywhere to scm_t_c_hook_type. Docstring fixes: * strings.c (scm_string_p): Change unnecessary `iff' to `if'. * ports.c (scm_sys_make_void_port): Use `@file'. * numbers.c (scm_number_p, scm_real_p): Use `otherwise' rather than `else'. * macros.c (scm_makmacro): Don't say that the form replaces its source, because it doesn't. (scm_makmmacro): Clarify difference between this and scm_makmacro. * backtrace.c (scm_display_error), filesys.c (scm_umask, scm_select, scm_basename), goops.c (scm_method_generic_function), numbers.c (scm_integer_length), posix.c (scm_getgroups, scm_execl, scm_setlocale, scm_flock), socket.c (scm_shutdown): Correct spelling mistakes. * debug.c (scm_debug_options), eval.c (scm_eval_options_interface), read.c (scm_read_options): Change incorrect @var in docstring to @code. 2002-03-14 Marius Vollmer * unif.c (singp): Use SCM_REALP instead of SCM_SLOPPY_REALP. * snarf.h (SCM_SNARF_INIT): Add "^:^" after code so that guile-snarf can remove trailing non-init code. * guile-snarf.in (modern_snarf): Remove everything following and including "^:^" from the output. 2002-03-14 Dirk Herrmann * eval.c (SCM_CEVAL), srcprop.h (SRCBRKP): Eliminated union 't'. * eval.c (SCM_CEVAL): Exlined call to EVALCAR. 2002-03-13 Thien-Thi Nguyen * guile-snarf.in: Update copyright. Rewrite to internalize error handling. Add "--compat=1.4" handling. Add commentary. * Makefile.am (libpath.h): Use @top_srcdir_absolute@. (snarfcppopts): New var. (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. (.c.doc): Use $(snarfcppopts). * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c, continuations.c, debug-malloc.c, debug.c, deprecation.c, dynl.c, dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, extensions.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, goops.c, gsubr.c, guardians.c, hash.c, hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c, list.c, load.c, macros.c, modules.c, net_db.c, numbers.c, objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c, print.c, procprop.c, procs.c, properties.c, ramap.c, random.c, rdelim.c, read.c, regex-posix.c, root.c, rw.c, scmsigs.c, script.c, simpos.c, socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, threads.c, throw.c, unif.c, values.c, variable.c, vectors.c, version.c, vports.c, weaks.c: Retire inclusion guard macro SCM_MAGIC_SNARFER. 2002-03-13 Dirk Herrmann * eval.c (SCM_CEVAL): Got rid of the last reference to t.lloc. The next step will be to remove the union 't' and simplify the code of SCM_CEVAL that way. 2002-03-12 Neil Jerram * iselect.c (collisionp, gnfds, greadfds, gwritefds, gexceptfds, rreadfds, rwritefds, rexceptfds): Made static. * gc.c (terminating), fports.c (terminating): Renamed scm_i_terminating. 2002-03-11 Marius Vollmer * numbers.c (scm_divide): Adapt code from libstdc++/f2c to void potential overflow problems. Thanks to John W Eaton! * strop.c (string_capitalize_x): Treat characters as unsigned so that 8-bit chars work. Thanks to David Pirotte! 2002-03-10 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'slot-ref', 'slot-set!' and 'nil-cond'. Removed some uses of t.arg1, arg2 and proc as temporary variables. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. 2002-03-09 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of #@dispatch. Added lots of comments regarding the implementation of #@dispatch. Changed intra-procedure communication to use t.arg1 instead of arg2. Removed some uses of t.arg1, t.lloc and proc as temporary variables. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. Use SCM_INSTANCE_HASH instead of computing the expression explicitly. Eliminate now unused label nontoplevel_cdrxbegin. * goops.h (SCM_INSTANCE_HASH): New macro. * objects.h (SCM_CMETHOD_FORMALS, SCM_CMETHOD_BODY): New macros. 2002-03-08 Thien-Thi Nguyen * Makefile.am (bin_SCRIPTS): Revive this decl, w/ initial element "guile-snarf" moved back from `noinst_SCRIPTS'. 2002-03-08 Neil Jerram * srcprop.c (scm_set_source_property_x): If SRCPROPS obj already exists when adding a source property other than those that are handled explicitly, add the new property to the SRCPROPS obj's plist. * debug.h (SCM_MAX_FRAME_SIZE): Remove incorrect comment about use of SCM_MAX_FRAME_SIZE as a bit mask; it isn't used like this. * eval.c (SCM_CEVAL): Don't store scm_debug_eframe_size in debug.status. It isn't needed, and it can overflow the bits reserved for it (which may lead to a segv or a GC abort). 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'apply'. Removed side-effecting operations from conditions and macro calls. Replaced SCM_N?IMP by a more explicit predicate in some places. Minimized the scope of some variables. 2002-03-02 Stefan Jahn * convert.i.c: Fixed int <-> long conversions which would have failed if their sizes were different. 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'if', 'let', 'letrec' and 'set*': Removed some uses of t.arg1, t.lloc and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. Removed code that was conditionally compiled if SICP was defined - which it never is. 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'cons' and 'do': Removed some uses of t.arg1 and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. 2002-03-02 Dirk Herrmann * eval.c (scm_badargsp, SCM_CEVAL): Replaced SCM_N?IMP by a more explicit predicate in some places. (CHECK_EQVISH): Removed. (SCM_CEVAL): Removed some uses of t.arg1 and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables for clarification. Sorted if-else-if check for the type of the last form in a list by frequency. Avoided some unnecessary tail-recursion calls. 2002-03-01 Dirk Herrmann * gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL, init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE, SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct scm_cell and all its uses to scm_t_cell in accordance to Guile's naming scheme for types. * alist.c (scm_acons), convert.i.c (CTYPES2UVECT, CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread, scm_spawn_thread), debug.c (scm_make_debugobj), environments.c (scm_make_environment), eval.c (scm_closure), fports.c (scm_fdes_to_port), gc.c (scm_deprecated_newcell, scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell), list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons), ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo), smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c (scm_take_str, scm_allocate_string), strports.c (scm_mkstrport), unif.c (scm_make_uve), variable.c (make_variable), vectors.c (scm_c_make_vector), vports.c (scm_make_soft_port): Renamed scm_alloc_cell to scm_cell. * environments.c (core_environments_observe), gc.c (scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object), inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c (FLOAT2NUM), numbers.c (scm_make_real), procs.c (scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2, SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable), symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c (allocate_weak_vector): Renamed scm_alloc_double_cell to scm_double_cell. 2002-02-27 Stefan Jahn * convert.i.c, convert.c: Better range checking. * inet_aton.c, fports.c: Commented the inclusion of . * deprecation.c (vsnprintf): Define to `_vsnprintf' for Windows (MinGW). 2002-02-26 Thien-Thi Nguyen * Makefile.am: Update path to pre-inst-guile automake frag. 2002-02-25 Dirk Herrmann * gc.c (scm_gc_sweep): Make it compile even when deprecated features are excluded. 2002-02-25 Dirk Herrmann * num2integral.i.c (NUM2INTEGRAL): Fixed signedness problem. 2002-02-25 Gary Houston * convert.c: include for convert_i.c. 2002-02-24 Rob Browning * .cvsignore: add stamp-h1. 2002-02-21 Neil Jerram * unif.c (scm_array_to_list): Correct name, which had been accidentally changed to scm_t_arrayo_list! 2002-02-20 Mikael Djurfeldt * gc.c (scm_gc_sweep): Print an error message when aborting due to underflowing scm_mallocated. 2002-02-14 Marius Vollmer * gc.h, gc.c (scm_must_malloc, scm_must_realloc, scm_must_strdup, scm_must_strndup, scm_done_malloc, scm_done_free, scm_must_free): Reimplemented using the new scm_gc_malloc, etc., functions and deprecated. 2002-02-11 Thien-Thi Nguyen * Makefile.am (bin_PROGRAMS): Move `guile_filter_doc_snarfage' to `noinst_PROGRAMS'. (bin_SCRIPTS): Move all values to `noinst_SCRIPTS'; delete. (noinst_PROGRAMS, noinst_SCRIPTS): New. 2002-02-11 Marius Vollmer * gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * deprecation.h, deprecation.c: Reimplemented to allow deprecation messages while the GC is running. (scm_c_issue_deprecation_warning_fmt): New. * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer. 2002-02-08 Thien-Thi Nguyen * gsubr.c (create_gsubr): On "too many args" error, also display arg count and name. Thanks to Bill Schottstaedt. 2002-02-05 Thien-Thi Nguyen * Makefile.am: Include $(top_srcdir)/pre-inst-guile.am. (bin_SCRIPTS): Remove guile-snarf-docs-texi. (alldotdocfiles, snarf2checkedtexi, dotdoc2texi): New vars. (guile.texi, guile-procedures.texi): Use $(dotdoc2texi). * guile-snarf-docs-texi.in: Bye bye. 2002-02-04 Marius Vollmer * symbols.c (scm_make_symbol): Fix typo in docstring. * symbols.h (scm_mem2uninterned_symbol, scm_symbol_interned_p, scm_make_symbol): New prototypes. 2002-02-03 Marius Vollmer * symbols.h (SCM_SET_SYMBOL_HASH): Removed. (SCM_SYMBOL_INTERNED_P): New. * symbols.c (scm_symbol_hash): Use scm_ulong2num instead of SCM_MAKINUM since hash values can well be bignums. (scm_mem2symbol): Only use hash values below SCM_T_BITS_MAX/2. This signals a interned symbol. (scm_mem2uninterned_symbol, scm_symbol_interned_p, scm_make_symbol): New. * print.c (scm_iprin1): Print uninterned symbols unreadably. 2002-02-02 Thien-Thi Nguyen * __scm.h (HAVE_UINTPTR_T): Only define if UINTPTR_T attributes are defined: UINTPTR_MAX, INTPTR_MAX, INTPTR_MIN. Thanks to Dave Love. 2002-01-31 Marius Vollmer * symbols.c (scm_gensym): Use " g" as default prefix, not "g". This might help to make unintended clashes less likely. (scm_string_to_symbol): Protect the string until the symbols is created. 2002-01-31 Stefan Jahn * convert.c, convert.h, convert.i.c: New files containing C array to Scheme conversion helpers meant to be replacement functions for the deprecated gh interface. * Makefile.am: Setup rules for new `convert.*' files. 2002-01-28 Stefan Jahn * symbols.c (scm_c_symbol2str): New function, replacement for `gh_scm2newsymbol()'. * strings.c (scm_c_substring2str): New function. Proper replacement for `gh_get_substr()'. * socket.c: Include `stdint.h' if available for the `uint32_t' declaration. * scmsigs.c (scm_sigaction): Initialize `chandler' (inhibits compiler warning). * backtrace.c: Include `lang.h' for GUILE_DEBUG conditional. 2002-01-22 Neil Jerram Other changes unrelated to Elisp... * eval.c (scm_m_if): Use s_if rather than repeating string literal "if". (comments): Fix a few typos. (scm_for_each): Add parentheses around oddly unparenthesized if/while conditions. * read.c (scm_read_opts): Add full stop at end of doc for `keywords' option. * script.c (scm_compile_shell_switches): Use scm_str2symbol instead of gh_symbol2scm. * srcprop.h (SRCPROPBRK): Return C type rather than SCM. (SRCBRKP): Use SRCPROPBRK rather than duplicating its logic. * srcprop.c (scm_srcprops_to_plist, scm_source_property): Change SRCPROPBRK (x) to SCM_BOOL (SRCPROPBRK (x)). First batch of changes for Elisp support... * alist.c, async.c, boolean.c, dynl.c, eval.c, filesys.c, fluids.c, list.c, load.c, options.c, posix.c, print.c, sort.c, throw.c, vectors.c, weaks.c: Add #include for lang.h. * eval.c, eval.h, init.c, lang.c, lang.h: Use SCM_ENABLE_ELISP to conditionalize compilation and initialization of Elisp support function. * alist.c (scm_assq, scm_assv, scm_assoc), async.c (scm_asyncs_pending, scm_run_asyncs, noop), backtrace.c (scm_set_print_params_x), dynl.c (scm_make_argv_from_stringlist), filesys.c (fill_select_type, retrieve_select_type), fluids.c (scm_swap_fluids, scm_swap_fluids_reverse), list.c (scm_null_p, scm_ilength, scm_append_x, scm_last_pair, scm_reverse, scm_reverse_x, scm_list_ref, scm_list_set_x, scm_list_cdr_set_x, scm_c_memq, scm_memv, scm_member), load.c (scm_search_path), options.c (change_option_setting, scm_options), posix.c (environ_list_to_c), print.c (scm_iprlist), throw.c (scm_exit_status), vectors.c (scm_vector), weaks.c (scm_weak_vector): Use SCM_NULL_OR_NIL_P instead of SCM_NULLP. * boolean.c (scm_not): Use `SCM_FALSEP || SCM_NILP' instead of just SCM_FALSEP. * boolean.c (scm_boolean_p): Use `SCM_BOOLP || SCM_NILP' instead of just SCM_BOOLP. * eval.c (scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify, scm_m_1_ify): Removed. (scm_m_atfop): Support function aliasing. Support both function args, which need transformation, and macro args, which do not. Add explanatory comments. (SCM_CEVAL): In switch cases for SCM_IM_AND, SCM_IM_COND, SCM_IM_DO, SCM_IM_IF and SCM_IM_OR, add `|| SCM_NILP' to existing checks for SCM_FALSEP. In switch case for SCM_IM_NIL_COND, use SCM_NULLP || SCM_NILP instead of checks against (removed) scm_lisp_nil. Removed switch cases for SCM_IM_NIL_IFY, SCM_IM_T_IFY, SCM_IM_0_COND, SCM_IM_0_IFY, SCM_IM_1_IFY. * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null, scm_m_while, scm_nil_eq): Commented out; I don't think we need these, but I don't want to remove them yet, just in case. (scm_init_lang): Define `%nil' variable on Scheme level to hold Elisp nil value. * lang.h (SCM_NILP): Test against Elisp nil value instead of against (removed) scm_lisp_nil. (SCM_NILNULLP, SCM_NIL2EOL, SCM_EOL2NIL): Commented out. (SCM_NULL_OR_NIL_P): New. * list.c (scm_append): Use SCM_VALIDATE_NULL_OR_NIL instead of SCM_VALIDATE_NULL. * print.c (scm_isymnames): Fix comment. Remove #@nil-ify, #@t-ify, #@0-cond, #@0-ify, #@1-ify. Add #nil (for SCM_ELISP_NIL value). * sort.c (scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x, scm_sort_x, scm_sort, scm_stable_sort_x, scm_stable_sort): Use SCM_NULL_OR_NIL_P instead of SCM_NULLP. In constructions like `if (SCM_NULLP (x)) return SCM_EOL;', return x rather than SCM_EOL. * tags.h (SCM_IM_NIL_IFY, SCM_IM_T_IFY, SCM_IM_0_COND, SCM_IM_0_IFY, SCM_IM_1_IFY): Removed. (SCM_IM_BIND, SCM_IM_DELAY, SCM_IM_CALL_WITH_VALUES, SCM_UNBOUND): Numbering shifted down accordingly. (SCM_ELISP_NIL): New IFLAG. * validate.h (SCM_VALIDATE_NULL_OR_NIL): New. 2002-01-10 Dirk Herrmann * eval.c: Removed outdated references to "everr". Improved some comments. (scm_deval_args, deval_args): Renamed scm_deval_args to deval_args, since it is not part of the interface. (SCM_CEVAL): Added (maybe somewhat verbose) comment. Avoid to use references to debug.vect[0] before it exists. Add parentheses to switch statement. * goops.h: Added local emacs variables. 2002-01-10 Dirk Herrmann * eval.[ch] (scm_deval_args): Made static. * srcprop.c (scm_source_property): Remove redundant SCM_IMP test. * strings.c (scm_c_string2str): Clarified comment. Replaced THINKME by FIXME for uniformness. Removed question about whether arguments need to be protected from garbage collection: Arguments must be protected as any other variable. 2002-01-10 Dirk Herrmann * procs.h (SCM_CLOSURE_BODY): New Macro. * debug.c (scm_procedure_name, scm_procedure_source), eval.c (SCM_CEVAL, SCM_APPLY), goops.c (scm_sys_initialize_object, get_slot_value, set_slot_value), procs.c (scm_procedure_documentation), sort.c (closureless), stacks.c (get_applybody): Replace SCM_CDR (SCM_CODE (...)) by SCM_CLOSURE_BODY. * sort.c (closureless): Prefer !SCM_FOOP over SCM_NFOOP. 2001-12-26 Marius Vollmer * Makefile.am (guile-procedures.txt): When we don't have makeinfo, use "cp" instead. 2001-12-16 Marius Vollmer * stacks.c, stacks.h (scm_t_stackype): Renamed to scm_stack_type everywhere. * continuations.c (scm_make_continuation): Do not retain the throw_value when the continuation is invoked. 2001-12-08 Stefan Jahn * strings.c (scm_c_string2str): New function. Converts a given Scheme string into a C string. Also put in two THINKME's regarding the malloc policy for the missing converter routines. 2001-12-01 Neil Jerram * gh_data.c (gh_module_lookup): Use scm_str2symbol rather than gh_symbol2scm. 2001-11-28 Dirk Herrmann * gc.h (SCM_GC_CELL_WORD, SCM_GC_CELL_OBJECT, SCM_GC_SET_CELL_WORD, SCM_GC_SET_CELL_OBJECT): New macros. (SCM_GC_CELL_TYPE, SCM_CELL_WORD, SCM_CELL_OBJECT, SCM_SET_CELL_WORD, SCM_SET_CELL_OBJECT, SCM_FREE_CELL_CDR, SCM_GC_SET_CELL_OBJECT): Express in terms of SCM_GC_CELL_* macros. (SCM_FREE_CELL_P): Express in terms of SCM_GC_CELL_TYPE. * inline.h (scm_alloc_cell, scm_alloc_double_cell): Use SCM_GC_CELL_* macros when accessing free cells. 2001-11-25 Marius Vollmer * vectors.h (SCM_MAKE_VECTOR_TAG): New. * unif.h (SCM_MAKE_BITVECTOR_TAG, SCM_MAKE_UVECTOR_TAG): New. * symbols.h (SCM_MAKE_SYMBOL_TAG): New. * strings.h (SCM_MAKE_STRING_TAG): New. * procs.h (SCM_MAKE_CCLO_TAG): New. * numbers.h (SCM_MAKE_BIGNUM_TAG): New. * goops.h: Replaced SCM_DEBUG_DEPRECATED with !SCM_ENABLE_DEPRECATED. * async.c, async.h (scm_system_async_mark_from_signal_handler): New. * scmsigs.c (scm_take_signal): Removed all code that assumes that signal handlers are allowed to divert the flow of control. Call scm_system_async_mark_from_signal_handler instead of scm_system_async_mark. Deprecated SCM_NEWCELL and SCM_NEWCELL2. Added scm_alloc_cell and scm_alloc_double_cell in their place. * gc.h (SCM_GC_SET_ALLOCATED, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated): Removed from header. (scm_deprecated_newcell, scm_deprecated_newcell2): New. (SCM_NEWCELL, SCM_NEWCELL2): Implement in terms of scm_deprecated_newcell and scm_deprecated_newcell2. gc.c (scm_tc16_allocated): Only define when including deprecated features. (scm_debug_newcell, scm_debug_newcell2): Removed. (scm_init_storage): Do not initialize scm_tc16_allocated. (scm_init_gc): Do it here. (allocated_mark): New, from old code. (scm_deprecated_newcell, scm_deprecated_newcell2): New. * inline.c, inline.h: New files. * Makefile.am: Added them in all the right places. * _scm.h: Include "libguile/inline.h". * alist.c, coop-threads.c, debug.c, environments.c, eval.c, fports.c, gh_data.c, goops.c, guardians.c, lang.c, list.c, num2float.i.c, numbers.c, pairs.c, ports.c, print.c, procs.c, smob.c, smob.h, strings.c, strports.c, struct.c, symbols.c, unif.c, variable.c, vectors.c, vports.c, weaks.c: Replaced SCM_NEWCELL and SCM_NEWCELL2 with scm_alloc_cell and scm_alloc_double_cell, respectively. 2001-11-23 Marius Vollmer * modules.c (scm_c_use_module): Adapt to changes to `process-use-modules'. 2001-11-22 Dirk Herrmann * numbers.c (scm_divide): Fix more division by zero errors. 2001-11-21 Gary Houston * Makefile.am (OMIT_DEPENDENCIES): removed, since it seems to be obsolete. autogen.sh says: invalid unused variable name: `OMIT_DEPENDENCIES' 2001-11-22 Dirk Herrmann * numbers.c (scm_divide): Fix (/ 0). Thanks to Keith Wright for reporting the bug. 2001-11-21 Marius Vollmer * Makefile.am (install-exec-hook): Prepend $(DESTDIR) to filename. Thanks to Eric Gillespie, Jr! 2001-11-21 Stefan Jahn * win32-socket.c (getservent, setservent, endservent, getprotoent, setprotoent, endprotoent): New functions. Appropriate replacements for M$-Windows. * numbers.c (SIZE_MAX, PTRDIFF_MAX, PTRDIFF_MIN): Reintroduced these definitions for GUILE_DEBUG. * net_db.c: Include "win32-socket.h" if compiling with a native M$-Windows compiler. Include some pieces of code (protoent and servent interface) protected by HAVE_* macros when using a native M$-Windows compiler. 2001-11-20 Marius Vollmer * modules.c (scm_c_export): Do nothing when the first argument is already the terminating NULL. Thanks to Han-Wen Nienhuys! 2001-11-20 Thien-Thi Nguyen * Makefile.am (libpath.h): In SCM_BUILD_INFO, also include `buildstamp'. 2001-11-18 Rob Browning * version.c (s_scm_major_version): use SCM_MAJOR_VERSION. (s_scm_minor_version): use SCM_MINOR_VERSION. (s_scm_micro_version): use SCM_MICRO_VERSION. (s_scm_version): use SCM_MAJOR_VERSION, SCM_MINOR_VERSION, and SCM_MICRO_VERSION. * version.h.in (SCM_MAJOR_VERSION): renamed from SCM_GUILE_MAJOR_VERSION. (SCM_MINOR_VERSION): renamed from SCM_GUILE_MINOR_VERSION. (SCM_MICRO_VERSION): renamed from SCM_GUILE_MICRO_VERSION. 2001-11-18 Neil Jerram * vectors.c (scm_vector_move_left_x, scm_vector_move_right_x): Rewrite docstrings without reference to substring-move-left/right, since the latter no longer exist. 2001-11-17 Dirk Herrmann * eval.c: Removed bogus comment about acros. (scm_unmemocar): Use !SCM_CONSP instead of SCM_IMP. Minimize scope of local variable. Eliminate dependency on macro DEBUG_EXTENSIONS. (s_splicing): New error message string. (scm_m_body): Issue 'bad body' message rather than 'missing expression' message. (scm_m_quote): Eliminate unnecessary copying. (scm_m_lambda, scm_m_letstar, scm_m_letrec, scm_m_let): Leave the checking of the body to scm_m_body. (scm_m_do): Move comment to function header. Rename arg1 to binding. Made the code a bit easier to read. (evalcar): Removed. (iqq): Added a comment. Changed the depth parameter to unsigned. Use size_t for vector lengths. Make sure vector object is gc protected as long as its contents are read. Add some syntax checks. Get rid of unnecessary SCM_IMP test. Clean up the control structure a bit. (scm_m_delay): Added comment about the implementation of scm_m_delay. (scm_m_define): Add comment about guile's currying define syntax. Renamed 'proc' to 'name'. Eliminate dependency on macro DEBUG_EXTENSIONS. Simplified code a bit. Eliminate SICP code. (scm_m_letrec1): Removed. Part of the functionality is taken over by the new function 'transform_bindings'. (transform_bindings): New function. Takes over some of the functionality of removed function 'scm_m_letrec1', namely to split a list of bindings into a reversed list of variables and a list of initializers. (scm_m_letrec): Call 'transform_bindings'. (scm_m_let): Minimized scope of local variables. Renamed 'proc' to 'temp' and 'arg1' to 'binding'. Eliminated redundant SCM_NIMP test. Use 'transform_bindings'. Fixed scoping error with named let (Thanks to Aubrey Jaffer for reporting the bug and to Neil Jerram for suggesting the fix). Cleaned up the control structure a bit. (scm_m_expand_body): Use 'transform_bindings'. Eliminated unnecessary consing. Eliminated unnecessary SCM_DEFER/ALLOW_INTS. (SCM_CEVAL): Un-obfuscated some loops. 2001-11-16 Neil Jerram * gc.h (scm_unhash_name): Old declaration removed. * eval.c (s_scm_eval): Change @var{primitive-eval} to @code{primitive-eval}. * feature.c, vectors.c, net_db.c, unif.c, weaks.c, struct.c, version.c, alist.c, ports.c, ramap.c, unif.c, strings.c, list.c: Change @deffnx lines in docstrings to say {Scheme Procedure} rather than primitive or procedure. * posix.c (scm_execl), filesys.c (scm_close), unif.c (scm_array_set_x, scm_array_contents, scm_uniform_array_read_x, scm_bit_set_star_x, scm_bit_invert_x), ramap.c (scm_array_fill_x, scm_array_for_each, scm_array_index_map_x), vectors.c (scm_vector, scm_make_vector, scm_vector_to_list, scm_vector_fill_x), strop.c (scm_string_split, scm_string_ci_to_symbol), strings.c (scm_string_p), sort.c (scm_merge), print.c (scm_newline), macros.c (scm_macro_type), alist.c (scm_acons, scm_assq): Docstring fixes and improvements reflecting edits that have been made in the reference manual source. * objprop.c (scm_object_properties, scm_set_object_properties_x, scm_object_property, scm_set_object_property_x): Remove invalid @deffnx lines for corresponding procedure property primitives. These changes add a @deffnx C function declaration and function index entries for each Guile primitive to the copy of the doc snarf output that is used for reference manual synchronization. Online help is unchanged. * snarf.h (SCM_SNARF_DOCS): Output primitive's C function name. (SCM_DEFINE, SCM_DEFINE1, SCM_REGISTER_PROC): Supply to C function name to SCM_SNARF_DOCS. * guile-snarf-docs-texi.in: Pass the shell script's arguments into snarf-check-and-output-texi. * Makefile.am (guile-procedures.texi): New rule. (BUILT_SOURCES, guile.texi, guile-procedures.txt, CLEANFILES): Changed so that the last stage of doc snarfing is now performed twice, once to produce guile-procedures.txt for online help, and once to produce guile.texi for reference manual synchronization. 2001-11-15 Dirk Herrmann * eval.c (RETURN): Wrap in do{}while(0) in order to make it safely usable as a single statement followed by a ';', for example in an if statement. (SCM_CEVAL, SCM_APPLY): Clean up code using 'RETURN'. 2001-11-13 Neil Jerram * random.c (scm_random_solid_sphere_x, scm_random_hollow_sphere_x): Correct "shere" typos. * hashtab.c (scm_hash_fold): Add missing apostrophe to docstring. * version.c (scm_version): Update docstring to include `micro-version'. 2001-11-13 Marius Vollmer * modules.c (scm_c_export): Call va_end after collecting the symbols. * strop.h, strop.c (scm_substring_move_left_x, scm_substring_move_right_x): Removed. * __scm.h (HAVE_UINTPTR_T, HAVE_PTRDIFF_T, HAVE_LONG_LONG, HAVE_LONG_LONGS): Define to "1" when defining them, to mirror what configure does. 2001-11-12 Marius Vollmer * numbers.c: Document macros to define when including num2integral.i.c. MAX_VALUE and MIN_VALU are no longer used, we now rely on SIZEOF_ macros that have been figured out at configure time. * num2integral.i.c: Adapt to new interface. (NUM2INTEGRAL): Test whether a fixnum can be represented in the target type by casting it and checking whether it is still the same. Do not try to handle bignums for integral types that are smaller than fixnums. When handling bignums, collect the magnituse first into a unsigned type, and correctly check for overflow. (INTEGRAL2BIG): Do not use MIN_VALUE explicitely by observing that only -MIN_VALUE can still be negative of all negative numbers (in twos-complement). * tags.h (SIZEOF_SCM_T_BITS): Define it appropriately. * __scm.h: Define HAVE_UINTPTR_T, HAVE_PTRDIFF_T and HAVE_LONG_LONG depending on whether their size is non-zero. 2001-11-11 Thien-Thi Nguyen * strop.c (scm_string_null_p): Docfix; nfc. Thanks to Scott Lenser. 2001-11-07 Neil Jerram * extensions.c (scm_load_extension): Canonicalize docstring whitespace. * unif.c (scm_uniform_array_write), ports.c (scm_current_output_port, scm_force_output), dynwind.c (scm_dynamic_wind), scmsigs.c (scm_setitimer, scm_getitimer), filesys.c (scm_open, scm_lstat), struct.c (scm_make_struct_layout), random.c (scm_random, scm_random_solid_sphere_x, scm_random_hollow_sphere_x, strop.c (scm_i_index): Remove superfluous whitespace from end of docstring lines. * filesys.c (scm_select), guardians.c (scm_guardian_greedy_p), strings.c (scm_make_string), variable.c (scm_make_variable, scm_make_undefined_variable, scm_variable_p, scm_variable_set_x, scm_variable_bound_p), scmsigs.c (scm_setitimer, scm_getitimer), posix.c (scm_crypt), struct.c (scm_make_vtable_vtable), hashtab.c (scm_hash_fold), ports.c (scm_port_for_each): Remove superfluous newline at end of docstrings. * modules.c (scm_set_current_module): Add missing newline to docstring. 2001-11-07 Stefan Jahn * win32-socket.[ch]: New files. Defines Winsock-API error codes and makes them available through Guile. That is because the Winsock-API does not store its errors in `errno' and thus cannot return error messages via `strerror (errno)'. * socket.c (scm_init_socket): Initialize `win32-socket' part here under M$-Windows. * numbers.h: Added missing declaration of `scm_sys_check_number_conversions()'. * error.c: Local definition of SCM_I_STRERROR and SCM_I_ERRNO and use in `(strerror)' and `(system-error)'. * Makefile.am (EXTRA_libguile_la_SOURCES): Added `win32-socket.[ch]' to extra source and header files. 2001-11-06 Marius Vollmer * script.c (scm_shell_usage, scm_compile_shell_switches): Prepend a call to turn-on-debugging when --debug has been given instead of turning it on directly. Also, handle new `--no-debug' option, which might suppress the call to turn-on-debugging. 2001-11-05 Stefan Jahn * struct.c (s_scm_struct_vtable_p): Corrected docstring. 2001-11-04 Stefan Jahn * Makefile.am (libguile_la_LIBADD): Added $(THREAD_LIBS_LOCAL) here (was at guile_LDADD) which describes the dependency correctly and allows a clean build on Win32. * __scm.h (SCM_API): Follow-up patch. Renamed __FOO__ macros into FOO. * __scm.h: USE_DLL_IMPORT indicates the usage of the DLL import macros for external libraries (libcrypt, libqthreads, libreadline and libregex). * coop-defs.h: Include for `struct timeval'. * posix.c (flock): Added support for flock() in M$-Windows. * guile.c (SCM_IMPORT): Follow-up patch. Use SCM_IMPORT instead of __SCM_IMPORT__. * fports.c (getflags): Differentiate reading and writing pipes descriptors. * filesys.c (S_IS*): Redefine all of the S_IS*() macros for M$-Windows. * coop.c (coop_condition_variable_timed_wait_mutex): Use conditionalized error code if `ETIMEDOUT' is not available. (scm_thread_usleep): Remove bogus declaration of `struct timeval timeout'. * numbers.c (PTRDIFF_MIN): Moved this definition where it actually belongs. That is because NO_PREPRO_MAGIC gets undefined after each inclusion of `num2integral.i.c'. (SIZE_MAX): Define NO_PREPRO_MAGIC if SIZE_MAX is undefined. 2001-11-03 Marius Vollmer * eval.c (scm_m_begin): Allow `(begin)`, with no subforms. (SCM_CEVAL): Evaluate an empty `begin' to SCM_UNSPECIFIED. 2001-11-02 Mikael Djurfeldt * print.c (scm_iprin1): Mark print state as revealed when dispatching to generic write or display. * unif.c (scm_ra2contig): Fixed memory overwrite bug. 2001-11-02 Marius Vollmer Support for native Win32. Thanks to Stefan Jahn! * Makefile.am: Add win32-uname.c, win32-uname.h, win32-dirent.c and win32-dirent.h to extra source and header files. These include the uname() and the POSIX dirent interface implementation for M$-Windows. Put `-no-undefined' into LDFLAGS to support linkers which do not allow unresolved symbols inside shared libraries. Corrected `guile_filter_doc_snarfage$(EXEEXT)' dependency. * __scm.h: Defined SCM_API. This macro gets prepended to all function and data definitions which should be exported or imported in the resulting dynamic link library in the Win32 port. * __scm.h, alist.h, arbiters.h, async.h, backtrace.h, boolean.h, chars.h, continuations.h, coop-defs.h, coop-threads.h, debug-malloc.h, debug.h, deprecation.h, dynl.h, dynwind.h, environments.h, eq.h, error.h, eval.h, evalext.h, extensions.h, feature.h, filesys.h, fluids.h, fports.h, gc.h, gdb_interface.h, gdbint.h, gh.h, goops.h, gsubr.h, guardians.h, hash.h, hashtab.h, hooks.h, init.h, ioext.h, iselect.h, keywords.h, lang.h, list.h, load.h, macros.h, mallocs.h, modules.h, net_db.h, numbers.h, objects.h, objprop.h, options.h, pairs.h, ports.h, posix.h, print.h, procprop.h, procs.h, properties.h, ramap.h, random.h, rdelim.h, read.h, regex-posix.h, root.h, rw.h, scmsigs.h, script.h, simpos.h, smob.h, socket.h, sort.h, srcprop.h, stackchk.h, stacks.h, stime.h, strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h, tags.h, threads.h, throw.h, unif.h, values.h, variable.h, vectors.h, vports.h, weaks.h: Prefixed each each exported symbol with SCM_API. * continuations.c: Added comment about the use of the extern declarations of {get,set}context() functions used in the ia64 port. * continuations.h, gc.c: `__libc_ia64_register_backing_store_base' is meant to be a `unsigned long *'. * filesys.c: Include `direct.h' if possible. Use local `win32-dirent.h' for the native M$-Windows port. Define S_IS*() macros for M$-Windows. Implementation of `fstat_Win32()' which is able to differentiate between sockets and other file descriptors. Use this function as wrapper in `scm_fstat()'. Fixed typo in `scm_dirname()'. * fports.c: Include `io.h' is possible. Put `*fp' into referring statement block in `scm_fport_buffer_add()'. Some corrections in `getflags()'. * gdb_interface.h (GDB_INTERFACE): Also support __CYGWIN__. * guile.c: Make sure to define __SCM_IMPORT__ for shared library build on Win32. Disable preloaded symbols on Win2 platforms. * ioext.c, ports.c: Include `io.h' is possible. * mkstemp.c: Include `process.h' is possible. * net_db.c: Disable extern declaration of `h_errno' for __CYGWIN__, too. Put `scm_return_entry()' into HAVE_GETSERVENT conditional. * posix.c: Remove unnecessary dirent includes and defines. Include local `win32-uname.h' for MinGW. Extern declaration of `mkstemp()' for systems where it does not exists. Make `getlogin()' available on M$-Windows. * scmsigs.c: Made `usleep()' avalable on MinGW. * stime.c: On M$-Windows `tzname[]' is known to be `_tzname[]'. * win32-dirent.c: Include "win32-dirent.h", not "dirent.h". * win32-uname.c: Include "win32-uname.h", not "uname.h". 2001-10-28 Mikael Djurfeldt * unif.c (scm_uniform_array_read_x, scm_uniform_array_write): Don't apply scm_uniform_vector_length on arrays. 2001-10-14 Dirk Herrmann * 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_ 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-14 Gary Houston * version.c (scm_version): use sprintf instead of snprintf, for portability. thanks to Bill Schottstaedt. 2001-10-14 Mikael Djurfeldt * 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.) 2001-10-13 Marius Vollmer * numbers.c: Set NO_PREPRO_MAGIC when defining our version of PTRDIFF_MIN. Thanks to Ken Raeburn. 2001-10-07 Marius Vollmer * Makefile.am (EXTRA_libguile_la_SOURCES): Added "mkstemp.c". * eval.c (scm_m_atbind): First try to find the variable without defining it locally; when it has not been found, define it locally. * modules.c (module_variable): Pass over variables that exist but are unbound. 2001-10-06 Marius Vollmer * backtrace.c (display_backtrace_file_and_line): Only use scm_basename when POSIX support is compiled in. Thanks to Chris Cramer. 2001-10-13 Dirk Herrmann * 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-12 Mikael Djurfeldt * debug.c (scm_mem_to_proc): Fixed typo in previous change. * validate.h (SCM_VALIDATE_DOUBLE_DEF_COPY): New macro. 2001-10-12 Dirk Herrmann * 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_ over SCM_N. (scm_prin1): When building lists, prefer scm_list_ 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 Dirk Herrmann * debug.c (scm_make_iloc): Prefer !SCM_ over SCM_N. (scm_memcons, scm_mem_to_proc): When building lists, prefer scm_list_ 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-09 Dirk Herrmann * numbers.c (mem2decimal_from_point): Cleaned up the parsing a little bit - should even be somewhat more accurate now. 2001-10-08 Rob Browning * gc.c: support ia64 register backing store. (SCM_MARK_BACKING_STORE): new macro. * continuations.h: support ia64 register backing store. (struct scm_t_contregs): add ia64 register backing store. * 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-08 Dirk Herrmann * 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-06 Marius Vollmer * 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. * num2integral.i.c (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. * numbers.c: Define NO_PREPRO_MAGOC when including num2integral.c.i for `long long' and `signed long long'. 2001-10-06 Mikael Djurfeldt These changes fixes a race condition in the Guile coop - pthread compatibility code. * 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-05 Dirk Herrmann * 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 Dirk Herrmann * num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about testing an unsigned value for being >= 0. 2001-10-05 Dirk Herrmann * 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-03 Gary Houston * continuations.h, unif.h: in the descriptions of the bit patterns of the heap cells, make bit 0 the least significant. 2001-09-25 Thien-Thi Nguyen * chars.h (SCM_MAKE_CHAR): Use `scm_t_bits' instead of `intptr_t'. Thanks to Golubev I. N. 2001-09-25 Gary Houston * ports.c (scm_drain_input): extended the docstring. thanks to Alex Schroeder and Thien-Thi Nguyen. 2001-09-23 Mikael Djurfeldt * 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-22 Mikael Djurfeldt * 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-21 Rob Browning * .cvsignore: really add version.h * 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. * 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. * error.c (scm_wta): coerce char* to intptr_t before int assignment. * debug.c (debugobj_print): coerce scm_intprint arg 1 to long, not int. * chars.h (SCM_MAKE_CHAR): coerce value to intptr_t. 2001-09-20 Mikael Djurfeldt * numbers.c (scm_integer_expt): Accept inexact integer in second argument. (Thanks to Bill Schottstaedt.) 2001-09-20 Rob Browning * .cvsignore: add version.h * versiondat.h.in: removed (obsolete). * 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. * version.h: renamed to version.h.in. * 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 Mikael Djurfeldt * 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. * num2integral.i.c (NUM2INTEGRAL): Report an error when these routines are passed an inexact. This change in behavior is motivated by concordance with R5RS: It is more common that a primitive doesn't want to accept an inexact for an exact. 2001-09-17 Dirk Herrmann The following patch partially undoes my patch from 2001-06-30, where I added the function scm_gc_mark_cell_conservatively. The function is buggy, since it breaks guile during conservative marking if a pointer on the stack points directly into the list of free cells on the heap: With conservative cell marking this will cause the whole free list to be scanned and marked - boom! * gc.c (allocated_mark, MARK, heap_segment, scm_gc_mark_cell_conservatively, scm_init_storage), gc.h (scm_gc_mark_cell_conservatively): Remove function scm_gc_mark_cell_conservatively and update the corresponding comments and uses accordingly. Thanks to Christopher Cramer for the patch. (Minor corrections by me.) 2001-09-15 Gary Houston * root.h (scm_root_state): removed the continuation_stack and continuation_stack_ptr members, which have no apparent purpose. (scm_continuation_stack, scm_continuation_stack_ptr): #defines removed. * root.c (root_mark), init.c (restart_stack, start_stack), gc (scm_igc): remove all references to contination_stack and continuation_stack_ptr, avoiding allocation of a vector and useless processing during gc. 2001-09-13 Dirk Herrmann * guardians.c (tconc_t, t_tconc): Renamed tconc_t to t_tconc. (TCONC_IN): Make sure that the cell word 0 is initialized last. (guardians_t, t_guardians): Renamed guardians_t to t_guardians. (GUARDIAN, GUARDIAN_DATA): Renamed GUARDIAN to GUARDIAN_DATA. (guardian_apply, scm_get_one_zombie, scm_make_guardian, mark_and_zombify): Prefer !SCM_ over SCM_N. 2001-09-13 Dirk Herrmann * guardians.c (mark_dependencies_in_tconc, whine_about_self_centered_zombies, scm_init_guardians): Register the static global variable `self_centered_zombies' via scm_gc_register_root, to make some cdr-ing unnecessary. 2001-09-13 Dirk Herrmann * backtrace.c (display_backtrace_file, display_backtrace_file_and_line): Use SCM_EQ_P when comparing SCM values, use SCM_FALSEP when comparing SCM values against #f. Thanks to Rob Browning for the bug report. 2001-09-12 Martin Baulig * strings.[ch] (scm_str2string): New function. 2001-09-06 Marius Vollmer * gc.c (scm_done_free): Always subtract size from scm_mallocated when computing nm, even if it's negative. (scm_must_malloc): Abort on overflow of scm_mtrigger. (scm_must_realloc): Likewise. 2001-09-01 Michael Livshin * numbers.c (scm_sys_check_number_conversions): new function, defined if Guile is compiled in debugging mode. currently checks `scm_num2ulong', should check much much more. * num2integral.i.c (NUM2INTEGRAL): when converting a bignum to unsigned, ensure that it's positive. thanks to Martin Baulig! 2001-08-31 Dirk Herrmann * __scm.h: Added new section about compile time selectable features. (long_long, ulong_long, scm_sizet, SCM_WNA, SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL, SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, SCM_ORD_SIG, SCM_NUM_SIGS): Removed. * deprecation.c (scm_include_deprecated_features): Simplified. * eval.c (EVALCAR, unmemocopy), eval.h (SCM_XEVALCAR): Use `SCM_IMP´ instead of `!SCM_CELLP´. * eval.c (unmemocopy): Eliminate redundant SCM_CELLP tests. Extract side-effecting operations from macros. (scm_init_eval): Don't initialize *top-level-lookup-closure*, scm_top_level_lookup_closure_var and scm_system_transformer. * gc.c (CELL_P): New local definition to replace SCM_CELLP. (heap_segment): Use CELL_P instead of SCM_CELLP. * init.c (start_stack): Don't initialize scm_top_level_lookup_closure_var and scm_system_transformer. * modules.c (scm_set_current_module): Don't access scm_top_level_lookup_closure_var and scm_system_transformer. (scm_sym2var): Don't call scm_variable_set_name_hint. (scm_post_boot_init_modules): Removed deprecated initializations. * print.c (scm_ipruk): Don't access cell contents of non cells. * strings.c (scm_string_set_x): All strings are writable. * strings.h (SCM_STRINGP): Use SCM_TYP7 to determine the string type. There is only one string type now. (SCM_STRING_COERCE_0TERMINATION_X): Deprecated. * tags.h: Remove comments about two different string types. (SCM_CELLP, SCM_NCELLP): Deprecated. * variable.c (make_variable): Remove code variant for vcells. * variable.h (SCM_VARIABLE_REF, SCM_VARIABLE_SET, SCM_VARIABLE_LOC): Remove code variant for vcells. * __scm.h, deprecation.[ch]: Renamed SCM_DEBUG_DEPRECATED to SCM_ENABLE_DEPRECATED with the logic reversed. * dynl.c (moddata, registered_mods), dynl.[ch] (scm_register_module_xxx, scm_registered_modules, scm_clear_registered_modules), error.[ch] (scm_wta), eval.c (*top-level-lookup-closure*), eval.[ch] (scm_top_level_lookup_closure_var, scm_system_transformer, scm_eval_3, scm_eval2), gc.h (SCM_SETAND_CAR, SCM_SETOR_CAR, SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_FREEP, SCM_NFREEP, SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR), gc.[ch] (scm_remember, scm_protect_object, scm_unprotect_object), modules.c (root_module_lookup_closure, scm_sym_app, scm_sym_modules, module_prefix, make_modules_in_var, beautify_user_module_x_var, try_module_autoload_var, scm_module_full_name), modules.[ch] (scm_the_root_module, scm_make_module, scm_ensure_user_module, scm_load_scheme_module), ports.h (scm_port, scm_ptob_descriptor, scm_port_rw_active), ports.[ch] (scm_close_all_ports_except), random.h (scm_rstate, scm_rng, scm_i_rstate), strings.h (SCM_SLOPPY_STRINGP, SCM_RWSTRINGP, SCM_STRING_UCHARS, SCM_STRING_CHARS), strings.[ch] (scm_read_only_string_p, scm_makstr, scm_makfromstr, scm_make_shared_substring), tags.h (scm_tc7_substring, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols), variable.c (sym_huh), variable.[ch] (scm_variable_set_name_hint, scm_builtin_variable), variable.h (SCM_VARVCELL, SCM_UDVARIABLEP, SCM_DEFVARIABLEP): Removed. * dynl.c (scm_dynamic_link, scm_dynamic_func), error.c (scm_error_scm), filesys.c (scm_chown, scm_chmod, scm_open_fdes, scm_stat, scm_link, scm_rename, scm_delete_file, scm_mkdir, scm_rmdir, scm_opendir, scm_chdir, scm_symlink, scm_readlink, scm_lstat, scm_copy_file), fports.c (scm_open_file), ioext.c (scm_fdopen), net_db.c (scm_gethost, scm_getnet, scm_getproto, scm_getserv), ports.c (scm_truncate_file, scm_sys_make_void_port), posix.c (scm_getpwuid, scm_getgrgid, scm_execl, scm_execlp, scm_execle, scm_mkstemp, scm_utime, scm_access, scm_setlocale, scm_mknod, scm_crypt, scm_chroot, scm_getpass, scm_sethostname), regex-posix.c (scm_make_regexp, scm_regexp_exec), simpos.c (scm_system, scm_getenv), socket.c (scm_inet_aton), stime.c (setzone, scm_strftime, scm_strptime), vports.c (scm_make_soft_port): Remove calls to SCM_STRING_COERCE_0TERMINATION_X. Since the substring type is gone, all strings are 0-terminated anyway. * dynl.h (LIBGUILE_DYNL_H, SCM_DYNL_H), random.h (RANDOMH, SCM_RANDOM_H): Renamed the macros that are defined to inhibit double inclusion of the same headers to the SCM__H format. * eval.c (SCM_CEVAL), gc.c (MARK, scm_gc_sweep), gh_data.c (gh_scm2chars), hash.c (scm_hasher), objects.c (scm_class_of), print.c (scm_iprin1): The type scm_tc7_substring does not exist any more. * ports.h (SCM_PORTP, SCM_OPPORTP, SCM_OPINPORTP, SCM_OPOUTPORTP, SCM_INPUT_PORT_P, SCM_OUTPUT_PORT_P, SCM_OPENP), tags.h (SCM_TYP16_PREDICATE), variable.h (SCM_VARIABLEP): Prefer !SCM_ over SCM_N. 2001-08-31 Dirk Herrmann * Makefile.am: Remove references to symbols-deprecated.c. * symbols.c (scm_init_symbols): Don't initialize deprecated symbol functions. * symbols-deprecated.c: Removed. * fluids.[ch] (scm_internal_with_fluids), gsubr.[ch] (scm_make_gsubr, scm_make_gsubr_with_generic), hooks.[ch] (scm_create_hook), list.c (list*), list.h (SCM_LIST[0-9], scm_listify), list.[ch] (scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member), load.c (scm_end_of_file_key), load.[ch] (scm_read_and_eval_x), numbers.[ch] (scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl), numbers.h (SCM_FIXNUM_BIT), procs.h (scm_subr_entry, SCM_SUBR_DOC), procs.[ch] (scm_make_subr_opt, scm_make_subr, scm_make_subr_with_generic), root.c (setjmp_type, setjmp_type), root.[ch] (scm_call_catching_errors), smob.[ch] (scm_make_smob_type_mfpe, scm_set_smob_mfpe), strports.[ch] (scm_strprint_obj, scm_read_0str, scm_eval_0str), symbols.h (SCM_CHARS, SCM_UCHARS, SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_LENGTH_MAX, SCM_LENGTH, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH, SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR, scm_strhash, scm_sym2vcell, scm_sym2ovcell_soft, scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray, scm_intern, scm_intern0, scm_sysintern, scm_sysintern0, scm_sysintern0_no_module_lookup, scm_symbol_value0, scm_string_to_obarray_symbol, scm_intern_symbol, scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p, scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp, scm_init_symbols_deprecated), vectors.c (s_vector_set_length_x), vectors.[ch] (scm_vector_set_length_x): Removed. * fluids.h (FLUIDSH, SCM_FLUIDS_H), gsubr.c (GSUBRH, SCM_GSUBR_H), list.h (LISTH, SCM_LIST_H), load.h (LOADH, SCM_LOAD_H), root.h (ROOTH, SCM_ROOT_H), strports.h (STRPORTSH, SCM_STRPORTS_H): Renamed the macros that are defined to inhibit double inclusion of the same headers to the SCM__H format. * procs.h (SCM_CLOSUREP, SCM_PROCEDURE_WITH_SETTER_P), symbols.h (SCM_SYMBOLP), vectors.h (SCM_VECTORP): Prefer !SCM_ over SCM_N. 2001-08-31 Dirk Herrmann * continuations.h (scm_contregs), debug.h (scm_debug_info, scm_debug_frame, SCM_DSIDEVAL), filesys.h (SCM_OPDIRP), fports.h (scm_fport), options.h (scm_option), snarf.h (SCM_CONST_LONG, SCM_VCELL, SCM_GLOBAL_VCELL, SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT), srcprop.h (scm_srcprops, scm_srcprops_chunk), stacks.h (scm_info_frame, scm_stack), unif.h (scm_array, scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_HUGE_LENGTH), validate.h (SCM_FUNC_NAME, SCM_WTA, RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY, SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, SCM_VALIDATE_RWSTRING, SCM_VALIDATE_OPDIR): Removed. * continuations.h (CONTINUATIONSH, SCM_CONTINUATIONS_H), filesys.h (FILESYSH, SCM_FILESYS_H), fports.h (FPORTSH, SCM_FPORTS_H), options.h (OPTIONSH, SCM_OPTIONS_H), regex-posix.h (REGEXPOSIXH, SCM_REGEX_POSIX_H), snarf.h (LIBGUILE_SNARF_H, SCM_SNARF_H), srcprop.h (SCM_SOURCE_PROPERTIES_H, SCM_SRCPROP_H), unif.h (SCM_UNIFORM_VECTORS_H, SCM_UNIF_H), validate.h (SCM_VALIDATE_H__, SCM_VALIDATE_H): Renamed the macros that are defined to inhibit double inclusion of the same headers to the SCM__H format. * debug.h (SCM_RESET_DEBUG_MODE), regex-posix.h (SCM_RGXP), srcprop.h (SRCBRKP, PROCTRACEP), struct.h (SCM_STRUCTP), validate.h (SCM_VALIDATE_THUNK, SCM_VALIDATE_ARRAY, SCM_VALIDATE_VECTOR_OR_DVECTOR, SCM_VALIDATE_VTABLE): Prefer !SCM_ over SCM_N. 2001-08-31 Dirk Herrmann * _scm.h (_SCMH, SCM__SCM_H), alist.h (ALISTH, SCM_ALIST_H), arbiters.h (ARBITERSH, SCM_ARBITERS_H), backtrace.h (BACKTRACEH, SCM_BACKTRACE_H), boolean.h (BOOLEANH, SCM_BOOLEAN_H), chars.h (SCM_CHARSH, SCM_CHARS_H), coop-defs.h (COOP_DEFSH, SCM_COOP_DEFS_H), coop-threads.h (COOP_THREADSH, SCM_COOP_THREADS_H), debug-malloc.h (DEBUGMALLOCH, SCM_DEBUG_MALLOC_H), dynwind.h (DYNWINDH, SCM_DYNWIND_H), environments.h (ENVIRONMENTS_H, SCM_ENVIRONMENTS_H), eq.h (EQH, SCM_EQ_H), evalext.h (EVALEXTH, SCM_EVALEXT_H), extensions.h (LIBGUILE_EXTENSIONS_H, SCM_EXTENSIONS_H), feature.h (FEATUREH, SCM_FEATURE_H), gdbint.h (GDBINTH, SCM_GDBINT_H), guardians.h (SCM_GUARDIANH, SCM_GUARDIANS_H), hash.h (HASHH, SCM_HASH_H), hashtab.h (HASHTABH, SCM_HASHTAB_H), init.h (INITH, SCM_INIT_H), ioext.h (IOEXTH, SCM_IOEXT_H), iselect.h (ISELECTH, SCM_ISELECT_H), keywords.h (KEYWORDSH, SCM_KEYWORDS_H), lang.h (LANGH, SCM_LANG_H), mallocs.h (MALLOCSH, SCM_MALLOCS_H), net_db.h (SCM_NETDBH, SCM_NET_DB_H), objprop.h (OBJPROPH, SCM_OBJPROP_H), posix.h (POSIXH, SCM_POSIX_H), procprop.h (PROCPROPH, SCM_PROCPROP_H), properties.h (PROPERTIES_H, SCM_PROPERTIES_H), ramap.h (RAMAPH, SCM_RAMAP_H), rdelim.h (SCM_RDELIM, SCM_RDELIM_H), read.h (READH, SCM_READ_H), rw.h (SCM_RW, SCM_RW_H), scmsigs.h (SCMSIGSH, SCM_SCMSIGS_H), script.h (SCRIPTH, SCM_SCRIPT_H), simpos.h (SIMPOSH, SCM_SIMPOS_H), socket.h (SCM_SOCKETH, SCM_SOCKET_H), sort.h (SORTH, SCM_SORT_H), stackchk.h (STACKCHKH, SCM_STACKCHK_H), stime.h (STIMEH, SCM_STIME_H), strop.h (STROPH, SCM_STROP_H), strorder.h (STRORDERH, SCM_STRORDER_H), threads.h (THREADSH, SCM_THREADS_H), throw.h (THROWH, SCM_THROW_H), version.h (VERSIONH, SCM_VERSION_H), vports.h (VPORTSH, SCM_VPORTS_H): Renamed the macros that are defined to inhibit double inclusion of the same headers to the SCM__H format. 2001-08-27 Marius Vollmer * ports.c, ports.h, fprots.c, gc.c, ioext.c: Replaced "scm_t_portable" with "scm_port_table" which was an artifact from the great "scm_*_t -> scm_t_" renaming. 2001-08-25 Thien-Thi Nguyen * gc_os_dep.c (GC_noop1): Move before `GC_find_limit' where it is used; nfc. Thanks to Bill Schottstaedt. * validate.h (SCM_VALIDATE_USHORT_COPY, SCM_VALIDATE_SHORT_COPY, SCM_VALIDATE_UINT_COPY, SCM_VALIDATE_INT_COPY): New macros. Thanks to Chris Cramer. 2001-08-25 Marius Vollmer * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". * eval.c (scm_m_atbind): Redesigned to behvae like `let', but with dynamic scope. * dynwind.h (scm_swap_bindings): Declare. * dynwind.c (scm_swap_bindings): Make non-static. 2001-08-25 Michael Livshin * gc.c (scm_gc_sweep): now can sweep unreachable variables (by doing exactly nothing about them). thanks Neil! 2001-08-18 Neil Jerram * __scm.h (SCM_ENABLE_VCELLS): Fix spelling mistake in comment. 2001-08-17 Thien-Thi Nguyen * gc.c: Fix omission bug: Add `heap_segment' forward decl (proto) in the case when either `GUILE_DEBUG' or `GUILE_DEBUG_FREELIST' preprocessor symbols are defined. (map_free_list): Fix typo: Ref `f' correctly. Thanks to Chris Cramer. 2001-08-15 Rob Browning * Makefile.am (libguile_la_LDFLAGS): use libtool interface version variables. (libpath.h): change libguileversion to libguileinterface. 2001-08-07 Marius Vollmer * Makefile.am (EXTRA_DIST): Distribute ChangeLog-1996-1999 and ChangeLog-2000. Thanks to Daniel Skarda! 2001-08-07 Michael Livshin * guile-snarf-docs-texi.in: don't call the tokenizer here, we now do it from the Makefile. * Makefile.am: rearrange the snarfing slightly, so that .doc files are of a reasonable size. 2001-08-02 Neil Jerram * stacks.c (scm_make_stack): Improve docstring by explaining use of cutting args. 2001-08-01 Marius Vollmer * chars.c (scm_char_alphabetic_p, scm_char_numeric_p, scm_char_whitespace_p, scm_char_upper_case_p, scm_char_lower_case_p, scm_char_is_both_p): Do not require characters to fulfill isascii in addition to the primary predicate. 2001-07-30 Dirk Herrmann * numbers.c (DIGITS, scm_small_istr2int, scm_istr2int, scm_istr2flo, scm_istring2number): Removed. (iflo2str, scm_real_p, scm_integer_p): Use SCM_ instead of SCM_SLOPPY_. (t_exactness, t_radix, DIGIT2UINT, XDIGIT2UINT, mem2uinteger, mem2decimal_from_point, mem2ureal, mem2complex, scm_i_mem2number): Added. (scm_string_to_number): Use new number parser. (scm_exact_to_inexact): Replace dummy by a GPROC, which also handles complex numbers. * numbers.h (NUMBERSH, SCM_NUMBERS_H): Rename H to SCM__H. (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Prefer !SCM_ over SCM_N. (scm_istr2int, scm_istr2flo, scm_istring2number): Removed. (scm_i_mem2number): Added. (scm_exact_to_inexact): Changed signature. * read.c (scm_lreadr): Perform the shortcut test for '+ and '- here instead of within scm_i_mem2number. Call scm_i_mem2number instead of scm_istr2int and scm_istring2number. 2001-07-30 Dirk Herrmann * eval.c (scm_lookupcar, scm_m_body, scm_m_lambda, unmemocopy, scm_unmemocopy, scm_badargsp, scm_eval_body, CHECK_EQVISH, SCM_CEVAL, scm_nconc2last, SCM_APPLY, scm_copy_tree): Prefer !SCM_ over SCM_N. (scm_eval_body): Remove side effecting code from macro call. (SCM_CEVAL, SCM_APPLY): Remove goto statement and redundant SCM_NIMP test. 2001-07-30 Dirk Herrmann * pairs.h (SCM_VALIDATE_PAIR): Use SCM_CONSP, not SCM_ECONSP. 2001-07-29 Marius Vollmer Removed vcell slot from structs. * struct.h (scm_vtable_index_vcell): Removed. Renumbered subsequent indices. * struct.c (scm_struct_vtable_p): Do not check vcell slot for zero. Use scm_vtable_index_layout instead of "0" when accessing said slot. (scm_init_struct): Remove vcell slot layout code from required_vtable_fields. * objects.h (scm_si_redefined, scm_si_hashsets): Renumbered. * goops.c (build_class_class_slots): Removed vcell slot definition. * goops.h: Renumbered slot indices. (SCM_CLASS_CLASS_LAYOUT): Removed vcell slot layout code. (scm_si_vcell): Removed. 2001-07-26 Marius Vollmer "Glocs" have been removed. * tags.h: Update tag system docs. (scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses. (scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses. (SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP or SCM_NCONSP, respectively. * struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c, objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above. * print.c (scm_iprin1): Remove printing of glocs. Do not try to tell glocs from structs. * gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs. * eval.c (scm_m_atbind): Make a list of variables, not glocs. (scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables instead of with glocs. (EVALCAR): Do not test for glocs. (scm_lookupcar, scm_lookupcar1): Do not handle glocs in race condition. (scm_unmemocar): Do not handle glocs. (scm_m_atfop): Memoize as a variable, not as a gloc. (scm_eval_args, scm_deval_args): Do not handle glocs. (scm_ceval, scm_deval): Likewise. * eval.h (SCM_XEVALCAR): Do not test for glocs. (SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC): Removed. * debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed. * dynwind.c (scm_swap_bindings): Likewise. (scm_dowinds): Updated to recognize lists of variables instead of lists of glocs. * __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments. * gc_os_dep.c (GC_noop1): Moved into the same #if/#endif context where it is needed. 2001-07-25 Gary Houston * numbers.c (scm_logand, scm_logior, scm_logxor): adjusted the docstrings to reflect the n-ary implementation. 2001-07-26 Marius Vollmer * eval.c (scm_ceval, scm_deval): Use "RETURN" macro when returning value of a variable, not the plain "return" statement. 2001-07-25 Marius Vollmer * eval.c: Allow variables in memoized code (in addition to glocs). (scm_lookupcar): Handle variables in lost races. Replace symbol with variable directly, do not make a gloc. (scm_unmemocar): Rewrite variables using a reverse lookup, just like glocs. (scm_ceval, scm_deval): Deal with variables in SCM_IM_SET and in the main switch. 2001-07-25 Marius Vollmer * variable.c (scm_i_variable_print): Use "value" instead of "binding" since a binding is the mapping between symbols and variables, not between variables and their values. * tags.h (scm_tc7_variable): New. * gc.c (scm_gc_mark): Handle scm_tc7_variable objects. * print.c (scm_iprin1): Likewise. * variable.h (scm_tc16_variable): Removed. (SCM_VARIABLEP): Test for new tc7 code. (scm_i_variable_print): New. * variable.c (scm_tc16_variable): Removed. (variable_print): Renamed to scm_i_variable_print and made non-static. (variable_equal_p): Removed. (make_variable): Construct a tc7 object instead of a smob. (scm_init_variable): Do not register smob. 2001-07-22 Marius Vollmer * tags.h: Include inttypes.h when we have it. 2001-07-13 Marius Vollmer * tags.h (SCM_UNBOUND): Make it the 34th isym/iflag, the 33th slot is taken by the new SCM_IM_CALL_WITH_VALUES. * print.c (scm_isymnames): Update table accordingly. 2001-07-22 Gary Houston * regex-posix.c (s_scm_regexp_exec): use scm_long2num not SCM_MAKINUM to convert regoff_t value to SCM. 2001-07-21 Gary Houston * scmsigs.c: include sys/time.h for itimer stuff. 2001-07-19 Rob Browning * gc_os_dep.c (GC_noop1): ifdef out (unused) to quiet warning. * c-tokenize.lex: add option %nounput to quiet warning. Add prototype for yylex to quiet warning. * scmconfig.h.in: add flags for setitimer and getitimer. * scmsigs.h (scm_init_scmsigs): new prototype. (scm_init_scmsigs): new prototype. * scmsigs.c (s_scm_setitimer): new function. (s_scm_setitimer): new function. 2001-07-18 Martin Grabmueller * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c, chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c, feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c, gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c, gh_predicates.c, gsubr.c, gsubr.h, guardians.h, guile-func-name-check.in, guile-snarf-docs-texi.in, guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in, hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h, objprop.c, objprop.h, options.c, options.h, random.h, regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c, strerror.c, strop.h, strports.h, threads.h, values.c, values.h, version.c, version.h: Updated copyright notice. 2001-07-17 Dirk Herrmann * goops.c (sym_layout, sym_vcell, sym_vtable, sym_print, sym_procedure, sym_setter, sym_redefined, sym_h0, sym_h1, sym_h2, sym_h3, sym_h4, sym_h5, sym_h6, sym_h7, sym_name, sym_direct_supers, sym_direct_slots, sym_direct_subclasses, sym_direct_methods, sym_cpl, sym_default_slot_definition_class, sym_slots, sym_getters_n_setters, sym_keyword_access, sym_nfields, sym_environment, scm_sym_change_class): New static variables to hold predefined symbols. (build_class_class_slots): Build the list using scm_list_n instead of cons. Also, slots are already created as lists, thus making a call to maplist unnecessary. (scm_class_name, scm_class_direct_supers, scm_class_direct_slots, scm_class_direct_subclasses, scm_class_direct_methods, scm_class_precedence_list, scm_class_slots, scm_class_environment, scm_method_procedure, create_standard_classes, purgatory): Use predefined symbols. (build_slots_list, compute_getters_n_setters, scm_sys_initialize_object, scm_sys_inherit_magic_x, get_slot_value_using_name, set_slot_value_using_name, scm_sys_invalidate_method_cache_x, scm_generic_capability_p, scm_compute_applicable_methods, scm_sys_method_more_specific_p, make_struct_class): Prefer !SCM_ over SCM_N. (scm_sys_prep_layout_x): Minimize variable scopes. (scm_sys_prep_layout_x, scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x): Fix signedness. (go_to_hell, go_to_heaven, purgatory, scm_change_object_class, lock_cache_mutex, unlock_cache_mutex, call_memoize_method, scm_memoize_method, scm_wrap_object): Use packing and unpacking when converting to and from SCM values. (scm_enable_primitive_generic_x): Add rest argument checking. (map, filter_cpl, maplist, scm_sys_initialize_object, scm_sys_prep_layout_x, slot_definition_using_name, scm_enable_primitive_generic_x, scm_compute_applicable_methods, call_memoize_method, scm_make, scm_make_class): Prefer explicit predicates over SCM_N?IMP tests. (scm_sys_prep_layout_x): Fix typo in error message. Fix type checking. (burnin, go_to_hell): Use SCM_STRUCT_DATA instead of the SCM_INST alias. 2001-07-16 Dirk Herrmann * fports.c (fport_print): Don't use SCM_C[AD]R for non pairs. * num2integral.i.c (INTEGRAL2NUM, INTEGRAL2BIG): Fix signedness. * symbols-deprecated.c (scm_gentemp): Simplify vector test. * vectors.c (scm_vector_p): Eliminate redundant IMP test. 2001-07-12 Michael Livshin * strings.c (s_scm_string): fix arg position in assert. 2001-07-11 Gary Houston * strports.c (st_write): use memcpy, not strncpy. thanks to Dale P. Smith. 2001-07-09 Thien-Thi Nguyen * alist.c, alloca.c, arbiters.c, async.c, async.h, backtrace.c, boolean.c, chars.c, continuations.c, coop-defs.h, coop-threads.c, debug-malloc.h, debug.c, debug.h, dynl.c, dynwind.c, eq.c, error.c, eval.c, evalext.c, feature.c, feature.h, filesys.c, filesys.h, fluids.c, fluids.h, fports.c, fports.h, gc.c, gc.h, gdbint.c, gsubr.c, guardians.c, hash.c, hashtab.c, hooks.c, hooks.h, inet_aton.c, init.c, ioext.c, keywords.c, keywords.h, lang.c, list.c, load.c, macros.c, mallocs.c, memmove.c, modules.c, net_db.c, numbers.c, numbers.h, objects.c, objprop.c, options.c, pairs.c, pairs.h, ports.c, ports.h, posix.c, print.c, print.h, procprop.c, procs.c, procs.h, properties.c, putenv.c, ramap.c, random.c, random.h, read.c, regex-posix.c, regex-posix.h, root.c, root.h, scmsigs.c, script.c, simpos.c, smob.c, snarf.h, socket.c, sort.c, srcprop.c, srcprop.h, stackchk.c, stacks.c, stacks.h, stime.c, strerror.c, strings.c, strings.h, strop.c, strorder.c, strports.c, struct.c, struct.h, symbols-deprecated.c, symbols.c, symbols.h, tags.h, threads.c, threads.h, throw.c, unif.c, unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c, vports.c, weaks.c, weaks.h: Remove "face-lift" comment. 2001-07-08 Rob Browning * .cvsignore: add stamp-h.in. 2001-07-04 Martin Grabmueller * hooks.c (scm_make_hook, scm_add_hook_x), (scm_remove_hook_x, scm_reset_hook_x, scm_run_hook): Added return value info to the docstrings. 2001-07-03 Martin Grabmueller Some more compatibility patches for Windows. * posix.c (getlogin): getlogin() implementation for Windows. * backtrace.c, ioext.c: Include . * unif.c, script.c, rw.c, error.c: Include , if it does exist. * cpp_sig_symbols.in: Added SIGBREAK. 2001-07-01 Marius Vollmer * strports.c (scm_read_0str, scm_eval_0str): Call scm_c_read_string and scm_c_eval_string respectively, not themselves. Thanks to Dale P. Smith! 2001-06-30 Dirk Herrmann * unif.c (scm_array_set_x): The variable args does not necessarily have to be a list. Further, got rid of a redundant SCM_NIMP test. 2001-06-30 Dirk Herrmann * list.c (SCM_I_CONS): Make sure the cell type is initialized last. * gc.c (s_scm_map_free_list, scm_igc, scm_gc_sweep, init_heap_seg): Fixed signedness. (init_heap_seg): Replaced strange for-loop with a while loop. * weaks.h (WEAKSH, SCM_WEAKS_H): Rename H to SCM__H. (SCM_WVECTP): Prefer !SCM_ over SCM_N. The following patch adds conservative marking for the elements of free or allocated cells. * gc.c (allocated_mark, heap_segment): New static functions. (which_seg): Deleted, since the functionality is now provided by function heap_segment. (map_free_list): Use heap_segment instead of which_seg. (MARK): If cell debugging is disabled, mark free cells conservatively. (scm_mark_locations, scm_cellp): Extracted the search for the heap segment of a SCM value into function heap_segment. (scm_init_storage): Allocated cells must be marked conservatively. * gc.[ch] (scm_gc_mark_cell_conservatively): New function. The following patch changes the representation of weak vectors to double cells instead of using an extension of the vector's allocated memory. * gc.c (MARK): Use SCM_SET_WVECT_GC_CHAIN instead of assigning to the result of SCM_WVECT_GC_CHAIN. (scm_gc_sweep): Weak vectors don't have extra fields any more. * weaks.c (allocate_weak_vector): New static function. It does not patch any previously created vector object during the construction of a weak vector, and thus doesn't need to switch off interrupts during vector creation. (scm_make_weak_vector, scm_make_weak_key_hash_table, scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table): Use allocate_weak_vector to provide the new weak vector object. * weaks.h (SCM_WVECT_TYPE, SCM_SET_WVECT_TYPE, SCM_SET_WVECT_GC_CHAIN): New macros. The weak vector subtype is now stored in the double cell. (SCM_IS_WHVEC, SCM_IS_WHVEC_V, SCM_IS_WHVEC_B, SCM_IS_WHVEC_ANY): Use SCM_WVECT_TYPE. (SCM_WVECT_GC_CHAIN): The weak objects are now chained together using an entry of the double cell. 2001-06-30 Thien-Thi Nguyen * stamp-h.in: bye bye 2001-06-30 Marius Vollmer * gh_eval.c (gh_eval_str): Use scm_c_eval_string instead of scm_eval_0str. * load.c, load.h (scm_c_primitive_load, scm_c_primitive_load_path): New. * strports.c, strports.h (scm_c_read_string): Renamed from scm_read_0str. Also, added "const" qualifier to argument. (scm_c_eval_string): Renamed from scm_eval_0str. (scm_read_0str, scm_eval_0str): Deprecated. 2001-06-28 Martin Grabmueller * fluids.c (scm_c_with_fluid): Use scm_list_1() instead of SCM_LIST1. 2001-06-28 Keisuke Nishida * list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5, scm_list_n): New functions. (SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated. (lots of files): Use the new functions. * goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N. * strings.c: #include "libguile/deprecation.h". 2001-06-27 Martin Grabmueller * read.c (scm_lreadr): When reading a hash token, check for a user-defined hash procedure first, so that overriding the builtin hash characters is possible (this was needed for implementing SRFI-4's read synax `f32(...)'). * num2integral.i.c: Use scm_t_signed_bits instead of scm_t_bits, because the latter is unsigned now and breaks comparisons like (n < (scm_t_signed_bits)MIN_VALUE). 2001-06-26 Neil Jerram * eval.h, eval.c (scm_call_4): New function. * eval.c (SCM_APPLY, SCM_CEVAL, ENTER_APPLY): Call trap handlers directly rather than dispatching to them via scm_ithrow and a lazy catch. * eval.c (scm_evaluator_trap_table), eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR): Add three new options for trap handler procedures. * debug.h (SCM_RESET_DEBUG_MODE): Add checks for trap handler procedures not being #f. 2001-06-27 Michael Livshin * Makefile.am (c-tokenize.c): add rule to generate it. (EXTRA_DIST): add c-tokenize.lex, so it gets distributed. filter-doc-snarfage.c: remove. 2001-06-26 Martin Grabmueller * ports.c (scm_output_port_p): Use result of SCM_COERCE_OUTPORT. The following set of changes makes compiling Guile under various Windows compilers easier. Compilation under GNU systems should not be affected at all. Thanks to Stefan Jahn for all necessary information, patches and testing. * posix.c: Conditialize getpwent, getgrent, kill, getppid, getuid, getpgrp, ttyname, primitive-fork and some header inclusion for Windows. * random.c: Define M_PI, if not predefined and use __int64 for LONG64 under Windows. * scmsigs.c: Emulate some functions (alarm, sleep, kill) under Windows and conditionalize some signal names. * socket.c (scm_getsockopt): Added missing comma. Include socket library header under Windows. * stime.c (CLKTCK): Add cast to int, to make it compile under Windows. * ports.c (truncate): New function, compiled only under Windows. * net_db.c: Do not declare errno under Windows. * iselect.h, inet_aton.c: Include socket library headers under Windows. * guile.c (inner_main): Under Windows, initialize socket library and initialize gdb_interface data structures. * gdb_interface.h: Under Windows, gdb_interface cannot be initialized statically. Initialize at runtime instead. * fports.c (write_all): ssize_t -> size_t. (fport_print): Conditionalize call to ttyname(). (getflags): New function, compiled only under Windows. * filesys.c: Conditionalize inclusion of . Conditionalize primitives chown, link, fcntl. (scm_basename, scm_dirname): Under Windows, handle \ as well as / as path seperator. * backtrace.c: Include under Windows. * async.h (ASYNCH, SCM_ASYNC_H): Rename H to SCM__H. * _scm.h: Added preprocessor conditional for __MINGW32__ for errno declaration. 2001-06-27 Keisuke Nishida * eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3, scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3): New functions. * eval.h (scm_call_0, scm_call_1, scm_call_2, scm_call_3, scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3): Declared. * async.c (scm_run_asyncs), coop-threads.c (scheme_body_bootstrip, scheme_handler_bootstrip), debug.c (with_traps_inner), dynwind.c (scm_dynamic_wind, scm_dowinds), environments.c (import_environment_conflict), eval.c (scm_macroexp, scm_force, scm_primitive_eval_x, scm_primitive_eval), fluids.c (apply_thunk), goops.c (GETVAR, purgatory, make_class_from_template, scm_ensure_accessor), hashtab.c (scm_ihashx, scm_sloppy_assx, scm_delx_x, fold_proc), hooks.c (scm_c_run_hook), load.c (scm_primitive_load), modules.c (scm_resolve_module, scm_c_define_module, scm_c_use_module, scm_c_export, module_variable, scm_eval_closure_lookup, scm_sym2var, scm_make_module, scm_ensure_user_module, scm_load_scheme_module), ports.c (scm_port_for_each), print.c (scm_printer_apply), properties.c (scm_primitive_property_ref), ramap.c (ramap, ramap_cxr, rafe, scm_array_index_map_x, read.c (scm_lreadr), scmsigs.c (sys_deliver_signals), sort.c (applyless), strports.c (scm_object_to_string, scm_call_with_output_string, scm_call_with_input_string), throw.c (scm_body_thunk, scm_handle_by_proc, hbpca_body), unif.c (scm_make_shared_array, scm_make_shared_array), vports.c (sf_flush, sf_write, sf_fill_input, sf_close): Use one of the above functions. * goops.c, hashtab.c, scmsigs.c, sort.c: #include "libguile/root.h". 2001-06-26 Dirk Herrmann * filesys.c (scm_close), ports.c (scm_close_port, scm_port_closed_p), strop.c (scm_string_null_p): Use SCM_BOOL instead of SCM_NEGATE_BOOL. * filesys.c (scm_stat): Clean up type dispatch. * filesys.c (scm_stat), ports.c (scm_input_port_p, scm_output_port_p): Get rid of redundant IM type check. * filesys.c (scm_readdir, scm_getcwd, scm_readlink), gh_data.c (gh_str2scm), load.c (scm_primitive_load, scm_internal_parse_path, scm_search_path), net_db.c (scm_gethost, scm_getnet, scm_getproto, scm_return_entry), numbers.c (scm_number_to_string), objects.c (scm_make_subclass_object), ports.c (scm_port_mode), read.c (scm_lreadr), simpos.c (scm_getenv), socket.c (scm_inet_ntoa, scm_addr_vector), stime.c (scm_strftime), strings.c (scm_makfromstrs, scm_makfrom0str, scm_substring), strings.h (SCM_STRING_COERCE_0TERMINATION_X), strop.c (string_copy, scm_string_split), strports.c (scm_strport_to_string), symbols.c (scm_symbol_to_string), vports.c (sf_write): Use scm_mem2string instead of scm_makfromstr. * net_db.c (scm_sethost, scm_setnet, scm_setproto, scm_setserv), ports.c (scm_close_all_ports_except), read.c (scm_lreadr, scm_read_hash_extend), stime.c (scm_strftime), strings.c (scm_string_append, scm_string), strings.h (SCM_STRINGP, SCM_STRING_COERCE_0TERMINATION_X, SCM_RWSTRINGP), strop.c (string_capitalize_x): Prefer explicit type check over SCM_N?IMP, !SCM_ over SCM_N. * strings.[ch] (scm_makfromstr): Deprecated. (scm_mem2string): New function, replaces scm_makfromstr. * strings.c (scm_substring), strop.c (string_copy, scm_string_split), strports.c (scm_strport_to_string), symbols.c (scm_symbol_to_string): Fix gc problem. * strings.h (STRINGSH, SCM_STRINGS_H): Rename H to SCM__H. * validate.h (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Eliminate warning about comparing signed and unsigned values. This fix is not optimal, since it won't work reliably if sizeof (c_start) > sizeof (size_t) or sizeof (c_end) > sizeof (size_t). A better solution is to define this macro as an inline function, thus allowing to specifiy the types of c_start and c_end. 2001-06-25 Dirk Herrmann * debug.h (SCM_DEBUGOBJ_FRAME): Deliver result as a scm_t_debug_frame*. * debug.h (DEBUGH, SCM_DEBUG_H), stacks.h (STACKSH, SCM_STACKSH): Rename H to SCM__H. * stacks.c (NEXT_FRAME, narrow_stack): Prefer explicit type check over SCM_N?IMP, !SCM_ over SCM_N. (narrow_stack): Make i unsigned. Don't use side-effecting operations in conditions. (narrow_stack, scm_make_stack, scm_stack_id, scm_last_stack_frame): Get rid of redundant SCM_N?IMP checks. (scm_make_stack, scm_stack_id, scm_last_stack_frame): Clean up type dispatch. No need to cast result of SCM_DEBUGOBJ_FRAME any more. (scm_stack_ref, scm_frame_previous, scm_frame_next): Fix signedness. (scm_last_stack_frame): Remove bogus `;´. * stacks.h (SCM_FRAMEP): Fix type check. 2001-06-25 Michael Livshin * Makefile.am (MAINTAINERCLEANFILES): be sure to remove c-tokenize.c when doing maintainer-clean. * snarf.h (SCM_SNARF_DOCS): change the "grammar" slightly. * guile-snarf-docs.in, guile-snarf-docs-texi.in: rewrite & simplify. * eval.c: all hash signs are in column 0. * Makefile.am (guile_filter_doc_snarfage): build using c-tokenize.c, not filter-doc-snarfage.c. rearrange snarfing dependencies a bit. * c-tokenize.lex: new file. 2001-06-25 Marius Vollmer * srcprop.h, srcprop.c (scm_srcprops_to_plist): Renamed from scm_t_srcpropso_plist. See the big type renaming. * coop-defs.h (scm_mutex_trylock, scm_cond_timedwait): Likewise. Thanks to Seth Alves! * numbers.c (SIZE_MAX, PTRDIFF_MIN, PTRDIFF_MAX): Only define when they aren't defined already. 2001-06-23 Dirk Herrmann * backtrace.c (display_backtrace_body): Use SCM_VALIDATE_STACK and SCM_VALIDATE_OPOUTPORT instead of SCM_ASSERT. Fix signedness problem. * backtrace.c (display_expression, scm_set_print_params_x, display_application, display_frame, scm_backtrace), numbers.c (scm_istring2number), objects.c (scm_class_of, scm_mcache_lookup_cmethod, scm_mcache_compute_cmethod): Prefer explicit type check over SCM_N?IMP, !SCM_ over SCM_N. * fluids.c (scm_fluid_ref, scm_fluid_set_x): Fluid numbers are always positive. * numbers.c (scm_i_mkbig): Remove unnecessary casts, remove unnecessary SCM_DEFER_INTS, SCM_ALLOW_INTS. * objects.c (scm_class_of): Type fix. (scm_mcache_lookup_cmethod): Improved comment, simplified, eliminated goto. * pairs.h (scm_error_pair_access): The function can return if called recursively. 2001-06-20 Martin Grabmueller * init.c (scm_init_guile_1): Removed initialization of tag.c. * gdbint.c, init.c: Removed inclusion of tag.h. * tag.h, tag.c: Removed files. * Makefile.am: Removed tag.{h,c,doc,x} in various places. 2001-06-20 Gary Houston * deprecation.c, extensions.c, rw.c: include string.h. 2001-06-19 Gary Houston * filter-doc-snarfage.c (process): added ungetc in MULTILINE_COOKIE case since otherwise it fails when there's no space between the '(' and the quote of the following string (gcc 3.0). 2001-06-14 Marius Vollmer Throughout: replace "scm_*_t" with "scm_t_*", except "scm_lisp_t". 2001-06-14 Marius Vollmer * unif.h (SCM_ARRAY_NDIM): Shift then cast so that no sign extension takes place. * strings.h (SCM_STRING_LENGTH): Likewise. (SCM_STRING_MAX_LENGTH): Use unsigned numbers. * __scm.h (ptrdiff_t): Typedef to long when configure didn't find it. * tags.h: Include when we have it. (scm_bits_t): Changed to be a unsigned type. Use uintptr_t when available. Else use "unsigned long". (scm_signed_bits_t): New. * numbers.h (SCM_SRS): Cast shiftee to scm_signed_bits_t. (SCM_INUM): Cast result to scm_signed_bits_t. 2001-06-13 Thien-Thi Nguyen * mkstemp.c: Update path to #include file scmconfig.h. Thanks to Golubev I. N. 2001-06-11 Dirk Herrmann * struct.h (SCM_STRUCT_VTABLE_FLAGS): New macro. * goops.h (SCM_NUMBER_OF_SLOTS): Removed bogus `\´ at the end of the macro definition. (SCM_CLASSP, SCM_INSTANCEP, SCM_PUREGENERICP, SCM_ACCESSORP, SCM_SIMPLEMETHODP, SCM_FASTMETHODP): Use SCM_STRUCT_VTABLE_FLAGS instead of SCM_INST_TYPE. (SCM_ACCESSORP, SCM_SIMPLEMETHODP, SCM_FASTMETHODP): Make sure the object is a struct before accessing its struct flags. (SCM_INST_TYPE, SCM_SIMPLEMETHODP, SCM_FASTMETHODP): Deprecated. 2001-06-10 Gary Houston * rdelim.c (scm_init_rdelim_builtins): don't try to activate the (ice-9 rdelim) module in (guile) and (guile-user). it didn't work reliably anymore. try it from boot-9.scm instead. 2001-06-09 Marius Vollmer * ports.c (scm_lfwrite): Maintain columnd and row count in port. Thanks to Matthias Köppe! 2001-06-08 Michael Livshin * snarf.h, filter-doc-snarfage.c: more changes to cope with space-happy C preprocessors. * filter-doc-snarfage.c, guile-snarf.in: try to cope with spaces inside cookies. thanks to Matthias Köppe! 2001-06-08 Dirk Herrmann * keywords.c (keyword_print): Don't use SCM_C[AD]R to access keywords. Fix gc protection. * objects.c (scm_mcache_lookup_cmethod): Don't use side effecting operations in macro calls. * pairs.c (scm_error_pair_access): Avoid recursion. Thanks to Matthias Koeppe for reporting the bugs that correspond to the following set of patches. * unif.c (scm_bit_set_star_x, scm_bit_invert_x), vectors.h (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Obtain the bitvector base address using SCM_BITVECTOR_BASE. * unif.h (SCM_BITVECTOR_BASE): Return the base address as an unsigned long*. 2001-06-08 Dirk Herrmann * goops.c (SCM_CLASS_REDEF): Removed. * vectors.h (VECTORSH, SCM_VECTORS_H): Renamed H to SCM__H. Thanks to Matthias Koeppe for reporting the bugs that correspond to the following set of patches. * goops.c (scm_sys_prep_layout_x, scm_basic_basic_make_class, create_basic_classes, scm_sys_fast_slot_set_x, set_slot_value, scm_sys_allocate_instance, clear_method_cache, scm_sys_invalidate_method_cache_x, scm_make, create_standard_classes, scm_make_port_classes, scm_make_class, scm_add_slot): Use SCM_SET_SLOT to set slot values. (prep_hashsets): Use SCM_SET_HASHSET to set class hash values. * goops.h (SCM_SET_SLOT, SCM_SET_HASHSET): New macros. * ramap.c (BINARY_ELTS_CODE, BINARY_PAIR_ELTS_CODE, UNARY_ELTS_CODE): Remove bogus break statement. * vectors.h (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Don't access bit vectors elements as SCM objects. * weaks.c (scm_make_weak_vector, scm_make_weak_key_hash_table, scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table): Don't assign to an unpacked value. 2001-06-07 Dirk Herrmann * __scm.h (SCM_NORETURN): Moved here from error.h. (SCM_UNUSED): New macro. (SCM_DEBUG_PAIR_ACCESSES): New macro. * backtrace.c (display_error_handler), continuations.c (continuation_print), debug.c (debugobj_print), dynwind.c (guards_print), environments.c (observer_print, core_environments_finalize, leaf_environment_cell, leaf_environment_print, eval_environment_print, eval_environment_observer, import_environment_define, import_environment_undefine, import_environment_print, import_environment_observer, export_environment_define, export_environment_undefine, export_environment_print, export_environment_observer), eval.c (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and, scm_m_or, scm_m_case, scm_m_cond, scm_m_lambda, scm_m_letstar, scm_m_do, scm_m_delay, scm_m_letrec1, scm_m_apply, scm_m_cont, scm_m_nil_cond, scm_m_nil_ify, scm_m_t_ify, scm_m_0_cond, scm_m_0_ify, scm_m_1_ify, scm_m_atfop, scm_m_at_call_with_values), evalext.c (scm_m_generalized_set_x), fluids.c (fluid_print), fports.c (fport_print), gc.c (gc_start_stats, scm_remember_upto_here_1, scm_remember_upto_here_2, scm_remember_upto_here, mark_gc_async), gh_init.c (gh_standard_handler), goops.c (get_slot_value, set_slot_value, test_slot_existence, scm_change_object_class, scm_m_atslot_ref, scm_m_atslot_set_x, make_struct_class, default_setter), guardians.c (guardian_print, guardian_gc_init, guardian_zombify, whine_about_self_centered_zombies), guile.c (inner_main), init.c (stream_handler), keywords.c (keyword_print), mallocs.c (malloc_print), numbers.c (scm_print_real, scm_print_complex, scm_bigprint), ports.c (flush_port_default, end_input_default, scm_port_print, fill_input_void_port, write_void_port), root.c (root_print), smob.c (scm_mark0, scm_free0, scm_smob_print, scm_smob_apply_1_error, scm_smob_apply_2_error, scm_smob_apply_3_error, free_print), stime.c (restorezone), strings.c (scm_makfromstr), struct.c (scm_struct_free_0, scm_struct_free_standard, scm_struct_free_entity, scm_struct_gc_init, scm_free_structs), throw.c (jmpbuffer_print, lazy_catch_print, ss_handler, scm_handle_by_throw, scm_ithrow), weaks.c (scm_weak_vector_gc_init, scm_mark_weak_vector_spines, scm_scan_weak_vectors), ramap.c (scm_array_fill_int), filesys.c (scm_dir_print): Mark unused parameters with SCM_UNUSED. * error.h (SCM_NORETURN): Moved to __scm.h. * error.h (ERRORH, SCM_ERROR_H), pairs.h (PAIRSH, SCM_PAIRS_H): Renamed H to SCM__H. * gc.c (debug_cells_gc_interval): New static variable. (scm_assert_cell_valid): If selected by the user, perform additional garbage collections. (scm_set_debug_cell_accesses_x): Extended to let the user specify if additional garbage collections are desired. (mark_gc_async): If additional garbage collections are selected by the user, don't call the after-gc-hook. Instead require the user to run the hook manually. * pairs.c (scm_error_pair_access): New function. Only compiled if SCM_DEBUG_PAIR_ACCESSES is set to 1. * pairs.h (SCM_VALIDATE_PAIR): New macro. (SCM_CAR, SCM_CDR, SCM_SETCAR, SCM_SETCDR): If SCM_DEBUG_PAIR_ACCESSES is set to 1, make sure that the argument is a real pair object. (Glocs are also accepted, but that may change.) If not, abort with an error message. 2001-06-05 Dirk Herrmann * eval.c (SCM_VALIDATE_NON_EMPTY_COMBINATION): New macro. (SCM_CEVAL, SCM_APPLY): Replace calls to SCM_EVALIM2 with calls to SCM_VALIDATE_NON_EMPTY_COMBINATION. 2001-06-05 Marius Vollmer * extensions.c (scm_c_register_extension): Allow NULL as library name. (load_extension): Ignore NULL library names when comparing. * hash.c (scm_hasher): Use SCM_UNPACK in the case labels so that non-pointers are being compared. Thanks to Alexander Klimov! 2001-06-04 Gary Houston * rw.c (scm_write_string_partial): new procedure implementing write-string/partial in (ice-9 rw). * rw.h: declare scm_write_string_partial. 2001-06-04 Marius Vollmer * keywords.c (keyword_print): Substract 1 from length of symbol name, accounting for the silly dash. * dynl.c (scm_registered_modules, scm_clear_registered_modules): Do not emit deprecation warning. Added exception notice to all files. * dynl.c: Include "deprecation.h". 2001-06-03 Marius Vollmer * dynl.c (scm_register_module_xxx, scm_registered_modules, scm_clear_registered_modules): Deprecated. 2001-06-02 Rob Browning * .cvsignore: add guile_filter_doc_snarfage guile-snarf-docs guile-snarf-docs-texi. * fports.c: HAVE_ST_BLKSIZE changed to HAVE_STRUCT_STAT_ST_BLKSIZE. (scm_fport_buffer_add): HAVE_ST_BLKSIZE changed to HAVE_STRUCT_STAT_ST_BLKSIZE. * filesys.c (scm_stat2scm): HAVE_ST_RDEV changed to HAVE_STRUCT_STAT_ST_RDEV. (scm_stat2scm): HAVE_ST_BLKSIZE changed to HAVE_STRUCT_STAT_ST_BLKSIZE. (scm_stat2scm): HAVE_ST_BLOCKS changed to HAVE_STRUCT_STAT_ST_BLOCKS. 2001-06-02 Marius Vollmer * strports.c (scm_eval_string): Use scm_primitive_eval_x instead of scm_eval_x to allow module changes between the forms in the string. Set/restore module using scm_c_call_with_current_module. * mkstemp.c: New file, slightly modified from libiberties mkstemps.c. 2001-05-31 Michael Livshin * guile-snarf-docs.in, guile-snarf-docs-texi.in, filter-doc-snarfage.c: new files. * Makefile.am: add stuff to [build,] use and distribute guile-snarf-docs, guile-snarf-docs-texi, guile_filter_doc_snarfage. * guile-snarf.in: grok the new snarf output. * snarf.h: make the output both texttools- and `read'-friendly. * guile-doc-snarf.in: reimplement in terms of guile-snarf and guile-snarf-docs. (should also deprecate, I guess. maybe not). 2001-05-31 Marius Vollmer * print.c (scm_simple_format): Support "~~" and "~%". Signal error for unsupported format controls and for superflous arguments. Thanks to Daniel Skarda! * print.h, print.c (scm_print_symbol_name): Factored out of scm_iprin1. (scm_iprin1): Call it. * keywords.c (keyword_print): Use scm_print_symbol_name so that weird names are printed correctly. * print.c (scm_print_symbol_name): Symbols whose name starts with `#' or `:' or ends with `:' are considered weird. 2001-05-30 Martin Grabmueller * numbers.c (scm_difference, scm_divide): Clarified comments for - and /. 2001-05-29 Martin Grabmueller * debug.h: Removed prototype for scm_eval_string. 2001-05-28 Martin Grabmueller * symbols.c (scm_gensym): Fix buffer overrun (try `(gensym (make-string 2000 #\!))' in an older version). Change strncpy to memcpy to allow embedded NUL characters in symbol prefix. 2001-05-28 Michael Livshin * hooks.c (scm_create_hook): deprecated. (make_hook): deleted. (scm_make_hook): all the hook creation code is now here. * gc.c (scm_init_gc): don't call `scm_create_hook'. instead make a hook, make it permanent, and do a `scm_c_define' on it. * strop.c (s_scm_string_capitalize_x): fix docstring quoting. * socket.c (s_scm_inet_pton): fix docstring quoting. (s_scm_inet_ntop): ditto. * num2integral.i.c (INTEGRAL2NUM): cast to fix a warning. * hashtab.c (scm_internal_hash_fold): fix argument position in SCM_ASSERT. * environments.c (s_scm_import_environment_set_imports_x): fix argument position in SCM_ASSERT. * debug.c (s_scm_make_gloc): fix SCM packing/unpacking. (s_scm_make_iloc): ditto. 2001-05-26 Dirk Herrmann * __scm.h (SCM_DEBUG_TYPING_STRICTNESS): Make 1 the default. * eval.c (promise_print): Read the promise's value as an object. (SCM_CEVAL): Don't perform side-effecting operations in macro parameters. * eval.h (SCM_EVALIM2): Fix the typing strictness of the conditional expression. * gc.c (scm_master_freelist, scm_master_freelist2): Added missing initializer. * gh_data.c (gh_set_substr): Removed redundant unsigned >= 0 text, removed redundant computation of effective_length and fixed the overflow check. * goops.c (test_slot_existence): Use SCM_EQ_P to compare SCM values. (wrap_init): Don't use SCM_C[AD]R for non pairs. (hell): Make it a scm_bits_t pointer rather than a SCM pointer. * goops.c (scm_sys_modify_class), strports.c (st_resize_port), struct.h (SCM_SET_STRUCT_PRINTER): Store unpacked values. * goops.h (SCM_ACCESSORS_OF, SCM_SLOT): Return a SCM value. * goops.h (GOOPSH, SCM_GOOPS_H), modules.h (MODULESH, SCM_MODULES_H), objects.h (OBJECTSH, SCM_OBJECTS_H), struct.h (STRUCTH, SCM_STRUCT_H), symbols.h (SYMBOLSH, SCM_SYMBOLS_H), __scm.h (__SCMH, SCM___SCM_H): Change H to SCM__H. * modules.[ch] (scm_module_tag): Make it a scm_bits_t value. * objects.h (SCM_SET_CLASS_INSTANCE_SIZE): Fixed typing. * ramap.c (ramap_rp): Removed bogus `;´. * sort.c (scm_restricted_vector_sort_x): Fixed signedness problem. * symbols.h (SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS, SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS): Read SCM objects rather than scm_bits_t values. * tags.h (SCM_VOIDP_TEST): Removed. (SCM_DEBUG_TYPING_STRICTNESS): Now takes values 0, 1, 2. The value of 2 now corresponds to the former 1, the current 1 corresponds to the former situation that SCM_VOIDP_TEST was defined. (SCM): Now defined as typedef struct scm_unused_struct * SCM; If this appears to be not ANSI compliant, we will change it to typedef struct scm_unused_struct { } * SCM; Thanks to Han-Wen Nienhuys for the suggestion. * unif.c (scm_array_set_x): Fix typing problem, and use SCM_UVECTOR_BASE instead of SCM_VELTS or SCM_CELL_WORD_1 when dealing with uniform vectors. 2001-05-27 Michael Livshin * gc.c (scm_init_storage): init `scm_gc_registered_roots'. (scm_igc): mark from them, too (precisely, not conservatively!). * root.h (scm_gc_registered_roots): new object in scm_sys_protects. * hooks.c (scm_create_hook): call `scm_gc_protect_object' instead `scm_protect_object'. shouldn't call it at all, though, it seems. * gc.c (scm_[un]protect_object): deprecated. (scm_gc_[un]protect_object): new names for scm_[un]protect_object. (scm_gc_[un]register_root[s]): new. * gc.h: add prototypes for scm_gc_[un]protect_object, scm_gc_[un]register_root[s]. 2001-05-26 Michael Livshin revert the controversial part of the 2001-05-24 changes. 2001-05-25 Marius Vollmer * modules.c (scm_env_module): Exported to Scheme. * eval.c (scm_debug_opts): New option `show-file-name'. * debug.h (SCM_SHOW_FILE_NAME): New. * backtrace.c: Include "libguile/filesys.h". (sym_base, display_backtrace_get_file_line, display_backtrace_file, display_backtrace_file_and_line): New. (display_frame): Call display_backtrace_file_and_line if that is requested. (display_backtrace_body): Call scm_display_backtrace_file if requested. * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): Prototypes removed since there's no definition for these functions. 2001-05-24 Martin Grabmueller * unif.c (scm_make_ra, array_free), unif.h (SCM_ARRAY_DIMS): Changed use of scm_array->scm_array_t and scm_array_dim->scm_array_dim_t to enable build with --disable-deprecated. 2001-05-24 Michael Livshin The purpose of this set of changes is to regularize Guile's usage of ANSI C integral types, with the following ideas in mind: - SCM does not nesessarily have to be long. - long is not nesessarily enough to store pointers. - long is not nesessarily the same size as int. The changes are incomplete and possibly buggy. Please test on something exotic. * validate.h (SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t. * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * goops.[hc]: various {int,long} -> scm_bits_t changes. * gh_data.c (gh_num2int): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * gc.[hc]: various small changes relating to many things stopping being long and starting being scm_[u]bits_t instead. scm_mallocated should no longer wrap around. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size from long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value beside that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t). (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c 2001-05-23 Marius Vollmer * snarf.h (SCM_CONST_LONG): Use SCM_VCELL_INIT instead of SCM_VARIABLE_INIT since that it what it used to be. * deprecation.c (scm_include_deprecated_features): Make docstring ANSIsh. Thanks to Matthias Köppe! 2001-05-21 Marius Vollmer * symbols.c (scm_mem2symbol): Re-introduce indirect cell. It is needed for weak-key hashtables. * procs.c (scm_make_subr_with_generic): Add missing last argument in call to scm_c_define_gsubr_with_generic. Thanks to Ariel Rios. * eval.c: Use SCM_EQ_P instead of `==' or `!=' in certain places. (scm_c_improper_memq): Return 1 instead of SCM_BOOL_T. * eval.h (SCM_EVALIM2): Use SCM_EQ_P instead of `=='. 2001-05-20 Marius Vollmer * symbols.c (scm_mem2symbol): Call `scm_must_strndup' instead of `duplicate_string'. Do not use an indirect cell, store symbol directly in collision list of hash table. (duplicate_string): Removed. * init.c (scm_init_guile_1): Call scm_init_extensions. * Makefile.am: Add "extensions.c" and related files in all the right places. * extensions.h, extension.c: New files. * gc.h, gc.c (scm_must_strdup, scm_must_strndup): New. * modules.h (scm_system_module_env_p): Move out of deprecated section. * rw.h (scm_init_rw): Added prototype. * gsubr.h, gsubr.c (scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic, scm_c_define_gsubr_with_generic): New functions. They replace scm_make_gsubr and scm_make_gsubr_with_generic. The `make' variants only create the gsubr object, while the `define' variants also put it into the current module. Changed all callers. (scm_make_gsubr, scm_make_gsubr_with_generic): Deprecated. * procs.h, procs.c (scm_c_make_subr, scm_c_define_subr, scm_c_make_subr_with_generic, scm_c_define_subr_with_generic): New functions. They replace scm_make_subr, scm_make_subr_opt and scm_make_subr_with_generic. The `make' variants only create the subr object, while the `define' variants also put it into the current module. Changed all callers. (scm_make_subr, scm_make_subr_opt, scm_make_subr_with_generic): Deprecated. * eval.c, gc.c, gh_funcs.c, goops.c, macros.c, pairs.c, ramap.c, rdelim.c, rw.c, scmsigs.c, snarf.h, values.c: Changed according to the comments above. 2001-05-19 Neil Jerram * throw.c (scm_lazy_catch): Slight docstring clarification. 2001-05-19 Marius Vollmer * throw.c: Lazy-catch handlers are no longer allowed to return. Fixed comments throughout. (scm_ithrow): Signal an error when a lazy-catch handler returns. Moved actual jump to jmpbuf into if-branch where the jmpbuf is recognized as such. * version.c (s_scm_micro_version): Fix typo in FUNC_NAME, it refered to s_scm_minor_version previously. * modules.h, modules.c: Moved around a lot of code so that deprecated features appear at the bottom. (root_module_lookup_closure, scm_sym_app, scm_sym_modules, module_prefix, make_modules_in_var, beautify_user_module_x_var, scm_the_root_module, scm_make_module, scm_ensure_user_module, scm_load_scheme_module): Deprecated. (scm_system_module_env_p): Return SCM_BOOL_T directly for environments corresponding to the root module. (convert_module_name, scm_c_resolve_module, scm_c_call_with_current_module, scm_c_define_module, scm_c_use_module, scm_c_export): New. (the_root_module): New static variant of scm_the_root_module. Use it everywhere instead of scm_the_root_module. * fluids.h, fluids.c (scm_internal_with_fluids): Deprecated. (scm_c_with_fluids): Renamed from scm_internal_with_fluids. (scm_c_with_fluid): New. (scm_with_fluids): Use scm_c_with_fluids instead of scm_internal_with_fluids. * goops.h, goops.c (scm_init_goops_builtins): Renamed from `scm_init_goops'. Do not explicitly create/switch modules. Return SCM_UNSPECIFIED. (scm_init_goops): Only register `%init-goops-builtins' procedure. (scm_load_goops): Use scm_c_resolve_module instead of scm_resolve_module. * init.c (scm_init_guile_1): Call `scm_init_goops' instead of `scm_init_oop_goops_goopscore_module'. Call `scm_init_rdelim' and `scm_init_rw' prior to loading the startup files. * rdelim.h, rdelim.c: (scm_init_rdelim_builtins): Renamed from scm_init_rdelim. Do not explicitly create/switch modules. Return SCM_UNSPECIFIED. (scm_init_rdelim): Only register `%init-rdelim-builtins' procedure. * rw.c (scm_init_rw_builtins): Renamed from scm_init_rw. Do not explicitly create/switch modules. Return SCM_UNSPECIFIED. (scm_init_rw): Only register `%init-rw-builtins' procedure. * script.c (scm_shell): Evaluate the compiled switches in the current module, not in the root module. 2001-05-18 Marius Vollmer * fluids.c (scm_c_with_fluids): Rename from scm_internal_with_fluids. (scm_internal_with_fluids): Deprecated. (scm_c_with_fluid): New. 2001-05-17 Dirk Herrmann * print.h (PRINTH, SCM_PRINT_H): Renamed PRINTH to SCM_PRINT_H. (SCM_PORT_WITH_PS_PORT, SCM_PORT_WITH_PS_PS): Only pairs may be accessed with SCM_C[AD]R. (SCM_COERCE_OUTPORT): Removed redundant SCM_NIMP test. 2001-05-16 Rob Browning * version.c (s_scm_major_version): doc fixes. (s_scm_minor_version): doc fixes. (s_scm_minor_version): new function. * version.h (scm_init_version): new function. * versiondat.h.in: add GUILE_MICRO_VERSION. 2001-05-16 Dirk Herrmann * deprecation.c (scm_init_deprecation): Renamed GUILE_WARN_DEPRECATED_DEFAULT to SCM_WARN_DEPRECATED_DEFAULT. 2001-05-16 Marius Vollmer * Makefile.am (cpp_sig_symbols.c, cpp_err_symbols.c): Make dependent on cpp_cnvt.awk 2001-05-15 Martin Grabmueller * script.c (scm_compile_shell_switches): New command line option `--use-srfi' for loading a list of SRFIs on startup. (scm_shell_usage): Added `--use-srfi' to help message. 2001-05-10 Marius Vollmer Merged from mvo-vcell-cleanup-1-branch. The concept of vcells has been removed from Guile. With it, explicit obarrays and associated operations are gone. Use hashtables instead of obarrays. Throughout: use scm_sym2var instead of scm_sym2vcell and treat result as variable instead of vcell. Glocs no longer point to a vcell but to a variable. Use scm_c_define instead of scm_sysintern and treat the result as a variable (which it is), not a vcell. * variable.c, variable.h (SCM_VARVCELL, SCM_UDVARIABLEP, SCM_DEFVARIABLEP): Deprecated. (SCM_VARIABLE_REF, SCM_VARIABLE_SET, SCM_VARIABLE_LOC): New. (variable_print): Do not print name of variable. (variable_equalp): Compare values, not vcells. (anonymous_variable_sym): Removed. (make_vcell_variable): Removed. (make_variable): New, as replacement. (scm_make_variable, scm_make_undefined_variable): Do not take name hint parameter. (scm_variable_ref): Check for SCM_UNDEFINED and throw "unbound" error in that case. (scm_builtin_variable): Deprecated. * symbols.c, symbols.h (scm_sym2vcell, scm_sym2ovcell_soft, scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray, scm_intern, scm_intern0, scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0, scm_symbol_value0, scm_string_to_obarray_symbol, scm_intern_symbol, scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned, scm_symbol_bound_p, scm_symbol_set_x, scm_gentmp, gentmp_counter): Deprecated and moved to "symbols-deprecated.c". (copy_and_prune_obarray, scm_builtin_bindings): Removed. (scm_init_symbols): Call scm_init_symbols_deprecated. * symbols-deprecated.c: New file. * Makefile.am: Added symbols-deprecated.c and related files in all the right places. * snarf.h (SCM_VCELL, SCM_GLOBAL_VCELL, SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT): Deprecated. (SCM_VARIABLE, SCM_GLOBAL_VARIABLE, SCM_VARIABLE_INIT, SCM_GLOBAL_VARIABLE_INIT): New, as replacement. Changed all uses. * print.c (scm_iprin1): Use scm_module_reverse_lookup instead of SCM_GLOC_SYM. * evalext.c, filesys.c, fports.c, gdbint.c, gh_data.c, gsubr.c, hooks.c, load.c, numbers.c, objects.c, ports.c, posix.c, procs.c, ramap.c, random.c, read.c, regex-posix.c, scmsigs.c, script.c, socket.c, srcprop.c, stacks.c, stime.c, struct.c, tag.c, throw.c: Changed according to the `throughout' comments. * modules.h, modules.c (scm_module_system_booted_p): Changed type to `int'. (scm_module_type): Removed. (the_root_module): Renamed to the_root_module_var. Now points to a variable instead of a vcell. Updated all uses. (scm_the_root_module): Return SCM_BOOL_F when module systems hasn't been booted yet. (SCM_VALIDATE_STRUCT_TYPE): Removed. (scm_post_boot_init_modules): Made static. (scm_set_current_module): Call scm_post_boot_init_modules on first call. (make_modules_in, beautify_user_module_x, resolve_module, try_module_autoload, module_make_local_var_x): Tacked on "_var" suffix. Now point to variables instead of vcells. Updated all uses. (scm_module_lookup_closure): Deal with the module being SCM_BOOL_F and return SCM_BOOL_F in that case. (scm_module_transformer): Likewise. (sym_module, scm_lookup_closure_module, scm_env_module): New. (SCM_F_EVAL_CLOSURE_INTERFACE, SCM_EVAL_CLOSURE_INTERFACE_P): New. (scm_eval_closure_lookup): Do not allow new definitions when `interface' flag is set. (scm_standard_interface_eval_closure): New. (scm_pre_modules_obarray, scm_sym2var, scm_module_lookup, scm_lookup, scm_module_define, scm_define, scm_c_module_lookup, scm_c_lookup, scm_c_module_define, scm_c_define, scm_module_reverse_lookup, scm_get_pre_modules_obarray, scm_modules_prehistory): New. (scm_post_boot_init_modules): Use scm_c_define and scm_c_lookup instead of scm_intern0. * macros.c (scm_make_synt): Return SCM_UNSPECIFIED instead of the symbol. * keywords.c (s_scm_make_keyword_from_dash_symbol): Use a regular hashtable operations to maintain the keywords, not obarray ones. * init.c (scm_load_startup_files): Do not call scm_post_boot_init_modules. This is done by scm_set_current_module now. (scm_init_guile_1): Call scm_modules_prehistory. Call scm_init_variable early on. * goops.c (s_scm_sys_goops_loaded): Get var_compute_applicable_methods from scm_sym2var, not from a direct invocation of scm_goops_lookup_closure. * gh_funcs.c (gh_define): Return SCM_UNSPECIFIED instead of vcell. * gc.c: Added simple debugging hack to mark phase of GC: When activated, do not tail-call scm_gc_mark. This gives nice backtraces. (scm_unhash_name): Removed. * feature.c (features): Renamed to features_var. Now points to a variable instead of a vcell. Updated all uses. * eval.h (SCM_TOP_LEVEL_LOOKUP_CLOSURE): Use `scm_current_module_lookup_closure' which will do the right thing when the module system hasn't been booted yet. (SCM_GLOC_SYM): Removed. (SCM_GLOC_VAR, SCM_GLOC_SET_VAL): New. (SCM_GLOC_VAL, SCM_GLOC_LOC): Reimplemented in terms of variables. * eval.c (scm_lookupcar, scm_lookupcar1): Deal with variables instead of with vcells. Do not overwrite `var' with the result of the lookup, use the new `real_var' instead. Remove `var2' in exchange (which was only used with threads). (sym_three_question_marks): New. (scm_unmemocar): Use `scm_module_reverse_lookup' instead of `SCM_GLOC_SYM'. (scm_lisp_nil, scm_lisp_t): Directly define as symbols. (scm_m_atfop): Expect the function definition to be a variable instead of a vcell. (scm_macroexp): Do not use `unmemocar', explicitely remember the symbol instead. (scm_unmemocopy): Removed thoughts about anti-macro interface. (scm_eval_args): Use more explicit code in the gloc branch of the atrocious struct ambiguity test. The optimizer will sort this out. (scm_deval_args): Likewise. (SCM_CEVAL): Likewise. Also, do not use unmemocar, explicitely remember the symbol instead. Added some comments where scm_tc3_cons_gloc really exclusively refers to structs. (scm_init_eval): Use scm_define to initialize "nil" and "t" to scm_lisp_nil and scm_lisp_t, respectively. Use scm_define instead of scm_sysintern in general. * dynwind.c (scm_swap_bindings): Use SCM_GLOC_SET_VAL instead of explicit magic. * debug.c (s_scm_make_gloc): Only allow proper variables, no pairs. Put the variable directly in the gloc. (s_scm_gloc_p): Use `scm_tc3_cons_gloc' instead of the magic `1'. (scm_init_debug): Use scm_c_define instead scm_sysintern. * cpp_cnvt.awk: Emit "scm_c_define" instead of "scm_sysintern". * backtrace.h, backtrace.c (scm_the_last_stack_fluid): Renamed to scm_the_last_stack_fluid_var. It now points to a variable instead of a vcell. Updated all uses. (scm_has_shown_backtrace_hint_p_var): Now points to a variable instead of a vcell. Updated all uses. * _scm.h: Include "variables.h" and "modules.h" since almost everybody needs them now. * root.h (scm_symhash, scm_symhash_vars): Removed. * gc.c (scm_init_storage): Do not initialize them. 2001-05-15 Dirk Herrmann * eval.c (scm_init_eval): Initialize scm_undefineds and scm_listofnull. * gc.c (scm_debug_newcell, scm_debug_newcell2): Fixed to behave like the SCM_NEWCELL macro counterparts. (scm_init_storage, scm_init_gc): Moved initialization of scm_tc16_allocated from scm_init_gc to scm_init_storage. (scm_init_storage): Moved initialization of scm_undefineds and scm_listofnull to eval.c, initializion of scm_nullstr to strings.c, initializion of scm_nullvect to vectors.c. * gc.h (SCM_NEWCELL, SCM_NEWCELL2): Prefer SCM_NULLP over SCM_IMP, as in scm_debug_newcell and scm_debug_newcell2. * init.c (scm_init_guile_1): Reordered some initializations and added dependcy information comments. * load.c (scm_init_load): Use scm_nullstr. * strings.c (scm_init_strings): Initialize scm_nullstr. * vectors.c (scm_init_vectors): Initialize scm_nullvect. 2001-05-15 Marius Vollmer * values.c (print_values): Print as a unreadable object, not as multiple lines. Thanks to Matthias Köppe! 2001-05-14 Dirk Herrmann * deprecation.c: Fixed copyright date. * deprecation.h (DEPRECATION_H, SCM_DEPRECATION_H): Renamed DEPRECATION_H to SCM_DEPRECATION_H. 2001-05-10 Thien-Thi Nguyen * guile-doc-snarf.in: Update copyright. Fix relative path bug. Thanks to Sergey Poznyakoff. 2001-05-10 Marius Vollmer * ports.c (scm_port_revealed, scm_set_port_revealed_x): Only accept open ports. Thanks to Quetzalcoatl Bradley! 2001-05-09 Martin Grabmueller * procs.c: Increased `scm_subr_table_room' to 800 because Guile now has 779 primitives on startup. 2001-05-09 Marius Vollmer * eval.c (scm_i_eval): Copy expression before passing it to SCM_XEVAL. The copy operation was removed unintendedly during my change on 2001-03-25. 2001-05-09 Michael Livshin from Matthias Köppe (thanks!): * ports.c (scm_c_read): pointer arithmetic on void pointers isn't portable. * deprecation.c (s_scm_include_deprecated_features): ANSI'fied the docstring. 2001-04-21 Dirk Herrmann * gc.c (scm_init_gc): Added FIXME comment. * hooks.c: Since hooks don't have a name any more, it is not necessary to include objprop.h. (hook_print, scm_add_hook_x): Replace SCM_NFALSEP by !SCM_FALSEP. (symbol_name, scm_make_hook_with_name): Removed. (scm_create_hook): Don't set the hook's name property. * hooks.h (HOOKSH, SCM_HOOKS_H): Renamed HOOKSH to SCM_HOOKS_H. (SCM_HOOK_NAME, scm_make_hook_with_name): Removed. * init.c (scm_init_guile_1): Hooks don't use objprops any more. * numbers.c (SCM_FLOBUFLEN, FLOBUFLEN, scm_number_to_string, scm_print_real, scm_print_complex): Renamed SCM_FLOBUFLEN to FLOBUFLEN and define it unconditionally. 2001-05-07 Marius Vollmer * gh_data.c (gh_lookup): Call gh_module_lookup with `scm_current_module ()', not `#f'. (gh_module_lookup): Expect a module instead of an obarray as first argument and do lookup in that module. * ramap.c (raeql_1): Do not call scm_uniform_vector_length on arrays. The length of array is already determined differently and scm_uniform_vector_length does not work on arrays. 2001-05-06 Marius Vollmer * snarf.h (SCM_FUNC_CAST_ARBITRARY_ARGS): Use "SCM (*)()" for C++ as well. "SCM (*)(...)" does not work on RedHat 7.1. * __scm.h (SCM_WTA_DISPATCH_0): Removed ARG and POS parameters, they are not used. Changed `wrong type' error into `wrong num args' error. Changed all callers. * numbers.c (scm_difference): Call SCM_WTA_DISPATCH_0 when zero arguments are supplied. 2001-05-05 Thien-Thi Nguyen * regex-posix.c (scm_regexp_exec): Expand docstring to briefly describe `regexp/notbol' and `regexp/noteol' execution flags. * strop.c (scm_substring_move_x): Doc fix; nfc. 2001-05-05 Marius Vollmer * objects.c, objects.h (scm_valid_object_procedure_p): New. (scm_set_object_procedure_x): Use it to check argument. Fix docstring. * evalext.c (scm_definedp): Fix docstring. 2001-05-05 Gary Houston * socket.c: use HAVE_IPV6 instead of AF_INET6 to enable IPv6 support. 2001-05-04 Neil Jerram * eval.c (scm_promise_p), list.c (scm_append_x, scm_reverse_x), symbols.c (scm_symbol_to_string), vports.c (scm_make_soft_port): Change R4RS references to R5RS. * guile-snarf.awk.in: Fixes so that (i) blank lines in the docstring source are correctly reproduced in the output (ii) we don't anymore get occasional trailing quotes. Also reorganized and commented the code a little. * scmsigs.c (scm_raise), throw.c (scm_throw): Docstring format fixes. 2001-05-04 Martin Grabmueller * strop.c (scm_string_split): New procedure. * strop.h (scm_string_split): Added prototype. 2001-05-04 Gary Houston * socket.c: define uint32_t if netdb.h doesn't. thanks to Dale P. Smith. 2001-05-02 Marius Vollmer * rw.c: Include "modules.h" and "strports.h". * net_db.h (scm_gethost): Added prototype. * deprecation.h, deprecation.c: New. * Makefile.am (libguile_la_SOURCES): Added "deprecation.c". (DOT_X_FILES): Added "deprecation.x". (modinclude_HEADERS): Added "deprecation.h". * init.c: Include "deprecation.h". (scm_init_guile_1): Call scm_init_deprecation. 2001-05-01 Marius Vollmer * gh.h (gh_init_guile, gh_make_string, gh_string_length, gh_string_ref, gh_string_set_x, gh_substring, gh_string_append): New. 2001-04-29 Gary Houston * rw.c: new file, implementing C part of module (ice-9 rw). (scm_read_string_x_partial): moved from ioext.c (scm_init_rw): new proc. * rw.h: new file. init.c: include rw.h and call scm_init_rw. Makefile.am: include rw.c and rw.h. 2001-04-28 Rob Browning * numbers.c: enabled local definition of SCM_FLOBUFLEN until we know what's supposed to happen to it. * list.h (scm_list_star): deprecation expired - removed. * numbers.h (scm_dblproc): deprecation expired - removed. (SCM_UNEGFIXABLE): deprecation expired - removed. (SCM_FLOBUFLEN): deprecation expired - removed. (SCM_INEXP): deprecation expired - removed. (SCM_CPLXP): deprecation expired - removed. (SCM_REAL): deprecation expired - removed. (SCM_IMAG): deprecation expired - removed. (SCM_REALPART): deprecation expired - removed. (scm_makdbl): deprecation expired - removed. (SCM_SINGP): deprecation expired - removed. (SCM_NUM2DBL): deprecation expired - removed. (SCM_NO_BIGDIG): deprecation expired - removed. * tags.h (SCM_DOUBLE_CELLP): deprecation expired - removed. (scm_tc_dblr): deprecation expired - removed. (scm_tc_dblc): deprecation expired - removed. (scm_tc16_flo): deprecation expired - removed. (scm_tc_flo): deprecation expired - removed. * tag.h (scm_tag): deprecation expired - removed. * tag.c: (scm_tag): deprecation expired - removed. * ioext.c: (scm_fseek): deprecation expired - removed. * ioext.h (scm_fseek): deprecation expired - removed. * gh_data.c (gh_int2scmb): deprecation expired - removed. * gh.h (gh_int2scmb): deprecation expired - removed. 2001-04-28 Neil Jerram * stacks.c (scm_make_stack): Fix typo in docstring. 2001-04-27 Rob Browning * error.c (scm_sysmissing): deprecation expired - removed. * error.h (scm_sysmissing): deprecation expired - removed. * gc.c (scm_init_gc): gc-thunk deprecation expired - removed. (scm_gc_vcell): deprecation expired - removed. (gc_async_thunk): scm_gc_vcell related code removed. * vectors.h (SCM_NVECTORP): deprecation expired - removed. * strings.h (SCM_NSTRINGP): deprecation expired - removed. (SCM_NRWSTRINGP): deprecation expired - removed. * continuations.h (SCM_SETJMPBUF): deprecation expired - removed. * chars.h (SCM_ICHRP): deprecation expired - removed. (SCM_ICHR): deprecation expired - removed. (SCM_MAKICHR): deprecation expired - removed. * ports.h (SCM_INPORTP): deprecation expired - removed. (SCM_OUTPORTP): deprecation expired - removed. 2001-04-25 Marius Vollmer * modules.c (scm_module_type): New. (scm_post_boot_init_modules): Initialize from Scheme value. (the_module, scm_current_module, scm_init_modules): the_module is now a C only fluid. (scm_current_module): Export to Scheme. (scm_set_current_module): Do not call out to Scheme, do all the work in C. Export procedure to Scheme. Only accept modules, `#f' is no longer valid as the current module. Only set scm_top_level_lookup_closure_var and scm_system_transformer when they are not deprecated. (scm_module_transformer, scm_current_module_transformer): New. * modules.h (scm_module_index_transformer, SCM_MODULE_TRANSFORMER, scm_current_module_transformer, scm_module_transformer): New. * gh_data.c: Removed FIXME comment about gh_lookup returning SCM_UNDEFINED. That's the right thing to do. * eval.h, eval.c (scm_system_transformer): Deprecated by moving it into the conditionally compiled sections. * eval.c (scm_primitive_eval_x, scm_primitive_eval): Use scm_current_module_transformer instead of scm_system_transformer. * init.c (start_stack): Move initialization of scm_system_transformer to the deprecated section. 2001-04-22 Neil Jerram * throw.c (scm_throw): Correct docstring. 2001-04-22 Gary Houston * socket.c: attempted to improve the docstrings slightly. * net_db.c: remove bogus "close" declaration. (inet_aton declaration, scm_inet_aton, scm_inet_ntoa, scm_inet_netof, scm_lnaof, scm_inet_makeaddr, INADDR_ANY etc.): moved to socket.c. * net_db.h: declarations moved too. * socket.c (scm_htonl, scm_ntohl): use uint32_t instead of unsigned long. (ipv6_net_to_num, ipv6_num_to_net): new static procedures. (VALIDATE_INET6): new macro. (scm_inet_pton, scm_inet_ntop): new procedures, implementing inet-pton and inet-ntop. (scm_fill_sockaddr): use VALIDATE_INET6 and ipv6_num_to_net. (scm_addr_vector): use ipv6_net_to_num. 2001-04-21 Dirk Herrmann * eq.c (scm_equal_p), ramap.c (scm_init_ramap): Don't compute the smob number explicitly. Use SCM_TC2SMOBNUM instead. * gc.c (MARK, scm_gc_sweep): Only check for illegal heap objects when compiled in debug mode. (scm_gc_sweep): Only call smob's free function if it is defined. * print.c (scm_iprin1): No need to check for validity of smob type or existence of print function. * smob.[ch] (scm_smobs): Made into a fixed size global array. Resizing will not work well with preemptive threading. * smob.c (scm_smob_print): Don't use SCM_CDR to access smob data. (scm_make_smob_type): Extracted initialization of smob descriptors to scm_smob_prehistory. Don't use scm_numsmob outside of the critical section. (scm_smob_prehistory): Initialize all smob descriptors. By default, don't assign a smob free function: Most smob types don't need one. * smob.h (SMOBH, SCM_SMOB_H): Renamed SMOBH to SCM_SMOB_H. 2001-04-21 Gary Houston * socket.c (FLIP_NET_HOST_128): new macro. (scm_fill_sockaddr): use new macro. (scm_addr_vector): completed IPv6 address support. added const to the address parameter. 2001-04-20 Gary Houston * socket.c (scm_fill_sockaddr): call htons for sin6_port. Don't assign sin6_scope_id in structure unless HAVE_SIN6_SCOPE_ID is defined. (scm_addr_vector): use a switch instead of multiple if statements. Add support for IPv6 (incomplete) . MAX_ADDR_SIZE: increase to size of struct sockaddr_in6 if needed. 2001-04-20 Dirk Herrmann * struct.c (scm_free_structs): Only pairs may be accessed with SCM_C[AD]R. 2001-04-19 Mikael Djurfeldt * unif.h (SCM_ARRAY_CONTIGUOUS): Reintroduced as deprecated. * __scm.h (SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1, SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_n): Inserted required parentheses in order to get the correct associativity. 2001-04-19 Dirk Herrmann * unif.c (scm_array_to_list): Added missing handling of arrays of bytes. Thanks to Masao Uebayashi for the bug report. 2001-04-19 Dirk Herrmann * debug.c (scm_procedure_source): Use SCM_CLOSURE_FORMALS more consistently. 2001-04-19 Dirk Herrmann * procs.h (SCM_CLOSURE_FORMALS): New macro. * debug.c (scm_procedure_source), eval.c (scm_badformalsp, SCM_CEVAL, SCM_APPLY), goops.c (get_slot_value, set_slot_value), procprop.c (scm_i_procedure_arity), sort.c (closureless): Use SCM_CLOSURE_FORMALS. * eval.c (scm_badformalsp, SCM_CEVAL), procprop.c (scm_i_procedure_arity): Prefer stronger predicates like SCM_NULLP or SCM_FALSEP over SCM_IMP. * macros.c (macro_print): Extracted macro printing code from print.c and simplified it. (scm_macro_type): Use SCM_MACRO_TYPE; (scm_init_macros): Use macro_print for printing macros. * print.c (scm_print_opts): Improved option documentation. (scm_iprin1): Extracted printing of macros to macros.c. Simplified printing of ordinary closures. * procs.c (scm_thunk_p): Fixed handling of closures. Thanks to Martin Grabmueller for the bug report. 2001-04-19 Dirk Herrmann This patch eliminates some further applications of SCM_C[AD]R to non pair cells. * gc.h (SCM_SETAND_CAR, SCM_SETOR_CAR): Deprecated. These have never been applied to real pairs. * srcprop.h (SCM_SOURCE_PROPERTY_FLAG_BREAK): Added. (SRCPROPBRK): Use SCM_SOURCE_PROPERTY_FLAG_BREAK. * unif.h (SCM_ARRAY_CONTIGUOUS, SCM_ARRAY_FLAG_CONTIGUOUS, SCM_ARRAY_CONTP): Renamed SCM_ARRAY_CONTIGUOUS to SCM_ARRAY_FLAG_CONTIGUOUS and use it. (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG): Added. * srcprop.h (SRCPROPH), unif.h (UNIFH): Renamed to SCM_SOURCE_PROPERTIES_H and SCM_UNIFORM_VECTORS_H, respectively. * srcprop.h (SETSRCPROPBRK, CLEARSRCPROPBRK), unif.c (scm_dimensions_to_uniform_array, scm_ra_set_contp): Don't use SCM_SET{AND,OR}_CAR. 2001-04-17 Gary Houston * some initial support for IPv6: * socket.c (scm_fill_sockaddr): improve the argument validation. don't allocate memory until all args are checked. instead of unconditional memset of soka, try setting sin_len to 0 if SIN_LEN is defined. add support for AF_INET6. define FUNC_NAME. (scm_socket, scm_connect): extend docstrings for IPv6. (scm_init_socket): intern AF_INET6 and PF_INET6. 2001-04-17 Niibe Yutaka * srcprop.c (scm_make_srcprops): Added SCM_ALLOW_INTS which matches SCM_DEFER_INTS at the beginning of the function. * mallocs.c (scm_malloc_obj): Remove un-matched SCM_ALLOW_INTS. * gc.c (scm_igc): Unconditionally call SCM_CRITICAL_SECTION_START/END. * fluids.c (next_fluid_num): Unconditionally call SCM_CRITICAL_SECTION_START/END. (s_scm_make_fluid): Remove un-matched SCM_DEFER_INTS. * coop-defs.h (SCM_THREAD_DEFER, SCM_THREAD_ALLOW, SCM_THREAD_REDEFER, SCM_THREAD_REALLOW_1, SCM_THREAD_REALLOW_2): Removed. * __scm.h (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END): Defined as nothing for the case of !defined(USE_THREADS). (SCM_THREAD_DEFER, SCM_THREAD_ALLOW, SCM_THREAD_REDEFER): Removed. (): Include when (SCM_DEBUG_INTERRUPTS == 1). (SCM_CHECK_NOT_DISABLED, SCM_CHECK_NOT_ENABLED): Print FILE and LINE. (SCM_DEFER_INTS, SCM_ALLOW_INTS_ONLY, SCM_ALLOW_INTS, SCM_REDEFER_INTS, SCM_REALLOW_INTS): Don't use SCM_THREAD_DEFER/SCM_THREAD_ALLOW. Instead, use SCM_CRITICAL_SECTION_START/END. (SCM_REALLOW_INTS: Bug fix. Don't call SCM_THREAD_SWITCHING_CODE. (SCM_TICK): Don't use SCM_DEFER_INTS/SCM_ALLOW_INTS. Instead, use SCM_THREAD_SWITCHING_CODE directly. (SCM_ENTER_A_SECTION): Unconditionally use SCM_CRITICAL_SECTION_START/END. (was: SCM_DEFER_INTS/SCM_ALLOW_INTS when SCM_POSIX_THREADS defined). 2001-04-17 Dirk Herrmann * __scm.h (SCM_CAREFUL_INTS, SCM_DEBUG_INTERRUPTS): Replaced the macro SCM_CAREFUL_INTS by the macro SCM_DEBUG_INTERRUPTS and allowed to explicitly set this macro via the CFLAGS variable during make. * fluids.c (next_fluid_num), gc.c (scm_igc), coop-defs.h (SCM_THREAD_CRITICAL_SECTION_START, SCM_THREAD_CRITICAL_SECTION_END): Renamed SCM_THREAD_CRITICAL_SECTION_START/END to SCM_CRITICAL_SECTION_START/END. 2001-04-11 Keisuke Nishida * debug-malloc.c (grow, scm_debug_malloc_prehistory): Use memset instead of bzero. * coop.c, iselect.c (FD_ZERO_N): Unconditionally use memset. (MISSING_BZERO_DECL): Remove the declaration. Thanks to NIIBE Yutaka. 2001-04-10 Mikael Djurfeldt * init.c, goops.c, goops.h: Reverted change of 2001-03-29. (The goops module should be registered in order to work for an application which uses libguile statically linked.) 2001-04-10 Dirk Herrmann * numbers.[ch] (scm_num2long, scm_num2long_long, scm_num2ulong_long, scm_num2ulong): Argument position is an unsigned integer. * environments.c (eval_environment_folder, import_environment_folder), gh_data.c (gh_scm2longs, gh_scm2floats, gh_scm2doubles): Distinguish between 0 and NULL for integers and pointers, respectively. * gh_data.c (gh_scm2ulong, gh_scm2long, gh_scm2int), socket.c (scm_fill_sockaddr), unif.c (scm_array_set_x), validate.h (SCM_NUM2ULONG, SCM_NUM2LONG, SCM_NUM2LONG_DEF, SCM_NUM2LONG_LONG): Don't pass argument positions as pointers. * filesys.c (scm_open_fdes, scm_open), net_db (scm_inet_ntoa, scm_inet_netof, scm_lnaof, scm_gethost, scm_getproto), posix.c (scm_utime), ramap.c (scm_array_fill_int), scmsigs.c (scm_sigaction), socket.c (scm_htonl, scm_ntohl, scm_sendto), stime.c (scm_localtime, scm_gmtime), struct.c (scm_struct_set_x), validate.h (SCM_VALIDATE_LONG_COPY): Whitespace fixes. 2001-04-09 Neil Jerram * strings.c (scm_read_only_string_p): Update docstring to reflect current (non-)usage of "read only" strings. (scm_make_shared_substring): Clarify docstring by changing "semantics" to "arguments". 2001-04-06 Martin Grabmueller * hooks.c (scm_make_hook, scm_make_hook_with_name), (scm_hook_p, scm_hook_empty_p, scm_run_hook): Docstring improvements. 2001-04-03 Martin Grabmueller The following changes make the documentation more consistent. * rdelim.c (scm_write_line), posix.c (scm_utime), ports.c (scm_seek), net_db.c (scm_inet_aton, scm_inet_ntoa), (scm_inet_netof, scm_lnaof, scm_inet_makeaddr), ioext.c (scm_ftell): Changed @smalllisp ... @end smalllisp to @lisp ... @end lisp. * vports.c (scm_make_soft_port), version.c (scm_version), unif.c (scm_array_dimensions, scm_make_shared_array), (scm_transpose_array, scm_enclose_array, scm_bit_count_star), throw.c (scm_catch), struct.c (scm_make_vtable_vtable), strop.c (scm_string_rindex, scm_string_index, scm_substring_fill_x), (scm_string_null_p), strings.c (scm_read_only_string_p), root.c (scm_call_with_dynamic_root), ramap.c (scm_array_index_map_x), posix.c (scm_mknod), numbers.c (scm_logtest, scm_logbit_p), macros.c (scm_makmmacro), list.c (scm_append), environments.c (scm_environment_fold), dynwind.c (s_scm_dynamic_wind): Changed @example ... @end example to @lisp ... @end lisp. * weaks.c (scm_weak_vector): Corrected docstring. * hashtab.c (scm_hashq_ref, scm_hashq_set_x, scm_hashq_remove_x), (scm_hashv_ref, scm_hashv_set_x, scm_hashv_remove_x), (scm_hash_ref, scm_hash_set_x, scm_hash_remove_x, scm_hashx_ref), (scm_hashx_set_x, scm_hashx_get_handle), (scm_hashx_create_handle_x), regex-posix.c (scm_make_regexp), (scm_regexp_exec, scm_regexp_p), numbers.c (scm_logtest), vectors.c (scm_vector_fill_x), strings.c (scm_make_shared_substring), symbols.c (scm_string_to_symbol), objprop.c (scm_set_object_properties_x): (scm_set_object_property_x), throw.c (scm_catch, scm_lazy_catch), strports.c (scm_call_with_input_string), ports.c (scm_truncate_file), ioext.c (scm_ftell), ports.c (scm_seek), list.c (scm_append_x), dynwind.c (scm_dynamic_wind), error.c (scm_error_scm), vports.c (scm_make_soft_port), weaks.c (scm_make_weak_vector,scm_weak_vector_p), (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table), (scm_make_doubly_weak_hash_table, scm_weak_key_hash_table_p), (scm_weak_value_hash_table_p, scm_doubly_weak_hash_table_p), macros.c (scm_macro_type), dynl.c (scm_dynamic_link), (scm_dynamic_unlink, scm_dynamic_call, scm_dynamic_args_call): Made parameter names match documentation by renaming parameters and/or fixing docstrings. * numbers.c (scm_ash): Corrected Texinfo markup. * strop.c (scm_string_index, scm_string_rindex), (scm_substring_fill_x, scm_string_null_p): Removed `qdocs'. * vports.c (scm_make_soft_port), unif.c (scm_uniform_vector_length, scm_array_p, scm_array_rank), (scm_dimensions_to_uniform_array, scm_transpose_array), (scm_array_in_bounds_p, scm_uniform_vector_ref), (scm_bit_count, scm_bit_position, scm_bit_count_star), (scm_array_to_list, scm_list_to_uniform_array), (scm_array_prototype, symbols.c (scm_string_to_symbol), strports.c (scm_open_input_string, scm_open_output_string), (scm_get_output_string), strop.c (scm_string_copy), (scm_string_fill_x), strings.c (scm_string_p, scm_string), stime.c (scm_get_internal_real_time, scm_times), (scm_get_internal_run_time, scm_current_time, scm_gettimeofday), (scm_localtime, scm_gmtime), socket.c (scm_htons, scm_ntohs), (scm_htonl, scm_ntohl, scm_socket, scm_socketpair), (scm_getsockopt, scm_getsockname, scm_getpeername, scm_recvfrom), simpos.c (scm_system), random.c (scm_random_uniform), (scm_random_normal, scm_random_exp), ramap.c (scm_array_equal_p), posix.c (scm_pipe, scm_getgroups), (scm_status_exit_val, scm_status_term_sig, scm_status_stop_sig), (scm_getppid, scm_getuid, scm_getgid, scm_geteuid, scm_getegid), (scm_getpgrp, scm_ttyname, scm_ctermid, scm_tcgetpgrp, scm_uname), (scm_environ, scm_tmpnam, scm_mkstemp, scm_access, scm_getpid), (scm_setlocale), ports.c (scm_char_ready_p, scm_drain_input), (scm_pt_size, scm_pt_member, scm_port_revealed, scm_port_mode), (scm_close_port, scm_input_port_p, scm_output_port_p, scm_port_p), (scm_port_closed_p, scm_eof_object_p, scm_read_char), (scm_peek_char), pairs.c (scm_pair_p, scm_cons), numbers.c (scm_logand, scm_logior, scm_logxor, scm_lognot), (scm_integer_expt, scm_bit_extract, scm_logcount), (scm_integer_length, scm_string_to_number, scm_inexact_to_exact), net_db.c (scm_inet_netof, scm_lnaof), modules.c (scm_interaction_environment), macros.c (scm_makacro), (scm_makmacro, scm_makmmacro), keywords.c (scm_keyword_p), ioext.c (scm_ftell, scm_dup_to_fdes, scm_fileno, scm_isatty_p), (scm_fdopen, scm_fdes_to_ports), gc.c (scm_gc_stats), fluids.c (scm_fluid_ref), filesys.c (scm_open_fdes), (scm_stat, scm_directory_stream_p, scm_getcwd, scm_readlink): Docstring correction: `Returns' -> `Return' * gc.c (scm_set_debug_cell_accesses_x): (s_scm_gc_set_debug_check_freelist_x): * fluids.c (scm_fluid_p): Added texinfo markup. * error.c (scm_strerror): Made docstring more precise. * vectors.c (scm_vector_p, scm_vector, scm_make_vector), (scm_vector_to_list, _scm_vector_fill_x), symbols.c (scm_symbol_p, scm_symbol_to_string), strorder.c (scm_string_equal_p, scm_string_ci_equal_p, scm_string_less_p), (scm_string_leq_p, scm_string_gr_p, scm_string_geq_p), (scm_string_ci_less_p, scm_string_ci_leq_p, scm_string_ci_gr_p): (scm_string_ci_geq_p), strop.c (scm_string_copy), (scm_string_fill_x): Removed `(r5rs)' from docstrings. 2001-04-01 Dirk Herrmann * gc.c (MARK): Re-introduce a cheap sanity test for non debug mode, as suggested by Michael Livshin. 2001-03-31 Michael Livshin * backtrace.c (display_backtrace_body): since the `print_state' variable is not used (instead its data field is used directly as `pstate'), protect it from the hungry compiler optimizations. thanks to Bill Schottstaedt for the report. 2001-03-30 Dirk Herrmann * gc.[ch] (scm_tc16_allocated): New type tag for allocated cells. It is only defined and used if guile is compiled with SCM_DEBUG_CELL_ACCESSES set to true. It's purpose is, to never let cells with a free_cell type tag be visible outside of the garbage collector when in debug mode. * gc.c (scm_debug_cell_accesses_p): Set to true as default. (scm_assert_cell_valid): Use a local static variable to avoid recursion. (MARK): Only check for rogue cell pointers in debug mode. Use scm_cellp for this purpose and place all checks for rogue pointers into that function. Further, since due to conservative scanning we may encounter free cells during marking, don't use the standard cell type accessor macro to determine the cell type. (scm_cellp): Check if the cell pointer actually points into a card header. (scm_init_gc): Initalize scm_tc16_allocated. * gc.h (GCH): Renamed to SCM_GC_H. (SCM_VALIDATE_CELL): Enclose the expression in brackets. This might be unnecessary, but I feel better this way :-) (SCM_GC_CELL_TYPE): New macro. (SCM_SETAND_CDR, SCM_SETOR_CDR): Deprecated. These are not used in guile, and it is unlikely that they will be applied to real pairs anyway. (SCM_SET_FREE_CELL_TYPE): Removed. It was not used. (SCM_GC_SET_ALLOCATED): New macro. Only non-empty if guile is compiled with SCM_DEBUG_CELL_ACCESSES set to true. (SCM_NEWCELL, SCM_NEWCELL2): Use of SCM_GC_SET_ALLOCATED will make sure that in debug mode no free cell will ever be visible outside of the garbage collector. 2001-03-30 Dirk Herrmann * async.c (scm_asyncs_pending): Don't use != to compare SCM values. * async.c (scm_system_async), variable.c (scm_make_variable, scm_make_undefined_variable): Use scm_cons to create a pair. * debug.c (scm_reverse_lookup): Perform proper type checking. Remove suspicious use of SCM_SLOPPY_CONSP. * eq.c (scm_equal_p), tags.h (SCM_ECONSP): Use SCM_CONSP instead of SCM_SLOPPY_CONSP. A sane compiler should be able to perform the corresponding optimization. * eval.c (iqq): Use proper type check. (scm_m_expand_body): Remove redundant type checks. (promise_print): Don't access promise cells as pairs. * eval.c (EVALCAR, iqq, scm_m_expand_body, scm_eval_args, scm_deval_args SCM_CEVAL), guardians.c (scm_guard), hashtab.c (scm_internal_hash_fold), print.c (scm_iprlist): Use !SCM_CELLP for SCM_NCELLP, !SCM_CONSP for SCM_NCONSP, !SCM_IMP for SCM_NIMP, !SCM_FALSEP for SCM_NFALSEP, !SCM_NULLP for SCM_NNULLP * eval.c (scm_m_define, scm_macroexp, SCM_CEVAL), print.c (scm_iprin1): Use new macro predicate and accessors. * eval.h (scm_tc16_macro): Removed declaration. It is declared in macros.h. * eval.h (EVALH), macros.h (MACROSH), ports.h (PORTSH), procs.h (PROCSH), tags.h (TAGSH), variable.h (VARIABLEH): Renamed to SCM_EVAL_H, SCM_MACROS_H, SCM_PORTS_H, SCM_PROCS_H, SCM_TAGS_H and SCM_VARIABLE_H. Even the macros that are used to inhibit including a header file twice should be in the SCM_ namespace. * fluids.c (scm_swap_fluids, scm_swap_fluids_reverse), properties.c (scm_primitive_property_ref, scm_primitive_property_del_x): Prefer stronger predicates like SCM_NULLP or SCM_FALSEP over SCM_IMP. * gc.c (MARK): Use proper macros to access procedure-with-setter cell elements and closure cell elements. (gc_sweep_freelist_finish, scm_gc_sweep, init_heap_seg): Don't access free cells as pairs. (scm_unprotect_object): scm_hashq_get_handle returns #f if no hashtab entry is found. * gc.c (scm_gc_sweep), ports.c (scm_close_port): Use new macro SCM_CLR_PORT_OPEN_FLAG. * guardians.c (TCONC_IN), print.c (scm_free_print_state): Don't use SCM_SET_C[AD]R for uninitialized cells. * hashtab.c (scm_hash_fn_get_handle): Use SCM_VALIDATE_VECTOR. If the hashtable has no slots, return #f instead of '(). This unifies the return value with most assoc-functions. (scm_hash_fn_ref): Use proper type check. (scm_hashq_get_handle, scm_hashv_get_handle, scm_hash_get_handle): Removed references to non-existing functions from documentation. * keywords.c (scm_keyword_dash_symbol): Use proper macros to access keyword cell elements. * macros.h (SCM_MACROP, SCM_MACRO_TYPE, SCM_MACRO_CODE): New macros. * ports.h (SCM_CLR_PORT_OPEN_FLAG): New macro. * print.c (scm_iprlist): Added comment. Improved loop conditions. * procs.h (SCM_ENV, SCM_SETENV): Don't access closure cells as pairs. * smob.c (scm_markcdr): Don't access smob cells as pairs. * tags.h (SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP): Deprecated. * throw.c (ACTIVATEJB, DEACTIVATEJB): Don't access jump buffer cells as pairs. * variable.c (variable_print, variable_equalp, scm_variable_ref, scm_variable_set_x): Use proper macros to access variable cell elements. (scm_variable_bound_p): Don't use SCM_NEGATE_BOOL. * variable.h (SCM_VARVCELL): Don't access variable cells as pairs. * vectors.c (scm_vector), weaks.c (scm_weak_vector): Simplified, added FIXME comment, removed register specifier. 2001-03-29 Keisuke Nishida * goops.c, goops.h (scm_init_oop_goops_goopscore_module): Deprecated. * init.c (scm_init_guile_1): Don't init goopscore module. 2001-03-27 Marius Vollmer * eval.c (SCM_APPLY): Check that arg1 is bound for scm_tc7_cxr. 2001-03-27 Martin Grabmueller * strop.c (scm_string_to_list): Fixed docstring markup. (scm_string_upcase_x, scm_string_upcase, scm_string_downcase_x), (scm_string_downcase, scm_string_capitalize_x), (scm_string_capitalize): Rewrote and corrected docstrings. (scm_string_ci_to_symbol): Made docstring more explicit. 2001-03-27 Marius Vollmer * values.h (scm_values_vtable, SCM_VALUESP): Moved here so that eval.c can use it. (scm_call_with_values): Removed. * values.c (values_vtable, scm_values_vtable): Added "scm_" prefix so that it can be exported. (scm_call_with_values): Removed. * tags.h (SCM_IM_CALL_WITH_VALUES): New isym. * eval.c: Include "libguile/values.h" (scm_m_at_call_with_values, scm_sym_at_call_with_values): New. (unmemocopy, scm_ceval, scm_deval): Handle new isym. * eval.h (scm_sym_at_call_with_values, scm_m_at_call_with_values): New delcarations to support above change. * eval.c (scm_primitive_eval_x, scm_primitive_eval): Fix syntax errors with last change. 2001-03-25 Marius Vollmer * eval.c (scm_primitive_eval_x, scm_primitive_eval, scm_i_eval_x, scm_i_eval): Moved the application of the system transformer from scm_i_eval to scm_primitive_eval. 2001-03-23 Neil Jerram * guile-snarf.awk.in: Substitute "\\" with "\" in .doc output. * strop.c (scm_string_index): Fix docstring line break regression. * list.c (scm_cons_star): Fix docstring typo. 2001-03-22 Dirk Herrmann * gc.c (scm_init_storage), gdbint.c (scm_init_gdbint), numbers.c (big2str), ports.c (scm_drain_input), read.c (scm_read, scm_grow_tok_buf), strings.c (scm_string, scm_makfromstr, scm_make_string, scm_string_append), strports.c (st_resize_port, scm_object_to_string), unif.c (scm_make_uve): Replace calls to scm_makstr with calls to scm_allocate_string. * strings.[ch] (scm_allocate_string): New function. * strings.[ch] (scm_makstr): Deprecated. 2001-03-18 Gary Houston * posix.c (scm_tmpnam): check that return value from tmpnam is not NULL. rewrote the docstring. (scm_mkstemp): new procedure implementing "mkstemp!". * posix.h: declare scm_mkstemp. * net_db.c: declare h_errno if configure didn't define HAVE_H_ERRNO. normally it would be found in netdb.h. 2001-03-17 Gary Houston * sort.c (scm_sort): move sortvec variable to avoid a compiler warning when HAVE_ARRAYS is not defined. move len too. * Makefile.am (DOT_X_FILES): remove net_db.x, posix.x, socket.x. (EXTRA_DOT_X_FILES): let configure set the value. (DOT_DOC_FILES): remove net_db.doc, posix.doc, socket.doc. * gc.c (scm_must_malloc): changed the comment explaining when scm_must variants of malloc/free etc., should be used, based on explanation from Dirk Herrmann. * fports.c (scm_fport_buffer_add): use FUNC_NAME instead of a local string with procedure name. use scm_must_malloc instead of malloc. (scm_setvbuf, scm_fdes_to_port, fport_close): use scm_must variants of malloc/free. * ports.c (scm_add_to_port_table, scm_remove_from_port_table, scm_ungetc): use scm_must variants of malloc/realloc/free. (scm_add_to_port_table, scm_ungetc): define FUNC_NAME. 2001-03-17 Dirk Herrmann * __scm.h (SCM_ASSERT, SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1, SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_n): Don't call scm_wta, call scm_wrong_type_arg instead. (SCM_WNA): Deprecated. * error.[ch] (scm_wta): Deprecated. * numbers.c (s_i_log): Minor comment fix. * read.c (scm_lreadr), unif.c (scm_aind, scm_shap2ra, scm_make_shared_array, scm_transpose_array, scm_enclose_array, scm_array_in_bounds_p): Don't use SCM_ASSERT to check for wrong-num-args or misc errors. * unif.c (scm_make_shared_array, scm_transpose_array, scm_enclose_array, scm_array_in_bounds_p, scm_array_set_x): Validate the rest argument (note: this is only done when guile is built with SCM_DEBUG_REST_ARGUMENT=1) (scm_array_in_bounds_p, scm_uniform_vector_ref, scm_array_set_x): Replace calls to scm_wrong_num_args by SCM_WRONG_NUM_ARGS. * validate.h (SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY, SCM_VALIDATE_NUMBER_DEF_COPY): Deprecated. 2001-03-17 Dirk Herrmann * validate.h (SCM_WRONG_NUM_ARGS): Call scm_error_num_args_subr instead of scm_wrong_num_args. * coop-threads.c: Don't include libguile/strings.h. (Was only needed for former implementation of SCM_WRONG_NUM_ARGS.) * debug.c (scm_m_start_stack): Don't use SCM_ASSERT to check for wrong-num-args errors. 2001-03-17 Dirk Herrmann * error.[ch] (scm_error_num_args_subr): New function. 2001-03-16 Martin Grabmueller * list.c (scm_list, scm_cons_star, scm_null_p, scm_list_p), (scm_length, scm_append, scm_reverse, scm_list_ref), (scm_memq, scm_memv, scm_member, scm_delv_x, scm_delete_x), (scm_delq, scm_delv, scm_delete, scm_delq1_x, scm_delv1_x), (scm_delete1_x), gc.c (scm_map_free_list), (scm_free_list_length), hash.c (scm_hashq, scm_hashv), (scm_hash), hashtab.c (scm_hashq_ref, scm_hashq_set_x), (scm_hashq_remove_x, scm_hashv_ref, scm_hashv_set_x), (scm_hashv_remove_x, scm_hash_ref, scm_hash_set_x), (scm_hash_remove_x), ports.c (scm_pt_size, scm_pt_member), print.c (scm_current_pstate), scmsigs.c (scm_usleep), goops.c (scm_get_keyword, scm_sys_compute_slots): Added texinfo markup. * weaks.c (scm_weak_vector_p, scm_weak_key_hash_table_p), (scm_weak_value_hash_table_p, scm_doubly_weak_hash_table_p), rdelim.c (scm_read_delimited_x), strop.c (scm_string_index), symbols.c (scm_symbol_interned_p), numbers.c (scm_string_to_number), ports.c (scm_port_p): Corrected texinfo markup. 2001-03-16 Keisuke Nishida * snarf.h (SCM_CONST_LONG): Deprecated. * tag.c (CONST_INUM): New macro. Use it to define scm_utag_*. 2001-03-15 Marius Vollmer * numbers.c (scm_num2ulong): Check that a bignum is positive before looking at the magnitude. Correctly check for overflow during conversion. (scm_num2long_long): Likewise. (scm_num2ulong_long): New. (ULONG_LONG_MAX): Define if not already defined. * numbers.h: (scm_num2ulong_long): New prototype. 2001-03-15 Martin Grabmueller * validate.h (SCM_VALIDATE_OPOUTSTRPORT): New macro. * strports.h (SCM_STRPORTP, SCM_OPSTRPORTP, SCM_OPINSTRPORTP), (SCM_OPOUTSTRPORTP): New predicate macros. (scm_open_input_string, scm_open_output_string), (scm_get_output_string): New prototypes. * strports.c (scm_open_input_string, scm_open_output_string), (scm_get_output_string): New procedures (SRFI-6 compliant). Made scm_tc16_strport non-static. 2001-03-15 Dirk Herrmann * macros.h (SCM_ASSYNT): Removed unused object argument from signature. * eval.c (scm_m_body, scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and, scm_m_or, scm_m_case, scm_m_cond, scm_m_letstar, scm_m_do, scm_m_quasiquote, scm_m_delay, scm_m_define, scm_m_letrec1, scm_m_letrec, scm_m_let, scm_m_apply, scm_m_cont, scm_m_nil_cond, scm_m_nil_ify, scm_m_t_ify, scm_m_0_cond, scm_m_0_ify, scm_m_1_ify, scm_m_atfop, scm_m_atbind, scm_m_expand_body), evalext.c (scm_m_generalized_set_x, scm_m_undefine), goops.c (scm_m_atslot_ref, scm_m_atslot_set_x, scm_m_atdispatch): Removed unused object argument from call to SCM_ASSYNT. 2001-03-15 Dirk Herrmann * gh.h/gh_data.c (gh_ints2scm): Changed the signature to use a const int* to reflect that the input array of integers remains unchanged. Thanks to Brett Viren for the hint. 2001-03-14 Martin Grabmueller * gh_data.c (gh_scm2chars, gh_scm2shorts, gh_scm2longs), (gh_scm2floats, gh_scm2doubles): Check for malloc() returning NULL in various places. (gh_scm2newstr, gh_symbol2newstr): Change call to scm_must_malloc() to malloc(), because user-free()able memory is allocated. * gc.c: Added declaration of `scm_debug_check_freelist'. 2001-03-13 Martin Grabmueller * ports.c (scm_port_mode): Changed `mode' array size to 4. 2001-03-12 Keisuke Nishida * strports.c (scm_object_to_string): New procedure. (scm_strprint_obj): Deprecated. * strports.h: Reflect the changes. 2001-03-12 Dirk Herrmann * goops.h (SCM_VALIDATE_PUREGENERIC): New macro. * goops.c (scm_m_atslot_ref, scm_m_atslot_set_x, scm_m_atdispatch): Provide definitions for FUNC_NAME. Don't use SCM_ASSYNT to check for correct argument types. Either use some SCM_VALIDATE_* macro or an explicit test. (scm_make_foreign_object): Don't use SCM_ASSERT to check for misc-errors. * macros.h (SCM_ASSYNT): On assertion failure, issue a misc-error instead of calling scm_wta. 2001-03-12 Martin Grabmueller * load.c (scm_primitive_load, scm_primitive_load_path), (scm_sys_search_load_path): Corrected docstrings (file -> filename). * eval.c (scm_force): Added texinfo markup to docstring. (scm_promise_p): Renamed parameter to `obj' to match docstring. * debug-malloc.c: Reinserted #include . 2001-03-11 Keisuke Nishida * list.c (s_scm_reverse_x): Use SCM_VALIDATE_LIST. * environments.c, error.c, eval.c, filesys.c, hashtab.c, load.c, net_db.c, procprop.c, read.c, scmsigs.c, socket.c, struct.c: Use SCM_LISTn instead of scm_listify. 2001-03-10 Mikael Djurfeldt * _scm.h: Removed #include . * error.c, net_db.c, putenv.c, stime.c: Removed declaration of errno variable (can be a macro on some systems, for example when using linux libc with threads). * error.c, filesys.c, gc.c, ioext.c, iselect.c, net_db.c, ports.c, posix.c, print.c, putenv.c, scmsigs.c, script.c, simpos.c, smob.c, socket.c, srcprop.c, stime.c, strop.c, unif.c, vports.c: Added #include in these 20 out of 100 files. 2001-03-10 Gary Houston * socket.c: add a definition of SUN_LEN (from glibc) for when it's not already defined. 2001-03-09 Mikael Djurfeldt * coop.c: Inserted #include . * iselect.c: Reinserted #include . 2001-03-10 Marius Vollmer * posix.c: Replaced `#define' of __USE_XOPEN right before including unistd.h with a define of _GNU_SOURCE at the very top of the file. 2001-03-09 Keisuke Nishida * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c, continuations.c, debug-malloc.c, debug.c, dynwind.c, eq.c, eval.c, feature.c, filesys.h, gc_os_dep.c, gh_data.c, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c, gh_predicates.c, hash.c, hashtab.c, iselect.c, keywords.c, list.c, load.c, mallocs.c, net_db.c, numbers.c, objprop.c, objprop.h, options.c, pairs.c, print.c, procprop.c, procs.c, properties.c, ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c, srcprop.c, stackchk.c, stacks.c, strings.c, strop.c, strorder.c, struct.c, symbols.c, tag.c, threads.c, variable.c, vectors.c, weaks.c: Remove #include * gc.c, gdbint.c, root.c, sort.c, unif.c: Add #include . * procs.c (scm_make_subr_opt): Init symcell to avoid warning. 2001-03-09 Martin Grabmueller * posix.c (scm_gethostname): Set initial name length to 256 for Solaris. 2001-03-09 Martin Grabmueller * posix.h (scm_crypt, scm_chroot, scm_getlogin, scm_cuserid), (scm_getpriority, scm_setpriority, scm_getpass, scm_flock), (scm_sethostname, scm_gethostname): New prototypes. * posix.c: Added inclusion of , and , if present. (scm_init_posix): [PRIO_PROCESS, PRIO_PGRP, PRIO_USER, LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB]: New variables. (scm_crypt, scm_chroot, scm_getlogin, scm_cuserid), (scm_getpriority, scm_setpriority, scm_getpass, scm_flock), (scm_sethostname, scm_gethostname): New procedures. 2001-03-08 Neil Jerram * ports.c (scm_port_column): Docstring fixes: (i) port-line arg is not optional (ii) "recommend" spelling correction. 2001-03-08 Mikael Djurfeldt * ramap.c (racp): Removed optimization which caused array copying to fail if the two arrays shared storage. Re-inserted the IVDEP macros removed in the change of 2000-03-09. (Don't really have a complete grasp of what they are for, but they seem to be necessary on Crays. This needs testing!) Thanks to Miroslav Silovic. * hash.c (scm_string_hash): Don't downcase characters. 2001-03-07 Mikael Djurfeldt * symbols.c (scm_symbols_prehistory): Changed symbol hash table size from 277 --> 1009. * symbols.c, symbols.h (scm_sys_symbols): New function GUILE_DEBUG function. * coop-threads.c: Fixed change of 2001-03-06. * validate.h: Code formatting. 2001-03-07 Keisuke Nishida * Makefile.am (*.x): Add dependency on snarf.h and guile-doc-snarf.in. (*.doc): Add dependency on guile-snarf.awk.in. * guile-snarf.awk.in: Neglect spaces at the end of SCM_SNARF_DOCSTRING_END. Skip lines "# NN ..." in the middle of docstrings. (To avoid the problem with gcc-2.96.) 2001-03-06 Dirk Herrmann * coop-threads.c (scm_call_with_new_thread), load.c (scm_primitive_load, scm_sys_search_load_path), random.c (scm_c_default_rstate), struct.c (scm_make_struct_layout, scm_struct_ref, scm_struct_set_x): Don't use SCM_ASSERT to (potentially) issue a scm-misc-error or wrong-num-args error message. * load.c (scm_search_path): Use SCM_ASSERT_TYPE to give details about the expected type with the wrong-type-arg error message. * smob.c (scm_make_smob): Abort on misuse of smob - it indicates a C level bug that can't be fixed from scheme anyway. 2001-03-05 Mikael Djurfeldt * eval.c (scm_m_letstar): Removed check for duplicate bindings. Duplicate bindings are OK in a let* since a let* is semantically equivalent to a nested set of let:s. 2001-03-05 Martin Grabmueller * print.c (scm_print_options): Fixed texinfo in docstring. * net_db.c (scm_getserv, scm_getproto, scm_getnet): Return #f if the underlying functions getservent, getprotoent or getnetent return NULL instead of signalling an error. 2001-03-04 Gary Houston * socket.c (scm_fill_sockaddr): don't allow buffer overflows when taking an unexpectedly large filename for an AF_UNIX socket from bind/connect/sendto (thanks to Martin Grabmueller). * socket.c (scm_sock_fd_to_port, SCM_SOCK_FD_TO_PORT): removed the former and adjusted the latter. (scm_socket, scm_socketpair): cosmetic changes. (scm_getsockopt, scm_setsockopt): declare optlen as int, not size_t as socklen_t substitute. don't restrict args/return values to INUM: allow full range of int or size_t. (scm_fill_sockaddr): check arguments before allocating memory, to avoid leakage. use malloc, not scm_must_malloc. (scm_connect, scm_bind, scm_sendto): use int, not size_t as socklen_t substitute. free the sockaddr structure before throwing an error. (scm_init_add_buffer): procedure removed, together with its static buffer scm_addr_buffer, which wouldn't be thread safe. instead, define a macro MAX_ADDR_SIZE and declare the buffer where needed. (scm_accept, scm_getpeername, scm_getsockname, scm_recvfrom, scm_sendto): use a local buffer instead of scm_addr_buffer. adjust for new SCM_SOCK_FD_TO_PORT. use int for address size, not size_t. (scm_recvfrom): set addr->sa_family to AF_UNSPEC before the recvfrom call to detect whether recvfrom could be bothered to set the address. (scm_init_socket): don't call scm_init_addr_buffer. 2001-03-04 Dirk Herrmann * debug.c (scm_procedure_source, scm_procedure_environment), print.c (scm_get_print_state), ramap.c (scm_array_fill_int, scm_array_index_map_x), sort.c (scm_sort_x, scm_sort, scm_stable_sort_x, scm_stable_sort), stacks.c (scm_make_stack, scm_last_stack_frame), symbols.c (scm_sym2vcell, scm_sym2ovcell), unif.c (scm_list_to_uniform_array, scm_uniform_vector_length, scm_transpose_array, scm_enclose_array, scm_array_in_bounds_p, scm_uniform_vector_ref, scm_array_set_x, scm_uniform_array_read_x, scm_uniform_array_write, scm_bit_set_star_x, scm_bit_count_star, scm_array_to_list, scm_array_prototype), validate.h (SCM_VALIDATE_NUMBER_COPY): Don't call function scm_wta, call scm_misc_error or scm_wrong_type_arg instead. * validate.h (SCM_WTA, RETURN_SCM_WTA): Deprecated. 2001-03-04 Mikael Djurfeldt * goops.c, goops.h (scm_sys_pre_expand_closure_x): Removed. (scm_sys_tag_body): Added. 2001-03-04 Dirk Herrmann * continuations.c (continuation_apply), eval.c (scm_m_lambda, scm_m_letstar, scm_m_letrec1, scm_m_let, SCM_APPLY), eval.h (SCM_EVALIM2), evalext.c (scm_m_generalized_set_x), gc.c (get_bvec, MARK), goops.c (scm_primitive_generic_generic), options.c (scm_options), ports.c (scm_remove_from_port_table), ramap.c (scm_ramapc), read.c (skip_scsh_block_comment, scm_lreadr, scm_lreadparen, scm_lreadrecparen), script.c (script_get_octal, script_get_backslash, script_read_arg), unif.c (scm_cvref): Don't call function scm_wta, call scm_misc_error or scm_wrong_type_arg instead. 2001-03-04 Mikael Djurfeldt * goops.c (scm_sys_pre_expand_closure_x): New procedure. 2001-03-04 Marius Vollmer * eval.c (scm_s_duplicate_bindings): New error message. (scm_m_letrec1, scm_m_letstar): Check for duplicate bindings. 2001-03-03 Marius Vollmer * eval.h (SCM_EVALIM2): New macro. Use it when a immediate, literal constant should be evaluated. * eval.c (scm_s_duplicate_formals): New error message string. (scm_c_improper_memq): New function. (scm_m_lambda): Check for duplicate arguments. (scm_ceval, scm_deval): When executing a body: only cons a new toplevel environment frame when it is different from the existing one; use EVALCAR instead of SIDEVAL so that we can properly check for empty combinations; use SCM_EVALIM2 for the same reason in the non-toplevel loop. (nontoplevel_cdrxnoap, nontoplevel_cdrxbegin, nontoplevel_begin): New labels with the meaning of their non-"nontoplevel" partners, but they are used when it is known that the body is not evaluated at top-level. (scm_apply, scm_dapply): use SCM_EVALIM2 to get proper error reporting for empty combinations. 2001-03-02 Keisuke Nishida * Remove dump facilities. * dump.c, dump.h: Removed. * Makefile.am: Remove dump.c, dump.h, dump.x, dump.doc. * init.c: Remove #include "libguile/dump.h". (scm_init_guile_1): Remove scm_init_dump. * smob.h (scm_smob_descriptor): Remove slots: dump, undump. (scm_set_smob_dump, scm_set_smob_undump): Remove declaration. * smob.c (scm_make_smob_type): Remove initialization: dump, undump. (scm_set_smob_dump, scm_set_smob_undump): Removed. * keywords.c: Remove #include "libguile/dump.h". (keyword_dump, keyword_undump): Removed. (scm_init_keywords): Remove scm_set_smob_dump and scm_set_smob_undump. 2001-03-02 Martin Grabmueller * vectors.c (s_scm_vector_p, list->vector, scm_vector) (scm_vector_ref, scm_vector_set_x, scm_vector_to_list) (scm_vector_fill_x), strorder.c (scm_string_equal_p) (scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p) (scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p) (scm_string_ci_geq_p), symbols.c (scm_symbol_p) (scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{} to @code{} as the texinfo manual recommends, converted the examples to use a @lisp{}-environment. * strports.c (scm_eval_string): Cleaned up the docstring. * struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo markup. * numbers.c (scm_exact_p, scm_odd_p, scm_even_p) (scm_number_to_string, scm_string_to_number, scm_number_p) (scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular) (scm_make_polar, scm_inexact_to_exact): Added texinfo markup. (scm_ash): Added texinfo markup and removed obsolete @refill. (scm_gr_p): Corrected comment. (scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future docstring) comments. (scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p) (scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum) (scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh) (scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact) (floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin) ($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part) (scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder) (scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments. 2001-02-28 Dirk Herrmann * __scm.h (SCM_ASSERT_TYPE): Add missing macro parameter. (Obviously nobody compiles with SCM_RECKLESS defined...) * validate.h (SCM_ASSERT_RANGE): Use the argument number. 2001-02-23 Mikael Djurfeldt * ports.c, ports.h (scm_c_read, scm_c_write): New functions. * ports.h (SCM_READ_BUFFER_EMPTY_P): New macro. 2001-02-24 Neil Jerram * numbers.c (scm_two_doubles, scm_sys_expt, scm_sys_atan2, scm_make_polar): Rename arguments `z1' and `z2' to `x' and `y', since use of `z' suggests that the arguments may be complex. * goops.c (scm_make), numbers.c (scm_sys_expt): Fix docstring typos. 2001-02-23 Neil Jerram * dump.c (scm_binary_write, scm_binary_read), eval.c (scm_primitive_eval), guardians.c (scm_guardian_destroyed_p, scm_guardian_greedy_p, scm_make_guardian), fports.c (scm_file_port_p): Minor docstring fixes. 2001-02-22 Marius Vollmer * load.c (load): Use scm_primitive_eval_x instead of scm_i_eval_x. * goops.c (scm_add_method, DEFVAR): Use scm_eval instead of scm_i_eval. (make_class_from_template): Do not bother to set the current module around the call to DEFVAR, scm_eval takes care of that. (scm_init_goops): Make scm_module_goops and scm_goops_lookup_closure permanent objects. * eval.c (scm_ceval, scm_deval): When evaluating expressions on top level, create a fresh top-level environment for each expression instead of mutating the exisint frame. This is important when that frame is closed over. * numbers.c (s_scm_logior) [SCM_DIGSTOOBIG]: Also use SCM_DIGSPERLONG instead of DIGSPERLONG. 2001-02-21 Marius Vollmer * eval.c (scm_ceval, scm_deval): Check for wrong number of args before applying arrow procedure in `cond' and before applying receiver procedure in call-with-current-continuation. (scm_i_eval): Do not invoke scm_copy_tree in argument in SCM_XEVAL macro. The argument is expanded more than one time. * numbers.c (scm_logior) [SCM_DIGSTOOBIG]: Correctly use SCM_BIGDIG instead of BIGDIG. Thanks to Steven G. Johnson! 2001-02-20 Marius Vollmer * guile-doc-snarf.in, guile-func-name-check.in: Added copyright notice and license. 2001-02-17 Martin Grabmueller * variable.c (scm_make_variable, scm_make_undefined_variable) (scm_variable_ref, scm_variable_set_x, scm_builtin_variable) (scm_variable_bound_p), values.c (scm_values) (scm_call_with_values), unif.c (scm_bit_count) (scm_bit_set_star_x), symbols.c (scm_gentemp) (scm_gensym), strings.c (scm_string_p, scm_make_string) (scm_read_only_string_p, scm_string_length, scm_string_ref) (scm_string_set_x, scm_substring, scm_string_append), stime.c (scm_strptime, scm_mktime), random.c (scm_seed_to_random_state) (scm_copy_random_state, scm_random), print.c (scm_newline) (scm_write_char, scm_simple_format), debug-malloc.c (scm_malloc_stats), environments.c (scm_environment_p) (scm_environment_bound_p, scm_environment_ref) (scm_environment_fold, scm_environment_define) (scm_environment_undefine, scm_environment_set_x) (scm_environment_cell, scm_environment_observe) (scm_environment_observe_weak, scm_environment_unobserve) (scm_make_eval_environment, scm_eval_environment_p) (scm_eval_environment_set_local_x, scm_eval_environment_local) (scm_eval_environment_imported) (scm_eval_environment_set_imported_x, scm_make_import_environment) (scm_import_environment_p, scm_import_environment_imports) (scm_import_environment_set_imports_x, scm_make_export_environment) (scm_export_environment_p, scm_export_environment_private) (scm_export_environment_set_private_x) (scm_export_environment_signature) (scm_export_environment_set_signature_x, scm_leaf_environment_p): Added texinfo markup. * ports.c (scm_drain_input): Lowercased argument to @var. (scm_current_input_port, scm_current_output_port): Filled in missing explanation. (scm_current_load_port, scm_set_current_output_port) (scm_set_current_error_port, scm_port_line, scm_set_port_line_x): Added texinfo markup. * arbiters.c (scm_make_arbiter, scm_try_arbiter) (scm_release_arbiter): Added texinfo markup to docstrings. Changed `Returns' to `Return'. (arbiter_print): Changed SCM_CDR to SCM_SMOB_DATA. 2001-02-16 Neil Jerram * guile-snarf.awk.in: Quote any `@'s that occur in Scheme names, by doubling them to `@@'. 2001-02-16 Martin Grabmueller * numbers.c (scm_lognot), random.c (scm_random, scm_random_normal, scm_random_solid_sphere_x, scm_random_hollow_sphere_x, scm_random_normal_vector_x, scm_random_exp), dynwind.c (scm_dynamic_wind): Removed unnecessary "" from docstrings. * goops.c (scm_sys_initialize_object, scm_instance_p, scm_class_name, scm_class_precedence_list, scm_class_slots, scm_class_environment, scm_generic_function_name, scm_generic_function_methods, scm_method_generic_function, scm_method_specializers, scm_method_procedure, scm_make_unbound, scm_unbound_p, scm_assert_bound, scm_at_assert_bound_ref, scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x, scm_slot_ref, scm_slot_set_x, _scm_slot_bound_p, scm_slots_exists_p, scm_sys_allocate_instance, scm_make, scm_pure_generic_p, scm_class_direct_supers, scm_class_direct_slots, scm_class_direct_subclasses, scm_class_direct_methods, scm_accessor_method_slot_definition, scm_sys_goops_loaded), debug.c (scm_with_traps, scm_memoized_p, scm_make_gloc, scm_gloc_p, scm_make_iloc, scm_iloc_p, scm_memcons, scm_mem_to_proc, scm_proc_to_mem, scm_unmemoize, scm_memoized_environment, scm_procedure_name, scm_procedure_source, scm_procedure_environment, scm_debug_hang), objects.c (scm_class_of, scm_entity_p, scm_operator_p, scm_set_object_procedure_x, scm_object_procedure, scm_make_class_object), hooks.c (scm_make_hook_with_name, scm_make_hook, scm_hook_p, scm_hook_empty_p, scm_add_hook_x, scm_remove_hook_x, scm_reset_hook_x, scm_run_hook, scm_hook_to_list), lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null, scm_nil_eq), numbers.c (scm_sys_expt, scm_sys_atan2), print.c (scm_print_options, scm_port_with_print_state, scm_get_print_state), procs.c (scm_make_cclo, scm_procedure_p, scm_closure_p, scm_thunk_p, scm_procedure_with_setter_p, scm_make_procedure_with_setter, scm_procedure), throw.c (scm_lazy_catch), modules.c (scm_standard_eval_closure), load.c (scm_parse_path, scm_search_path), stacks.c (scm_make_stack, scm_stack_ref, scm_stack_length, scm_frame_p, scm_last_stack_frame, scm_frame_number, scm_frame_source, scm_frame_procedure, scm_frame_arguments, scm_frame_previous, scm_frame_next, scm_frame_real_p, scm_frame_procedure_p, scm_frame_evaluating_args_p, scm_frame_overflow_p), filesys.c (scm_dirname, scm_basename), dynwind.c (scm_wind_chain), read.c (scm_read_options, scm_read, scm_read_hash_extend), gc.c (scm_unhash_name), eval.c (scm_eval_options_interface, scm_evaluator_traps, s_scm_nconc2last), backtrace.c (scm_display_error, scm_set_print_params_x, scm_display_application, scm_display_backtrace, scm_backtrace), async.c (scm_async, scm_system_async, scm_async_mark, scm_system_async_mark, scm_run_asyncs, scm_noop, scm_set_tick_rate, scm_set_switch_rate, scm_unmask_signals, scm_mask_signals): Added docstrings. 2001-02-15 Keisuke Nishida * dump.c (scm_undump): Use SCM_CARLOC/SCM_CDRLOC to obtain the address of car/cdr. (Thanks to Dirk Herrmann) Use scm_sizet to obtain the length of strings. (Thanks to Matthias Koeppe) 2001-02-15 Marius Vollmer * symbols.c (scm_mem2symbol): Put a empty statement after the next_symbol label. This is mandated by ANSI, appearantly. 2001-02-13 Marius Vollmer * gc_os_dep.c: Do not include . It makes no sense to compile for a specific kernel version. Do not include while defining __KERNEL__. This hack should no longer be needed and caused problems. 2001-02-13 Marius Vollmer * eval.c (scm_ceval, scm_deval): use `SIDEVAL' instead of SCM_CEVAL when evaluating subforms of `begin' forms. SCM_CEVAL can not deal with immediates. 2001-02-12 Keisuke Nishida * list.c (scm_list_copy): Validate the first argument. 2001-02-11 Marius Vollmer Fix evaluator so that top-level expressions are correctly evaluated with respect to the module system. * modules.h. modules.c (scm_current_module_lookup_closure): New function. * eval.h (scm_primitive_eval, scm_primitive_eval_x): New prototypes. (scm_i_eval, scm_i_eval_x, scm_eval, scm_eval_x): Changed argument names to better reflect their meaning. * eval.c (scm_ceval, scm_deval): Recognize when `begin' is being evaluated at top-level and synronize lookup closure before executing every subform. (scm_primitve_eval_x, scm_primitive_eval): New functions. (scm_eval_x, scm_eval): Reimplement in terms of scm_primitive_eval_x and scm_primitive_eval, respectively. 2001-02-09 Marius Vollmer * macros.c (scm_macro_name, scm_macro_transformer): Use SCM_SMOB_DATA instead of SCM_CDR. Provided by Martin Grabmueller. Thanks! 2001-02-10 Keisuke Nishida * dump.c (scm_store_bytes): Store data size before data. (scm_restore_bytes): Restore data size. Takes a pointer to size. * dump.h (scm_restore_bytes): Updated. 2001-02-09 Keisuke Nishida * dump.c: Use double cells for update schedule. 2001-02-08 Keisuke Nishida * ports.c (scm_unread_char): Take an optional argument. 2001-02-08 Marius Vollmer * modules.h (scm_selected_module, scm_current_module): Renamed scm_selected_module to scm_current_module to synchronize Scheme and C names. (scm_select_module, scm_set_current_module): Likewise. Changed all uses. * ports.c (scm_port_for_each): Make a snapshot of the port table before iterating over it. The table might change while the user code is running. With the snapshot, the user can depend on the fact that each port that existed at the start of the iteration is encountered exactly once. (ice-9 popen) depends on this. 2001-02-08 Dirk Herrmann * strings.h (SCM_STRING_MAX_LENGTH): New macro. * strings.c (scm_makstr, scm_take_str, scm_make_string): Added range checking for the size parameter. Thanks to Martin Grabmueller for the hint. (scm_makstr): Reordered string initialization to make interrupt deferring unnecessary. * vectors.c (scm_make_vector): Fixed range checking. 2001-02-08 Dirk Herrmann * vectors.h (SCM_VECTOR_MAX_LENGTH): New macro. * vectors.c (scm_make_vector, scm_c_make_vector): Improved the checking of the size parameter for type correctness and valid range. Thanks to Rob Browning for reporting the problem. Instead of deferring interrupts, scm_remember_upto_here_1 is used. 2001-02-05 Keisuke Nishida * dump.c (scm_store_cell_object, scm_restore_cell_object): Removed. (scm_dump_cell_update): Removed. (scm_dump_update): Renamed from scm_dump_object_update. (scm_restore_string, scm_restore_bytes, scm_restore_word): Takes a pointer instead of returning a value. * keywords.c (keyword_undump): Updated. 2001-02-05 Keisuke Nishida * dump.c, dump.h: Modified a lot. (SCM_DUMP_COOKIE): Version 0.1 (scm_dump_mark): Removed. (scm_restore_cell_object, scm_store_cell_object): New functions. * smob.h (scm_smob_descriptor): Removed slots: dump_mark, dump_dealloc, dump_store, undump_alloc, undump_restore, undump_init. New slots: dump, undump. * smob.c (scm_make_smob_type, scm_set_smob_dump, scm_set_smob_undump): Updated. * keywords.c (keyword_dump): Renamed from keyword_dealloc. (keyword_undump): Renamed from keyword_alloc. (scm_init_keywords): Set keyword_dump and keyword_undump. 2001-02-03 Michael Livshin * gc.c (DOUBLECELL_ALIGNED_P): new macro, a better-named analog of the deprecated SCM_DOUBLE_CELLP. * tags.h (SCM_DOUBLE_CELLP): deprecated. 2001-02-02 Keisuke Nishida * dump.c, dump.h: New files. * Makefile.am: Added dump.c, dump.h, dump.x, dump.doc. * init.c: #include "libguile/dump.h". (scm_init_guile_1): Call scm_init_dump. * smob.h (scm_smob_descriptor): New slots: dump_mark, dump_dealloc, dump_store, undump_alloc, undump_restore, undump_init. * smob.c (scm_make_smob_type): Init the new slots. (scm_set_smob_dump, scm_set_smob_undump): New functions. * smob.h (scm_set_smob_dump, scm_set_smob_undump): Declared. * keywords.c: #include "libguile/dump.h". (keyword_dealloc, keyword_alloc): New functions. (scm_init_keywords): Set smob_dump and smob_undump. 2001-02-01 Keisuke Nishida * vectors.c (scm_c_make_vector): New function. * vectors.h (scm_c_make_vector): Declared. * eval.c (scm_copy_tree), filesys.c (scm_stat2scm), fluids.c (scm_make_initial_fluids, grow_fluids), gc.c (scm_init_storage), gh_data.c (gh_ints2scm, gh_doubles2scm): goops.c (scm_make_method_cache, scm_i_vector2list, scm_compute_applicable_methods, scm_sys_method_more_specific_p), init.c (start_stack), net_db.c (scm_gethost, scm_getnet, scm_getproto, scm_return_entry), posix.c (scm_getgroups, scm_getpwuid, scm_getgrgid, scm_uname), print.c (make_print_state, grow_ref_stack), regex-posix.c (scm_regexp_exec), scmsigs.c (scm_init_scmsigs), socket.c (scm_addr_vector, scm_addr_vector), stime.c (scm_times, filltime), unif.c (scm_make_uve), vectors.c (scm_vector, scm_make_vector): Use scm_c_make_vector. * hashtab.c (scm_c_make_hash_table): New function. * hashtab.h (scm_c_make_hash_table): Declared. * environments.c (scm_make_leaf_environment, scm_make_eval_environment), gc.c (scm_init_storage), keywords.c (scm_init_keywords), symbols.c (scm_builtin_bindings): Use scm_c_make_hash_table. 2001-01-31 Mikael Djurfeldt * unif.c (rapr1): Don't apply scm_uniform_vector_length on arrays. 2001-01-29 Martin Grabmueller * struct.c (scm_make_vtable_vtable): Removed unnecessary "" from end of docstring. * struct.c (scm_struct_set_x, scm_struct_vtable_tag, scm_struct_vtable_name, scm_set_struct_vtable_name_x), weaks.c (scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table, scm_weak_value_hash_table_p, scm_doubly_weak_hash_table_p), srcprop.c (scm_source_properties, scm_set_source_properties_x, scm_source_property, scm_set_source_property_x), sort.c (scm_sort_list_x, scm_restricted_vector_sort_x, scm_sorted_p, scm_merge, scm_merge_x, scm_sort_x, scm_sort, scm_stable_sort_x, scm_stable_sort, scm_sort_list_x, scm_sort_list): Added docstrings. 2001-01-29 Mikael Djurfeldt * eval.c (SCM_APPLY): Check that primitives which take 1 arg really get that arg. 2001-01-26 Keisuke Nishida * goops.c (s_scm_get_keyword): Bug fix. 2001-01-26 Dirk Herrmann The following patch was sent by Martin Grabmueller. It makes sure that in case of parameter errors the correct function name is shown, and that parameter types are only checked once. * strop.c (string_copy, string_upcase_x, string_downcase_x, string_capitalize_x): New functions. Each one performs the core functionality of the corresponding scm_* function. (scm_string_copy, scm_string_upcase_x, scm_string_upcase, scm_string_downcase_x, scm_string_downcase, scm_string_capitalize_x, scm_string_capitalize): Reduced to parameter checking wrappers of the above functions. 2001-01-26 Dirk Herrmann * continuations.c, dynl.c, keywords.c, load.c: Include strings.h. Thanks to Bill Schottstaedt for the bug report. 2001-01-25 Dirk Herrmann * backtrace.c (display_header): Make sure that line and column information is shown independent of whether the port the code was read from had an associated filename. Thanks to Martin Grabmueller for providing this patch. 2001-01-25 Dirk Herrmann * fports.[ch] (scm_file_port_p): New primitive. 2001-01-25 Dirk Herrmann * tags.h (scm_tc16_fport, scm_tc16_strport, scm_tc16_sfport): These are now defined in fports.c, strports.c and vports.c. * fports.[ch] (scm_tc16_fport), strports.c (scm_tc16_strport), vports.c (scm_tc16_sfport): Made variables (were macros defined in tags.h). fports.c (scm_make_fptob), strports.c (scm_make_stptob), vports.c (scm_make_sfptob): Made static. These return a type code now. fports.c (scm_init_fports), strports.c (scm_init_strports), vports.c (scm_init_vports): Create the corresponding port types. * fports.h (SCM_FPORTP, SCM_OPFPORTP, SCM_OPINFPORTP, SCM_OPOUTFPORTP): Redefined in terms of scm_tc16_fport. * init.c (scm_init_guile_1): Make sure strports are initialized before gdbint. * ports.[ch] (scm_make_port_type): Changed the return type to scm_bits_t. * ports.c (scm_ports_prehistory): Don't create any port types here. * posix.c (scm_ttyname): Use SCM_FPORTP instead of comparing against scm_tc16_fport directly. 2001-01-25 Dirk Herrmann * srcprop.c (scm_set_source_property_x): Fix to handle (set-source-property! 'copy ) correctly. 2001-01-24 Gary Houston * filesys.c (scm_link): docstring fix. * fports.h (scm_setfileno): obsolete declaration removed. * posix.c: bogus popen declaration removed. * rdelim.c: new file, split from ioext.c. * rdelim.h: new file, split from ioext.h * Makefile.am: add rdelim.c and related files. * init.c: call scm_init_rdelim. include rdelim.h. 2001-01-24 Dirk Herrmann This patch was sent by Martin Grabmueller and makes sure that parameter errors are reported correctly by the lexicographic ordering predicates. * strorder.c (string_less_p, string_ci_less_p): New functions. (scm_string_less_p, scm_string_ci_less_p): Extracted the core functionality into string_less_p, string_ci_less_p respectively. The remaining code is just a wrapper to do the parameter checking. (scm_string_leq_p, scm_string_gr_p, scm_string_geq_p): Check the parameters and call string_less_p instead of scm_string_less_p. (scm_string_ci_leq_p, scm_string_ci_gr_p, scm_string_ci_geq_p): Check the parameters and call string_less_ci_p instead of scm_string_ci_less_p. 2001-01-24 Dirk Herrmann This patch modifies scm_display_error to perform parameter checking. Thanks to Neil Jerram for the bug report. * backtrace.[ch] (scm_i_display_error): New function. * backtrace.c (scm_display_error): Added parameter check and extracted the core functionality into function scm_i_display_error. * throw.c (handler_message): Call scm_i_display_error to display the error message. 2001-01-23 Mikael Djurfeldt * eval.c (SCM_APPLY): Added # args check for application of procedures with arity 3. (Thanks to Anders Holst.) 2001-01-24 Dirk Herrmann * filesys.h (SCM_DIR_FLAG_OPEN, SCM_DIR_OPEN_P): Added. (SCM_OPDIRP): Deprecated. * filesys.c (scm_opendir): Use SCM_DIR_FLAG_OPEN instead of SCM_OPN. (scm_readdir, scm_rewinddir): Don't use SCM_VALIDATE_OPDIR. Instead, give an explicit error message in case the directory is closed. (scm_closedir, scm_dir_print): Rewritten to use SCM_DIR_OPEN_P instead of SCM_OPENP and SCM_CLOSEDP. * validate.h (SCM_VALIDATE_OPDIR): Deprecated. 2001-01-22 Dirk Herrmann * eval.c (inner_eval, scm_eval): Move all real functionality into inner_eval. Avoid to copy the expression twice by inlining some code from scm_i_eval. 2001-01-19 Dirk Herrmann * eval.c (scm_m_case): The 'else' clause of a 'case' statement now has to be the last clause, as required by R5RS. Thanks to Martin Grabmueller for the patch. 2001-01-18 Gary Houston * ioext.c: further simplify scm_read_string_x_partial by defining a macro SCM_EBLOCK. 2001-01-18 Dirk Herrmann * gh_data.c (gh_ints2scm): Simplified using SCM_FIXABLE. 2001-01-18 Dirk Herrmann * __scm.h: Added comment about architecture and compiler properties that are required by guile. (SCM_FIXNUM_BIT, SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Moved to numbers.h. (SCM_CHAR_BIT, SCM_LONG_BIT): Moved here from numbers.h. * numbers.h (SCM_CHAR_BIT, SCM_LONG_BIT): Moved to __scm.h. (SCM_FIXNUM_BIT, SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Moved here from __scm.h. 2001-01-17 Dirk Herrmann * __scm.h (SCM_FIXNUM_BIT): Added. The name is chosen in analogy to the names in limits.h. * numbers.c (abs_most_negative_fixnum): Added. (scm_quotient, scm_remainder): Fixed the fixnum-min / (abs fixnum-min) special case. (scm_big_and): Fix for negative first parameter. (scm_bit_extract): Fix for fixnum paramters. Thanks to Rob Browning for the bug report. (scm_init_numbers): Initialize abs_most_negative_fixnum. 2001-01-16 Dirk Herrmann * symbols.c (scm_symbol_bound_p): Fixed comment. Thanks to Chris Cramer. 2001-01-15 Dirk Herrmann * smob.[ch] (scm_make_smob_type): Return type is scm_bits_t now. Thanks to Bill Schottstaedt. 2001-01-11 Michael Livshin from Matthias Köppe: * objects.h (SCM_SET_ENTITY_SETTER): new macro. SCM_ENTITY_SETTER casts its result, so doesn't yield an lvalue per ANSI C. * goops.c (s_scm_sys_set_object_setter_x): use SCM_SET_ENTITY_SETTER. (clear_method_cache): use SCM_SET_ENTITY_PROCEDURE. * gc.h (SCM_GC_SET_CARD_BVEC): new macro. SCM_GC_CARD_BVEC casts its result, so doesn't yield an lvalue per ANSI C. (SCM_GC_SET_CARD_FLAGS): ditto for SCM_GC_GET_CARD_FLAGS. (SCM_GC_CLR_CARD_FLAGS): redefined in terms of SCM_GC_SET_CARD_FLAGS. (SCM_GC_SET_CARD_FLAG, SCM_GC_CLR_CARD_FLAGS): ditto. * gc.c (INIT_CARD): use the explicit setter macro to set the bvec. 2001-01-08 Gary Houston * validate.h (SCM_VALIDATE_SUBSTRING_SPEC_COPY): new macro. * ioext.c (scm_read_string_x_partial, scm_read_delimited_x), socket.c (scm_recvfrom): use the new macro, plus minor docstring changes. * ioext.c (scm_read_string_x_partial): don't crash if -1 is supplied for fdes. if current input port is used, check that it's a file port. 2001-01-06 Gary Houston * ioext.c (scm_read_string_x_partial): new procedure, implements read-string!/partial. * ports.c (scm_take_from_input_buffers): new procedure used by scm_read_string_x_partial. (scm_drain_input): use scm_take_from_input_buffers. 2001-01-06 Marius Vollmer * validate.h (SCM_VALIDATE_NUMBER): New. 2001-01-03 Michael Livshin * guardians.c (F_GREEDY, F_LISTED, F_DESTROYED, GREEDY_P, SET_GREEDY, LISTED_P, SET_LISTED, CLR_LISTED, DESTROYED_P, SET_DESTROYED): new defines/macros. (GUARDIAN_LIVE, GUARDIAN_ZOMBIES, GUARDIAN_NEXT): deleted. (add_to_live_list): takes a `guardian_t *' now, not SCM. (guardian_print): print more info. (guardian_apply): check if the guardian is destroyed, and throw an error if so. take one more optional argument `throw_p'. (scm_guard): depending on the value of `throw_p', return a boolean result. (scm_get_one_zombie): remove redundant property test. (guardian_t): represent the various (currently 3, I hope nothing more gets added) boolean fields as bit flags. (scm_guardian_destroyed_p, scm_guardian_greedy_p): new predicates. (scm_destroy_guardian_x): new procedure. * guardians.h: added prototypes for `scm_guardian_greedy_p' and `scm_guardian_destroyed_p'. changed prototype for `scm_guard'. 2001-01-01 Gary Houston * fports.c (fport_write): bugfix: handle short writes for unbuffered ports too. optimize the buffered case by minimizing the number of write/flush calls. (write_all): new helper procedure. The ChangeLog continues in the file: "ChangeLog-2000"