From 8c67d05cefcecd8e8bf9e47255abc9ee19d035df Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 21:57:52 +0000 Subject: [PATCH 001/107] (scm_string_map, scm_string_map_x, scm_string_for_each): Reverse order of first two args. (scm_string_for_each_index): New proc. Thanks to Alex Shinn. --- srfi/srfi-13.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/srfi/srfi-13.h b/srfi/srfi-13.h index 86c21a832..5a66015c2 100644 --- a/srfi/srfi-13.h +++ b/srfi/srfi-13.h @@ -3,17 +3,17 @@ /* srfi-13.c --- SRFI-13 procedures for Guile * * Copyright (C) 2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2, or (at * your option) any later version. - * + * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -110,13 +110,14 @@ SCM scm_string_concatenate (SCM ls); SCM scm_string_concatenate_shared (SCM ls); SCM scm_string_concatenate_reverse (SCM ls, SCM final_string, SCM end); SCM scm_string_concatenate_reverse_shared (SCM ls, SCM final_string, SCM end); -SCM scm_string_map (SCM s, SCM proc, SCM start, SCM end); -SCM scm_string_map_x (SCM s, SCM proc, SCM start, SCM end); +SCM scm_string_map (SCM proc, SCM s, SCM start, SCM end); +SCM scm_string_map_x (SCM proc, SCM s, SCM start, SCM end); SCM scm_string_fold (SCM kons, SCM knil, SCM s, SCM start, SCM end); SCM scm_string_fold_right (SCM kons, SCM knil, SCM s, SCM start, SCM end); SCM scm_string_unfold (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final); SCM scm_string_unfold_right (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final); -SCM scm_string_for_each (SCM s, SCM proc, SCM start, SCM end); +SCM scm_string_for_each (SCM proc, SCM s, SCM start, SCM end); +SCM scm_string_for_each_index (SCM proc, SCM s, SCM start, SCM end); SCM scm_xsubstring (SCM s, SCM from, SCM to, SCM start, SCM end); SCM scm_string_xcopy_x (SCM target, SCM tstart, SCM s, SCM sfrom, SCM sto, SCM start, SCM end); SCM scm_string_replace (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2); From 0f21643339d47afa6bdf47a5ad2fab420a4c9e03 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 21:59:50 +0000 Subject: [PATCH 002/107] (scm_string_for_each): Reverse order of first 2 args. (scm_string_for_each_index): New func. Thanks to Alex Shinn. --- srfi/srfi-13.c | 154 ++++++++++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 66 deletions(-) diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c index a54dfbc1a..231e2adaa 100644 --- a/srfi/srfi-13.c +++ b/srfi/srfi-13.c @@ -1,17 +1,17 @@ /* srfi-13.c --- SRFI-13 procedures for Guile * * Copyright (C) 2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2, or (at * your option) any later version. - * + * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -52,7 +52,7 @@ #include "srfi-13.h" #include "srfi-14.h" -SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0, +SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0, (SCM pred, SCM s, SCM start, SCM end), "Check if the predicate @var{pred} is true for any character in\n" "the string @var{s}, proceeding from left (index @var{start}) to\n" @@ -83,7 +83,7 @@ SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_every, "string-every", 2, 2, 0, +SCM_DEFINE (scm_string_every, "string-every", 2, 2, 0, (SCM pred, SCM s, SCM start, SCM end), "Check if the predicate @var{pred} is true for every character\n" "in the string @var{s}, proceeding from left (index @var{start})\n" @@ -115,7 +115,7 @@ SCM_DEFINE (scm_string_every, "string-every", 2, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_tabulate, "string-tabulate", 2, 0, 0, +SCM_DEFINE (scm_string_tabulate, "string-tabulate", 2, 0, 0, (SCM proc, SCM len), "@var{proc} is an integer->char procedure. Construct a string\n" "of size @var{len} by applying @var{proc} to each index to\n" @@ -169,7 +169,7 @@ SCM_DEFINE (scm_string_to_listS, "string->list", 1, 2, 0, } #undef FUNC_NAME -SCM_DEFINE (scm_reverse_list_to_string, "reverse-list->string", 1, 0, 0, +SCM_DEFINE (scm_reverse_list_to_string, "reverse-list->string", 1, 0, 0, (SCM chrs), "An efficient implementation of @code{(compose string->list\n" "reverse)}:\n" @@ -181,7 +181,7 @@ SCM_DEFINE (scm_reverse_list_to_string, "reverse-list->string", 1, 0, 0, { SCM result; long i = scm_ilength (chrs); - + if (i < 0) SCM_WRONG_TYPE_ARG (1, chrs); result = scm_allocate_string (i); @@ -209,7 +209,7 @@ SCM_SYMBOL (scm_sym_strict_infix, "strict-infix"); SCM_SYMBOL (scm_sym_suffix, "suffix"); SCM_SYMBOL (scm_sym_prefix, "prefix"); -SCM_DEFINE (scm_string_join, "string-join", 1, 2, 0, +SCM_DEFINE (scm_string_join, "string-join", 1, 2, 0, (SCM ls, SCM delimiter, SCM grammar), "Append the string in the string list @var{ls}, using the string\n" "@var{delim} as a delimiter between the elements of @var{ls}.\n" @@ -358,10 +358,10 @@ SCM_DEFINE (scm_string_join, "string-join", 1, 2, 0, break; } return result; -#undef GRAM_INFIX -#undef GRAM_STRICT_INFIX -#undef GRAM_SUFFIX -#undef GRAM_PREFIX +#undef GRAM_INFIX +#undef GRAM_STRICT_INFIX +#undef GRAM_SUFFIX +#undef GRAM_PREFIX } #undef FUNC_NAME @@ -380,12 +380,12 @@ SCM_DEFINE (scm_string_copyS, "string-copy", 1, 2, 0, 2, start, cstart, 3, end, cend); return scm_mem2string (cstr + cstart, cend - cstart); - + } #undef FUNC_NAME -SCM_DEFINE (scm_substring_shared, "substring/shared", 2, 1, 0, +SCM_DEFINE (scm_substring_shared, "substring/shared", 2, 1, 0, (SCM str, SCM start, SCM end), "Like @code{substring}, but the result may share memory with the\n" "argument @var{str}.") @@ -405,7 +405,7 @@ SCM_DEFINE (scm_substring_shared, "substring/shared", 2, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_copy_x, "string-copy!", 3, 2, 0, +SCM_DEFINE (scm_string_copy_x, "string-copy!", 3, 2, 0, (SCM target, SCM tstart, SCM s, SCM start, SCM end), "Copy the sequence of characters from index range [@var{start},\n" "@var{end}) in string @var{s} to string @var{target}, beginning\n" @@ -438,7 +438,7 @@ SCM_DEFINE (scm_string_copy_x, "string-copy!", 3, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_take, "string-take", 2, 0, 0, +SCM_DEFINE (scm_string_take, "string-take", 2, 0, 0, (SCM s, SCM n), "Return the @var{n} first characters of @var{s}.") #define FUNC_NAME s_scm_string_take @@ -449,13 +449,13 @@ SCM_DEFINE (scm_string_take, "string-take", 2, 0, 0, SCM_VALIDATE_STRING_COPY (1, s, cstr); SCM_VALIDATE_INUM_COPY (2, n, cn); SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s)); - + return scm_mem2string (cstr, cn); } #undef FUNC_NAME -SCM_DEFINE (scm_string_drop, "string-drop", 2, 0, 0, +SCM_DEFINE (scm_string_drop, "string-drop", 2, 0, 0, (SCM s, SCM n), "Return all but the first @var{n} characters of @var{s}.") #define FUNC_NAME s_scm_string_drop @@ -466,13 +466,13 @@ SCM_DEFINE (scm_string_drop, "string-drop", 2, 0, 0, SCM_VALIDATE_STRING_COPY (1, s, cstr); SCM_VALIDATE_INUM_COPY (2, n, cn); SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s)); - + return scm_mem2string (cstr + cn, SCM_STRING_LENGTH (s) - cn); } #undef FUNC_NAME -SCM_DEFINE (scm_string_take_right, "string-take-right", 2, 0, 0, +SCM_DEFINE (scm_string_take_right, "string-take-right", 2, 0, 0, (SCM s, SCM n), "Return the @var{n} last characters of @var{s}.") #define FUNC_NAME s_scm_string_take_right @@ -483,13 +483,13 @@ SCM_DEFINE (scm_string_take_right, "string-take-right", 2, 0, 0, SCM_VALIDATE_STRING_COPY (1, s, cstr); SCM_VALIDATE_INUM_COPY (2, n, cn); SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s)); - + return scm_mem2string (cstr + SCM_STRING_LENGTH (s) - cn, cn); } #undef FUNC_NAME -SCM_DEFINE (scm_string_drop_right, "string-drop-right", 2, 0, 0, +SCM_DEFINE (scm_string_drop_right, "string-drop-right", 2, 0, 0, (SCM s, SCM n), "Return all but the last @var{n} characters of @var{s}.") #define FUNC_NAME s_scm_string_drop_right @@ -500,7 +500,7 @@ SCM_DEFINE (scm_string_drop_right, "string-drop-right", 2, 0, 0, SCM_VALIDATE_STRING_COPY (1, s, cstr); SCM_VALIDATE_INUM_COPY (2, n, cn); SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s)); - + return scm_mem2string (cstr, SCM_STRING_LENGTH (s) - cn); } #undef FUNC_NAME @@ -882,7 +882,7 @@ SCM_DEFINE (scm_string_compare, "string-compare", 5, 4, 0, SCM_VALIDATE_PROC (3, proc_lt); SCM_VALIDATE_PROC (4, proc_eq); SCM_VALIDATE_PROC (5, proc_gt); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -925,7 +925,7 @@ SCM_DEFINE (scm_string_compare_ci, "string-compare-ci", 5, 4, 0, SCM_VALIDATE_PROC (3, proc_lt); SCM_VALIDATE_PROC (4, proc_eq); SCM_VALIDATE_PROC (5, proc_gt); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -960,7 +960,7 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -995,7 +995,7 @@ SCM_DEFINE (scm_string_neq, "string<>", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -1030,7 +1030,7 @@ SCM_DEFINE (scm_string_lt, "string<", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -1065,7 +1065,7 @@ SCM_DEFINE (scm_string_gt, "string>", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -1100,7 +1100,7 @@ SCM_DEFINE (scm_string_le, "string<=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -1135,7 +1135,7 @@ SCM_DEFINE (scm_string_ge, "string>=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (cstr1[cstart1] < cstr2[cstart2]) @@ -1171,7 +1171,7 @@ SCM_DEFINE (scm_string_ci_eq, "string-ci=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1207,7 +1207,7 @@ SCM_DEFINE (scm_string_ci_neq, "string-ci<>", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1243,7 +1243,7 @@ SCM_DEFINE (scm_string_ci_lt, "string-ci<", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1279,7 +1279,7 @@ SCM_DEFINE (scm_string_ci_gt, "string-ci>", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1315,7 +1315,7 @@ SCM_DEFINE (scm_string_ci_le, "string-ci<=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1351,7 +1351,7 @@ SCM_DEFINE (scm_string_ci_ge, "string-ci>=", 2, 4, 0, SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2, 5, start2, cstart2, 6, end2, cend2); - + while (cstart1 < cend1 && cstart2 < cend2) { if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2])) @@ -1718,7 +1718,7 @@ SCM_DEFINE (scm_string_index_right, "string-index-right", 2, 2, 0, return SCM_MAKINUM (cend); } } - return SCM_BOOL_F; + return SCM_BOOL_F; } #undef FUNC_NAME @@ -1838,7 +1838,7 @@ SCM_DEFINE (scm_string_skip_right, "string-skip-right", 2, 2, 0, return SCM_MAKINUM (cend); } } - return SCM_BOOL_F; + return SCM_BOOL_F; } #undef FUNC_NAME @@ -1985,7 +1985,7 @@ SCM_DEFINE (scm_string_contains_ci, "string-contains-ci", 2, 4, 0, #undef FUNC_NAME -/* Helper function for the string uppercase conversion functions. +/* Helper function for the string uppercase conversion functions. * No argument checking is performed. */ static SCM string_upcase_x (SCM v, int start, int end) @@ -2001,7 +2001,7 @@ string_upcase_x (SCM v, int start, int end) /* FIXME::martin: The `S' is to avoid a name clash with the procedure in the core, which does not accept start/end indices */ -SCM_DEFINE (scm_string_upcase_xS, "string-upcase!", 1, 2, 0, +SCM_DEFINE (scm_string_upcase_xS, "string-upcase!", 1, 2, 0, (SCM str, SCM start, SCM end), "Destructively upcase every character in @code{str}.\n" "\n" @@ -2026,7 +2026,7 @@ SCM_DEFINE (scm_string_upcase_xS, "string-upcase!", 1, 2, 0, /* FIXME::martin: The `S' is to avoid a name clash with the procedure in the core, which does not accept start/end indices */ -SCM_DEFINE (scm_string_upcaseS, "string-upcase", 1, 2, 0, +SCM_DEFINE (scm_string_upcaseS, "string-upcase", 1, 2, 0, (SCM str, SCM start, SCM end), "Upcase every character in @code{str}.") #define FUNC_NAME s_scm_string_upcaseS @@ -2042,7 +2042,7 @@ SCM_DEFINE (scm_string_upcaseS, "string-upcase", 1, 2, 0, #undef FUNC_NAME -/* Helper function for the string lowercase conversion functions. +/* Helper function for the string lowercase conversion functions. * No argument checking is performed. */ static SCM string_downcase_x (SCM v, int start, int end) @@ -2058,7 +2058,7 @@ string_downcase_x (SCM v, int start, int end) /* FIXME::martin: The `S' is to avoid a name clash with the procedure in the core, which does not accept start/end indices */ -SCM_DEFINE (scm_string_downcase_xS, "string-downcase!", 1, 2, 0, +SCM_DEFINE (scm_string_downcase_xS, "string-downcase!", 1, 2, 0, (SCM str, SCM start, SCM end), "Destructively downcase every character in @var{str}.\n" "\n" @@ -2085,7 +2085,7 @@ SCM_DEFINE (scm_string_downcase_xS, "string-downcase!", 1, 2, 0, /* FIXME::martin: The `S' is to avoid a name clash with the procedure in the core, which does not accept start/end indices */ -SCM_DEFINE (scm_string_downcaseS, "string-downcase", 1, 2, 0, +SCM_DEFINE (scm_string_downcaseS, "string-downcase", 1, 2, 0, (SCM str, SCM start, SCM end), "Downcase every character in @var{str}.") #define FUNC_NAME s_scm_string_downcaseS @@ -2101,7 +2101,7 @@ SCM_DEFINE (scm_string_downcaseS, "string-downcase", 1, 2, 0, #undef FUNC_NAME -/* Helper function for the string capitalization functions. +/* Helper function for the string capitalization functions. * No argument checking is performed. */ static SCM string_titlecase_x (SCM str, int start, int end) @@ -2131,7 +2131,7 @@ string_titlecase_x (SCM str, int start, int end) } -SCM_DEFINE (scm_string_titlecase_x, "string-titlecase!", 1, 2, 0, +SCM_DEFINE (scm_string_titlecase_x, "string-titlecase!", 1, 2, 0, (SCM str, SCM start, SCM end), "Destructively titlecase every first character in a word in\n" "@var{str}.") @@ -2148,7 +2148,7 @@ SCM_DEFINE (scm_string_titlecase_x, "string-titlecase!", 1, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_titlecase, "string-titlecase", 1, 2, 0, +SCM_DEFINE (scm_string_titlecase, "string-titlecase", 1, 2, 0, (SCM str, SCM start, SCM end), "Titlecase every first character in a word in @var{str}.") #define FUNC_NAME s_scm_string_titlecase @@ -2183,7 +2183,7 @@ string_reverse_x (char * str, int cstart, int cend) } -SCM_DEFINE (scm_string_reverse, "string-reverse", 1, 2, 0, +SCM_DEFINE (scm_string_reverse, "string-reverse", 1, 2, 0, (SCM str, SCM start, SCM end), "Reverse the string @var{str}. The optional arguments\n" "@var{start} and @var{end} delimit the region of @var{str} to\n" @@ -2205,7 +2205,7 @@ SCM_DEFINE (scm_string_reverse, "string-reverse", 1, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_reverse_x, "string-reverse!", 1, 2, 0, +SCM_DEFINE (scm_string_reverse_x, "string-reverse!", 1, 2, 0, (SCM str, SCM start, SCM end), "Reverse the string @var{str} in-place. The optional arguments\n" "@var{start} and @var{end} delimit the region of @var{str} to\n" @@ -2225,7 +2225,7 @@ SCM_DEFINE (scm_string_reverse_x, "string-reverse!", 1, 2, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_append_shared, "string-append/shared", 0, 0, 1, +SCM_DEFINE (scm_string_append_shared, "string-append/shared", 0, 0, 1, (SCM ls), "Like @code{string-append}, but the result may share memory\n" "with the argument strings.") @@ -2245,7 +2245,7 @@ SCM_DEFINE (scm_string_append_shared, "string-append/shared", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_string_concatenate, "string-concatenate", 1, 0, 0, +SCM_DEFINE (scm_string_concatenate, "string-concatenate", 1, 0, 0, (SCM ls), "Append the elements of @var{ls} (which must be strings)\n" "together into a single string. Guaranteed to return a freshly\n" @@ -2288,7 +2288,7 @@ SCM_DEFINE (scm_string_concatenate, "string-concatenate", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, 0, +SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, 0, (SCM ls, SCM final_string, SCM end), "Without optional arguments, this procedure is equivalent to\n" "\n" @@ -2319,7 +2319,7 @@ SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, if (!SCM_UNBNDP (end)) { SCM_VALIDATE_INUM_COPY (3, end, cend); - SCM_ASSERT_RANGE (3, end, + SCM_ASSERT_RANGE (3, end, (cend >= 0) && (cend <= SCM_STRING_LENGTH (final_string))); } @@ -2369,7 +2369,7 @@ SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, #undef FUNC_NAME -SCM_DEFINE (scm_string_concatenate_shared, "string-concatenate/shared", 1, 0, 0, +SCM_DEFINE (scm_string_concatenate_shared, "string-concatenate/shared", 1, 0, 0, (SCM ls), "Like @code{string-concatenate}, but the result may share memory\n" "with the strings in the list @var{ls}.") @@ -2387,7 +2387,7 @@ SCM_DEFINE (scm_string_concatenate_shared, "string-concatenate/shared", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_string_concatenate_reverse_shared, "string-concatenate-reverse/shared", 1, 2, 0, +SCM_DEFINE (scm_string_concatenate_reverse_shared, "string-concatenate-reverse/shared", 1, 2, 0, (SCM ls, SCM final_string, SCM end), "Like @code{string-concatenate-reverse}, but the result may\n" "share memory with the the strings in the @var{ls} arguments.") @@ -2637,7 +2637,7 @@ SCM_DEFINE (scm_string_unfold_right, "string-unfold-right", 4, 2, 0, SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0, - (SCM s, SCM proc, SCM start, SCM end), + (SCM proc, SCM s, SCM start, SCM end), "@var{proc} is mapped over @var{s} in left-to-right order. The\n" "return value is not specified.") #define FUNC_NAME s_scm_string_for_each @@ -2645,10 +2645,10 @@ SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0, char * cstr; int cstart, cend; - SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr, + SCM_VALIDATE_PROC (1, proc); + SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr, 3, start, cstart, 4, end, cend); - SCM_VALIDATE_PROC (2, proc); while (cstart < cend) { scm_call_1 (proc, SCM_MAKE_CHAR (cstr[cstart])); @@ -2658,6 +2658,28 @@ SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0, } #undef FUNC_NAME +SCM_DEFINE (scm_string_for_each_index, "string-for-each-index", 2, 2, 0, + (SCM proc, SCM s, SCM start, SCM end), + "@var{proc} is mapped over @var{s} in left-to-right order. The\n" + "return value is not specified.") +#define FUNC_NAME s_scm_string_for_each +{ + char * cstr; + int cstart, cend; + + SCM_VALIDATE_PROC (1, proc); + SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr, + 3, start, cstart, + 4, end, cend); + while (cstart < cend) + { + scm_call_1 (proc, SCM_MAKINUM (cstart)); + cstart++; + } + return SCM_UNSPECIFIED; +} +#undef FUNC_NAME + SCM_DEFINE (scm_xsubstring, "xsubstring", 2, 3, 0, (SCM s, SCM from, SCM to, SCM start, SCM end), "This is the @emph{extended substring} procedure that implements\n" @@ -2683,9 +2705,9 @@ SCM_DEFINE (scm_xsubstring, "xsubstring", 2, 3, 0, SCM_VALIDATE_INUM_DEF_COPY (3, to, cfrom + (cend - cstart), cto); if (cstart == cend && cfrom != cto) SCM_MISC_ERROR ("start and end indices must not be equal", SCM_EOL); - + result = scm_allocate_string (cto - cfrom); - + p = SCM_STRING_CHARS (result); while (cfrom < cto) { @@ -2894,7 +2916,7 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0, { SCM ls = SCM_EOL; char chr; - + chr = SCM_CHAR (char_pred); idx = cstart; while (idx < cend) @@ -2908,7 +2930,7 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0, else if (SCM_CHARSETP (char_pred)) { SCM ls = SCM_EOL; - + idx = cstart; while (idx < cend) { @@ -2960,7 +2982,7 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0, { SCM ls = SCM_EOL; char chr; - + chr = SCM_CHAR (char_pred); idx = cstart; while (idx < cend) @@ -2974,7 +2996,7 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0, else if (SCM_CHARSETP (char_pred)) { SCM ls = SCM_EOL; - + idx = cstart; while (idx < cend) { From 4cf7528804e08fa92c05c0c5ac5ae2eeaed0c48e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 22:00:45 +0000 Subject: [PATCH 003/107] (string-for-each-index): New exported proc. --- srfi/srfi-13.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm index ba1ff6fc1..b623c405e 100644 --- a/srfi/srfi-13.scm +++ b/srfi/srfi-13.scm @@ -1,17 +1,17 @@ ;;;; srfi-13.scm --- SRFI-13 procedures for Guile ;;;; ;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; +;;;; ;;;; This program is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU General Public License as ;;;; published by the Free Software Foundation; either version 2, or ;;;; (at your option) any later version. -;;;; +;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; General Public License for more details. -;;;; +;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -56,7 +56,7 @@ (define string-downcase #f) (define string-downcase! #f)) -(export +(export ;;; Predicates ;; string? string-null? <= in the core string-any string-every @@ -134,6 +134,7 @@ string-unfold string-unfold-right string-for-each + string-for-each-index ;;; Replicate/Rotate xsubstring string-xcopy! From e5c5ac9240fd6d08f364f240c803565b1f48a332 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 22:06:05 +0000 Subject: [PATCH 004/107] (string-for-each, string-for-each-index): Add tests. --- test-suite/tests/srfi-13.test | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/test-suite/tests/srfi-13.test b/test-suite/tests/srfi-13.test index 37ecfa5af..bb2d0e24b 100644 --- a/test-suite/tests/srfi-13.test +++ b/test-suite/tests/srfi-13.test @@ -2,17 +2,17 @@ ;;;; Martin Grabmueller, 2001-05-07 ;;;; ;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; +;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2, or (at your option) ;;;; any later version. -;;;; +;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. -;;;; +;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -161,7 +161,7 @@ (string=? "bla|delim|fasel" (string-join '("bla" "fasel") "|delim|" 'infix))) - (pass-if-exception "empty list, strict infix" + (pass-if-exception "empty list, strict infix" exception:strict-infix-grammar (string-join '() "|delim|" 'strict-infix)) @@ -1021,3 +1021,21 @@ (pass-if "upcase" (string=? "FOO" (string-map char-upcase "foo")))) + +(with-test-prefix "string-for-each" + + (pass-if "copy" + (let* ((foo "foo") + (bar (make-string (string-length foo))) + (i 0)) + (string-for-each + (lambda (c) (string-set! bar i c) (set! i (1+ i))) foo) + (string=? foo bar))) + + (pass-if "index" + (let* ((foo "foo") + (bar (make-string (string-length foo)))) + (string-for-each-index + (lambda (i) (string-set! bar i (string-ref foo i))) foo) + (string=? foo bar)))) + From e9313ed7f89f14206642bf7ced4b73f12fde84bc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 22:07:20 +0000 Subject: [PATCH 005/107] *** empty log message *** --- srfi/ChangeLog | 45 ++++++++++++++++++++++++++++---------------- test-suite/ChangeLog | 5 +++++ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index e2286b8b7..6931487c9 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,16 @@ +2001-08-24 Thien-Thi Nguyen + + * srfi-13.h (scm_string_map, scm_string_map_x, + scm_string_for_each): Reverse order of first two args. + (scm_string_for_each_index): New proc. + + * srfi-13.c (scm_string_for_each): Reverse order of first 2 args. + (scm_string_for_each_index): New func. + + * srfi-13.scm (string-for-each-index): New exported proc. + + Thanks to Alex Shinn. + 2001-08-22 Mikael Djurfeldt * srfi-13.c (string-map): Swapped order of string and proc args to @@ -29,7 +42,7 @@ (scm_char_set_xor_x): disabled the side-effecting code, since it gives inconsistent results to scm_char_set_xor for the case (char-set-xor! a a a). - + (scm_char_set_diff_plus_intersection_x): added cs2 argument, since two arguments are compulsory in final spec. also similar changes as for scm_char_set_diff_plus_intersection. @@ -50,7 +63,7 @@ * srfi-14.c: Okay. Now I got it. Really. This time it's fixed. Guaranteed. (Maybe) - + * srfi-19.scm: Define `current-time' before exporting it. 2001-07-17 Martin Grabmueller @@ -58,7 +71,7 @@ * srfi-14.c: Fix for bug caused by brain-malfunctioning on my side. Bit sets were handled wrong because I couldn't tell bit counts from byte counts. Also, the bit array should be 256 / 8 - bytes long. Thank you, Gary! + bytes long. Thank you, Gary! Removed unnecessary protoype for scm_char_set_copy. @@ -84,7 +97,7 @@ more values. 2001-07-15 Gary Houston - + * srfi-14.c (scm_char_set_hash): recognise 0 instead of #f in the opt arg to give default bound, as in final spec. don't allow negative bounds. @@ -120,7 +133,7 @@ delete!, assoc): roll back the previous change. instead place dummy definitions in a deprecated block at the beginning as in srfi-13.scm. - + 2001-07-06 Rob Browning * srfi-19.scm (priv:locale-reader): don't need open-output-string. @@ -208,10 +221,10 @@ properly and relied on non-R5RS-isms like passing reals to `quotient'. For Guile, some additional fixes were needed because of the incomplete numeric tower implementation. See also - srfi-19.test. - + srfi-19.test. + * srfi-19.scm (date-zone-offset): Fixed typo in export clause. - (add-duration): Renamed from priv:add-duration. + (add-duration): Renamed from priv:add-duration. (priv:time-normalize!): Handle fractional nanoseconds; remove duplicate definition. (priv:current-time-tai): Fixed typo. @@ -226,15 +239,15 @@ DST effects. (time-utc->date, time-tai->date, time-monotonic->date): Handle the changed signature of priv:local-tz-offset. Don't pass non-integer - arguments to quotient (non-R5RS, not supported by Guile). + arguments to quotient (non-R5RS, not supported by Guile). (date->time-utc): Ensure that seconds in a date structure are always exact integers. Handle DST properly. (current-date, julian-day->date, modified-julian-day->date): - Handle the changed signature of priv:local-tz-offset. + Handle the changed signature of priv:local-tz-offset. (julian-day->time-utc): Reverted earlier inexact->exact hack; make-time now handles inexact arguments. (priv:locale-print-time-zone): At least print the numerical time - zone. + zone. (priv:integer-reader): Fixed named let iteration. (priv:read-directives): Use set-date-month! instead of priv:set-date-month! etc. @@ -313,7 +326,7 @@ 2001-05-19 Marius Vollmer Avoid using module operations from C. - + * srfi-13.c (scm_init_srfi_13_14): Removed. * srfi-14.h, srfi-14.c (scm_c_init_srfi_14): New. Contains initializations needed by C clients of srfi-14. @@ -366,7 +379,7 @@ * srfi-10.scm: New file. * srfi-17.scm: New file, contributed by Matthias Koeppe. Thanks a - lot! + lot! Added `Commentary:' tag. * srfi-9.scm: Added `Commentary:' tag. @@ -411,7 +424,7 @@ Changed two procedure names to match final SRFI document. Thanks to Rob Browning for spotting this. - + * srfi-13.scm (string-concatenate-reverse), (string-concatenate-reverse/shared): Rename from reverse-string-concatenate[/shared]. @@ -453,7 +466,7 @@ 2001-04-23 Martin Grabmueller Integrated the guile-srfi package into the Guile distribution. - + * srfi-13.c: All procedures so specified in the SRFI now accept character set arguments. @@ -494,7 +507,7 @@ to 0.0.3. * Released version 0.0.2. - + * Makefile.am: Added rules for builing the SRFI-14 library. * srfi-14.c, srfi-14.scm: New files, implementing SRFI-14 diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index d12e6fdc1..a284610a8 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,8 @@ +2001-08-24 Thien-Thi Nguyen + + * tests/srfi-13.test (string-for-each, string-for-each-index): + Add tests. (Thanks to Alex Shinn.) + 2001-08-22 Mikael Djurfeldt * tests/srfi-13.test (string-map): Swapped order of string and From 31623ceabeae1539e9c65c37a0c63b2020c0521d Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 22:09:22 +0000 Subject: [PATCH 006/107] Add Alex Shinn. --- THANKS | 1 + 1 file changed, 1 insertion(+) diff --git a/THANKS b/THANKS index 6941df180..967b4ba2e 100644 --- a/THANKS +++ b/THANKS @@ -49,6 +49,7 @@ For fixes or providing information which led to a fix: Ariel Rios Julian Satchell Bill Schottstaedt + Alex Shinn Miroslav Silovic David Skarda Dale P. Smith From ec2667f0cfa25f71c88d49d57c599129c71091e8 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 24 Aug 2001 22:24:11 +0000 Subject: [PATCH 007/107] *** empty log message *** --- THANKS | 2 +- libguile/ChangeLog | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/THANKS b/THANKS index 967b4ba2e..7e0004f5c 100644 --- a/THANKS +++ b/THANKS @@ -51,7 +51,7 @@ For fixes or providing information which led to a fix: Bill Schottstaedt Alex Shinn Miroslav Silovic - David Skarda + Daniel Skarda Dale P. Smith Masao Uebayashi Bernard Urban diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e19afc953..e354f6437 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,7 +1,7 @@ 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 @@ -1017,7 +1017,7 @@ * print.c (scm_simple_format): Support "~~" and "~%". Signal error for unsupported format controls and for superflous - arguments. Thanks to David Skarda! + arguments. Thanks to Daniel Skarda! * print.h, print.c (scm_print_symbol_name): Factored out of scm_iprin1. From 8a3e715b20285eaeb4f60b54cc4fc218c53b2901 Mon Sep 17 00:00:00 2001 From: Michael Livshin Date: Fri, 24 Aug 2001 23:57:12 +0000 Subject: [PATCH 008/107] * gc.c (scm_gc_sweep): now can sweep unreachable variables (by doing exactly nothing about them). thanks Neil! --- libguile/ChangeLog | 5 +++++ libguile/gc.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e354f6437..d44668e74 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/libguile/gc.c b/libguile/gc.c index b7a0defbf..457c0edce 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1793,6 +1793,8 @@ scm_gc_sweep () m += SCM_SYMBOL_LENGTH (scmptr) + 1; scm_must_free (SCM_SYMBOL_CHARS (scmptr)); break; + case scm_tc7_variable: + break; case scm_tcs_subrs: /* the various "subrs" (primitives) are never freed */ continue; From 3307df9557835201bccaf57c763636a90ffaabff Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:05:04 +0000 Subject: [PATCH 009/107] (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". --- ice-9/Makefile.am | 2 +- libguile/Makefile.am | 2 +- oop/Makefile.am | 2 +- oop/goops/Makefile.am | 2 +- qt/Makefile.am | 2 +- qt/md/Makefile.am | 2 +- qt/time/Makefile.am | 2 +- scripts/Makefile.am | 2 +- srfi/Makefile.am | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index e9af0558a..09f7bdae3 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu # These should be installed and distributed. ice9_sources = \ diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 8eaa24fc5..64eae886e 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu ## Prevent automake from adding extra -I options DEFS = @DEFS@ diff --git a/oop/Makefile.am b/oop/Makefile.am index 0587c83be..adf3fbb66 100644 --- a/oop/Makefile.am +++ b/oop/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu SUBDIRS = goops diff --git a/oop/goops/Makefile.am b/oop/goops/Makefile.am index b80216bbc..e447598f9 100644 --- a/oop/goops/Makefile.am +++ b/oop/goops/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu # These should be installed and distributed. goops_sources = \ diff --git a/qt/Makefile.am b/qt/Makefile.am index ab0aa3cb6..926f15575 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu ## subdirs are for making distributions only. SUBDIRS = md time diff --git a/qt/md/Makefile.am b/qt/md/Makefile.am index d576ffb8b..66e2ea8bd 100644 --- a/qt/md/Makefile.am +++ b/qt/md/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu EXTRA_DIST = _sparc.s _sparc_b.s axp.1.Makefile axp.2.Makefile \ axp.Makefile axp.README axp.c axp.h axp.s axp_b.s default.Makefile \ diff --git a/qt/time/Makefile.am b/qt/time/Makefile.am index a982bdf18..ab4fffee1 100644 --- a/qt/time/Makefile.am +++ b/qt/time/Makefile.am @@ -19,6 +19,6 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu EXTRA_DIST = README.time assim cswap go init prim raw diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 373f03d69..effdfe8df 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu # These should be installed and distributed. scripts_sources = \ diff --git a/srfi/Makefile.am b/srfi/Makefile.am index 8340ab1b2..01e16aa99 100644 --- a/srfi/Makefile.am +++ b/srfi/Makefile.am @@ -19,7 +19,7 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = gnu ## Prevent automake from adding extra -I options DEFS = @DEFS@ From 11503928568206723fe84628c9690d9856e518a3 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:05:37 +0000 Subject: [PATCH 010/107] New file. --- test-suite/tests/dynamic-scope.test | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 test-suite/tests/dynamic-scope.test diff --git a/test-suite/tests/dynamic-scope.test b/test-suite/tests/dynamic-scope.test new file mode 100644 index 000000000..bb7e1adda --- /dev/null +++ b/test-suite/tests/dynamic-scope.test @@ -0,0 +1,78 @@ +;;;; -*- scheme -*- +;;;; dynamic-scop.test --- test suite for dynamic scoping constructs +;;;; +;;;; Copyright (C) 2001 Free Software Foundation, Inc. +;;;; +;;;; This program is free software; you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation; either version 2, or (at your option) +;;;; any later version. +;;;; +;;;; This program is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with this software; see the file COPYING. If not, write to +;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;;;; Boston, MA 02111-1307 USA + +(use-modules (test-suite lib)) + +(define global-a 0) +(define (fetch-global-a) global-a) + +(with-test-prefix "dynamic scope" + + (pass-if "@bind binds" + (= (@bind ((global-a 1)) (fetch-global-a)) 1)) + + (pass-if "@bind unbinds" + (begin + (set! global-a 0) + (@bind ((global-a 1)) (fetch-global-a)) + (= global-a 0))) + + (pass-if-exception "duplicate @binds" + (cons 'misc-error "^duplicate bindings") + (@bind ((a 1) (a 2)) (+ a a))) + + (pass-if-exception "@bind missing expression" + (cons 'misc-error "^missing or extra expression") + (@bind ((global-a 1)))) + + (pass-if-exception "@bind bad bindings" + (cons 'misc-error "^bad bindings") + (@bind (a) #f)) + + (pass-if-exception "@bind bad bindings" + (cons 'misc-error "^bad bindings") + (@bind ((a)) #f)) + + (pass-if "@bind and dynamic-wind" + (letrec ((co-routine #f) + (spawn (lambda (proc) + (set! co-routine proc))) + (yield (lambda (val) + (call-with-current-continuation + (lambda (k) + (let ((next co-routine)) + (set! co-routine k) + (next val))))))) + + (spawn (lambda (val) + (@bind ((global-a 'inside)) + (yield global-a) + (yield global-a)))) + + (set! global-a 'outside) + (let ((inside-a (yield #f))) + (let ((outside-a global-a)) + (let ((inside-a2 (yield #f))) + (and (eq? inside-a 'inside) + (eq? outside-a 'outside) + (eq? inside-a2 'inside)))))))) + + + From 969e8e458a052c8bb7d19c0e78d53e98957c1388 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:05:50 +0000 Subject: [PATCH 011/107] *** empty log message *** --- ice-9/ChangeLog | 4 ++++ oop/ChangeLog | 5 +++++ qt/ChangeLog | 5 +++++ scripts/ChangeLog | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 3bbf33074..240a7116c 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,7 @@ +2001-08-25 Marius Vollmer + + * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". + 2001-08-12 Thien-Thi Nguyen * getopt-long.scm: Rewrite. diff --git a/oop/ChangeLog b/oop/ChangeLog index ab927758c..87a52a216 100644 --- a/oop/ChangeLog +++ b/oop/ChangeLog @@ -1,3 +1,8 @@ +2001-08-25 Marius Vollmer + + * Makefile.am, goops/Makefile.am: (AUTOMAKE_OPTIONS): Change + "foreign" to "gnu". + 2001-07-29 Marius Vollmer * goops/dispatch.scm (hashset-index): Renumbered, since the vcell diff --git a/qt/ChangeLog b/qt/ChangeLog index 2550d9d59..2d8c015e9 100644 --- a/qt/ChangeLog +++ b/qt/ChangeLog @@ -1,3 +1,8 @@ +2001-08-25 Marius Vollmer + + * Makefile.am, md/Makefile.am, time/Makefile.am: + (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". + 2001-08-15 Rob Browning * Makefile.am (libqthreads_la_LDFLAGS): use libtool interface version diff --git a/scripts/ChangeLog b/scripts/ChangeLog index b4eced90c..04ee6ceb7 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2001-08-25 Marius Vollmer + + * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". + 2001-08-07 Michael Livshin * snarf-check-and-output-texi: print optional args in a prettier From 2e1711782d553c3fa96824ab3aed825ceb47f449 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:08:13 +0000 Subject: [PATCH 012/107] * 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. --- libguile/dynwind.c | 2 +- libguile/dynwind.h | 2 + libguile/eval.c | 109 ++++++++++++++++++++++++++------------------- 3 files changed, 67 insertions(+), 46 deletions(-) diff --git a/libguile/dynwind.c b/libguile/dynwind.c index 889c0d4fb..d093861cf 100644 --- a/libguile/dynwind.c +++ b/libguile/dynwind.c @@ -184,7 +184,7 @@ SCM_DEFINE (scm_wind_chain, "wind-chain", 0, 0, 0, #undef FUNC_NAME #endif -static void +void scm_swap_bindings (SCM vars, SCM vals) { SCM tmp; diff --git a/libguile/dynwind.h b/libguile/dynwind.h index 9f457f636..f956ea456 100644 --- a/libguile/dynwind.h +++ b/libguile/dynwind.h @@ -59,6 +59,8 @@ extern SCM scm_internal_dynamic_wind (scm_t_guard before, extern void scm_dowinds (SCM to, long delta); extern void scm_init_dynwind (void); +extern void scm_swap_bindings (SCM vars, SCM vals); + #ifdef GUILE_DEBUG extern SCM scm_wind_chain (void); #endif /*GUILE_DEBUG*/ diff --git a/libguile/eval.c b/libguile/eval.c index f598f370d..b896814d2 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1112,32 +1112,53 @@ scm_m_atfop (SCM xorig, SCM env SCM_UNUSED) return x; } +/* (@bind ((var exp) ...) body ...) + + This will assign the values of the `exp's to the global variables + named by `var's (symbols, not evaluated), creating them if they + don't exist, executes body, and then restores the previous values of + the `var's. Additionally, whenever control leaves body, the values + of the `var's are saved and restored when control returns. It is an + error when a symbol appears more than once among the `var's. + All `exp's are evaluated before any `var' is set. + + This of this as `let' for dynamic scope. + + It is memoized into (#@bind ((var ...) . (reversed-val ...)) body ...). + + XXX - also implement `@bind*'. +*/ + SCM_SYNTAX (s_atbind, "@bind", scm_makmmacro, scm_m_atbind); SCM scm_m_atbind (SCM xorig, SCM env) { SCM x = SCM_CDR (xorig); - SCM_ASSYNT (scm_ilength (x) > 1, scm_s_expression, "@bind"); + SCM top_level = scm_env_top_level (env); + SCM vars = SCM_EOL; + SCM exps = SCM_EOL; + + SCM_ASSYNT (scm_ilength (x) > 1, scm_s_expression, s_atbind); - if (SCM_IMP (env)) - env = SCM_BOOL_F; - else - { - while (SCM_NIMP (SCM_CDR (env))) - env = SCM_CDR (env); - env = SCM_CAR (env); - if (SCM_CONSP (env)) - env = SCM_BOOL_F; - } - x = SCM_CAR (x); while (SCM_NIMP (x)) { - SCM_SETCAR (x, scm_sym2var (SCM_CAR (x), env, SCM_BOOL_T)); + SCM rest; + SCM sym_exp = SCM_CAR (x); + SCM_ASSYNT (scm_ilength (sym_exp) == 2, scm_s_bindings, s_atbind); + SCM_ASSYNT (SCM_SYMBOLP (SCM_CAR (sym_exp)), scm_s_bindings, s_atbind); x = SCM_CDR (x); + for (rest = x; SCM_NIMP (rest); rest = SCM_CDR (rest)) + if (SCM_EQ_P (SCM_CAR (sym_exp), SCM_CAR (SCM_CAR (rest)))) + scm_misc_error (s_atbind, scm_s_duplicate_bindings, SCM_EOL); + vars = scm_cons (scm_sym2var (SCM_CAR (sym_exp), top_level, SCM_BOOL_T), + vars); + exps = scm_cons (SCM_CADR (sym_exp), exps); } - return scm_cons (SCM_IM_BIND, SCM_CDR (xorig)); + return scm_cons (SCM_IM_BIND, + scm_cons (scm_cons (scm_reverse_x (vars, SCM_EOL), exps), + SCM_CDDR (xorig))); } SCM_SYNTAX (s_at_call_with_values, "@call-with-values", scm_makmmacro, scm_m_at_call_with_values); @@ -2411,39 +2432,37 @@ dispatch: : SCM_INUM0) case (SCM_ISYMNUM (SCM_IM_BIND)): - x = SCM_CDR (x); + { + SCM vars, exps, vals; - t.arg1 = SCM_CAR (x); - arg2 = SCM_CDAR (env); - while (SCM_NIMP (arg2)) - { - proc = SCM_VARIABLE_REF (SCM_CAR (t.arg1)); - SCM_VARIABLE_SET (SCM_CAR (t.arg1), SCM_CAR (arg2)); - SCM_SETCAR (arg2, proc); - t.arg1 = SCM_CDR (t.arg1); - arg2 = SCM_CDR (arg2); - } - t.arg1 = SCM_CAR (x); - scm_dynwinds = scm_acons (t.arg1, SCM_CDAR (env), scm_dynwinds); - - arg2 = x = SCM_CDR (x); - while (!SCM_NULLP (arg2 = SCM_CDR (arg2))) - { - SIDEVAL (SCM_CAR (x), env); - x = arg2; - } - proc = EVALCAR (x, env); - - scm_dynwinds = SCM_CDR (scm_dynwinds); - arg2 = SCM_CDAR (env); - while (SCM_NIMP (arg2)) - { - SCM_VARIABLE_SET (SCM_CAR (t.arg1), SCM_CAR (arg2)); - t.arg1 = SCM_CDR (t.arg1); - arg2 = SCM_CDR (arg2); - } + x = SCM_CDR (x); + vars = SCM_CAAR (x); + exps = SCM_CDAR (x); - RETURN (proc); + vals = SCM_EOL; + + while (SCM_NIMP (exps)) + { + vals = scm_cons (EVALCAR (exps, env), vals); + exps = SCM_CDR (exps); + } + + scm_swap_bindings (vars, vals); + scm_dynwinds = scm_acons (vars, vals, scm_dynwinds); + + arg2 = x = SCM_CDR (x); + while (!SCM_NULLP (arg2 = SCM_CDR (arg2))) + { + SIDEVAL (SCM_CAR (x), env); + x = arg2; + } + proc = EVALCAR (x, env); + + scm_dynwinds = SCM_CDR (scm_dynwinds); + scm_swap_bindings (vars, vals); + + RETURN (proc) + } case (SCM_ISYMNUM (SCM_IM_CALL_WITH_VALUES)): { From 0005eb7c2d392cedde62078b40d9a4c179e8e195 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:12:09 +0000 Subject: [PATCH 013/107] (resolve-interface): Get variables from the public interface of a module instead of from the module itselfs. --- ice-9/boot-9.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 67e20c523..152e85fe0 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -1712,11 +1712,11 @@ (orig (if direct? bspec (car bspec))) (seen (if direct? bspec (cdr bspec)))) (module-add! custom-i (renamer seen) - (or (module-local-variable module orig) + (or (module-local-variable public-i orig) (error ;; fixme: format manually for now (simple-format - #f "no binding `~A' in module ~A" + #f "no binding `~A' exported from module ~A" orig name)))))) selection) custom-i)))) From b573e744551a9a4a9f77ac5889a7924aef73f156 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 25 Aug 2001 16:12:28 +0000 Subject: [PATCH 014/107] *** empty log message *** --- ice-9/ChangeLog | 5 +++++ libguile/ChangeLog | 9 +++++++++ srfi/ChangeLog | 4 ++++ test-suite/ChangeLog | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 240a7116c..1d0d50abe 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,8 @@ +2001-08-25 Marius Vollmer + + * boot-9.scm (resolve-interface): Get variables from the public + interface of a module instead of from the module itselfs. + 2001-08-25 Marius Vollmer * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". diff --git a/libguile/ChangeLog b/libguile/ChangeLog index d44668e74..694f71030 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 6931487c9..427d3f337 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,7 @@ +2001-08-25 Marius Vollmer + + * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". + 2001-08-24 Thien-Thi Nguyen * srfi-13.h (scm_string_map, scm_string_map_x, diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index a284610a8..73dd85265 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,7 @@ +2001-08-25 Marius Vollmer + + * tests/dynamic-scope.test: New file. + 2001-08-24 Thien-Thi Nguyen * tests/srfi-13.test (string-for-each, string-for-each-index): From 9ec1e7705c553141cc48429cd9acec9f1c7b78d7 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 18:20:56 +0000 Subject: [PATCH 015/107] (GC_noop1): Move before `GC_find_limit' where it is used; nfc. Thanks to Bill Schottstaedt. --- libguile/gc_os_dep.c | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/libguile/gc_os_dep.c b/libguile/gc_os_dep.c index cc5af6837..55864acb3 100644 --- a/libguile/gc_os_dep.c +++ b/libguile/gc_os_dep.c @@ -18,7 +18,7 @@ /* * Copied from gc5.2, files "os_dep.c", "gc_priv.h", "mark.c" and "gcconfig.h", - * and modified for Guile by Marius Vollmer. + * and modified for Guile by Marius Vollmer. */ #include @@ -225,7 +225,7 @@ typedef int GC_bool; # if defined(_AMIGA) && !defined(AMIGA) # define AMIGA # endif -# ifdef AMIGA +# ifdef AMIGA # define M68K # define mach_type_known # endif @@ -434,7 +434,7 @@ typedef int GC_bool; * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines, * the value of environ is a pointer that can serve as STACKBOTTOM. * I expect that HEURISTIC2 can be replaced by this approach, which - * interferes far less with debugging. + * interferes far less with debugging. * * If no expression for STACKBOTTOM can be found, and neither of the above * heuristics are usable, the collector can still be used with all of the above @@ -737,7 +737,7 @@ typedef int GC_bool; # define OS_TYPE "SEQUENT" extern int etext; # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff)) -# define STACKBOTTOM ((ptr_t) 0x3ffff000) +# define STACKBOTTOM ((ptr_t) 0x3ffff000) # endif # ifdef SUNOS5 # define OS_TYPE "SUNOS5" @@ -826,7 +826,7 @@ typedef int GC_bool; /* cache miss stalls for the targetted load instructions. But it */ /* seems to interfere enough with other cache traffic that the net */ /* result is worse than prefetchnta. */ -# if 0 +# if 0 /* Using prefetches for write seems to have a slight negative */ /* impact on performance, at least for a PIII/500. */ # define PREFETCH_FOR_WRITE(x) \ @@ -836,7 +836,7 @@ typedef int GC_bool; # ifdef USE_3DNOW_PREFETCH # define PREFETCH(x) \ __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x))) -# define PREFETCH_FOR_WRITE(x) +# define PREFETCH_FOR_WRITE(x) __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x))) # endif # endif @@ -1371,7 +1371,7 @@ typedef int GC_bool; # if defined(LINUX) && !defined(POWERPC) -# if 0 +# if 0 # include # if (LINUX_VERSION_CODE <= 0x10400) /* Ugly hack to get struct sigcontext_struct definition. Required */ @@ -1531,13 +1531,13 @@ typedef int GC_bool; # endif /*!OS/2 */ -/* - * Find the base of the stack. +/* + * Find the base of the stack. * Used only in single-threaded environment. * With threads, GC_mark_roots needs to know how to do this. * Called with allocator lock held. */ -# ifdef MSWIN32 +# ifdef MSWIN32 # define is_writable(prot) ((prot) == PAGE_READWRITE \ || (prot) == PAGE_WRITECOPY \ || (prot) == PAGE_EXECUTE_READWRITE \ @@ -1551,7 +1551,7 @@ static word GC_get_writable_length(ptr_t p, ptr_t *base) MEMORY_BASIC_INFORMATION buf; word result; word protect; - + result = VirtualQuery(p, &buf, sizeof(buf)); if (result != sizeof(buf)) ABORT("Weird VirtualQuery result"); if (base != 0) *base = (ptr_t)(buf.AllocationBase); @@ -1589,7 +1589,7 @@ void *scm_get_stack_base() { PTIB ptib; PPIB ppib; - + if (DosGetInfoBlocks(&ptib, &ppib) != NO_ERROR) { GC_err_printf0("DosGetInfoBlocks failed\n"); ABORT("DosGetInfoBlocks failed\n"); @@ -1604,7 +1604,7 @@ void *scm_get_stack_base() void *scm_get_stack_base() { struct Process *proc = (struct Process*)SysBase->ThisTask; - + /* Reference: Amiga Guru Book Pages: 42,567,574 */ if (proc->pr_Task.tc_Node.ln_Type==NT_PROCESS && proc->pr_CLI != NULL) { @@ -1651,7 +1651,7 @@ void *scm_get_stack_base() /* Some tools to implement HEURISTIC2 */ # define MIN_PAGE_SIZE 256 /* Smallest conceivable page size, bytes */ /* static */ jmp_buf GC_jmp_buf; - + /*ARGSUSED*/ static void GC_fault_handler(sig) int sig; @@ -1673,7 +1673,7 @@ void *scm_get_stack_base() # else static handler old_segv_handler, old_bus_handler; # endif - + static void GC_setup_temporary_fault_handler() { # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) @@ -1710,7 +1710,7 @@ void *scm_get_stack_base() # endif # endif } - + static void GC_reset_fault_handler() { # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) @@ -1727,6 +1727,15 @@ void *scm_get_stack_base() # endif } + /* Single argument version, robust against whole program analysis. */ + static void + GC_noop1(x) + word x; + { + static VOLATILE word sink; + sink = x; + } + /* Return the first nonaddressible location > p (up) or */ /* the smallest location q s.t. [q,p] is addressible (!up). */ static ptr_t GC_find_limit(p, up) @@ -1760,15 +1769,6 @@ void *scm_get_stack_base() return(result); } - /* Single argument version, robust against whole program analysis. */ - static void - GC_noop1(x) - word x; - { - static VOLATILE word sink; - sink = x; - } - # endif #ifdef LINUX_STACKBOTTOM @@ -1784,13 +1784,13 @@ void *scm_get_stack_base() { /* We read the stack base value from /proc/self/stat. We do this */ /* using direct I/O system calls in order to avoid calling malloc */ - /* in case REDIRECT_MALLOC is defined. */ + /* in case REDIRECT_MALLOC is defined. */ # define STAT_BUF_SIZE 4096 # ifdef USE_LD_WRAP # define STAT_READ __real_read # else # define STAT_READ read -# endif +# endif char stat_buf[STAT_BUF_SIZE]; int f; char c; From d098d810cfbe3c7052f1c0291e582cf8b5c47b03 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 18:22:50 +0000 Subject: [PATCH 016/107] (SCM_VALIDATE_USHORT_COPY, SCM_VALIDATE_SHORT_COPY, SCM_VALIDATE_UINT_COPY, SCM_VALIDATE_INT_COPY): New macros. Thanks to Chris Cramer. --- libguile/validate.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libguile/validate.h b/libguile/validate.h index 51a9708cf..869ae97a4 100644 --- a/libguile/validate.h +++ b/libguile/validate.h @@ -1,4 +1,3 @@ -/* $Id: validate.h,v 1.34 2001-06-26 10:59:34 dirk Exp $ */ /* Copyright (C) 1999,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -199,6 +198,26 @@ cvar = SCM_INUM (k); \ } while (0) +#define SCM_VALIDATE_USHORT_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2USHORT (pos, k); \ + } while (0) + +#define SCM_VALIDATE_SHORT_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2SHORT (pos, k); \ + } while (0) + +#define SCM_VALIDATE_UINT_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2UINT (pos, k); \ + } while (0) + +#define SCM_VALIDATE_INT_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2INT (pos, k); \ + } while (0) + #define SCM_VALIDATE_ULONG_COPY(pos, k, cvar) \ do { \ cvar = SCM_NUM2ULONG (pos, k); \ From e4d1c1eabdc093810721162ddc066818f8cb3035 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 18:29:38 +0000 Subject: [PATCH 017/107] *** empty log message *** --- libguile/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 694f71030..ac5665c14 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +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". From afb47f6d45f80f02c59a38d76c1612a788dd3d40 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 18:40:11 +0000 Subject: [PATCH 018/107] (add-duration): Fix bug: Call `add-duration!' w/ two args. Thanks to Alex Shinn. --- srfi/srfi-19.scm | 104 ++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm index 6a1a5a268..721fd7414 100644 --- a/srfi/srfi-19.scm +++ b/srfi/srfi-19.scm @@ -1,17 +1,17 @@ ;;; srfi-19.scm --- SRFI-19 procedures for Guile ;;; ;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;; +;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 2, or ;;; (at your option) any later version. -;;; +;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. -;;; +;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this software; see the file COPYING. If not, write to ;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -173,13 +173,13 @@ (define priv:locale-number-separator ".") (define priv:locale-abbr-weekday-vector - (vector "Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat")) + (vector "Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat")) (define priv:locale-long-weekday-vector (vector "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday")) -;; note empty string in 0th place. +;; note empty string in 0th place. (define priv:locale-abbr-month-vector (vector "" "Jan" @@ -193,7 +193,7 @@ "Sep" "Oct" "Nov" - "Dec")) + "Dec")) (define priv:locale-long-month-vector (vector "" @@ -208,7 +208,7 @@ "September" "October" "November" - "December")) + "December")) (define priv:locale-pm "PM") (define priv:locale-am "AM") @@ -239,7 +239,7 @@ ;; and update as necessary. ;; this procedures reads the file in the abover ;; format and creates the leap second table -;; it also calls the almost standard, but not R5 procedures read-line +;; it also calls the almost standard, but not R5 procedures read-line ;; & open-input-string ;; ie (set! priv:leap-second-table (priv:read-tai-utc-date "tai-utc.dat")) @@ -254,7 +254,7 @@ (if (not (eq? line eof)) (begin (let* ((data (read (open-input-string - (string-append "(" line ")")))) + (string-append "(" line ")")))) (year (car data)) (jd (cadddr (cdr data))) (secs (cadddr (cdddr data)))) @@ -501,7 +501,7 @@ (define (add-duration t duration) (let ((result (copy-time t))) - (add-duration! result))) + (add-duration! result duration))) (define (subtract-duration! t duration) (if (not (eq? (time-type duration) time-duration)) @@ -524,7 +524,7 @@ (set-time-type! time-out time-utc) (set-time-nanosecond! time-out (time-nanosecond time-in)) (set-time-second! time-out (- (time-second time-in) - (priv:leap-second-delta + (priv:leap-second-delta (time-second time-in)))) time-out) @@ -541,7 +541,7 @@ (set-time-type! time-out time-tai) (set-time-nanosecond! time-out (time-nanosecond time-in)) (set-time-second! time-out (+ (time-second time-in) - (priv:leap-second-delta + (priv:leap-second-delta (time-second time-in)))) time-out) @@ -640,7 +640,7 @@ (quotient y 400) -32045))) -;; gives the seconds/date/month/year +;; gives the seconds/date/month/year (define (priv:decode-julian-day-number jdn) (let* ((days (inexact->exact (truncate jdn))) (a (+ days 32044)) @@ -677,7 +677,7 @@ (if (not (eq? (time-type time) time-utc)) (priv:time-error 'time->date 'incompatible-time-types time)) (let* ((offset (if (null? tz-offset) - (priv:local-tz-offset time) + (priv:local-tz-offset time) (car tz-offset))) (leap-second? (priv:leap-second? (+ offset (time-second time)))) (jdn (priv:time->julian-day-number (if leap-second? @@ -775,7 +775,7 @@ priv:tai-epoch-in-jd)) ;; jdays is an integer plus 1/2, (jdays-1/2 (inexact->exact (- jdays 1/2)))) - (make-time + (make-time time-utc (date-nanosecond date) (+ (* jdays-1/2 24 60 60) @@ -797,7 +797,7 @@ (define (leap-year? date) (priv:leap-year? (date-year date))) -(define priv:month-assoc '((1 . 31) (2 . 59) (3 . 90) (4 . 120) +(define priv:month-assoc '((1 . 31) (2 . 59) (3 . 90) (4 . 120) (5 . 151) (6 . 181) (7 . 212) (8 . 243) (9 . 273) (10 . 304) (11 . 334) (12 . 365))) @@ -812,7 +812,7 @@ (define (date-year-day date) (priv:year-day (date-day date) (date-month date) (date-year date))) -;; from calendar faq +;; from calendar faq (define (priv:week-day day month year) (let* ((a (quotient (- 14 month) 12)) (y (- year a)) @@ -843,7 +843,7 @@ (priv:days-before-first-week date day-of-week-starting-week)) 7)) -(define (current-date . tz-offset) +(define (current-date . tz-offset) (let ((time (current-time time-utc))) (time-utc->date time @@ -895,7 +895,7 @@ (define (time-tai->julian-day time) (if (not (eq? (time-type time) time-tai)) (priv:time-error 'time->date 'incompatible-time-types time)) - (+ (/ (+ (- (time-second time) + (+ (/ (+ (- (time-second time) (priv:leap-second-delta (time-second time))) (/ (time-nanosecond time) priv:nano)) priv:sid) @@ -909,7 +909,7 @@ (define (time-monotonic->julian-day time) (if (not (eq? (time-type time) time-monotonic)) (priv:time-error 'time->date 'incompatible-time-types time)) - (+ (/ (+ (- (time-second time) + (+ (/ (+ (- (time-second time) (priv:leap-second-delta (time-second time))) (/ (time-nanosecond time) priv:nano)) priv:sid) @@ -923,7 +923,7 @@ (let ((secs (* priv:sid (- jdn priv:tai-epoch-in-jd)))) (receive (seconds parts) (priv:split-real secs) - (make-time time-utc + (make-time time-utc (* parts priv:nano) seconds)))) @@ -975,7 +975,7 @@ (define (priv:last-n-digits i n) (abs (remainder i (expt 10 n)))) -(define (priv:locale-abbr-weekday n) +(define (priv:locale-abbr-weekday n) (vector-ref priv:locale-abbr-weekday-vector n)) (define (priv:locale-long-weekday n) @@ -1035,7 +1035,7 @@ ;; the second is a procedure that takes the date, a padding character ;; (which might be #f), and the output port. ;; -(define priv:directives +(define priv:directives (list (cons #\~ (lambda (date pad-with port) (display #\~ port))) @@ -1072,8 +1072,8 @@ (display (priv:padding (date-second date) pad-with 2) port)) - (receive (i f) - (priv:split-real (/ + (receive (i f) + (priv:split-real (/ (date-nanosecond date) priv:nano 1.0)) (let* ((ns (number->string f)) @@ -1165,7 +1165,7 @@ (display (priv:padding (date-week-number date 1) #\0 2) port)))) (cons #\y (lambda (date pad-with port) - (display (priv:padding (priv:last-n-digits + (display (priv:padding (priv:last-n-digits (date-year date) 2) pad-with 2) @@ -1201,21 +1201,21 @@ (display current-char port) (priv:date-printer date (+ index 1) format-string str-len port)) (if (= (+ index 1) str-len) ; bad format string. - (priv:time-error 'priv:date-printer 'bad-date-format-string + (priv:time-error 'priv:date-printer 'bad-date-format-string format-string) (let ((pad-char? (string-ref format-string (+ index 1)))) (cond ((char=? pad-char? #\-) (if (= (+ index 2) str-len) ; bad format string. (priv:time-error 'priv:date-printer - 'bad-date-format-string + 'bad-date-format-string format-string) - (let ((formatter (priv:get-formatter + (let ((formatter (priv:get-formatter (string-ref format-string (+ index 2))))) (if (not formatter) (priv:time-error 'priv:date-printer - 'bad-date-format-string + 'bad-date-format-string format-string) (begin (formatter date #f port) @@ -1224,18 +1224,18 @@ format-string str-len port)))))) - + ((char=? pad-char? #\_) (if (= (+ index 2) str-len) ; bad format string. (priv:time-error 'priv:date-printer - 'bad-date-format-string + 'bad-date-format-string format-string) - (let ((formatter (priv:get-formatter + (let ((formatter (priv:get-formatter (string-ref format-string (+ index 2))))) (if (not formatter) (priv:time-error 'priv:date-printer - 'bad-date-format-string + 'bad-date-format-string format-string) (begin (formatter date #\Space port) @@ -1245,12 +1245,12 @@ str-len port)))))) (else - (let ((formatter (priv:get-formatter + (let ((formatter (priv:get-formatter (string-ref format-string (+ index 1))))) (if (not formatter) (priv:time-error 'priv:date-printer - 'bad-date-format-string + 'bad-date-format-string format-string) (begin (formatter date #\0 port) @@ -1304,8 +1304,8 @@ (let ((ch (peek-char port))) (cond ((>= nchars n) accum) - ((eof-object? ch) - (priv:time-error 'string->date 'bad-date-template-string + ((eof-object? ch) + (priv:time-error 'string->date 'bad-date-template-string "Premature ending to integer read.")) ((char-numeric? ch) (set! padding-ok #f) @@ -1316,7 +1316,7 @@ (read-char port) ; consume padding (accum-int port accum (+ nchars 1))) (else ; padding where it shouldn't be - (priv:time-error 'string->date 'bad-date-template-string + (priv:time-error 'string->date 'bad-date-template-string "Non-numeric characters in integer read."))))) (accum-int port 0 0))) @@ -1325,8 +1325,8 @@ (lambda (port) (priv:integer-reader-exact n port))) -(define (priv:zone-reader port) - (let ((offset 0) +(define (priv:zone-reader port) + (let ((offset 0) (positive? #f)) (let ((ch (read-char port))) (if (eof-object? ch) @@ -1375,8 +1375,8 @@ (if (char-alphabetic? ch) (read-char-string (cons (read-char port) result)) (list->string (reverse! result))))) - - (let* ((str (read-char-string '())) + + (let* ((str (read-char-string '())) (index (indexer str))) (if index index (priv:time-error 'string->date 'bad-date-template-string @@ -1396,7 +1396,7 @@ ;; A List of formatted read directives. ;; Each entry is a list. -;; 1. the character directive; +;; 1. the character directive; ;; a procedure, which takes a character as input & returns ;; 2. #t as soon as a character on the input port is acceptable ;; for input, @@ -1406,7 +1406,7 @@ ;; object (here, always the date) and (probably) side-effects it. ;; In some cases (e.g., ~A) the action is to do nothing -(define priv:read-directives +(define priv:read-directives (let ((ireader4 (priv:make-integer-reader 4)) (ireader2 (priv:make-integer-reader 2)) (ireaderf (priv:make-integer-reader #f)) @@ -1422,7 +1422,7 @@ priv:locale-long-month->index)) (char-fail (lambda (ch) #t)) (do-nothing (lambda (val object) (values)))) - + (list (list #\~ char-fail (priv:make-char-id-reader #\~) do-nothing) (list #\a char-alphabetic? locale-reader-abbr-weekday do-nothing) @@ -1452,7 +1452,7 @@ object val))) (list #\S char-numeric? ireader2 (lambda (val object) (set-date-second! object val))) - (list #\y char-fail eireader2 + (list #\y char-fail eireader2 (lambda (val object) (set-date-year! object (priv:natural-year val)))) (list #\Y char-numeric? ireader4 (lambda (val object) @@ -1473,7 +1473,7 @@ (if (not (skipper ch)) (begin (read-char port) (skip-until port skipper)))))) (if (>= index str-len) - (begin + (begin (values)) (let ((current-char (string-ref format-string index))) (if (not (char=? current-char #\~)) @@ -1510,7 +1510,7 @@ (actor val date))) (priv:string->date date (+ index 2) - format-string + format-string str-len port template-string)))))))))) @@ -1538,10 +1538,10 @@ ;; get it right (think of the double/missing hour in the ;; night when we are switching between normal time and DST). (set-date-zone-offset! newdate - (priv:local-tz-offset + (priv:local-tz-offset (make-time time-utc 0 0))) (set-date-zone-offset! newdate - (priv:local-tz-offset + (priv:local-tz-offset (date->time-utc newdate))))) (if (priv:date-ok? newdate) newdate @@ -1549,3 +1549,5 @@ 'string->date 'bad-date-format-string (list "Incomplete date read. " newdate template-string))))) + +;;; srfi-19.scm ends here From fa5a8c00ec3d25b945893b6ea7659cbe07906160 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 19:05:07 +0000 Subject: [PATCH 019/107] *** empty log message *** --- srfi/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 427d3f337..8bf12a69e 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,8 @@ +2001-08-25 Thien-Thi Nguyen + + * srfi-19.scm (add-duration): Fix bug: Call `add-duration!' w/ + two args. Thanks to Alex Shinn. + 2001-08-25 Marius Vollmer * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". From 176d0e0bfd538663a115f3d4186704cd36744ebb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 19:08:50 +0000 Subject: [PATCH 020/107] (test-time-comparision, test-time-arithmatic): New procs. Add time comparison tests using new procs. Thanks to Alex Shinn. --- test-suite/tests/srfi-19.test | 36 +++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/test-suite/tests/srfi-19.test b/test-suite/tests/srfi-19.test index 4065b0556..75eb25637 100644 --- a/test-suite/tests/srfi-19.test +++ b/test-suite/tests/srfi-19.test @@ -2,17 +2,17 @@ ;;;; Matthias Koeppe --- June 2001 ;;;; ;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; +;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2, or (at your option) ;;;; any later version. -;;;; +;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. -;;;; +;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -52,7 +52,7 @@ incomplete numerical tower implementation.)" (pass-if (format "~A makes integer seconds" date->time) (exact? (time-second - (date->time (make-date 0 0 0 12 1 6 2001 0)))))) + (date->time (make-date 0 0 0 12 1 6 2001 0)))))) (define (test-time->date time->date date->time) (pass-if (format "~A works" @@ -80,12 +80,20 @@ incomplete numerical tower implementation.)" (let ((time (make-time ,a 12345 67890123))) (time=? time (,b->a-sym (,a->b-sym time))))))) +(define (test-time-comparison cmp a b) + (pass-if (format #f "~A works" cmp) + (cmp a b))) + +(define (test-time-arithmetic op a b res) + (pass-if (format #f "~A works" op) + (time=? (op a b) res))) + (with-test-prefix "SRFI date/time library" ;; check for typos and silly errors (pass-if "date-zone-offset is defined" (and (defined? 'date-zone-offset) date-zone-offset - #t)) + #t)) (pass-if "add-duration is defined" (and (defined? 'add-duration) add-duration @@ -126,7 +134,23 @@ incomplete numerical tower implementation.)" (with-tz "CET" (string->date "2001-06-01@14:00" "~Y-~m-~d@~H:~M"))) (date->time-utc - (make-date 0 0 0 12 1 6 2001 0))))) + (make-date 0 0 0 12 1 6 2001 0)))) + ;; check time comparison procedures + (let* ((time1 (make-time time-monotonic 0 0)) + (time2 (make-time time-monotonic 0 0)) + (time3 (make-time time-monotonic 385907 998360432)) + (time4 (make-time time-monotonic 385907 998360432))) + (test-time-comparison time<=? time1 time3) + (test-time-comparison time=? time3 time3) + (test-time-comparison time>? time3 time2)) + ;; check time arithmetic procedures + (let* ((time1 (make-time time-monotonic 0 0)) + (time2 (make-time time-monotonic 385907 998360432)) + (diff (time-difference time2 time1))) + (test-time-arithmetic add-duration time1 diff time2) + (test-time-arithmetic subtract-duration time2 diff time1))) ;; Local Variables: ;; eval: (put 'with-tz 'scheme-indent-function 1) From 6fdad5dcc361e174dfb4bae7b8629a82225b4ec3 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 19:10:29 +0000 Subject: [PATCH 021/107] *** empty log message *** --- test-suite/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index 73dd85265..274d7cfc7 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,11 @@ +2001-08-25 Thien-Thi Nguyen + + * tests/srfi-19.test (test-time-comparision, + test-time-arithmatic): New procs. + + Add time comparison tests using new procs. + Thanks to Alex Shinn. + 2001-08-25 Marius Vollmer * tests/dynamic-scope.test: New file. From 047dc3aed5e75b61f5404c8bdae115039e742ee6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 25 Aug 2001 19:52:53 +0000 Subject: [PATCH 022/107] Add news on `:select' and `:renamer' facilities. --- NEWS | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/NEWS b/NEWS index 5390f8c41..5d8c5ff4b 100644 --- a/NEWS +++ b/NEWS @@ -383,6 +383,61 @@ want to re-export bindings, use the new `re-export' in place of `export'. The new `re-export' will not make copies of variables when rexporting them, as `export' did wrongly. +** Module system now allows selection and renaming of imported bindings + +Previously, when using `use-modules' or the `#:use-module' clause in +the `define-module' form, all the bindings (association of symbols to +values) for imported modules were added to the "current module" on an +as-is basis. This has been changed to allow finer control through two +new facilities: selection and renaming. + +You can now select which of the imported module's bindings are to be +visible in the current module by using the `:select' clause. This +clause also can be used to rename individual bindings. For example: + + ;; import all bindings no questions asked + (use-modules (ice-9 common-list)) + + ;; import four bindings, renaming two of them; + ;; the current module sees: every some zonk-y zonk-n + (use-modules ((ice-9 common-list) + :select (every some + (remove-if . zonk-y) + (remove-if-not . zonk-n)))) + +You can also programmatically rename all selected bindings using the +`:renamer' clause, which specifies a proc that takes a symbol and +returns another symbol. Because it is common practice to use a prefix, +we now provide the convenience procedure `symbol-prefix-proc'. For +example: + + ;; import four bindings, renaming two of them specifically, + ;; and all four w/ prefix "CL:"; + ;; the current module sees: CL:every CL:some CL:zonk-y CL:zonk-n + (use-modules ((ice-9 common-list) + :select (every some + (remove-if . zonk-y) + (remove-if-not . zonk-n)) + :renamer (symbol-prefix-proc 'CL:))) + + ;; import four bindings, renaming two of them specifically, + ;; and all four by upcasing. + ;; the current module sees: EVERY SOME ZONK-Y ZONK-N + (define (upcase-symbol sym) + (string->symbol (string-upcase (symbol->string sym)))) + + (use-modules ((ice-9 common-list) + :select (every some + (remove-if . zonk-y) + (remove-if-not . zonk-n)) + :renamer upcase-symbol)) + +Note that programmatic renaming is done *after* individual renaming. +Also, the above examples show `use-modules', but the same facilities are +available for the `#:use-module' clause of `define-module'. + +See manual for more info. + ** The semantics of guardians have changed. The changes are for the most part compatible. An important criterion From f91fc9cdd3e7eab7d1842d5ba88ff5ec1cc10b79 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 26 Aug 2001 21:51:32 +0000 Subject: [PATCH 023/107] Do not include ".libs" in LTDL_LIBRARY_PATH, libltdl provides it itself. --- check-guile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-guile.in b/check-guile.in index a9961e93d..126550a0c 100644 --- a/check-guile.in +++ b/check-guile.in @@ -21,7 +21,7 @@ if [ x"$1" = x-i ] ; then else guile=libguile/guile GUILE_LOAD_PATH=$srcdir:$TEST_SUITE_DIR - LTDL_LIBRARY_PATH=`pwd`/srfi/.libs:${LTDL_LIBRARY_PATH} + LTDL_LIBRARY_PATH=`pwd`/srfi:${LTDL_LIBRARY_PATH} fi export GUILE_LOAD_PATH export LTDL_LIBRARY_PATH From 7e8ef316ad8bae2a595ffb270f48cf054ae6bcc0 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 26 Aug 2001 21:52:33 +0000 Subject: [PATCH 024/107] Use load-extension instead of explicit dynamic-link/dynamic-call. Removed ".so" extension from library name. --- guile-readline/readline.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guile-readline/readline.scm b/guile-readline/readline.scm index 99e63bce0..3627c27c6 100644 --- a/guile-readline/readline.scm +++ b/guile-readline/readline.scm @@ -35,7 +35,7 @@ ;;; but only when it isn't already present. (if (not (feature? 'readline)) - (dynamic-call "scm_init_readline" (dynamic-link "libguilereadline.so"))) + (load-extension "libguilereadline" "scm_init_readline")) (if (not (feature? 'readline)) (scm-error 'misc-error From f5fd8aa2a70c16729bd8df6e4f012ade202f66ce Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 26 Aug 2001 21:54:11 +0000 Subject: [PATCH 025/107] Replaced "scm_t_portable" with "scm_port_table" which was an artifact from the great "scm_*_t -> scm_t_" renaming. --- libguile/fports.c | 4 ++-- libguile/gc.c | 6 +++--- libguile/ioext.c | 8 ++++---- libguile/ports.c | 52 +++++++++++++++++++++++------------------------ libguile/ports.h | 6 +++--- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/libguile/fports.c b/libguile/fports.c index 9466214b2..886caadf6 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -209,9 +209,9 @@ scm_evict_ports (int fd) { long i; - for (i = 0; i < scm_t_portable_size; i++) + for (i = 0; i < scm_port_table_size; i++) { - SCM port = scm_t_portable[i]->port; + SCM port = scm_port_table[i]->port; if (SCM_FPORTP (port)) { diff --git a/libguile/gc.c b/libguile/gc.c index 457c0edce..d63562f44 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -2821,9 +2821,9 @@ scm_init_storage () scm_c_hook_init (&scm_after_gc_c_hook, 0, SCM_C_HOOK_NORMAL); /* Initialise the list of ports. */ - scm_t_portable = (scm_t_port **) - malloc (sizeof (scm_t_port *) * scm_t_portable_room); - if (!scm_t_portable) + scm_port_table = (scm_t_port **) + malloc (sizeof (scm_t_port *) * scm_port_table_room); + if (!scm_port_table) return 1; #ifdef HAVE_ATEXIT diff --git a/libguile/ioext.c b/libguile/ioext.c index 759e78c38..4cb28ad62 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -300,11 +300,11 @@ SCM_DEFINE (scm_fdes_to_ports, "fdes->ports", 1, 0, 0, SCM_VALIDATE_INUM_COPY (1,fd,int_fd); - for (i = 0; i < scm_t_portable_size; i++) + for (i = 0; i < scm_port_table_size; i++) { - if (SCM_OPFPORTP (scm_t_portable[i]->port) - && ((scm_t_fport *) scm_t_portable[i]->stream)->fdes == int_fd) - result = scm_cons (scm_t_portable[i]->port, result); + if (SCM_OPFPORTP (scm_port_table[i]->port) + && ((scm_t_fport *) scm_port_table[i]->stream)->fdes == int_fd) + result = scm_cons (scm_port_table[i]->port, result); } return result; } diff --git a/libguile/ports.c b/libguile/ports.c index ddcc4b9a6..266ac0ea4 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -425,10 +425,10 @@ SCM_DEFINE (scm_set_current_error_port, "set-current-error-port", 1, 0, 0, /* The port table --- an array of pointers to ports. */ -scm_t_port **scm_t_portable; +scm_t_port **scm_port_table; -long scm_t_portable_size = 0; /* Number of ports in scm_t_portable. */ -long scm_t_portable_room = 20; /* Size of the array. */ +long scm_port_table_size = 0; /* Number of ports in scm_port_table. */ +long scm_port_table_room = 20; /* Size of the array. */ /* Add a port to the table. */ @@ -438,22 +438,22 @@ scm_add_to_port_table (SCM port) { scm_t_port *entry; - if (scm_t_portable_size == scm_t_portable_room) + if (scm_port_table_size == scm_port_table_room) { /* initial malloc is in gc.c. this doesn't use scm_must_malloc etc., since it can never be freed during gc. */ - void *newt = realloc ((char *) scm_t_portable, + void *newt = realloc ((char *) scm_port_table, (size_t) (sizeof (scm_t_port *) - * scm_t_portable_room * 2)); + * scm_port_table_room * 2)); if (newt == NULL) scm_memory_error ("scm_add_to_port_table"); - scm_t_portable = (scm_t_port **) newt; - scm_t_portable_room *= 2; + scm_port_table = (scm_t_port **) newt; + scm_port_table_room *= 2; } entry = (scm_t_port *) scm_must_malloc (sizeof (scm_t_port), FUNC_NAME); entry->port = port; - entry->entry = scm_t_portable_size; + entry->entry = scm_port_table_size; entry->revealed = 0; entry->stream = 0; entry->file_name = SCM_BOOL_F; @@ -464,8 +464,8 @@ scm_add_to_port_table (SCM port) entry->rw_active = SCM_PORT_NEITHER; entry->rw_random = 0; - scm_t_portable[scm_t_portable_size] = entry; - scm_t_portable_size++; + scm_port_table[scm_port_table_size] = entry; + scm_port_table_size++; return entry; } @@ -480,20 +480,20 @@ scm_remove_from_port_table (SCM port) scm_t_port *p = SCM_PTAB_ENTRY (port); long i = p->entry; - if (i >= scm_t_portable_size) + if (i >= scm_port_table_size) SCM_MISC_ERROR ("Port not in table: ~S", scm_list_1 (port)); if (p->putback_buf) scm_must_free (p->putback_buf); scm_must_free (p); /* Since we have just freed slot i we can shrink the table by moving the last entry to that slot... */ - if (i < scm_t_portable_size - 1) + if (i < scm_port_table_size - 1) { - scm_t_portable[i] = scm_t_portable[scm_t_portable_size - 1]; - scm_t_portable[i]->entry = i; + scm_port_table[i] = scm_port_table[scm_port_table_size - 1]; + scm_port_table[i]->entry = i; } SCM_SETPTAB_ENTRY (port, 0); - scm_t_portable_size--; + scm_port_table_size--; } #undef FUNC_NAME @@ -507,7 +507,7 @@ SCM_DEFINE (scm_pt_size, "pt-size", 0, 0, 0, "is only included in @code{--enable-guile-debug} builds.") #define FUNC_NAME s_scm_pt_size { - return SCM_MAKINUM (scm_t_portable_size); + return SCM_MAKINUM (scm_port_table_size); } #undef FUNC_NAME @@ -520,10 +520,10 @@ SCM_DEFINE (scm_pt_member, "pt-member", 1, 0, 0, { long i; SCM_VALIDATE_INUM_COPY (1,index,i); - if (i < 0 || i >= scm_t_portable_size) + if (i < 0 || i >= scm_port_table_size) return SCM_BOOL_F; else - return scm_t_portable[i]->port; + return scm_port_table[i]->port; } #undef FUNC_NAME #endif @@ -728,8 +728,8 @@ SCM_DEFINE (scm_port_for_each, "port-for-each", 1, 0, 0, SCM_DEFER_INTS; scm_block_gc++; ports = SCM_EOL; - for (i = 0; i < scm_t_portable_size; i++) - ports = scm_cons (scm_t_portable[i]->port, ports); + for (i = 0; i < scm_port_table_size; i++) + ports = scm_cons (scm_port_table[i]->port, ports); scm_block_gc--; SCM_ALLOW_INTS; @@ -757,9 +757,9 @@ SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1, { long i = 0; SCM_VALIDATE_REST_ARGUMENT (ports); - while (i < scm_t_portable_size) + while (i < scm_port_table_size) { - SCM thisport = scm_t_portable[i]->port; + SCM thisport = scm_port_table[i]->port; int found = 0; SCM ports_ptr = ports; @@ -872,10 +872,10 @@ SCM_DEFINE (scm_flush_all_ports, "flush-all-ports", 0, 0, 0, { size_t i; - for (i = 0; i < scm_t_portable_size; i++) + for (i = 0; i < scm_port_table_size; i++) { - if (SCM_OPOUTPORTP (scm_t_portable[i]->port)) - scm_flush (scm_t_portable[i]->port); + if (SCM_OPOUTPORTP (scm_port_table[i]->port)) + scm_flush (scm_port_table[i]->port); } return SCM_UNSPECIFIED; } diff --git a/libguile/ports.h b/libguile/ports.h index 866b74d23..60877af8c 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -130,8 +130,8 @@ typedef struct size_t putback_buf_size; /* allocated size of putback_buf. */ } scm_t_port; -extern scm_t_port **scm_t_portable; -extern long scm_t_portable_size; /* Number of ports in scm_t_portable. */ +extern scm_t_port **scm_port_table; +extern long scm_port_table_size; /* Number of ports in scm_port_table. */ #define SCM_READ_BUFFER_EMPTY_P(c_port) (c_port->read_pos >= c_port->read_end) @@ -219,7 +219,7 @@ typedef struct scm_t_ptob_descriptor extern scm_t_ptob_descriptor *scm_ptobs; extern long scm_numptob; -extern long scm_t_portable_room; +extern long scm_port_table_room; From fada26b27ea9abb301009965857f08a4978f1707 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 26 Aug 2001 21:54:33 +0000 Subject: [PATCH 026/107] *** empty log message *** --- ChangeLog | 5 +++++ guile-readline/ChangeLog | 6 ++++++ libguile/ChangeLog | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4a96bdc4b..74ff28440 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-08-27 Marius Vollmer + + * check-guile.in: Do not include ".libs" in LTDL_LIBRARY_PATH, + libltdl provides it itself. + 2001-08-24 Neil Jerram * configure.in (AC_CONFIG_FILES): Add per-manual doc directory diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index aba59dcb3..0b2bdfb2c 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,9 @@ +2001-08-25 Marius Vollmer + + * readline.scm: Use load-extension instead of explicit + dynamic-link/dynamic-call. Removed ".so" extension from library + name. + 2001-08-02 Neil Jerram * readline.scm (call-with-readline-completion-function): New. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ac5665c14..8f754125b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +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 From b45898cae3e21cfef5d4d98ba8d3d154a9861062 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Mon, 27 Aug 2001 21:25:44 +0000 Subject: [PATCH 027/107] * Fix doc snapshot build problems by avoiding use of ../AUTHORS file. * Use TEXINFO_TEX to avoid shipping multiple copies of texinfo.tex. --- doc/AUTHORS | 0 doc/ChangeLog | 8 ++++++ doc/goops/ChangeLog | 14 ++++++++++ doc/goops/Makefile.am | 4 ++- doc/goops/goops.texi | 17 +++++++++++- doc/mltext.texi | 4 +-- doc/r5rs/ChangeLog | 10 +++++++ doc/r5rs/Makefile.am | 2 ++ doc/ref/ChangeLog | 14 ++++++++++ doc/ref/Makefile.am | 3 +- doc/ref/guile.texi | 55 +++++++++++++++++++++++++++++++++++-- doc/ref/intro.texi | 21 +++++++------- doc/sources/ChangeLog | 5 ++++ doc/tutorial/ChangeLog | 14 ++++++++++ doc/tutorial/Makefile.am | 2 +- doc/tutorial/guile-tut.texi | 5 +++- 16 files changed, 157 insertions(+), 21 deletions(-) delete mode 100644 doc/AUTHORS create mode 100644 doc/goops/ChangeLog create mode 100644 doc/r5rs/ChangeLog create mode 100644 doc/ref/ChangeLog create mode 100644 doc/sources/ChangeLog create mode 100644 doc/tutorial/ChangeLog diff --git a/doc/AUTHORS b/doc/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/doc/ChangeLog b/doc/ChangeLog index e5b072ee9..0703983f5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,11 @@ +2001-08-27 Neil Jerram + + * mltext.texi (Guile Character Properties): Fix `hexidecimal' + spelling errors (merge from stable branch). + + * AUTHORS: Removed. Authorship information for each manual is now + in the top-level Texinfo file for that manual. + 2001-08-24 Neil Jerram * Makefile.am: Split documentation into per-manual subdirectories. diff --git a/doc/goops/ChangeLog b/doc/goops/ChangeLog new file mode 100644 index 000000000..2328d10d8 --- /dev/null +++ b/doc/goops/ChangeLog @@ -0,0 +1,14 @@ +2001-08-27 Neil Jerram + + * Makefile.am (goops_TEXINFOS): Remove ../AUTHORS. + (TEXINFO_TEX): Added; avoids shipping multiple copies of + texinfo.tex in a single distribution. + + * goops.texi: Incorporate text previously in separate AUTHORS + file. + +2001-08-27 Neil Jerram + + The change log for files in this directory continues backwards + from 2001-08-27 in ../ChangeLog, as all the Guile documentation + prior to this date was contained in a single directory. diff --git a/doc/goops/Makefile.am b/doc/goops/Makefile.am index 8a2661dfd..c9edf88b8 100644 --- a/doc/goops/Makefile.am +++ b/doc/goops/Makefile.am @@ -23,7 +23,9 @@ AUTOMAKE_OPTIONS = gnu info_TEXINFOS = goops.texi -goops_TEXINFOS = goops-tutorial.texi hierarchy.eps hierarchy.txt ../AUTHORS +goops_TEXINFOS = goops-tutorial.texi hierarchy.eps hierarchy.txt + +TEXINFO_TEX = ../ref/texinfo.tex # Optionally support building an HTML version of the manual. diff --git a/doc/goops/goops.texi b/doc/goops/goops.texi index 580b120e0..2e1909f36 100644 --- a/doc/goops/goops.texi +++ b/doc/goops/goops.texi @@ -40,7 +40,22 @@ are preserved on all copies. @titlepage @title Goops Manual @subtitle For use with GOOPS @value{VERSION} -@include ../AUTHORS + +@c AUTHORS + +@c The GOOPS tutorial was written by Christian Lynbech and Mikael +@c Djurfeldt, who also wrote GOOPS itself. The GOOPS reference manual +@c and MOP documentation were written by Neil Jerram and reviewed by +@c Mikael Djurfeldt. + +@author Christian Lynbech +@author @email{chl@@tbit.dk} +@author +@author Mikael Djurfeldt +@author @email{djurfeldt@@nada.kth.se} +@author +@author Neil Jerram +@author @email{neil@@ossau.uklinux.net} @c The following two commands @c start the copyright page. diff --git a/doc/mltext.texi b/doc/mltext.texi index 64bcdafa3..73071f501 100644 --- a/doc/mltext.texi +++ b/doc/mltext.texi @@ -53,7 +53,7 @@ Return non-zero iff @var{c} is a whitespace character. @end deftypefn @deftypefn {Libguile Function} int scm_mb_isxdigit (scm_mb_char_t @var{c}) -Return non-zero iff @var{c} is a hexidecimal digit. +Return non-zero iff @var{c} is a hexadecimal digit. @end deftypefn @deftypefn {Libguile Function} int scm_mb_isdefined (scm_mb_char_t @var{c}) @@ -69,7 +69,7 @@ unchanged. @end deftypefn @deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c}) -If @var{c} is a hexidecimal digit (according to +If @var{c} is a hexadecimal digit (according to @code{scm_mb_isxdigit}), then return its numeric value. Otherwise return -1. @end deftypefn diff --git a/doc/r5rs/ChangeLog b/doc/r5rs/ChangeLog new file mode 100644 index 000000000..4b0973487 --- /dev/null +++ b/doc/r5rs/ChangeLog @@ -0,0 +1,10 @@ +2001-08-27 Neil Jerram + + * Makefile.am (TEXINFO_TEX): Added; avoids shipping multiple copies of + texinfo.tex in a single distribution. + +2001-08-27 Neil Jerram + + The change log for files in this directory continues backwards + from 2001-08-27 in ../ChangeLog, as all the Guile documentation + prior to this date was contained in a single directory. diff --git a/doc/r5rs/Makefile.am b/doc/r5rs/Makefile.am index 231c7bfeb..2b3d40a67 100644 --- a/doc/r5rs/Makefile.am +++ b/doc/r5rs/Makefile.am @@ -22,3 +22,5 @@ AUTOMAKE_OPTIONS = gnu info_TEXINFOS = r5rs.texi + +TEXINFO_TEX = ../ref/texinfo.tex diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog new file mode 100644 index 000000000..a7300fd4c --- /dev/null +++ b/doc/ref/ChangeLog @@ -0,0 +1,14 @@ +2001-08-27 Neil Jerram + + * intro.texi: Merged wording fixes from stable CVS branch. + + * Makefile.am (guile_TEXINFOS): Remove ../AUTHORS. + + * guile.texi: Incorporate text previously in separate AUTHORS + file. + +2001-08-27 Neil Jerram + + The change log for files in this directory continues backwards + from 2001-08-27 in ../ChangeLog, as all the Guile documentation + prior to this date was contained in a single directory. diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 9f264c31c..99e06b0a8 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -32,8 +32,7 @@ guile_TEXINFOS = preface.texi intro.texi scheme-intro.texi \ scheme-reading.texi scheme-indices.texi slib.texi posix.texi \ expect.texi scsh.texi tcltk.texi scripts.texi gh.texi scm.texi \ appendices.texi indices.texi script-getopt.texi data-rep.texi \ - extend.texi repl-modules.texi srfi-modules.texi misc-modules.texi \ - ../AUTHORS + extend.texi repl-modules.texi srfi-modules.texi misc-modules.texi # Optionally support building an HTML version of the reference manual. diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 4ff25876b..834405d18 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -80,9 +80,60 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.2 2001-08-24 10:16:15 ossau Exp $ +@subtitle $Id: guile.texi,v 1.3 2001-08-27 21:25:44 ossau Exp $ @subtitle For use with Guile @value{VERSION} -@include ../AUTHORS + +@c AUTHORS + +@c The Guile reference and tutorial manuals were written and edited +@c largely by Mark Galassi and Jim Blandy. In particular, Jim wrote the +@c original tutorial on Guile's data representation and the C API for +@c accessing Guile objects. + +@c Significant portions were contributed by Gary Houston (contributions +@c to posix system calls and networking, expect, I/O internals and +@c extensions, slib installation, error handling) and Tim Pierce +@c (sections on script interpreter triggers, alists, function tracing). + +@c Tom Lord contributed a great deal of material with early Guile +@c snapshots; although most of this text has been rewritten, all of it +@c was important, and some of the structure remains. + +@c Aubrey Jaffer wrote the SCM Scheme implementation and manual upon +@c which the Guile program and manual are based. Some portions of the +@c SCM and SLIB manuals have been included here verbatim. + +@c Since Guile 1.4, Neil Jerram has been maintaining and improving the +@c reference manual. Among other contributions, he wrote the Basic +@c Ideas chapter, developed the tools for keeping the manual in sync +@c with snarfed libguile docstrings, and reorganized the structure so as +@c to accommodate docstrings for all Guile's primitives. + +@c Martin Grabmueller has made substantial contributions throughout the +@c reference manual in preparation for the Guile 1.6 release, including +@c filling out a lot of the documentation of Scheme data types, control +@c mechanisms and procedures. In addition, he wrote the documentation +@c for Guile's SRFI modules and modules associated with the Guile REPL. + +@author Mark Galassi +@author Cygnus Solution and Los Alamos National Laboratory +@author @email{rosalia@@cygnus.com} +@author +@author Jim Blandy +@author Free Software Foundation and MIT AI Lab +@author @email{jimb@@red-bean.com} +@author +@author Gary Houston +@author @email{ghouston@@arglist.com} +@author +@author Tim Pierce +@author @email{twp@@skepsis.com} +@author +@author Neil Jerram +@author @email{neil@@ossau.uklinux.net} +@author +@author Martin Grabmueller +@author @email{mgrabmue@@cs.tu-berlin.de} @c The following two commands start the copyright page. @page diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi index 28e30d06b..fdbbbf85b 100644 --- a/doc/ref/intro.texi +++ b/doc/ref/intro.texi @@ -1,4 +1,4 @@ -@c $Id: intro.texi,v 1.1 2001-08-24 09:40:29 ossau Exp $ +@c $Id: intro.texi,v 1.2 2001-08-27 21:25:44 ossau Exp $ @page @node What is Guile? @@ -359,7 +359,7 @@ manual. Once you've compiled your source files, you need to link them against the Guile object code library, @code{libguile}. On most systems, you should not need to do tell the compiler and linker -explicitely where they can find @file{libguile.h} and @file{libguile}. +explicitly where they can find @file{libguile.h} and @file{libguile}. When Guile has been installed in a peculiar way, or when you are on a peculiar system, things might not be so easy and you might need to pass additional @code{-I} or @code{-L} options to the compiler. Guile @@ -410,7 +410,7 @@ Why must the caller do all the real work from @var{main_func}? Guile's garbage collector scans the stack to find all local variables that reference Scheme objects. To do this, it needs to know the bounds of the stack that might contain such references. Because there is no -protable way in C to find the base of the stack, @code{scm_boot_guile} +portable way in C to find the base of the stack, @code{scm_boot_guile} assumes that all references are above its own stack frame. If you try to manipulate Scheme objects after this function returns, it's the luck of the draw whether Guile's storage manager will be able to find the @@ -632,7 +632,7 @@ available to Scheme. First we need to write the appropriate glue code to convert the arguments and return values of the functions from Scheme to C and back. Additionally, we need a function that will add them to the set of Guile primitives. Because this is just an example, we will -only implement this for the @code{j0} function, tho. +only implement this for the @code{j0} function. Consider the following file @file{bessel.c}. @@ -729,7 +729,7 @@ guile -c '(write %load-path) (newline)' Suppose you want to use the procedures and variables exported by the module @code{(ice-9 popen)}, which provides the means for communicating with other processes over pipes. Add the following line to your -currently running Guile REPL or the top of you script file. +currently running Guile REPL or the top of your script file. @lisp (use-modules (ice-9 popen)) @@ -840,7 +840,7 @@ is the current one. Thus, the call to @code{scm_c_define_gsubr} will put the new definition for @code{j0} into it, just as we want it. The definitions made in the C code are not automatically exported from -a module. You need to explicitely list the ones you want to export in +a module. You need to explicitly list the ones you want to export in @code{export} statements or with the @code{:export} option of @code{define-module}. @@ -961,7 +961,7 @@ Of course, if the bug is that Guile gets a fatal signal, then one can't miss it. But if the bug is incorrect results, the maintainer might fail to notice what is wrong. Why leave it to chance? -If the manifestation of the bug is an Guile error message, it is +If the manifestation of the bug is a Guile error message, it is important to report the precise text of the error message, and a backtrace showing how the Scheme program arrived at the error. @@ -978,7 +978,7 @@ programs that you must load into Guile in order to cause the problem to occur. @item -If the problem does depend on an init file or other Lisp programs that +If the problem does depend on an init file or other Scheme programs that are not part of the standard Guile distribution, then you should make sure it is not a bug in those programs by complaining to their maintainers first. After they verify that they are using Guile in a way @@ -988,7 +988,7 @@ that is supposed to work, they should report the bug. If you wish to mention something in the Guile source, show the line of code with a few lines of context. Don't just give a line number. -The line numbers in the development sources don't match those in your +The line numbers in the development sources might not match those in your sources. It would take extra work for the maintainers to determine what code is in your version at a given line number, and we could not be certain. @@ -1001,8 +1001,7 @@ very long, and using GDB is easy. You can find the GDB distribution, including the GDB manual in online form, in most of the same places you can find the Guile distribution. To run Guile under GDB, you should switch to the @file{libguile} subdirectory in which Guile was compiled, then -do @code{gdb .libs/guile}. -@c fixme: libguile/.libs is for libtool-enabled systems -- what about rest? +do @code{gdb guile} or @code{gdb .libs/guile} (if using GNU Libtool). However, you need to think when you collect the additional information if you want it to show what causes the bug. diff --git a/doc/sources/ChangeLog b/doc/sources/ChangeLog new file mode 100644 index 000000000..1df00138b --- /dev/null +++ b/doc/sources/ChangeLog @@ -0,0 +1,5 @@ +2001-08-27 Neil Jerram + + The change log for files in this directory continues backwards + from 2001-08-27 in ../ChangeLog, as all the Guile documentation + prior to this date was contained in a single directory. diff --git a/doc/tutorial/ChangeLog b/doc/tutorial/ChangeLog new file mode 100644 index 000000000..d7b7d1ea2 --- /dev/null +++ b/doc/tutorial/ChangeLog @@ -0,0 +1,14 @@ +2001-08-27 Neil Jerram + + * Makefile.am (guile_tut_TEXINFOS): Removed. + (TEXINFO_TEX): Added; avoids shipping multiple copies of + texinfo.tex in a single distribution. + + * guile-tut.texi: Incorporate text previously in separate AUTHORS + file. + +2001-08-27 Neil Jerram + + The change log for files in this directory continues backwards + from 2001-08-27 in ../ChangeLog, as all the Guile documentation + prior to this date was contained in a single directory. diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am index 7d439137f..4f9a6658f 100644 --- a/doc/tutorial/Makefile.am +++ b/doc/tutorial/Makefile.am @@ -23,7 +23,7 @@ AUTOMAKE_OPTIONS = gnu info_TEXINFOS = guile-tut.texi -guile_tut_TEXINFOS = ../AUTHORS +TEXINFO_TEX = ../ref/texinfo.tex # Optionally support building an HTML version of the reference manual. diff --git a/doc/tutorial/guile-tut.texi b/doc/tutorial/guile-tut.texi index c2f9fecee..3e1308d9c 100644 --- a/doc/tutorial/guile-tut.texi +++ b/doc/tutorial/guile-tut.texi @@ -27,7 +27,10 @@ @title Guile Tutorial @subtitle For use with Guile @value{VERSION} @subtitle Last updated @value{UPDATED} -@include ../AUTHORS + +@author Mark Galassi +@author Cygnus Solutions and Los Alamos National Laboratory +@author @email{rosalia@@nis.lanl.gov} @page @vskip 0pt plus 1filll From e1f0133b40ec99cc645c594cdf9625762f52ed71 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Aug 2001 18:23:35 +0000 Subject: [PATCH 028/107] Mention libtool ./configure-regeneration requirement. --- HACKING | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/HACKING b/HACKING index 431c1ea55..92ce83225 100644 --- a/HACKING +++ b/HACKING @@ -52,12 +52,17 @@ Automake 1.4-p4 --- a system for automatically generating Makefiles that Before using automake, you may need to copy `threads.m4' and `guile.m4' from the top directory of the Guile core disty to - `/usr/local/share/aclocal. + `/usr/local/share/aclocal'. libtool 1.4 --- a system for managing the zillion hairy options needed on various systems to produce shared libraries. Available in "ftp://ftp.gnu.org/pub/gnu/libtool" + To avoid reported tricky errors during the Guile build: After + unpacking the libtool distribution, use autoconf (2.50) to + regenerate its ./configure script. Then build and install as + usual. + flex 2.5.4 (or newer) --- a scanner generator. earlier versions will most probably work too. From cf390da1641263fdbf0db3d802737fd4b633fd50 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Aug 2001 18:25:39 +0000 Subject: [PATCH 029/107] *** empty log message *** --- ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 74ff28440..e0f143996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-08-30 Thien-Thi Nguyen + + * HACKING: Mention libtool ./configure-regeneration requirement. + 2001-08-27 Marius Vollmer * check-guile.in: Do not include ".libs" in LTDL_LIBRARY_PATH, @@ -7,7 +11,7 @@ * configure.in (AC_CONFIG_FILES): Add per-manual doc directory Makefiles. - + 2001-08-15 Rob Browning * configure.in From 6c997de26654216147ccd53afcc474e73243f6cf Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 30 Aug 2001 20:02:13 +0000 Subject: [PATCH 030/107] * Various typo fixes and clarifications merged from the stable CVS branch. --- doc/ref/ChangeLog | 9 +++++++++ doc/ref/scheme-data.texi | 17 ++++++++--------- doc/ref/scheme-ideas.texi | 6 +++--- doc/ref/scheme-modules.texi | 2 +- doc/ref/scm.texi | 6 +++--- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index a7300fd4c..7206f31ea 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,12 @@ +2001-08-30 Neil Jerram + + * scheme-data.texi (Random, String Syntax, String Modification, + Regular Expressions), scheme-ideas.texi (Definition), + scheme-modules.texi (Dynamic Linking and Compiled Code Modules), + scm.texi (Transforming Scheme name to C name, Port + Implementation): Various typo fixes and clarifications merged from + the stable CVS branch. + 2001-08-27 Neil Jerram * intro.texi: Merged wording fixes from stable CVS branch. diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi index 3303881ec..0adf9abfc 100755 --- a/doc/ref/scheme-data.texi +++ b/doc/ref/scheme-data.texi @@ -1125,7 +1125,7 @@ the sum of whose squares is equal to 1.0. Thinking of vect as coordinates in space of dimension n = (vector-length vect), the coordinates are uniformly distributed over the surface of the -unit n-shere. +unit n-sphere. @end deffn @deffn primitive random:normal [state] @@ -1146,7 +1146,7 @@ Fills vect with inexact real random numbers the sum of whose squares is less than 1.0. Thinking of vect as coordinates in space of dimension n = (vector-length vect), the coordinates -are uniformly distributed within the unit n-shere. +are uniformly distributed within the unit n-sphere. The sum of the squares of the numbers is returned. @end deffn @@ -1389,7 +1389,7 @@ characters enclosed in double quotes (@code{"}). @footnote{Actually, the current implementation restricts strings to a length of 2^24 characters.} If you want to insert a double quote character into a string literal, it must be prefixed with a backslash @code{\} character -(called an @emph{escape character}). +(called an @dfn{escape character}). The following are examples of string literals: @@ -1410,8 +1410,7 @@ fulfills some specified property. @rnindex string? @deffn primitive string? obj -Return @code{#t} iff @var{obj} is a string, else returns -@code{#f}. +Return @code{#t} iff @var{obj} is a string, else @code{#f}. @end deffn @deffn primitive string-null? str @@ -1522,9 +1521,9 @@ exact integers satisfying: @node String Modification @subsection String Modification -These procedures are for modifying strings in-place. That means, that -not a new string is the result of a string operation, but that the -actual memory representation of a string is modified. +These procedures are for modifying strings in-place. This means that the +result of the operation is not a new string; instead, the original string's +memory representation is modified. @rnindex string-set! @deffn primitive string-set! str k chr @@ -1821,7 +1820,7 @@ A @dfn{regular expression} (or @dfn{regexp}) is a pattern that describes a whole class of strings. A full description of regular expressions and their syntax is beyond the scope of this manual; an introduction can be found in the Emacs manual (@pxref{Regexps, -, Syntax of Regular Expressions, emacs, The GNU Emacs Manual}, or +, Syntax of Regular Expressions, emacs, The GNU Emacs Manual}), or in many general Unix reference books. If your system does not include a POSIX regular expression library, and diff --git a/doc/ref/scheme-ideas.texi b/doc/ref/scheme-ideas.texi index 80f5fbab4..7de9d9376 100644 --- a/doc/ref/scheme-ideas.texi +++ b/doc/ref/scheme-ideas.texi @@ -188,9 +188,9 @@ of an existing variable. @code{define} syntax that can be used when defining new procedures. @item -REFFIXME, to read about an alternative form of the @code{set!} syntax -that helps with changing a single value in the depths of a compound data -structure.) +@ref{Procedures with Setters}, to read about an alternative form of the +@code{set!} syntax that helps with changing a single value in the depths +of a compound data structure.) @end itemize diff --git a/doc/ref/scheme-modules.texi b/doc/ref/scheme-modules.texi index c0b37bc3c..70cbd94d7 100644 --- a/doc/ref/scheme-modules.texi +++ b/doc/ref/scheme-modules.texi @@ -698,7 +698,7 @@ module @samp{(math bessel)}. First we need to write the appropriate glue code to convert the arguments and return values of the functions from Scheme to C and back. Additionally, we need a function that will add them to the set of Guile primitives. Because this is just an -example, we will only implement this for the @code{j0} function, tho. +example, we will only implement this for the @code{j0} function. @c FIXME::martin: Change all gh_ references to their scm_ equivalents. diff --git a/doc/ref/scm.texi b/doc/ref/scm.texi index c6a00d5c9..2cda191d8 100644 --- a/doc/ref/scm.texi +++ b/doc/ref/scm.texi @@ -78,7 +78,7 @@ Prefix arg non-nil means use \"gh_\" prefix, otherwise use \"scm_\" prefix." (">=" . "_geq") ("<" . "_less") (">" . "_gr") - ("@" . "at")))) + ("@@" . "at")))) (while transforms (let ((trigger (concat "\\(.*\\)" (regexp-quote (caar transforms)) @@ -233,9 +233,9 @@ All of the elements of the ptob, apart from @code{name}, are procedures which collectively implement the port behaviour. Creating a new port type mostly involves writing these procedures. -@code{scm_make_port_type} initialises three elements of the structure +@code{scm_make_port_type} initializes three elements of the structure (@code{name}, @code{fill_input} and @code{write}) from its arguments. -The remaining elements are initialised with default values and can be +The remaining elements are initialized with default values and can be set later if required. @table @code From 255ea78443daa4fef803903d764d62d111d9a9e6 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 30 Aug 2001 20:19:20 +0000 Subject: [PATCH 031/107] * Group all index nodes together. --- doc/ref/ChangeLog | 4 ++++ doc/ref/guile.texi | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 7206f31ea..e3b3bbcc6 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,5 +1,9 @@ 2001-08-30 Neil Jerram + * guile.texi (Top): Group all index nodes together so that + `Info-index' works more effectively in Info. Thanks to Eric + Hanchrow for the report and fix. + * scheme-data.texi (Random, String Syntax, String Modification, Regular Expressions), scheme-ideas.texi (Definition), scheme-modules.texi (Dynamic Linking and Compiled Code Modules), diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 834405d18..a47956a3a 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -80,7 +80,7 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.3 2001-08-27 21:25:44 ossau Exp $ +@subtitle $Id: guile.texi,v 1.4 2001-08-30 20:19:20 ossau Exp $ @subtitle For use with Guile @value{VERSION} @c AUTHORS @@ -212,8 +212,6 @@ Part II: Guile Scheme * Debugging:: Internal debugging interface. * Deprecated:: Features that are planned to disappear. * Further Reading:: Where to find out more about Scheme programming. -* R5RS Index:: -* Guile Extensions Index:: Part III: Guile Modules @@ -257,6 +255,8 @@ Indices * Procedure Index:: * Variable Index:: * Type Index:: +* R5RS Index:: +* Guile Extensions Index:: @end menu From 2ccb6ae47bb78e9b8dee45f82212b6b39189eeff Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 30 Aug 2001 20:23:44 +0000 Subject: [PATCH 032/107] * Added Eric Hanchrow to THANKS. --- THANKS | 1 + 1 file changed, 1 insertion(+) diff --git a/THANKS b/THANKS index 7e0004f5c..872e63b53 100644 --- a/THANKS +++ b/THANKS @@ -30,6 +30,7 @@ For fixes or providing information which led to a fix: Albert Chin Chris Cramer I. N. Golubev + Eric Hanchrow Utz-Uwe Haus Karl M. Hegbloom Anders Holst From bbf5a91367604e2a81e9c9957a0e4e61f872b62a Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Aug 2001 23:25:34 +0000 Subject: [PATCH 033/107] (resolve-interface): When returning a custom interface, also consult source module's entire binding set, not just its exported bindings, before throwing error. --- ice-9/boot-9.scm | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 152e85fe0..0bfd735ac 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -1713,10 +1713,11 @@ (seen (if direct? bspec (cdr bspec)))) (module-add! custom-i (renamer seen) (or (module-local-variable public-i orig) + (module-local-variable module orig) (error ;; fixme: format manually for now (simple-format - #f "no binding `~A' exported from module ~A" + #f "no binding `~A' in module ~A" orig name)))))) selection) custom-i)))) @@ -1879,7 +1880,7 @@ "Write a Scheme file instead that uses `load-extension'.") (issue-deprecation-warning (simple-format #f "(You just autoloaded module ~S.)" modname))) - + (define (init-dynamic-module modname) ;; Register any linked modules which have been registered on the C level (register-modules #f) @@ -1942,7 +1943,7 @@ module-name))))) (let ((subdir (car subdir-and-libname)) (libname (cdr subdir-and-libname))) - + ;; Now look in each dir in %LOAD-PATH for `subdir/libfoo.la'. If that ;; file exists, fetch the dlname from that file and attempt to link ;; against it. If `subdir/libfoo.la' does not exist, or does not seem @@ -1958,23 +1959,23 @@ (if (and sharlib-full (file-exists? sharlib-full)) (link-dynamic-module sharlib-full init) (check-dirs (cdr dir-list))))))))) - + (define (try-using-libtool-name libdir libname) (let ((libtool-filename (in-vicinity libdir (string-append libname ".la")))) (and (file-exists? libtool-filename) libtool-filename))) - + (define (try-using-sharlib-name libdir libname) (in-vicinity libdir (string-append libname ".so"))) - + (define (link-dynamic-module filename initname) ;; Register any linked modules which have been registered on the C level (register-modules #f) (let ((dynobj (dynamic-link filename))) (dynamic-call initname dynobj) (register-modules dynobj))) - + (define (try-module-linked module-name) (init-dynamic-module module-name)) @@ -1982,7 +1983,7 @@ (and (find-and-link-dynamic-module module-name) (init-dynamic-module module-name)))) ;; end of deprecated section - + (define autoloads-done '((guile . guile))) @@ -2649,7 +2650,7 @@ '()))) (define (map-apply func list) (map (lambda (args) (apply func args)) list)) - (define keys + (define keys ;; sym key quote? '((:select #:select #t) (:renamer #:renamer #f))) @@ -2700,7 +2701,7 @@ (defmacro define-module args `(eval-case ((load-toplevel) - (let ((m (process-define-module + (let ((m (process-define-module (list ,@(compile-define-module-args args))))) (set-current-module m) m)) @@ -2785,7 +2786,7 @@ (begin-deprecated (if (not (module-local-variable m name)) (let ((v (module-variable m name))) - (cond + (cond (v (issue-deprecation-warning "Using `export' to re-export imported bindings is deprecated. Use `re-export' instead.") @@ -2987,13 +2988,13 @@ (load-emacs-interface)) ;; Use some convenient modules (in reverse order) - + (if (provided? 'regex) (module-use! guile-user-module (resolve-interface '(ice-9 regex)))) (if (provided? 'threads) (module-use! guile-user-module (resolve-interface '(ice-9 threads)))) ;; load debugger on demand - (module-use! guile-user-module + (module-use! guile-user-module (make-autoload-interface guile-user-module '(ice-9 debugger) '(debug))) (module-use! guile-user-module (resolve-interface '(ice-9 session))) @@ -3032,13 +3033,13 @@ (sigaction (car sig-msg) (make-handler (cdr sig-msg)))) signals)))) - + ;; the protected thunk. (lambda () (let ((status (scm-style-repl))) (run-hook exit-hook) status)) - + ;; call at exit. (lambda () (map (lambda (sig-msg old-handler) From e09c8eb74751b838416959e734f290f4867f47d7 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Aug 2001 23:27:48 +0000 Subject: [PATCH 034/107] *** empty log message *** --- ice-9/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 1d0d50abe..144df014f 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,9 @@ +2001-08-30 Thien-Thi Nguyen + + * boot-9.scm (resolve-interface): When returning a custom + interface, also consult source module's entire binding set, + not just its exported bindings, before throwing error. + 2001-08-25 Marius Vollmer * boot-9.scm (resolve-interface): Get variables from the public From f7c6b7788674a3fdf68875e59fe0ab51c9fc2907 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 09:16:23 +0000 Subject: [PATCH 035/107] * Removed deprecated definitions. * Minor cleanups. --- ChangeLog | 7 +++++ libguile.h | 75 +++++++++--------------------------------------------- 2 files changed, 19 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0f143996..7658e4a24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-08-31 Dirk Herrmann + + * libguile.h: Removed bogus comment, rearranged includes, removed + deprecated definitions. + + (LIBGUILEH, SCM_LIBGUILE_H): Renamed H to SCM__H. + 2001-08-30 Thien-Thi Nguyen * HACKING: Mention libtool ./configure-regeneration requirement. diff --git a/libguile.h b/libguile.h index cb7d3bfca..c184776e2 100644 --- a/libguile.h +++ b/libguile.h @@ -1,7 +1,7 @@ -#ifndef LIBGUILEH -#define LIBGUILEH +#ifndef SCM_LIBGUILE_H +#define SCM_LIBGUILE_H -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,24 +48,12 @@ extern "C" { #endif #include "libguile/__scm.h" - -/* These files define typedefs used by later files, so they need to - come first. */ -#include "libguile/print.h" -#include "libguile/smob.h" -#include "libguile/pairs.h" - #include "libguile/alist.h" #include "libguile/arbiters.h" #include "libguile/async.h" #include "libguile/boolean.h" #include "libguile/chars.h" #include "libguile/continuations.h" -#ifdef DEBUG_EXTENSIONS -#include "libguile/backtrace.h" -#include "libguile/debug.h" -#include "libguile/stacks.h" -#endif #include "libguile/dynl.h" #include "libguile/dynwind.h" #include "libguile/eq.h" @@ -98,8 +86,10 @@ extern "C" { #include "libguile/objects.h" #include "libguile/objprop.h" #include "libguile/options.h" +#include "libguile/pairs.h" #include "libguile/ports.h" #include "libguile/posix.h" +#include "libguile/print.h" #include "libguile/procprop.h" #include "libguile/properties.h" #include "libguile/procs.h" @@ -110,6 +100,7 @@ extern "C" { #include "libguile/scmsigs.h" #include "libguile/script.h" #include "libguile/simpos.h" +#include "libguile/smob.h" #include "libguile/snarf.h" #include "libguile/socket.h" #include "libguile/sort.h" @@ -132,64 +123,22 @@ extern "C" { #include "libguile/version.h" #include "libguile/vports.h" #include "libguile/weaks.h" +#ifdef DEBUG_EXTENSIONS +#include "libguile/backtrace.h" +#include "libguile/debug.h" +#include "libguile/stacks.h" +#endif #ifdef USE_THREADS #include "libguile/threads.h" #endif -/* Deprecated type names. Don't use them for new code. */ - -#if SCM_DEBUG_DEPRECATED == 0 - -typedef scm_t_array_dim scm_array_dim_t; -typedef scm_t_array scm_array_t; -typedef scm_t_bits scm_bits_t; -typedef scm_t_c_bvec_limb scm_c_bvec_limb_t; -typedef scm_t_c_hook_entry scm_c_hook_entry_t; -typedef scm_t_c_hook_function scm_c_hook_function_t; -typedef scm_t_c_hook scm_c_hook_t; -typedef scm_t_catch_body scm_catch_body_t; -typedef scm_t_catch_handler scm_catch_handler_t; -typedef scm_t_complex scm_complex_t; -typedef scm_t_contregs scm_contregs_t; -typedef scm_t_debug_frame scm_debug_frame_t; -typedef scm_t_debug_info scm_debug_info_t; -typedef scm_t_double scm_double_t; -typedef scm_t_fport scm_fport_t; -typedef scm_t_guard scm_guard_t; -typedef scm_t_i_rstate scm_i_rstate_t; -typedef scm_t_info_frame scm_info_frame_t; -typedef scm_t_inner scm_inner_t; -typedef scm_t_method scm_method_t; -typedef scm_t_option scm_option_t; -typedef scm_t_port_rw_active scm_port_rw_active_t; -typedef scm_t_port scm_port_t; -typedef scm_t_ptob_descriptor scm_ptob_descriptor_t; -typedef scm_t_rng scm_rng_t; -typedef scm_t_rstate scm_rstate_t; -typedef scm_t_signed_bits scm_signed_bits_t; -typedef scm_t_srcprops_chunk scm_srcprops_chunk_t; -typedef scm_t_srcprops scm_srcprops_t; -typedef scm_t_stack scm_stack_t; -typedef scm_t_struct_free scm_struct_free_t; -typedef scm_t_subr_entry scm_subr_entry_t; - -#ifdef USE_THREADS - -typedef scm_t_cond scm_cond_t; -typedef scm_t_key scm_key_t; -typedef scm_t_mutex scm_mutex_t; - -#endif - -#endif /* !SCM_DEBUG_DEPRECATED */ - #ifdef __cplusplus } #endif -#endif /* LIBGUILEH */ +#endif /* SCM_LIBGUILE_H */ /* Local Variables: From fbd5c4521557e2f5c458ee947c2cb8d0a7ffb0b2 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 09:21:03 +0000 Subject: [PATCH 036/107] =?UTF-8?q?*=20Using=20`provided=3F=C2=B4=20instea?= =?UTF-8?q?d=20of=20`feature=3F=C2=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guile-readline/ChangeLog | 5 +++++ guile-readline/readline.scm | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index 0b2bdfb2c..e5f9b5eea 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,8 @@ +2001-08-31 Dirk Herrmann + + * readline.scm: `feature?´ is deprecated. Use `provided?´ + instead. + 2001-08-25 Marius Vollmer * readline.scm: Use load-extension instead of explicit diff --git a/guile-readline/readline.scm b/guile-readline/readline.scm index 3627c27c6..2afb03513 100644 --- a/guile-readline/readline.scm +++ b/guile-readline/readline.scm @@ -34,10 +34,10 @@ ;;; Dynamically link the glue code for accessing the readline library, ;;; but only when it isn't already present. -(if (not (feature? 'readline)) +(if (not (provided? 'readline)) (load-extension "libguilereadline" "scm_init_readline")) -(if (not (feature? 'readline)) +(if (not (provided? 'readline)) (scm-error 'misc-error #f "readline is not provided in this Guile installation" @@ -168,7 +168,7 @@ (define-public (set-readline-read-hook! h) (set! read-hook h)) -(if (feature? 'regex) +(if (provided? 'regex) (begin (define-public apropos-completion-function (let ((completions '())) From fc6629a7d5a9b19a0cdcf07ca08d5df917e11098 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 09:33:55 +0000 Subject: [PATCH 037/107] =?UTF-8?q?*=20Deleted=20`and-let-star-compat.scm?= =?UTF-8?q?=C2=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ice-9/ChangeLog | 6 ++++++ ice-9/Makefile.am | 7 +------ ice-9/and-let-star-compat.scm | 0 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 ice-9/and-let-star-compat.scm diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 144df014f..69fba4b6c 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,9 @@ +2001-08-31 Dirk Herrmann + + * and-let-star-compat.scm: Deleted. + + * Makefile.am: Remove references to and-let-star-compat.scm. + 2001-08-30 Thien-Thi Nguyen * boot-9.scm (resolve-interface): When returning a custom diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index 09f7bdae3..567444e9a 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -38,13 +38,8 @@ subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 subpkgdata_DATA = $(ice9_sources) ETAGS_ARGS = $(subpkgdata_DATA) -install-data-local: - -$(INSTALL_DATA) and-let-star-compat.scm \ - $(subpkgdatadir)/'and-let*.scm' - ## test.scm is not currently installed. -EXTRA_DIST = $(ice9_sources) test.scm and-let-star-compat.scm \ - compile-psyntax.scm +EXTRA_DIST = $(ice9_sources) test.scm compile-psyntax.scm if MAINTAINER_MODE psyntax.pp: psyntax.ss diff --git a/ice-9/and-let-star-compat.scm b/ice-9/and-let-star-compat.scm deleted file mode 100644 index e69de29bb..000000000 From 431e2ac105b350e920efa9cdfa39e3c07004064b Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 09:51:25 +0000 Subject: [PATCH 038/107] * Remove #& reader extension. --- ice-9/ChangeLog | 4 ++++ ice-9/optargs.scm | 13 ------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 69fba4b6c..2294c5d5b 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,7 @@ +2001-08-31 Dirk Herrmann + + * optargs.scm: Remove #& reader extension. + 2001-08-31 Dirk Herrmann * and-let-star-compat.scm: Deleted. diff --git a/ice-9/optargs.scm b/ice-9/optargs.scm index a64ca9cd8..b098bc4f9 100644 --- a/ice-9/optargs.scm +++ b/ice-9/optargs.scm @@ -200,19 +200,6 @@ accum (loop (car rest) (cdr rest) accum))))))) -;; This is a reader extension to support the (deprecated) use of -;; "#&optional" instead of "#:optional" - -(read-hash-extend #\& (lambda (c port) - (issue-deprecation-warning - "`#&' is deprecated, use `#:' instead.") - (case (read port) - ((optional) #:optional) - ((key) #:key) - ((rest) #:rest) - ((allow-other-keys) #:allow-other-keys) - (else (error "Bad #& value."))))) - ;; lambda* args . body ;; lambda extended for optional and keyword arguments From 0527e6876338ba394366273351105d6622368da2 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 10:42:19 +0000 Subject: [PATCH 039/107] * Renamed header macros to the SCM__H format. --- libguile/ChangeLog | 34 ++++++++++++++++++++++ libguile/_scm.h | 17 ++++++----- libguile/alist.h | 16 +++++----- libguile/arbiters.h | 16 +++++----- libguile/async.h | 3 +- libguile/backtrace.h | 16 +++++----- libguile/boolean.h | 17 ++++++----- libguile/chars.h | 16 +++++----- libguile/coop-defs.h | 12 ++++---- libguile/coop-threads.h | 15 +++++----- libguile/debug-malloc.h | 9 +++--- libguile/dynwind.h | 17 ++++++----- libguile/environments.h | 12 ++++---- libguile/eq.h | 17 ++++++----- libguile/evalext.h | 16 +++++----- libguile/extensions.h | 19 +++++++----- libguile/feature.h | 15 +++++----- libguile/gdb_interface.h | 9 +++--- libguile/gdbint.h | 16 +++++----- libguile/guardians.h | 16 +++++----- libguile/hash.h | 16 +++++----- libguile/hashtab.h | 17 ++++++----- libguile/init.h | 16 +++++----- libguile/ioext.h | 16 +++++----- libguile/iselect.h | 19 ++++++------ libguile/keywords.h | 15 +++++----- libguile/lang.h | 16 +++++----- libguile/macros.h | 10 ++++--- libguile/mallocs.h | 17 ++++++----- libguile/net_db.h | 19 ++++++------ libguile/objects.h | 9 +++--- libguile/objprop.h | 20 ++++++------- libguile/pairs.h | 8 ++--- libguile/print.h | 8 +++-- libguile/procprop.h | 16 +++++----- libguile/properties.h | 16 +++++----- libguile/ramap.h | 16 +++++----- libguile/rdelim.h | 16 +++++----- libguile/read.h | 16 +++++----- libguile/rw.h | 14 +++++---- libguile/scmsigs.h | 17 ++++++----- libguile/script.h | 17 ++++++----- libguile/simpos.h | 17 ++++++----- libguile/socket.h | 16 +++++----- libguile/sort.h | 19 ++++++------ libguile/stackchk.h | 17 ++++++----- libguile/stime.h | 10 ++++--- libguile/strop.h | 16 +++++----- libguile/strorder.h | 21 ++++++-------- libguile/threads.h | 14 ++++----- libguile/throw.h | 17 ++++++----- libguile/values.h | 9 +++--- libguile/version.h | 63 ---------------------------------------- libguile/vports.h | 16 +++++----- libguile/weaks.h | 9 +++--- 55 files changed, 470 insertions(+), 416 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8f754125b..140c5c587 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,37 @@ +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 diff --git a/libguile/_scm.h b/libguile/_scm.h index d155f9441..1ee482b35 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef _SCMH -#define _SCMH -/* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM__SCM_H +#define SCM__SCM_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -128,8 +130,7 @@ #define max(A,B) ((A) >= (B) ? (A) : (B)) #endif -#endif /* _SCMH */ - +#endif /* SCM__SCM_H */ /* Local Variables: diff --git a/libguile/alist.h b/libguile/alist.h index 9005ae18a..bf8b4562e 100644 --- a/libguile/alist.h +++ b/libguile/alist.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef ALISTH -#define ALISTH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_ALIST_H +#define SCM_ALIST_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -66,7 +68,7 @@ extern SCM scm_assv_remove_x (SCM alist, SCM key); extern SCM scm_assoc_remove_x (SCM alist, SCM key); extern void scm_init_alist (void); -#endif /* ALISTH */ +#endif /* SCM_ALIST_H */ /* Local Variables: diff --git a/libguile/arbiters.h b/libguile/arbiters.h index b7f282ae0..7cda145c7 100644 --- a/libguile/arbiters.h +++ b/libguile/arbiters.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef ARBITERSH -#define ARBITERSH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_ARBITERS_H +#define SCM_ARBITERS_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -53,7 +55,7 @@ extern SCM scm_try_arbiter (SCM arb); extern SCM scm_release_arbiter (SCM arb); extern void scm_init_arbiters (void); -#endif /* ARBITERSH */ +#endif /* SCM_ARBITERS_H */ /* Local Variables: diff --git a/libguile/async.h b/libguile/async.h index 15a1841cb..ed2d7c416 100644 --- a/libguile/async.h +++ b/libguile/async.h @@ -2,7 +2,8 @@ #ifndef SCM_ASYNC_H #define SCM_ASYNC_H -/* Copyright (C) 1995, 96, 97, 98, 2000, 2001 Free Software Foundation, Inc. + +/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/libguile/backtrace.h b/libguile/backtrace.h index db0cd8dc5..0c0b7417b 100644 --- a/libguile/backtrace.h +++ b/libguile/backtrace.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef BACKTRACEH -#define BACKTRACEH -/* Copyright (C) 1996, 1998, 1999, 2000, 2001 Free Software Foundation - * +#ifndef SCM_BACKTRACE_H +#define SCM_BACKTRACE_H + +/* Copyright (C) 1996,1998,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -45,6 +46,7 @@ * * The author can be reached at djurfeldt@nada.kth.se * Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */ + #include "libguile/__scm.h" @@ -63,7 +65,7 @@ SCM scm_set_print_params_x (SCM params); void scm_init_backtrace (void); -#endif /* BACKTRACEH */ +#endif /* SCM_BACKTRACE_H */ /* Local Variables: diff --git a/libguile/boolean.h b/libguile/boolean.h index bc80e9f82..a4328fd48 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef BOOLEANH -#define BOOLEANH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_BOOLEAN_H +#define SCM_BOOLEAN_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -74,7 +77,7 @@ extern SCM scm_not (SCM x); extern SCM scm_boolean_p (SCM obj); extern void scm_init_boolean (void); -#endif /* BOOLEANH */ +#endif /* SCM_BOOLEAN_H */ /* Local Variables: diff --git a/libguile/chars.h b/libguile/chars.h index 65cc079d2..fa24a374a 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_CHARSH -#define SCM_CHARSH -/* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_CHARS_H +#define SCM_CHARS_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -87,7 +89,7 @@ extern int scm_upcase (unsigned int c); extern int scm_downcase (unsigned int c); extern void scm_init_chars (void); -#endif /* SCM_CHARSH */ +#endif /* SCM_CHARS_H */ /* Local Variables: diff --git a/libguile/coop-defs.h b/libguile/coop-defs.h index 6a54c5ca0..302230ebe 100644 --- a/libguile/coop-defs.h +++ b/libguile/coop-defs.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef COOP_DEFSH -#define COOP_DEFSH +#ifndef SCM_COOP_DEFS_H +#define SCM_COOP_DEFS_H /* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -272,7 +272,7 @@ do { \ #define SCM_THREAD_LOCAL_DATA (coop_global_curr->data) #define SCM_SET_THREAD_LOCAL_DATA(ptr) (coop_global_curr->data = (ptr)) -#endif /* COOP_DEFSH */ +#endif /* SCM_COOP_DEFS_H */ /* Local Variables: diff --git a/libguile/coop-threads.h b/libguile/coop-threads.h index 11cb392d5..ffc1ef120 100644 --- a/libguile/coop-threads.h +++ b/libguile/coop-threads.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef COOP_THREADSH -#define COOP_THREADSH +#ifndef SCM_COOP_THREADS_H +#define SCM_COOP_THREADS_H -/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. - * +/* Copyright (C) 1996,1997,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -43,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + /* This file is only included by coop-threads.c while coop-defs.h is @@ -121,7 +122,7 @@ extern coop_q_t coop_tmp_queue; extern coop_q_t coop_global_allq; /* A queue of all threads. */ extern coop_t *coop_global_curr; /* Currently-executing thread. */ -#endif /* COOP_THREADSH */ +#endif /* SCM_COOP_THREADS_H */ /* Local Variables: diff --git a/libguile/debug-malloc.h b/libguile/debug-malloc.h index 29e465bc0..1d646fcb9 100644 --- a/libguile/debug-malloc.h +++ b/libguile/debug-malloc.h @@ -1,8 +1,9 @@ /* classes: h_files */ -#ifndef DEBUGMALLOCH -#define DEBUGMALLOCH -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +#ifndef SCM_DEBUG_MALLOC_H +#define SCM_DEBUG_MALLOC_H + +/* Copyright (C) 2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +59,7 @@ extern SCM scm_malloc_stats (void); extern void scm_debug_malloc_prehistory (void); extern void scm_init_debug_malloc (void); -#endif /* DEBUGMALLOCH */ +#endif /* SCM_DEBUG_MALLOC_H */ /* Local Variables: diff --git a/libguile/dynwind.h b/libguile/dynwind.h index f956ea456..d7ac926f3 100644 --- a/libguile/dynwind.h +++ b/libguile/dynwind.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef DYNWINDH -#define DYNWINDH -/* Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_DYNWIND_H +#define SCM_DYNWIND_H + +/* Copyright (C) 1995,1996,1998,1999,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -65,7 +68,7 @@ extern void scm_swap_bindings (SCM vars, SCM vals); extern SCM scm_wind_chain (void); #endif /*GUILE_DEBUG*/ -#endif /* DYNWINDH */ +#endif /* SCM_DYNWIND_H */ /* Local Variables: diff --git a/libguile/environments.h b/libguile/environments.h index 2103b383f..77f866d2f 100644 --- a/libguile/environments.h +++ b/libguile/environments.h @@ -1,8 +1,9 @@ /* classes: h_files */ -#ifndef ENVIRONMENTS_H -#define ENVIRONMENTS_H -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +#ifndef SCM_ENVIRONMENTS_H +#define SCM_ENVIRONMENTS_H + +/* Copyright (C) 1999,2000 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -201,9 +203,7 @@ extern SCM scm_export_environment_set_private_x (SCM env, SCM private); extern SCM scm_export_environment_signature (SCM env); extern SCM scm_export_environment_set_signature_x (SCM env, SCM signature); - -#endif - +#endif /* SCM_ENVIRONMENTS_H */ /* Local Variables: diff --git a/libguile/eq.h b/libguile/eq.h index 2bfcd2d8b..6fbfe3e1b 100644 --- a/libguile/eq.h +++ b/libguile/eq.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef EQH -#define EQH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_EQ_H +#define SCM_EQ_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -52,7 +55,7 @@ extern SCM scm_eqv_p (SCM x, SCM y); extern SCM scm_equal_p (SCM x, SCM y); extern void scm_init_eq (void); -#endif /* EQH */ +#endif /* SCM_EQ_H */ /* Local Variables: diff --git a/libguile/evalext.h b/libguile/evalext.h index 3fafa6e5e..bac8c0eaa 100644 --- a/libguile/evalext.h +++ b/libguile/evalext.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef EVALEXTH -#define EVALEXTH -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_EVALEXT_H +#define SCM_EVALEXT_H + +/* Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -53,7 +55,7 @@ extern SCM scm_definedp (SCM sym, SCM env); extern SCM scm_m_undefine (SCM x, SCM env); extern void scm_init_evalext (void); -#endif /* EVALEXTH */ +#endif /* SCM_EVALEXT_H */ /* Local Variables: diff --git a/libguile/extensions.h b/libguile/extensions.h index f42b85535..184ab0e23 100644 --- a/libguile/extensions.h +++ b/libguile/extensions.h @@ -1,15 +1,20 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. - * +/* classes: h_files */ + +#ifndef SCM_EXTENSIONS_H +#define SCM_EXTENSIONS_H + +/* Copyright (C) 2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -38,10 +43,8 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - -#ifndef LIBGUILE_EXTENSIONS_H -#define LIBGUILE_EXTENSIONS_H + #include "libguile/__scm.h" @@ -55,7 +58,7 @@ extern SCM scm_load_extension (SCM lib, SCM init); void scm_init_extensions (void); -#endif /* LIBGUILE_EXTENSIONS_H */ +#endif /* SCM_EXTENSIONS_H */ /* Local Variables: diff --git a/libguile/feature.h b/libguile/feature.h index dcde6803f..bbda02c53 100644 --- a/libguile/feature.h +++ b/libguile/feature.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef FEATUREH -#define FEATUREH -/* Copyright (C) 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_FEATURE_H +#define SCM_FEATURE_H + +/* Copyright (C) 1995,1996,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -52,7 +53,7 @@ extern SCM scm_program_arguments (void); extern void scm_set_program_arguments (int argc, char **argv, char *first); extern void scm_init_feature (void); -#endif /* FEATUREH */ +#endif /* SCM_FEATURE_H */ /* Local Variables: diff --git a/libguile/gdb_interface.h b/libguile/gdb_interface.h index ad3e3af5f..ad93b463e 100644 --- a/libguile/gdb_interface.h +++ b/libguile/gdb_interface.h @@ -1,3 +1,7 @@ +/* classes: h_files */ + +#ifndef GDB_INTERFACE_H +#define GDB_INTERFACE_H /* Simple interpreter interface for GDB, the GNU debugger. Copyright (C) 1996, 2000, 2001 Free Software Foundation @@ -44,9 +48,6 @@ If you do not wish that, delete this exception notice. The author can be reached at djurfeldt@nada.kth.se Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */ -#ifndef GDB_INTERFACE_H -#define GDB_INTERFACE_H - /* This is the header file for GDB's interpreter interface. The interpreter must supply definitions of all symbols declared in this file. @@ -169,7 +170,7 @@ extern int gdb_print (GDB_TYPE value); extern int gdb_binding (GDB_TYPE name, GDB_TYPE value); -#endif /* GDB_INTERFACE_H */ +#endif /* GDB_INTERFACE_H */ /* Local Variables: diff --git a/libguile/gdbint.h b/libguile/gdbint.h index 623bf93ec..70bf8b484 100644 --- a/libguile/gdbint.h +++ b/libguile/gdbint.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef GDBINTH -#define GDBINTH -/* Copyright (C) 1996, 2000 Free Software Foundation - * +#ifndef SCM_GDBINT_H +#define SCM_GDBINT_H + +/* Copyright (C) 1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -45,6 +46,7 @@ * * The author can be reached at djurfeldt@nada.kth.se * Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */ + #include "libguile/__scm.h" @@ -55,7 +57,7 @@ extern int scm_print_carefully_p; extern void scm_init_gdbint (void); -#endif /* GDBINTH */ +#endif /* SCM_GDBINT_H */ /* Local Variables: diff --git a/libguile/guardians.h b/libguile/guardians.h index 4a0489d03..344fac7af 100644 --- a/libguile/guardians.h +++ b/libguile/guardians.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_GUARDIANH -#define SCM_GUARDIANH -/* Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_GUARDIANS_H +#define SCM_GUARDIANS_H + +/* Copyright (C) 1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -58,7 +60,7 @@ SCM scm_get_one_zombie (SCM guardian); void scm_init_guardians (void); -#endif /* !SCM_GUARDIANH */ +#endif /* SCM_GUARDIANS_H */ /* Local Variables: diff --git a/libguile/hash.h b/libguile/hash.h index 5b2d5bb80..fc3b00b61 100644 --- a/libguile/hash.h +++ b/libguile/hash.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef HASHH -#define HASHH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_HASH_H +#define SCM_HASH_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -58,7 +60,7 @@ extern unsigned long scm_ihash (SCM obj, unsigned long n); extern SCM scm_hash (SCM obj, SCM n); extern void scm_init_hash (void); -#endif /* HASHH */ +#endif /* SCM_HASH_H */ /* Local Variables: diff --git a/libguile/hashtab.h b/libguile/hashtab.h index c7594a344..6e969570b 100644 --- a/libguile/hashtab.h +++ b/libguile/hashtab.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef HASHTABH -#define HASHTABH -/* Copyright (C) 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_HASHTAB_H +#define SCM_HASHTAB_H + +/* Copyright (C) 1995,1996,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -85,7 +88,7 @@ extern SCM scm_hashx_remove_x (SCM hash, SCM assoc, SCM del, SCM table, SCM obj) extern SCM scm_hash_fold (SCM proc, SCM init, SCM hash); extern void scm_init_hashtab (void); -#endif /* HASHTABH */ +#endif /* SCM_HASHTAB_H */ /* Local Variables: diff --git a/libguile/init.h b/libguile/init.h index 4367e1a1c..4e95fb557 100644 --- a/libguile/init.h +++ b/libguile/init.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef INITH -#define INITH -/* Copyright (C) 1995,1996,1997, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_INIT_H +#define SCM_INIT_H + +/* Copyright (C) 1995,1996,1997,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -59,7 +61,7 @@ extern void scm_boot_guile (int argc, char **argv, extern void scm_load_startup_files (void); -#endif /* INITH */ +#endif /* SCM_INIT_H */ /* Local Variables: diff --git a/libguile/ioext.h b/libguile/ioext.h index c6b4712ac..5cb5e2394 100644 --- a/libguile/ioext.h +++ b/libguile/ioext.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef IOEXTH -#define IOEXTH -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_IOEXT_H +#define SCM_IOEXT_H + +/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -59,7 +61,7 @@ extern SCM scm_primitive_move_to_fdes (SCM port, SCM fd); extern SCM scm_fdes_to_ports (SCM fd); extern void scm_init_ioext (void); -#endif /* IOEXTH */ +#endif /* SCM_IOEXT_H */ /* Local Variables: diff --git a/libguile/iselect.h b/libguile/iselect.h index 4a7971864..bbacf3036 100644 --- a/libguile/iselect.h +++ b/libguile/iselect.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef ISELECTH -#define ISELECTH +#ifndef SCM_ISELECT_H +#define SCM_ISELECT_H -/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,8 +42,9 @@ * * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - */ + * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -103,7 +104,7 @@ extern void scm_init_iselect (void); #endif /* GUILE_ISELECT */ -#endif +#endif /* SCM_ISELECT_H */ /* Local Variables: diff --git a/libguile/keywords.h b/libguile/keywords.h index 13ce8cb95..3ff94907d 100644 --- a/libguile/keywords.h +++ b/libguile/keywords.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef KEYWORDSH -#define KEYWORDSH -/* Copyright (C) 1995,1996,1999, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_KEYWORDS_H +#define SCM_KEYWORDS_H + +/* Copyright (C) 1995,1996,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -63,7 +64,7 @@ extern SCM scm_keyword_p (SCM obj); extern SCM scm_keyword_dash_symbol (SCM keyword); extern void scm_init_keywords (void); -#endif /* KEYWORDSH */ +#endif /* SCM_KEYWORDS_H */ /* Local Variables: diff --git a/libguile/lang.h b/libguile/lang.h index f0514d0c6..0619e5221 100644 --- a/libguile/lang.h +++ b/libguile/lang.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef LANGH -#define LANGH -/* Copyright (C) 1998 Free Software Foundation, Inc. - * +#ifndef SCM_LANG_H +#define SCM_LANG_H + +/* Copyright (C) 1998 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -68,7 +70,7 @@ extern SCM scm_m_while (SCM exp, SCM env); extern SCM scm_nil_eq (SCM x, SCM y); extern void scm_init_lang (void); -#endif /* PAIRSH */ +#endif /* SCM_LANG_H */ /* Local Variables: diff --git a/libguile/macros.h b/libguile/macros.h index 2678d1c53..1a2203ab1 100644 --- a/libguile/macros.h +++ b/libguile/macros.h @@ -2,18 +2,19 @@ #ifndef SCM_MACROS_H #define SCM_MACROS_H + /* Copyright (C) 1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -69,7 +71,7 @@ extern SCM scm_make_synt (const char *name, SCM (*fcn) ()); extern void scm_init_macros (void); -#endif /* SCM_MACROS_H */ +#endif /* SCM_MACROS_H */ /* Local Variables: diff --git a/libguile/mallocs.h b/libguile/mallocs.h index f62c245ab..cb96af7f5 100644 --- a/libguile/mallocs.h +++ b/libguile/mallocs.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef MALLOCSH -#define MALLOCSH -/* Copyright (C) 1995, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_MALLOCS_H +#define SCM_MALLOCS_H + +/* Copyright (C) 1995,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -57,7 +60,7 @@ extern scm_t_bits scm_tc16_malloc; extern SCM scm_malloc_obj (size_t n); extern void scm_init_mallocs (void); -#endif /* MALLOCSH */ +#endif /* SCM_MALLOCS_H */ /* Local Variables: diff --git a/libguile/net_db.h b/libguile/net_db.h index 56c04157f..db8f22005 100644 --- a/libguile/net_db.h +++ b/libguile/net_db.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_NETDBH -#define SCM_NETDBH -/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_NET_DB_H +#define SCM_NET_DB_H + +/* Copyright (C) 1995,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,13 +43,11 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" - - - extern SCM scm_gethost (SCM host); @@ -61,7 +60,7 @@ extern SCM scm_setproto (SCM arg); extern SCM scm_setserv (SCM arg); extern void scm_init_net_db (void); -#endif /* SCM_NETDBH */ +#endif /* SCM_NET_DB_H */ /* Local Variables: diff --git a/libguile/objects.h b/libguile/objects.h index a7afb4aa2..26d39af61 100644 --- a/libguile/objects.h +++ b/libguile/objects.h @@ -4,17 +4,17 @@ #define SCM_OBJECTS_H /* Copyright (C) 1996,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -43,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + /* This file and objects.c contains those minimal pieces of the Guile @@ -240,7 +241,7 @@ extern SCM scm_i_make_class_object (SCM metaclass, SCM layout_string, unsigned long flags); extern void scm_init_objects (void); -#endif /* SCM_OBJECTS_H */ +#endif /* SCM_OBJECTS_H */ /* Local Variables: diff --git a/libguile/objprop.h b/libguile/objprop.h index bc590fbe0..82afc2534 100644 --- a/libguile/objprop.h +++ b/libguile/objprop.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef OBJPROPH -#define OBJPROPH -/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_OBJPROP_H +#define SCM_OBJPROP_H + +/* Copyright (C) 1995,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,14 +43,11 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" - - - - extern SCM scm_object_properties (SCM obj); @@ -58,7 +56,7 @@ extern SCM scm_object_property (SCM obj, SCM key); extern SCM scm_set_object_property_x (SCM obj, SCM key, SCM val); extern void scm_init_objprop (void); -#endif /* OBJPROPH */ +#endif /* SCM_OBJPROP_H */ /* Local Variables: diff --git a/libguile/pairs.h b/libguile/pairs.h index ff6bddc5b..2149b3918 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -2,18 +2,19 @@ #ifndef SCM_PAIRS_H #define SCM_PAIRS_H + /* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -43,7 +44,6 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - #include "libguile/__scm.h" diff --git a/libguile/print.h b/libguile/print.h index 5d8e3e06d..754f307b1 100644 --- a/libguile/print.h +++ b/libguile/print.h @@ -2,18 +2,19 @@ #ifndef SCM_PRINT_H #define SCM_PRINT_H + /* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -122,6 +123,7 @@ extern void scm_init_print (void); #ifdef GUILE_DEBUG extern SCM scm_current_pstate (void); #endif + #endif /* SCM_PRINT_H */ /* diff --git a/libguile/procprop.h b/libguile/procprop.h index 98331465a..f5db1d4bf 100644 --- a/libguile/procprop.h +++ b/libguile/procprop.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef PROCPROPH -#define PROCPROPH -/* Copyright (C) 1995,1996,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_PROCPROP_H +#define SCM_PROCPROP_H + +/* Copyright (C) 1995,1996,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -61,7 +63,7 @@ extern SCM scm_procedure_property (SCM p, SCM k); extern SCM scm_set_procedure_property_x (SCM p, SCM k, SCM v); extern void scm_init_procprop (void); -#endif /* PROCPROPH */ +#endif /* SCM_PROCPROP_H */ /* Local Variables: diff --git a/libguile/properties.h b/libguile/properties.h index 1a3298626..2c59c03d0 100644 --- a/libguile/properties.h +++ b/libguile/properties.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef PROPERTIES_H -#define PROPERTIES_H -/* Copyright (C) 1995,1996,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_PROPERTIES_H +#define SCM_PROPERTIES_H + +/* Copyright (C) 1995,1996,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -53,7 +55,7 @@ SCM scm_primitive_property_del_x (SCM prop, SCM obj); void scm_init_properties (void); -#endif /* PROPERTIES_H */ +#endif /* SCM_PROPERTIES_H */ /* Local Variables: diff --git a/libguile/ramap.h b/libguile/ramap.h index a71cfca86..c9c4e17c0 100644 --- a/libguile/ramap.h +++ b/libguile/ramap.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef RAMAPH -#define RAMAPH -/* Copyright (C) 1995,1996,1997, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_RAMAP_H +#define SCM_RAMAP_H + +/* Copyright (C) 1995,1996,1997,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -71,7 +73,7 @@ extern SCM scm_raequal (SCM ra0, SCM ra1); extern SCM scm_array_equal_p (SCM ra0, SCM ra1); extern void scm_init_ramap (void); -#endif /* RAMAPH */ +#endif /* SCM_RAMAP_H */ /* Local Variables: diff --git a/libguile/rdelim.h b/libguile/rdelim.h index 3b1039bdc..6a987cc7d 100644 --- a/libguile/rdelim.h +++ b/libguile/rdelim.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_RDELIM -#define SCM_RDELIM -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_RDELIM_H +#define SCM_RDELIM_H + +/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -54,7 +56,7 @@ extern SCM scm_init_rdelim_builtins (void); void scm_init_rdelim (void); -#endif +#endif /* SCM_RDELIM_H */ /* Local Variables: diff --git a/libguile/read.h b/libguile/read.h index 3362060e1..ccdc4a2c3 100644 --- a/libguile/read.h +++ b/libguile/read.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef READH -#define READH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_READ_H +#define SCM_READ_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -89,7 +91,7 @@ extern SCM scm_lreadrecparen (SCM * tok_buf, SCM port, char *name, SCM *copy); extern SCM scm_read_hash_extend (SCM chr, SCM proc); extern void scm_init_read (void); -#endif /* READH */ +#endif /* SCM_READ_H */ /* Local Variables: diff --git a/libguile/rw.h b/libguile/rw.h index c2089d423..d9ad59026 100644 --- a/libguile/rw.h +++ b/libguile/rw.h @@ -1,14 +1,15 @@ /* classes: h_files */ -#ifndef SCM_RW -#define SCM_RW -/* Copyright (C) 2001 Free Software Foundation, Inc. - * +#ifndef SCM_RW_H +#define SCM_RW_H + +/* Copyright (C) 2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -54,7 +56,7 @@ extern SCM scm_write_string_partial (SCM str, SCM port_or_fdes, SCM start, SCM scm_init_rw_builtins (void); void scm_init_rw (void); -#endif +#endif /* SCM_RW_H */ /* Local Variables: diff --git a/libguile/scmsigs.h b/libguile/scmsigs.h index 06fc129d5..5c9893e30 100644 --- a/libguile/scmsigs.h +++ b/libguile/scmsigs.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCMSIGSH -#define SCMSIGSH -/* Copyright (C) 1995,1996,1997,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_SCMSIGS_H +#define SCM_SCMSIGS_H + +/* Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -60,7 +63,7 @@ extern SCM scm_usleep (SCM i); extern SCM scm_raise (SCM sig); extern void scm_init_scmsigs (void); -#endif /* SCMSIGSH */ +#endif /* SCM_SCMSIGS_H */ /* Local Variables: diff --git a/libguile/script.h b/libguile/script.h index 655307aa9..d71ddca92 100644 --- a/libguile/script.h +++ b/libguile/script.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCRIPTH -#define SCRIPTH -/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_SCRIPT_H +#define SCM_SCRIPT_H + +/* Copyright (C) 1997,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -59,7 +62,7 @@ extern void scm_shell (int argc, char **argv); extern char *scm_usage_name; extern void scm_init_script (void); -#endif /* SCRIPTH */ +#endif /* SCM_SCRIPT_H */ /* Local Variables: diff --git a/libguile/simpos.h b/libguile/simpos.h index bd843f975..4bae4e520 100644 --- a/libguile/simpos.h +++ b/libguile/simpos.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SIMPOSH -#define SIMPOSH -/* Copyright (C) 1995,1996,1997,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_SIMPOS_H +#define SCM_SIMPOS_H + +/* Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -52,7 +55,7 @@ extern SCM scm_getenv (SCM nam); extern SCM scm_primitive_exit (SCM status); extern void scm_init_simpos (void); -#endif /* SIMPOSH */ +#endif /* SCM_SIMPOS_H */ /* Local Variables: diff --git a/libguile/socket.h b/libguile/socket.h index f88b9229e..3d355796d 100644 --- a/libguile/socket.h +++ b/libguile/socket.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_SOCKETH -#define SCM_SOCKETH -/* Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_SOCKET_H +#define SCM_SOCKET_H + +/* Copyright (C) 1995,1996,1997,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -77,7 +79,7 @@ extern SCM scm_recvfrom (SCM sockfd, SCM buff_or_size, SCM flags, SCM offset, SC extern SCM scm_sendto (SCM sockfd, SCM message, SCM fam, SCM address, SCM args_and_flags); extern void scm_init_socket (void); -#endif /* SCM_SOCKETH */ +#endif /* SCM_SOCKET_H */ /* Local Variables: diff --git a/libguile/sort.h b/libguile/sort.h index 6aa941c0b..ed98a3212 100644 --- a/libguile/sort.h +++ b/libguile/sort.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SORTH -#define SORTH -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_SORT_H +#define SCM_SORT_H + +/* Copyright (C) 1999,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -63,10 +65,7 @@ extern SCM scm_sort_list (SCM ls, SCM less); extern SCM scm_sort_list_x (SCM ls, SCM less); extern void scm_init_sort (void); -#endif /* SORTH */ - - - +#endif /* SCM_SORT_H */ /* Local Variables: diff --git a/libguile/stackchk.h b/libguile/stackchk.h index bdbe69009..8617e1ca2 100644 --- a/libguile/stackchk.h +++ b/libguile/stackchk.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef STACKCHKH -#define STACKCHKH -/* Copyright (C) 1995,1996,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_STACKCHK_H +#define SCM_STACKCHK_H + +/* Copyright (C) 1995,1996,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" #include "libguile/continuations.h" @@ -89,7 +92,7 @@ extern long scm_stack_size (SCM_STACKITEM *start); extern void scm_stack_report (void); extern void scm_init_stackchk (void); -#endif /* STACKCHKH */ +#endif /* SCM_STACKCHK_H */ /* Local Variables: diff --git a/libguile/stime.h b/libguile/stime.h index eaea28847..788e85422 100644 --- a/libguile/stime.h +++ b/libguile/stime.h @@ -1,8 +1,9 @@ /* classes: h_files */ -#ifndef STIMEH -#define STIMEH -/* Copyright (C) 1995,1996,1997,1998, 2000 Free Software Foundation, Inc. +#ifndef SCM_STIME_H +#define SCM_STIME_H + +/* Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -61,7 +63,7 @@ extern SCM scm_strftime (SCM format, SCM stime); extern SCM scm_strptime (SCM format, SCM string); extern void scm_init_stime (void); -#endif /* STIMEH */ +#endif /* SCM_STIME_H */ /* Local Variables: diff --git a/libguile/strop.h b/libguile/strop.h index 14b079849..0f1ceb1a8 100644 --- a/libguile/strop.h +++ b/libguile/strop.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef STROPH -#define STROPH -/* Copyright (C) 1995,1996,1997, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_STROP_H +#define SCM_STROP_H + +/* Copyright (C) 1995,1996,1997,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -70,7 +72,7 @@ extern SCM scm_string_ci_to_symbol (SCM v); #define scm_substring_move_left_x scm_substring_move_x #define scm_substring_move_right_x scm_substring_move_x -#endif /* STROPH */ +#endif /* SCM_STROP_H */ /* Local Variables: diff --git a/libguile/strorder.h b/libguile/strorder.h index c145a1d94..3660c61a3 100644 --- a/libguile/strorder.h +++ b/libguile/strorder.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef STRORDERH -#define STRORDERH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_STRORDER_H +#define SCM_STRORDER_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,15 +43,11 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" - - - - - extern SCM scm_string_equal_p (SCM s1, SCM s2); @@ -65,7 +62,7 @@ extern SCM scm_string_ci_gr_p (SCM s1, SCM s2); extern SCM scm_string_ci_geq_p (SCM s1, SCM s2); extern void scm_init_strorder (void); -#endif /* STRORDERH */ +#endif /* SCM_STRORDER_H */ /* Local Variables: diff --git a/libguile/threads.h b/libguile/threads.h index 1cc228594..223732a44 100644 --- a/libguile/threads.h +++ b/libguile/threads.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef THREADSH -#define THREADSH +#ifndef SCM_THREADS_H +#define SCM_THREADS_H -/* Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1996,1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -104,7 +104,7 @@ extern SCM scm_signal_condition_variable (SCM cond); #include "libguile/coop-defs.h" #endif -#endif /* THREADSH */ +#endif /* SCM_THREADS_H */ /* Local Variables: diff --git a/libguile/throw.h b/libguile/throw.h index 1211cd926..6b6b3d79c 100644 --- a/libguile/throw.h +++ b/libguile/throw.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef THROWH -#define THROWH -/* Copyright (C) 1995,1996,1998, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_THROW_H +#define SCM_THROW_H + +/* Copyright (C) 1995,1996,1998,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -100,7 +102,8 @@ extern SCM scm_ithrow (SCM key, SCM args, int noreturn); extern SCM scm_throw (SCM key, SCM args); extern void scm_init_throw (void); -#endif /* THROWH */ + +#endif /* SCM_THROW_H */ /* Local Variables: diff --git a/libguile/values.h b/libguile/values.h index 1ddac9a71..2c2fce0ef 100644 --- a/libguile/values.h +++ b/libguile/values.h @@ -2,18 +2,19 @@ #ifndef SCM_VALUES_H #define SCM_VALUES_H -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - * + +/* Copyright (C) 2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, diff --git a/libguile/version.h b/libguile/version.h index b95254632..e69de29bb 100644 --- a/libguile/version.h +++ b/libguile/version.h @@ -1,63 +0,0 @@ -/* classes: h_files */ - -#ifndef VERSIONH -#define VERSIONH -/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA - * - * As a special exception, the Free Software Foundation gives permission - * for additional uses of the text contained in its release of GUILE. - * - * The exception is that, if you link the GUILE library with other files - * to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the GUILE library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the - * Free Software Foundation under the name GUILE. If you copy - * code from other Free Software Foundation releases into a copy of - * GUILE, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for GUILE, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. */ - - -#include "libguile/__scm.h" - - - -extern SCM scm_major_version (void); -extern SCM scm_minor_version (void); -extern SCM scm_micro_version (void); -extern SCM scm_version (void); -extern void scm_init_version (void); - -#endif /* VERSIONH */ - -/* - Local Variables: - c-file-style: "gnu" - End: -*/ diff --git a/libguile/vports.h b/libguile/vports.h index 52e6b7a45..90c628fb5 100644 --- a/libguile/vports.h +++ b/libguile/vports.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef VPORTSH -#define VPORTSH -/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc. - * +#ifndef SCM_VPORTS_H +#define SCM_VPORTS_H + +/* Copyright (C) 1995,1996,2000 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -51,7 +53,7 @@ extern SCM scm_make_soft_port (SCM pv, SCM modes); extern void scm_init_vports (void); -#endif /* VPORTSH */ +#endif /* SCM_VPORTS_H */ /* Local Variables: diff --git a/libguile/weaks.h b/libguile/weaks.h index 4e561eec2..bfafba674 100644 --- a/libguile/weaks.h +++ b/libguile/weaks.h @@ -2,18 +2,19 @@ #ifndef SCM_WEAKS_H #define SCM_WEAKS_H -/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. - * + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, From b29058ffee392969b448f8157afaf370c17a736c Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 11:17:06 +0000 Subject: [PATCH 040/107] * Remove deprecated macros and typenames. * Rename header macros to SCM__H. * Prefer !SCM_ over SCM_N. --- libguile/ChangeLog | 31 +++++++++++++++ libguile/continuations.h | 21 +++++----- libguile/debug.h | 23 +++++------ libguile/filesys.h | 23 ++++------- libguile/fports.h | 19 ++++----- libguile/options.h | 19 +++++---- libguile/posix.h | 16 ++++---- libguile/regex-posix.h | 20 +++++----- libguile/snarf.h | 43 +++++--------------- libguile/srcprop.h | 24 +++++------- libguile/stacks.h | 17 +++----- libguile/struct.h | 9 +++-- libguile/unif.h | 35 ++++------------- libguile/validate.h | 84 ++++++---------------------------------- 14 files changed, 142 insertions(+), 242 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 140c5c587..65f9ffcd2 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,34 @@ +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), diff --git a/libguile/continuations.h b/libguile/continuations.h index 2c67d78a5..74f2b1aa3 100644 --- a/libguile/continuations.h +++ b/libguile/continuations.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef CONTINUATIONSH -#define CONTINUATIONSH -/* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_CONTINUATIONS_H +#define SCM_CONTINUATIONS_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -74,10 +77,6 @@ typedef struct SCM_STACKITEM stack[1]; /* copied stack of size num_stack_items. */ } scm_t_contregs; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_contregs scm_t_contregs -#endif - #define SCM_CONTINUATIONP(x) SCM_TYP16_PREDICATE (scm_tc16_continuation, x) #define SCM_CONTREGS(x) ((scm_t_contregs *) SCM_CELL_WORD_1 (x)) @@ -97,7 +96,7 @@ typedef struct extern SCM scm_make_continuation (int *first); extern void scm_init_continuations (void); -#endif /* CONTINUATIONSH */ +#endif /* SCM_CONTINUATIONS_H */ /* Local Variables: diff --git a/libguile/debug.h b/libguile/debug.h index c5b54a62c..baa209fbd 100644 --- a/libguile/debug.h +++ b/libguile/debug.h @@ -2,18 +2,19 @@ #ifndef SCM_DEBUG_H #define SCM_DEBUG_H -/* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation - * + +/* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -97,11 +98,11 @@ extern int scm_check_entry_p, scm_check_apply_p, scm_check_exit_p; #define SCM_RESET_DEBUG_MODE \ do {\ CHECK_ENTRY = (SCM_ENTER_FRAME_P || SCM_BREAKPOINTS_P)\ - && SCM_NFALSEP (SCM_ENTER_FRAME_HDLR);\ + && !SCM_FALSEP (SCM_ENTER_FRAME_HDLR);\ CHECK_APPLY = (SCM_APPLY_FRAME_P || SCM_TRACE_P)\ - && SCM_NFALSEP (SCM_APPLY_FRAME_HDLR);\ + && !SCM_FALSEP (SCM_APPLY_FRAME_HDLR);\ CHECK_EXIT = (SCM_EXIT_FRAME_P || SCM_TRACE_P)\ - && SCM_NFALSEP (SCM_EXIT_FRAME_HDLR);\ + && !SCM_FALSEP (SCM_EXIT_FRAME_HDLR);\ scm_debug_mode = SCM_DEVAL_P || CHECK_ENTRY || CHECK_APPLY || CHECK_EXIT;\ scm_ceval_ptr = scm_debug_mode ? scm_deval : scm_ceval;\ } while (0) @@ -126,11 +127,6 @@ typedef struct scm_t_debug_frame scm_t_debug_info *info; } scm_t_debug_frame; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_debug_info scm_t_debug_info -# define scm_debug_frame scm_t_debug_frame -#endif - #ifndef USE_THREADS extern scm_t_debug_frame *scm_last_debug_frame; #endif @@ -165,7 +161,6 @@ extern scm_t_debug_frame *scm_last_debug_frame; #define SCM_CLEAR_MACROEXP(x) ((x).status &= ~SCM_MACROEXPF) #define SCM_DEBUGGINGP scm_debug_mode -#define SCM_DSIDEVAL(x, env) if NIMP(x) scm_deval((x), (env)) /* {Debug Objects} */ @@ -217,7 +212,7 @@ extern SCM scm_proc_to_mem (SCM obj); extern SCM scm_debug_hang (SCM obj); #endif /*GUILE_DEBUG*/ -#endif /* SCM_DEBUG_H */ +#endif /* SCM_DEBUG_H */ /* Local Variables: diff --git a/libguile/filesys.h b/libguile/filesys.h index ee845b743..6ad9179c7 100644 --- a/libguile/filesys.h +++ b/libguile/filesys.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef FILESYSH -#define FILESYSH -/* Copyright (C) 1995,1997,1998, 1999, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_FILESYS_H +#define SCM_FILESYS_H + +/* Copyright (C) 1995,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -90,15 +91,7 @@ extern SCM scm_basename (SCM filename, SCM suffix); extern void scm_init_filesys (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x))) - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif /* FILESYSH */ +#endif /* SCM_FILESYS_H */ /* Local Variables: diff --git a/libguile/fports.h b/libguile/fports.h index c8de4f2cb..db968128d 100644 --- a/libguile/fports.h +++ b/libguile/fports.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef FPORTSH -#define FPORTSH -/* Copyright (C) 1995,1996,1997,1998,1999, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_FPORTS_H +#define SCM_FPORTS_H + +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -56,10 +57,6 @@ typedef struct scm_t_fport { int fdes; /* file descriptor. */ } scm_t_fport; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_fport scm_t_fport -#endif - extern scm_t_bits scm_tc16_fport; #define SCM_FSTREAM(x) ((scm_t_fport *) SCM_STREAM (x)) @@ -82,7 +79,7 @@ extern SCM scm_fdes_to_port (int fdes, char *mode, SCM name); extern SCM scm_file_port_p (SCM obj); extern void scm_init_fports (void); -#endif /* FPORTSH */ +#endif /* SCM_FPORTS_H */ /* Local Variables: diff --git a/libguile/options.h b/libguile/options.h index f8b56ef68..98f21c464 100644 --- a/libguile/options.h +++ b/libguile/options.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef OPTIONSH -#define OPTIONSH -/* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation - * +#ifndef SCM_OPTIONS_H +#define SCM_OPTIONS_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -45,6 +46,7 @@ * * The author can be reached at djurfeldt@nada.kth.se * Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */ + #include "libguile/__scm.h" @@ -64,9 +66,6 @@ typedef struct scm_t_option char *doc; } scm_t_option; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_option scm_t_option -#endif #define SCM_OPTION_BOOLEAN 0 #define SCM_OPTION_INTEGER 1 @@ -77,7 +76,7 @@ extern SCM scm_options (SCM new_mode, scm_t_option options[], int n, const char extern void scm_init_opts (SCM (*func) (SCM), scm_t_option options[], int n); extern void scm_init_options (void); -#endif /* OPTIONSH */ +#endif /* SCM_OPTIONS_H */ /* Local Variables: diff --git a/libguile/posix.h b/libguile/posix.h index 7d6d65743..9f67baa25 100644 --- a/libguile/posix.h +++ b/libguile/posix.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef POSIXH -#define POSIXH -/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_POSIX_H +#define SCM_POSIX_H + +/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -108,7 +110,7 @@ extern SCM scm_sethostname (SCM name); extern SCM scm_gethostname (void); extern void scm_init_posix (void); -#endif /* POSIXH */ +#endif /* SCM_POSIX_H */ /* Local Variables: diff --git a/libguile/regex-posix.h b/libguile/regex-posix.h index 798c55240..02b6e02a8 100644 --- a/libguile/regex-posix.h +++ b/libguile/regex-posix.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef REGEXPOSIXH -#define REGEXPOSIXH +#ifndef SCM_REGEX_POSIX_H +#define SCM_REGEX_POSIX_H -/* Copyright (C) 1997,1998, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1997,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,22 +42,22 @@ * * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - */ + * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" extern scm_t_bits scm_tc16_regex; #define SCM_RGX(X) ((regex_t *) SCM_CELL_WORD_1 (X)) -#define SCM_RGXP(X) (SCM_NIMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_regex)) +#define SCM_RGXP(X) (!SCM_IMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_regex)) extern SCM scm_make_regexp (SCM pat, SCM flags); SCM scm_regexp_p (SCM x); extern SCM scm_regexp_exec (SCM rx, SCM str, SCM start, SCM flags); extern void scm_init_regex_posix (void); -#endif +#endif /* SCM_REGEX_POSIX_H */ /* Local Variables: diff --git a/libguile/snarf.h b/libguile/snarf.h index 8c03c3874..c44484b3a 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -1,22 +1,20 @@ /* classes: h_files */ -/* Macros for snarfing initialization actions from C source. */ +#ifndef SCM_SNARF_H +#define SCM_SNARF_H -#ifndef LIBGUILE_SNARF_H -#define LIBGUILE_SNARF_H - -/* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -46,9 +44,10 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - +/* Macros for snarfing initialization actions from C source. */ + #if defined(__cplusplus) || defined(GUILE_CPLUSPLUS_SNARF) /* This used to be "SCM (*)(...)" but GCC on RedHat 7.1 doesn't seem @@ -191,36 +190,12 @@ SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, init_va SCM_SNARF_HERE(SCM c_name) \ SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, init_val));) -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_CONST_LONG(c_name, scheme_name,value) \ -SCM_VCELL_INIT(c_name, scheme_name, scm_long2num(value)) - -#define SCM_VCELL(c_name, scheme_name) \ -SCM_SNARF_HERE(static SCM c_name) \ -SCM_SNARF_INIT(c_name = scm_permanent_object (scm_sysintern (scheme_name, SCM_BOOL_F));) - -#define SCM_GLOBAL_VCELL(c_name, scheme_name) \ -SCM_SNARF_HERE(SCM c_name) \ -SCM_SNARF_INIT(c_name = scm_permanent_object (scm_sysintern (scheme_name, SCM_BOOL_F));) - -#define SCM_VCELL_INIT(c_name, scheme_name, init_val) \ -SCM_SNARF_HERE(static SCM c_name) \ -SCM_SNARF_INIT(c_name = scm_permanent_object (scm_sysintern (scheme_name, init_val));) - -#define SCM_GLOBAL_VCELL_INIT(c_name, scheme_name, init_val) \ -SCM_SNARF_HERE(SCM c_name) \ -SCM_SNARF_INIT(c_name = scm_permanent_object (scm_sysintern (scheme_name, init_val));) - -#endif /* (SCM_DEBUG_DEPRECATED == 0) */ - #ifdef SCM_MAGIC_SNARF_DOCS #undef SCM_ASSERT #define SCM_ASSERT(_cond, _arg, _pos, _subr) ^^ argpos _arg _pos __LINE__ ^^ #endif /* SCM_MAGIC_SNARF_DOCS */ -#endif /* LIBGUILE_SNARF_H */ - +#endif /* SCM_SNARF_H */ /* Local Variables: diff --git a/libguile/srcprop.h b/libguile/srcprop.h index 5da2e1282..ed0ea217b 100644 --- a/libguile/srcprop.h +++ b/libguile/srcprop.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_SOURCE_PROPERTIES_H -#define SCM_SOURCE_PROPERTIES_H -/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation - * +#ifndef SCM_SRCPROP_H +#define SCM_SRCPROP_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -93,11 +94,6 @@ typedef struct scm_t_srcprops_chunk scm_t_srcprops srcprops[1]; } scm_t_srcprops_chunk; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_srcprops scm_t_srcprops -# define scm_srcprops_chunk scm_t_srcprops_chunk -#endif - #define SCM_SOURCE_PROPERTY_FLAG_BREAK (1L << 16) #define SRCPROPSP(p) (SCM_TYP16_PREDICATE (scm_tc16_srcprops, p)) @@ -120,11 +116,11 @@ typedef struct scm_t_srcprops_chunk #define SETSRCPROPLINE(p,l) SETSRCPROPPOS (p, l, SRCPROPCOL (p)) #define SETSRCPROPCOL(p,c) SETSRCPROPPOS (p, SRCPROPLINE (p), c) -#define SRCBRKP(x) (SCM_NIMP (t.arg1 = scm_whash_lookup (scm_source_whash, (x)))\ +#define SRCBRKP(x) (!SCM_IMP (t.arg1 = scm_whash_lookup (scm_source_whash, (x)))\ && SRCPROPSP (t.arg1)\ && (SCM_CELL_WORD_0 (t.arg1) & (1L << 16))) -#define PROCTRACEP(x) SCM_NFALSEP (scm_procedure_property (x, scm_sym_trace)) +#define PROCTRACEP(x) (!SCM_FALSEP (scm_procedure_property (x, scm_sym_trace))) extern SCM scm_sym_filename; extern SCM scm_sym_copy; @@ -144,7 +140,7 @@ extern SCM scm_set_source_properties_x (SCM obj, SCM props); extern void scm_finish_srcprop (void); extern void scm_init_srcprop (void); -#endif /* SCM_SOURCE_PROPERTIES_H */ +#endif /* SCM_SRCPROP_H */ /* Local Variables: diff --git a/libguile/stacks.h b/libguile/stacks.h index bea51ce7a..747a3daec 100644 --- a/libguile/stacks.h +++ b/libguile/stacks.h @@ -2,18 +2,19 @@ #ifndef SCM_STACKS_H #define SCM_STACKS_H -/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation - * + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -72,11 +73,6 @@ typedef struct scm_t_stack { scm_t_info_frame tail[1]; } scm_t_stack; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_info_frame scm_t_info_frame -# define scm_stack scm_t_stack -#endif - extern SCM scm_t_stackype; #define SCM_STACKP(obj) (SCM_STRUCTP (obj) && SCM_EQ_P (SCM_STRUCT_VTABLE (obj), scm_t_stackype)) @@ -138,10 +134,9 @@ SCM scm_frame_procedure_p (SCM frame); SCM scm_frame_evaluating_args_p (SCM frame); SCM scm_frame_overflow_p (SCM frame); - void scm_init_stacks (void); -#endif /* SCM_STACKS_H */ +#endif /* SCM_STACKS_H */ /* Local Variables: diff --git a/libguile/struct.h b/libguile/struct.h index ec5ae8cff..a36adf0a4 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -2,18 +2,19 @@ #ifndef SCM_STRUCT_H #define SCM_STRUCT_H + /* Copyright (C) 1995,1997,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -77,7 +78,7 @@ typedef size_t (*scm_t_struct_free) (scm_t_bits * vtable, scm_t_bits * data); #define SCM_STRUCTF_LIGHT (1L << 31) /* Light representation (no hidden words) */ -#define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_struct)) +#define SCM_STRUCTP(X) (!SCM_IMP(X) && (SCM_TYP3(X) == scm_tc3_struct)) #define SCM_STRUCT_DATA(X) ((scm_t_bits *) SCM_CELL_WORD_1 (X)) #define SCM_STRUCT_VTABLE_DATA(X) ((scm_t_bits *) (SCM_CELL_WORD_0 (X) - scm_tc3_struct)) diff --git a/libguile/unif.h b/libguile/unif.h index 9b5b61d6c..66a33fcf0 100644 --- a/libguile/unif.h +++ b/libguile/unif.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef SCM_UNIFORM_VECTORS_H -#define SCM_UNIFORM_VECTORS_H +#ifndef SCM_UNIF_H +#define SCM_UNIF_H + /* Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -72,19 +73,10 @@ typedef struct scm_t_array_dim long inc; } scm_t_array_dim; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_array scm_t_array -# define scm_array_dim scm_t_array_dim -#endif - extern scm_t_bits scm_tc16_array; #define SCM_ARRAY_FLAG_CONTIGUOUS (1 << 16) -#if (SCM_DEBUG_DEPRECATED == 0) -#define SCM_ARRAY_CONTIGUOUS SCM_ARRAY_FLAG_CONTIGUOUS -#endif - #define SCM_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_array, a) #define SCM_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 17)) #define SCM_ARRAY_CONTP(x) (SCM_CELL_WORD_0 (x) & SCM_ARRAY_FLAG_CONTIGUOUS) @@ -152,20 +144,7 @@ extern int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate); extern SCM scm_array_prototype (SCM ra); extern void scm_init_unif (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -/* apparently it's possible to have more than SCM_LENGTH_MAX elements - in an array: if the length is SCM_LENGTH_MAX then the SCM_VELTS - block begins with the true length (a long int). I wonder if it - works. */ -#define SCM_HUGE_LENGTH(x)\ - (SCM_LENGTH_MAX==SCM_LENGTH(x) ? *((long *)SCM_VELTS(x)) : SCM_LENGTH(x)) - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif /* SCM_UNIFORM_VECTORS_H */ +#endif /* SCM_UNIF_H */ /* Local Variables: diff --git a/libguile/validate.h b/libguile/validate.h index 869ae97a4..ddbf98a48 100644 --- a/libguile/validate.h +++ b/libguile/validate.h @@ -1,3 +1,8 @@ +/* classes: h_files */ + +#ifndef SCM_VALIDATE_H +#define SCM_VALIDATE_H + /* Copyright (C) 1999,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -41,8 +46,7 @@ /* Written by Greg J. Badros , Dec-1999 */ -#ifndef SCM_VALIDATE_H__ -#define SCM_VALIDATE_H__ + #define SCM_SYSERROR do { scm_syserror (FUNC_NAME); } while (0) @@ -344,7 +348,7 @@ #define SCM_VALIDATE_THUNK(pos, thunk) \ do { \ - SCM_ASSERT (SCM_NFALSEP (scm_thunk_p (thunk)), thunk, pos, FUNC_NAME); \ + SCM_ASSERT (!SCM_FALSEP (scm_thunk_p (thunk)), thunk, pos, FUNC_NAME); \ } while (0) #define SCM_VALIDATE_SYMBOL(pos, sym) SCM_MAKE_VALIDATE (pos, sym, SYMBOLP) @@ -412,7 +416,7 @@ #define SCM_VALIDATE_ARRAY(pos,v) \ do { \ - SCM_ASSERT (SCM_NIMP (v) \ + SCM_ASSERT (!SCM_IMP (v) \ && !SCM_FALSEP (scm_array_p (v, SCM_UNDEFINED)), \ v, pos, FUNC_NAME); \ } while (0) @@ -422,7 +426,7 @@ #define SCM_VALIDATE_VECTOR_OR_DVECTOR(pos, v) \ do { \ SCM_ASSERT ((SCM_VECTORP (v) \ - || (SCM_NIMP (v) && SCM_TYP7 (v) == scm_tc7_dvect)), \ + || (!SCM_IMP (v) && SCM_TYP7 (v) == scm_tc7_dvect)), \ v, pos, FUNC_NAME); \ } while (0) @@ -430,7 +434,7 @@ #define SCM_VALIDATE_VTABLE(pos, v) \ do { \ - SCM_ASSERT (SCM_NIMP (v) && SCM_NFALSEP (scm_struct_vtable_p (v)), \ + SCM_ASSERT (!SCM_IMP (v) && !SCM_FALSEP (scm_struct_vtable_p (v)), \ v, pos, FUNC_NAME); \ } while (0) @@ -439,73 +443,7 @@ SCM_ASSERT (SCM_VECTORP (v) && len == SCM_VECTOR_LENGTH (v), v, pos, FUNC_NAME); \ } while (0) - - -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME)) - -#define SCM_WTA(pos, scm) \ - do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0) - -#define RETURN_SCM_WTA(pos, scm) \ - do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0) - -#define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \ - do { \ - if (SCM_INUMP (z)) \ - cvar = (double) SCM_INUM (z); \ - else if (SCM_REALP (z)) \ - cvar = SCM_REAL_VALUE (z); \ - else if (SCM_BIGP (z)) \ - cvar = scm_i_big2dbl (z); \ - else \ - { \ - cvar = 0.0; \ - SCM_WRONG_TYPE_ARG (pos, z); \ - } \ - } while (0) - -#define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \ - do { \ - if (SCM_UNBNDP (number)) \ - cvar = def; \ - else \ - SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \ - } while (0) - -#define SCM_VALIDATE_STRINGORSUBSTR SCM_VALIDATE_STRING - -#define SCM_VALIDATE_ROSTRING(pos, str) SCM_MAKE_VALIDATE (pos, str, ROSTRINGP) - -#define SCM_VALIDATE_ROSTRING_COPY(pos, str, cvar) \ - do { \ - SCM_ASSERT (SCM_ROSTRINGP (str), str, pos, FUNC_NAME); \ - cvar = SCM_ROCHARS (str); \ - } while (0) - -#define SCM_VALIDATE_NULLORROSTRING_COPY(pos, str, cvar) \ - do { \ - SCM_ASSERT (SCM_FALSEP (str) || SCM_ROSTRINGP (str), \ - str, pos, FUNC_NAME); \ - if (SCM_FALSEP(str)) \ - cvar = NULL; \ - else \ - cvar = SCM_ROCHARS(str); \ - } while (0) - -#define SCM_VALIDATE_RWSTRING(pos, str) \ - do { \ - SCM_ASSERT (SCM_STRINGP (str), str, pos, FUNC_NAME); \ - if (!SCM_RWSTRINGP (str)) \ - scm_misc_error (FUNC_NAME, "argument is a read-only string", str); \ - } while (0) - -#define SCM_VALIDATE_OPDIR(pos, port) SCM_MAKE_VALIDATE (pos, port, OPDIRP) - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif +#endif /* SCM_VALIDATE_H */ /* Local Variables: From dee01b012cd5179b70a2e361ee08c364ed9f3314 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 12:13:50 +0000 Subject: [PATCH 041/107] * Removed deprecated stuff. * Some more renamings to SCM__H. --- libguile/ChangeLog | 46 ++++++++++++++++++ libguile/Makefile.am | 7 ++- libguile/fluids.c | 13 ------ libguile/fluids.h | 23 ++++----- libguile/gsubr.c | 30 +----------- libguile/gsubr.h | 29 ++++-------- libguile/hooks.c | 11 ----- libguile/hooks.h | 11 ++--- libguile/list.c | 62 ------------------------ libguile/list.h | 46 ++++-------------- libguile/load.c | 24 ---------- libguile/load.h | 18 +++---- libguile/numbers.c | 88 ----------------------------------- libguile/numbers.h | 31 ++---------- libguile/procs.c | 36 -------------- libguile/procs.h | 33 +++---------- libguile/root.c | 40 ---------------- libguile/root.h | 25 +++------- libguile/smob.c | 33 ------------- libguile/smob.h | 27 +++-------- libguile/strports.c | 32 ------------- libguile/strports.h | 24 ++++------ libguile/symbols-deprecated.c | 0 libguile/symbols.c | 3 -- libguile/symbols.h | 69 ++------------------------- libguile/vectors.c | 82 -------------------------------- libguile/vectors.h | 17 ++----- 27 files changed, 132 insertions(+), 728 deletions(-) delete mode 100644 libguile/symbols-deprecated.c diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 65f9ffcd2..956953644 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,49 @@ +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, diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 64eae886e..09fa64ae5 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -52,7 +52,7 @@ libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \ random.c rdelim.c read.c root.c rw.c scmsigs.c script.c simpos.c smob.c \ sort.c srcprop.c stackchk.c stacks.c stime.c strings.c strop.c \ strorder.c strports.c struct.c symbols.c throw.c values.c \ - variable.c vectors.c version.c vports.c weaks.c symbols-deprecated.c + variable.c vectors.c version.c vports.c weaks.c DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \ continuations.x debug.x deprecation.x dynl.x dynwind.x \ @@ -66,7 +66,7 @@ DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \ scmsigs.x script.x simpos.x smob.x sort.x srcprop.x \ stackchk.x stacks.x stime.x strings.x strop.x strorder.x strports.x \ struct.x symbols.x throw.x values.x variable.x vectors.x \ - version.x vports.x weaks.x symbols-deprecated.x + version.x vports.x weaks.x EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@ @@ -83,8 +83,7 @@ DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \ scmsigs.doc script.doc simpos.doc smob.doc sort.doc \ srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc strop.doc \ strorder.doc strports.doc struct.doc symbols.doc throw.doc \ - values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc \ - symbols-deprecated.doc + values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@ diff --git a/libguile/fluids.c b/libguile/fluids.c index 4ce9b8860..2a8ff9a1f 100644 --- a/libguile/fluids.c +++ b/libguile/fluids.c @@ -266,19 +266,6 @@ scm_init_fluids () #endif } -#if SCM_DEBUG_DEPRECATED == 0 - -SCM -scm_internal_with_fluids (SCM fluids, SCM values, SCM (*cproc) (), void *cdata) -{ - scm_c_issue_deprecation_warning ("`scm_internal_with_fluids' is deprecated. " - "Use `scm_c_with_fluids' instead."); - - return scm_c_with_fluids (fluids, values, cproc, cdata); -} - -#endif - /* Local Variables: c-file-style: "gnu" diff --git a/libguile/fluids.h b/libguile/fluids.h index acc6bebb4..6e0aa8f24 100644 --- a/libguile/fluids.h +++ b/libguile/fluids.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef FLUIDSH -#define FLUIDSH +#ifndef SCM_FLUIDS_H +#define SCM_FLUIDS_H -/* Copyright (C) 1996, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -44,6 +44,7 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" #include "libguile/root.h" @@ -106,15 +107,7 @@ void scm_swap_fluids_reverse (SCM fluids, SCM vals); void scm_init_fluids (void); -#if SCM_DEBUG_DEPRECATED == 0 - -/* Use scm_c_with_fluids instead. */ -SCM scm_internal_with_fluids (SCM fluids, SCM vals, - SCM (*cproc)(void *), void *cdata); - -#endif - -#endif /* !FLUIDSH */ +#endif /* SCM_FLUIDS_H */ /* Local Variables: diff --git a/libguile/gsubr.c b/libguile/gsubr.c index 6fe3492a8..767fc69ea 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,7 +39,6 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - #include @@ -278,7 +277,6 @@ gsubr_21l(SCM req1, SCM req2, SCM opt, SCM rst) #endif - void scm_init_gsubr() { @@ -293,32 +291,6 @@ scm_init_gsubr() #endif } -#if SCM_DEBUG_DEPRECATED == 0 - -SCM -scm_make_gsubr (const char *name, int req, int opt, int rst, SCM (*fcn)()) -{ - scm_c_issue_deprecation_warning - ("`scm_make_gsubr' is deprecated. Use `scm_c_define_gsubr' instead."); - - return scm_c_define_gsubr (name, req, opt, rst, fcn); -} - -SCM -scm_make_gsubr_with_generic (const char *name, - int req, int opt, int rst, - SCM (*fcn)(), SCM *gf) -{ - scm_c_issue_deprecation_warning - ("`scm_make_gsubr_with_generic' is deprecated. " - "Use `scm_c_define_gsubr_with_generic' instead."); - - return scm_c_define_gsubr_with_generic (name, req, opt, rst, fcn, gf); -} - -#endif /* !SCM_DEBUG_DEPRECATED */ - - /* Local Variables: c-file-style: "gnu" diff --git a/libguile/gsubr.h b/libguile/gsubr.h index fe7dcd8f5..de3489805 100644 --- a/libguile/gsubr.h +++ b/libguile/gsubr.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef GSUBRH -#define GSUBRH -/* Copyright (C) 1995,1996,1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_GSUBR_H +#define SCM_GSUBR_H + +/* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -75,20 +77,7 @@ extern SCM scm_c_define_gsubr_with_generic (const char *name, extern SCM scm_gsubr_apply (SCM args); extern void scm_init_gsubr (void); -#if SCM_DEBUG_DEPRECATED == 0 - -extern SCM scm_make_gsubr (const char *name, int req, int opt, int rst, - SCM (*fcn)()); -extern SCM scm_make_gsubr_with_generic (const char *name, - int req, - int opt, - int rst, - SCM (*fcn)(), - SCM *gf); - -#endif - -#endif /* GSUBRH */ +#endif /* SCM_GSUBR_H */ /* Local Variables: diff --git a/libguile/hooks.c b/libguile/hooks.c index 2d32db31a..3fd45960e 100644 --- a/libguile/hooks.c +++ b/libguile/hooks.c @@ -171,17 +171,6 @@ hook_print (SCM hook, SCM port, scm_print_state *pstate) return 1; } -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_create_hook (const char *name, int n_args) -{ - SCM hook = scm_make_hook (SCM_MAKINUM (n_args)); - scm_c_define (name, hook); - return scm_permanent_object (hook); -} - -#endif SCM_DEFINE (scm_make_hook, "make-hook", 0, 1, 0, (SCM n_args), diff --git a/libguile/hooks.h b/libguile/hooks.h index c475bb07e..8f9dc63c5 100644 --- a/libguile/hooks.h +++ b/libguile/hooks.h @@ -2,18 +2,19 @@ #ifndef SCM_HOOKS_H #define SCM_HOOKS_H + /* Copyright (C) 1995,1996,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -112,10 +113,6 @@ extern void scm_c_run_hook (SCM hook, SCM args); extern SCM scm_hook_to_list (SCM hook); extern void scm_init_hooks (void); -#if (SCM_DEBUG_DEPRECATED == 0) -extern SCM scm_create_hook (const char* name, int n_args); -#endif - #endif /* SCM_HOOKS_H */ /* diff --git a/libguile/list.c b/libguile/list.c index b1465fa78..a2f29f034 100644 --- a/libguile/list.c +++ b/libguile/list.c @@ -133,12 +133,6 @@ SCM_DEFINE (scm_list, "list", 0, 0, 1, #undef FUNC_NAME -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM_REGISTER_PROC (s_list_star, "list*", 1, 0, 1, scm_cons_star); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - SCM_DEFINE (scm_cons_star, "cons*", 1, 0, 1, (SCM arg, SCM rest), "Like @code{list}, but the last arg provides the tail of the\n" @@ -553,60 +547,6 @@ SCM_DEFINE (scm_list_copy, "list-copy", 1, 0, 0, /* membership tests (memq, memv, etc.) */ -#if SCM_DEBUG_DEPRECATED == 0 - -SCM_DEFINE (scm_sloppy_memq, "sloppy-memq", 2, 0, 0, - (SCM x, SCM lst), - "This procedure behaves like @code{memq}, but does no type or error checking.\n" - "Its use is recommended only in writing Guile internals,\n" - "not for high-level Scheme programs.") -#define FUNC_NAME s_scm_sloppy_memq -{ - for(; SCM_CONSP (lst); lst = SCM_CDR(lst)) - { - if (SCM_EQ_P (SCM_CAR (lst), x)) - return lst; - } - return lst; -} -#undef FUNC_NAME - - -SCM_DEFINE (scm_sloppy_memv, "sloppy-memv", 2, 0, 0, - (SCM x, SCM lst), - "This procedure behaves like @code{memv}, but does no type or error checking.\n" - "Its use is recommended only in writing Guile internals,\n" - "not for high-level Scheme programs.") -#define FUNC_NAME s_scm_sloppy_memv -{ - for(; SCM_CONSP (lst); lst = SCM_CDR(lst)) - { - if (! SCM_FALSEP (scm_eqv_p (SCM_CAR (lst), x))) - return lst; - } - return lst; -} -#undef FUNC_NAME - - -SCM_DEFINE (scm_sloppy_member, "sloppy-member", 2, 0, 0, - (SCM x, SCM lst), - "This procedure behaves like @code{member}, but does no type or error checking.\n" - "Its use is recommended only in writing Guile internals,\n" - "not for high-level Scheme programs.") -#define FUNC_NAME s_scm_sloppy_member -{ - for(; SCM_CONSP (lst); lst = SCM_CDR(lst)) - { - if (! SCM_FALSEP (scm_equal_p (SCM_CAR (lst), x))) - return lst; - } - return lst; -} -#undef FUNC_NAME - -#endif /* DEPRECATED */ - /* The function scm_c_memq returns the first sublist of list whose car is * 'eq?' obj, where the sublists of list are the non-empty lists returned by * (list-tail list k) for k less than the length of list. If obj does not @@ -642,7 +582,6 @@ SCM_DEFINE (scm_memq, "memq", 2, 0, 0, #undef FUNC_NAME - SCM_DEFINE (scm_memv, "memv", 2, 0, 0, (SCM x, SCM lst), "Return the first sublist of @var{lst} whose car is @code{eqv?}\n" @@ -684,7 +623,6 @@ SCM_DEFINE (scm_member, "member", 2, 0, 0, } #undef FUNC_NAME - /* deleting elements from a list (delq, etc.) */ diff --git a/libguile/list.h b/libguile/list.h index d4f2c6efb..78af07c95 100644 --- a/libguile/list.h +++ b/libguile/list.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef LISTH -#define LISTH -/* Copyright (C) 1995,1996,1997, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_LIST_H +#define SCM_LIST_H + +/* Copyright (C) 1995,1996,1997,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -86,37 +88,7 @@ extern SCM scm_delv1_x (SCM item, SCM lst); extern SCM scm_delete1_x (SCM item, SCM lst); extern void scm_init_list (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_LIST0 SCM_EOL -#define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL) -#define SCM_LIST2(e0, e1) scm_cons2 ((e0), (e1), SCM_EOL) -#define SCM_LIST3(e0, e1, e2) scm_cons ((e0), SCM_LIST2 ((e1), (e2))) -#define SCM_LIST4(e0, e1, e2, e3)\ - scm_cons2 ((e0), (e1), SCM_LIST2 ((e2), (e3))) -#define SCM_LIST5(e0, e1, e2, e3, e4)\ - scm_cons ((e0), SCM_LIST4 ((e1), (e2), (e3), (e4))) -#define SCM_LIST6(e0, e1, e2, e3, e4, e5)\ - scm_cons2 ((e0), (e1), SCM_LIST4 ((e2), (e3), (e4), (e5))) -#define SCM_LIST7(e0, e1, e2, e3, e4, e5, e6)\ - scm_cons ((e0), SCM_LIST6 ((e1), (e2), (e3), (e4), (e5), (e6))) -#define SCM_LIST8(e0, e1, e2, e3, e4, e5, e6, e7)\ - scm_cons2 ((e0), (e1), SCM_LIST6 ((e2), (e3), (e4), (e5), (e6), (e7))) -#define SCM_LIST9(e0, e1, e2, e3, e4, e5, e6, e7, e8)\ - scm_cons ((e0),\ - SCM_LIST8 ((e1), (e2), (e3), (e4), (e5), (e6), (e7), (e8))) - -#define scm_listify scm_list_n - -extern SCM scm_sloppy_memq (SCM x, SCM lst); -extern SCM scm_sloppy_memv (SCM x, SCM lst); -extern SCM scm_sloppy_member (SCM x, SCM lst); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif /* LISTH */ +#endif /* SCM_LIST_H */ /* Local Variables: diff --git a/libguile/load.c b/libguile/load.c index f8c9b76ec..d26f5aca8 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -470,30 +470,6 @@ scm_c_primitive_load_path (const char *filename) return scm_primitive_load_path (scm_makfrom0str (filename)); } -#if SCM_DEBUG_DEPRECATED == 0 - -/* Eval now copies source properties, so this function is no longer required. - */ - -SCM_SYMBOL (scm_end_of_file_key, "end-of-file"); - -SCM_DEFINE (scm_read_and_eval_x, "read-and-eval!", 0, 1, 0, - (SCM port), - "Read a form from @var{port} (standard input by default), and evaluate it\n" - "(memoizing it in the process) in the top-level environment. If no data\n" - "is left to be read from @var{port}, an @code{end-of-file} error is\n" - "signalled.") -#define FUNC_NAME s_scm_read_and_eval_x -{ - SCM form = scm_read (port); - if (SCM_EOF_OBJECT_P (form)) - scm_ithrow (scm_end_of_file_key, SCM_EOL, 1); - return scm_eval_x (form, scm_current_module ()); -} -#undef FUNC_NAME - -#endif - /* Information about the build environment. */ diff --git a/libguile/load.h b/libguile/load.h index b3c2c2e52..a4d17b1ce 100644 --- a/libguile/load.h +++ b/libguile/load.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef LOADH -#define LOADH -/* Copyright (C) 1995,1996,1998, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_LOAD_H +#define SCM_LOAD_H + +/* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -58,10 +61,9 @@ extern SCM scm_search_path (SCM path, SCM filename, SCM exts); extern SCM scm_sys_search_load_path (SCM filename); extern SCM scm_primitive_load_path (SCM filename); extern SCM scm_c_primitive_load_path (const char *filename); -extern SCM scm_read_and_eval_x (SCM port); extern void scm_init_load (void); -#endif /* LOADH */ +#endif /* SCM_LOAD_H */ /* Local Variables: diff --git a/libguile/numbers.c b/libguile/numbers.c index 1a6ff53c1..3bead8ce6 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -4454,94 +4454,6 @@ scm_init_numbers () #endif } -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_mkbig (size_t len, int sign) -{ - scm_c_issue_deprecation_warning ("`scm_mkbig' is deprecated. " - "Use `scm_i_mkbig' instead."); - return scm_i_mkbig (len, sign); -} - -SCM -scm_big2inum (SCM b, size_t l) -{ - scm_c_issue_deprecation_warning ("`scm_big2inum' is deprecated. " - "Use `scm_i_big2num' instead."); - return scm_i_big2inum (b, l); -} - -SCM -scm_adjbig (SCM b, size_t nlen) -{ - scm_c_issue_deprecation_warning ("`scm_adjbig' is deprecated. " - "Use `scm_i_adjbig' instead."); - return scm_i_adjbig (b, nlen); -} - -SCM -scm_normbig (SCM b) -{ - scm_c_issue_deprecation_warning ("`scm_normbig' is deprecated. " - "Use `scm_i_normbig' instead."); - return scm_i_normbig (b); -} - -SCM -scm_copybig (SCM b, int sign) -{ - scm_c_issue_deprecation_warning ("`scm_copybig' is deprecated. " - "Use `scm_i_copybig' instead."); - return scm_i_copybig (b, sign); -} - -SCM -scm_2ulong2big (unsigned long *np) -{ - unsigned long n; - size_t i; - SCM_BIGDIG *digits; - SCM ans; - - ans = scm_i_mkbig (2 * SCM_DIGSPERLONG, 0); - digits = SCM_BDIGITS (ans); - - n = np[0]; - for (i = 0; i < SCM_DIGSPERLONG; ++i) - { - digits[i] = SCM_BIGLO (n); - n = SCM_BIGDN ((unsigned long) n); - } - n = np[1]; - for (i = 0; i < SCM_DIGSPERLONG; ++i) - { - digits[i + SCM_DIGSPERLONG] = SCM_BIGLO (n); - n = SCM_BIGDN ((unsigned long) n); - } - return ans; -} - -SCM -scm_dbl2big (double d) -{ - scm_c_issue_deprecation_warning ("`scm_dbl2big' is deprecated. " - "Use `scm_dbl2num' instead," - "or `scm_i_dbl2big'."); - return scm_i_dbl2big (d); -} - -double -scm_big2dbl (SCM b) -{ - scm_c_issue_deprecation_warning ("`scm_big2dbl' is deprecated. " - "Use `scm_num2dbl' instead," - "or `scm_i_big2dbl'."); - return scm_i_big2dbl (b); -} - -#endif - /* Local Variables: c-file-style: "gnu" diff --git a/libguile/numbers.h b/libguile/numbers.h index 05c2b4b21..4c3023ecd 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -2,18 +2,19 @@ #ifndef SCM_NUMBERS_H #define SCM_NUMBERS_H + /* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -233,26 +234,11 @@ extern SCM scm_i_ulong2big (unsigned long n); extern SCM scm_i_size2big (size_t n); extern SCM scm_i_ptrdiff2big (ptrdiff_t n); - -#if (SCM_DEBUG_DEPRECATED == 0) -extern SCM scm_big2inum (SCM b, size_t l); -extern SCM scm_mkbig (size_t nlen, int sign); -extern SCM scm_adjbig (SCM b, size_t len); -extern SCM scm_normbig (SCM b); -extern SCM scm_copybig (SCM b, int sign); - -#define SCM_FIXNUM_BIT SCM_I_FIXNUM_BIT -#endif - #ifdef HAVE_LONG_LONGS extern SCM scm_i_long_long2big (long long n); extern SCM scm_i_ulong_long2big (unsigned long long n); #endif -#if (SCM_DEBUG_DEPRECATED == 0) -extern SCM scm_2ulong2big (unsigned long * np); -#endif - extern int scm_bigcomp (SCM x, SCM y); extern long scm_pseudolong (long x); extern void scm_longdigs (long x, SCM_BIGDIG digs[]); @@ -307,17 +293,8 @@ extern SCM scm_exact_to_inexact (SCM z); extern SCM scm_inexact_to_exact (SCM z); extern SCM scm_trunc (SCM x); extern SCM scm_i_dbl2big (double d); - -#if (SCM_DEBUG_DEPRECATED == 0) -extern SCM scm_dbl2big (double d); -#endif - extern double scm_i_big2dbl (SCM b); -#if (SCM_DEBUG_DEPRECATED == 0) -extern double scm_big2dbl (SCM b); -#endif - extern SCM scm_short2num (short n); extern SCM scm_ushort2num (unsigned short n); extern SCM scm_int2num (int n); diff --git a/libguile/procs.c b/libguile/procs.c index 78b703bca..6f3dca63a 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -401,42 +401,6 @@ scm_init_procs () #endif } -#if SCM_DEBUG_DEPRECATED == 0 - -SCM -scm_make_subr_opt (const char *name, int type, SCM (*fcn) (), int set) -{ - scm_c_issue_deprecation_warning - ("`scm_make_subr_opt' is deprecated. Use `scm_c_make_subr' or " - "`scm_c_define_subr' instead."); - - if (set) - return scm_c_define_subr (name, type, fcn); - else - return scm_c_make_subr (name, type, fcn); -} - -SCM -scm_make_subr (const char *name, int type, SCM (*fcn) ()) -{ - scm_c_issue_deprecation_warning - ("`scm_make_subr' is deprecated. Use `scm_c_define_subr' instead."); - - return scm_c_define_subr (name, type, fcn); -} - -SCM -scm_make_subr_with_generic (const char *name, int type, SCM (*fcn) (), SCM *gf) -{ - scm_c_issue_deprecation_warning - ("`scm_make_subr_with_generic' is deprecated. Use " - "`scm_c_define_subr_with_generic' instead."); - - return scm_c_define_subr_with_generic (name, type, fcn, gf); -} - -#endif /* !SCM_DEBUG_DEPRECATION */ - /* Local Variables: c-file-style: "gnu" diff --git a/libguile/procs.h b/libguile/procs.h index 9e0f34eba..0cb2586dc 100644 --- a/libguile/procs.h +++ b/libguile/procs.h @@ -2,18 +2,19 @@ #ifndef SCM_PROCS_H #define SCM_PROCS_H + /* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -63,10 +64,6 @@ typedef struct SCM properties; /* procedure properties */ } scm_t_subr_entry; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_subr_entry scm_t_subr_entry -#endif - #define SCM_SUBRNUM(subr) (SCM_CELL_WORD_0 (subr) >> 8) #define SCM_SET_SUBRNUM(subr, num) \ SCM_SET_CELL_WORD_0 (subr, (num << 8) + SCM_TYP7 (subr)) @@ -92,7 +89,7 @@ typedef struct /* Closures */ -#define SCM_CLOSUREP(x) (SCM_NIMP(x) && (SCM_TYP3 (x) == scm_tc3_closure)) +#define SCM_CLOSUREP(x) (!SCM_IMP(x) && (SCM_TYP3 (x) == scm_tc3_closure)) #define SCM_CLOSCAR(x) SCM_PACK (SCM_CELL_WORD_0 (x) - scm_tc3_closure) #define SCM_CODE(x) SCM_CAR (SCM_CLOSCAR (x)) #define SCM_CLOSURE_FORMALS(x) SCM_CAR (SCM_CODE (x)) @@ -151,7 +148,7 @@ typedef struct GETTER and SETTER slots can live directly on the heap, using the new four-word cells. */ -#define SCM_PROCEDURE_WITH_SETTER_P(obj) (SCM_NIMP(obj) && (SCM_TYP7 (obj) == scm_tc7_pws)) +#define SCM_PROCEDURE_WITH_SETTER_P(obj) (!SCM_IMP(obj) && (SCM_TYP7 (obj) == scm_tc7_pws)) #define SCM_PROCEDURE(obj) SCM_CELL_OBJECT_1 (obj) #define SCM_SETTER(obj) SCM_CELL_OBJECT_2 (obj) @@ -186,24 +183,6 @@ extern void scm_init_procs (void); extern SCM scm_make_cclo (SCM proc, SCM len); #endif /*GUILE_DEBUG*/ - - -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_SUBR_DOC(x) SCM_BOOL_F - -extern SCM scm_make_subr (const char *name, int type, SCM (*fcn) ()); -extern SCM scm_make_subr_with_generic (const char *name, - int type, - SCM (*fcn) (), - SCM *gf); -extern SCM scm_make_subr_opt (const char *name, - int type, - SCM (*fcn) (), - int set); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_PROCS_H */ /* diff --git a/libguile/root.c b/libguile/root.c index 6ff24ca49..26a914948 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -382,46 +382,6 @@ scm_apply_with_dynamic_root (SCM proc, SCM a1, SCM args, SCM handler) -#if (SCM_DEBUG_DEPRECATED == 0) - -/* Call thunk(closure) underneath a top-level error handler. - * If an error occurs, pass the exitval through err_filter and return it. - * If no error occurs, return the value of thunk. - */ - -#ifdef _UNICOS -typedef int setjmp_type; -#else -typedef long setjmp_type; -#endif - - -SCM -scm_call_catching_errors (SCM (*thunk)(), SCM (*err_filter)(), void *closure) -{ - SCM answer; - setjmp_type i; -#ifdef DEBUG_EXTENSIONS - SCM_DFRAME (scm_rootcont) = scm_last_debug_frame; -#endif - i = setjmp (SCM_JMPBUF (scm_rootcont)); - scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P; - if (!i) - { - scm_gc_heap_lock = 0; - answer = thunk (closure); - } - else - { - scm_gc_heap_lock = 1; - answer = err_filter (scm_exitval, closure); - } - return answer; -} - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - - void scm_init_root () { diff --git a/libguile/root.h b/libguile/root.h index 2bc3b4f20..c3f83ed28 100644 --- a/libguile/root.h +++ b/libguile/root.h @@ -1,20 +1,20 @@ /* classes: h_files */ -#ifndef ROOTH -#define ROOTH +#ifndef SCM_ROOT_H +#define SCM_ROOT_H -/* Copyright (C) 1996,1998, 2000, 2001 Free Software Foundation, Inc. - * +/* Copyright (C) 1996,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -46,8 +46,6 @@ - - #include "libguile/__scm.h" #include "libguile/debug.h" #include "libguile/throw.h" @@ -157,16 +155,7 @@ extern SCM scm_dynamic_root (void); extern SCM scm_apply_with_dynamic_root (SCM proc, SCM a1, SCM args, SCM handler); extern void scm_init_root (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -/* Use the catch functions from throw.[ch] instead of: */ -extern SCM scm_call_catching_errors (SCM (*thunk)(), SCM (*err_filter)(), void * closure); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif /* ROOTH */ +#endif /* SCM_ROOT_H */ /* Local Variables: diff --git a/libguile/smob.c b/libguile/smob.c index 16fef9fcb..b4935ba81 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -475,39 +475,6 @@ scm_make_smob (scm_t_bits tc) return z; } - -/* {Deprecated stuff} - */ - -#if (SCM_DEBUG_DEPRECATED == 0) - -long -scm_make_smob_type_mfpe (char *name, size_t size, - SCM (*mark) (SCM), - size_t (*free) (SCM), - int (*print) (SCM, SCM, scm_print_state *), - SCM (*equalp) (SCM, SCM)) -{ - long answer = scm_make_smob_type (name, size); - scm_set_smob_mfpe (answer, mark, free, print, equalp); - return answer; -} - -void -scm_set_smob_mfpe (long tc, - SCM (*mark) (SCM), - size_t (*free) (SCM), - int (*print) (SCM, SCM, scm_print_state *), - SCM (*equalp) (SCM, SCM)) -{ - if (mark) scm_set_smob_mark (tc, mark); - if (free) scm_set_smob_free (tc, free); - if (print) scm_set_smob_print (tc, print); - if (equalp) scm_set_smob_equalp (tc, equalp); -} - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - /* {Initialization for i/o types, float, bignum, the type of free cells} */ diff --git a/libguile/smob.h b/libguile/smob.h index d7551f842..679966c2f 100644 --- a/libguile/smob.h +++ b/libguile/smob.h @@ -2,18 +2,19 @@ #ifndef SCM_SMOB_H #define SCM_SMOB_H + /* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" #include "libguile/print.h" @@ -161,24 +164,6 @@ extern void scm_set_smob_apply (scm_t_bits tc, extern SCM scm_make_smob (scm_t_bits tc); extern void scm_smob_prehistory (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -extern long scm_make_smob_type_mfpe (char *name, size_t size, - SCM (*mark) (SCM), - size_t (*free) (SCM), - int (*print) (SCM, SCM, scm_print_state*), - SCM (*equalp) (SCM, SCM)); - -extern void scm_set_smob_mfpe (long tc, - SCM (*mark) (SCM), - size_t (*free) (SCM), - int (*print) (SCM, SCM, scm_print_state*), - SCM (*equalp) (SCM, SCM)); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_SMOB_H */ /* diff --git a/libguile/strports.c b/libguile/strports.c index 969d2b79b..612d98b27 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -338,16 +338,6 @@ SCM_DEFINE (scm_object_to_string, "object->string", 1, 1, 0, } #undef FUNC_NAME -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_strprint_obj (SCM obj) -{ - return scm_object_to_string (obj, SCM_UNDEFINED); -} - -#endif /* (SCM_DEBUG_DEPRECATED == 0) */ - SCM_DEFINE (scm_call_with_output_string, "call-with-output-string", 1, 0, 0, (SCM proc), "Calls the one-argument procedure @var{proc} with a newly created output\n" @@ -450,28 +440,6 @@ scm_c_eval_string (const char *expr) return scm_eval_string (scm_makfrom0str (expr)); } -#if SCM_DEBUG_DEPRECATED == 0 - -SCM -scm_read_0str (char *expr) -{ - scm_c_issue_deprecation_warning - ("scm_read_0str is deprecated. Use scm_c_read_string instead."); - - return scm_c_read_string (expr); -} - -SCM -scm_eval_0str (const char *expr) -{ - scm_c_issue_deprecation_warning - ("scm_eval_0str is deprecated. Use scm_c_eval_string instead."); - - return scm_c_eval_string (expr); -} - -#endif - static SCM inner_eval_string (void *data) { diff --git a/libguile/strports.h b/libguile/strports.h index 590aa2959..777281118 100644 --- a/libguile/strports.h +++ b/libguile/strports.h @@ -1,19 +1,20 @@ /* classes: h_files */ -#ifndef STRPORTSH -#define STRPORTSH -/* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation, Inc. - * +#ifndef SCM_STRPORTS_H +#define SCM_STRPORTS_H + +/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -77,15 +79,7 @@ extern SCM scm_c_eval_string (const char *expr); extern SCM scm_eval_string (SCM string); extern void scm_init_strports (void); -#if (SCM_DEBUG_DEPRECATED == 0) - -extern SCM scm_strprint_obj (SCM obj); -extern SCM scm_read_0str (char *expr); -extern SCM scm_eval_0str (const char *expr); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#endif /* STRPORTSH */ +#endif /* SCM_STRPORTS_H */ /* Local Variables: diff --git a/libguile/symbols-deprecated.c b/libguile/symbols-deprecated.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/libguile/symbols.c b/libguile/symbols.c index 3093a6484..f833eb2be 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -333,9 +333,6 @@ scm_init_symbols () #ifndef SCM_MAGIC_SNARFER #include "libguile/symbols.x" #endif -#if SCM_ENABLE_VCELLS - scm_init_symbols_deprecated (); -#endif } /* diff --git a/libguile/symbols.h b/libguile/symbols.h index f1417b4b5..e68ee1f9f 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -2,18 +2,19 @@ #ifndef SCM_SYMBOLS_H #define SCM_SYMBOLS_H + /* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -52,7 +53,7 @@ * SCM_SYMBOL_CHARS(SYM) is the address of the first character of SYM's name. */ -#define SCM_SYMBOLP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol)) +#define SCM_SYMBOLP(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol)) #define SCM_SYMBOL_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) #define SCM_SET_SYMBOL_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_symbol)) #define SCM_SYMBOL_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) @@ -90,66 +91,6 @@ extern SCM scm_gensym (SCM prefix); extern void scm_symbols_prehistory (void); extern void scm_init_symbols (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -#define SCM_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) -#define SCM_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x))) -#define SCM_SETCHARS(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_t_bits) (v))) -#define SCM_SLOPPY_SUBSTRP(x) (SCM_SUBSTRP (x)) -#define SCM_SUBSTR_STR(x) (SCM_CDDR (x)) -#define SCM_SUBSTR_OFFSET(x) (SCM_CADR (x)) -#define SCM_LENGTH_MAX (0xffffffL) -#define SCM_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) -#define SCM_SETLENGTH(x, v, t) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + (t))) -#define SCM_ROSTRINGP(x) (SCM_NIMP(x) && ((SCM_TYP7S(x)==scm_tc7_string) \ - || (SCM_TYP7(x) == scm_tc7_symbol))) -#define SCM_ROLENGTH(x) SCM_LENGTH (x) -#define SCM_ROCHARS(x) ((SCM_TYP7 (x) == scm_tc7_substring) \ - ? (SCM_INUM (SCM_CADR (x)) + SCM_STRING_CHARS (SCM_CDDR (x))) \ - : ((SCM_TYP7 (x) == scm_tc7_string) \ - ? SCM_STRING_CHARS (x) \ - : SCM_SYMBOL_CHARS (x))) -#define SCM_ROUCHARS(x) ((SCM_TYP7 (x) == scm_tc7_substring) \ - ? (SCM_INUM (SCM_CADR (x)) + SCM_STRING_UCHARS (SCM_CDDR (x))) \ - : ((SCM_TYP7 (x) == scm_tc7_string) \ - ? SCM_STRING_UCHARS (x) \ - : (unsigned char *) SCM_SYMBOL_CHARS (x))) -#define SCM_SUBSTRP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring)) -#define SCM_COERCE_SUBSTR(x) SCM_STRING_COERCE_0TERMINATION_X (x) -#define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n)) - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - -#if SCM_ENABLE_VCELLS - -extern SCM scm_sym2vcell (SCM sym, SCM thunk, SCM definep); -extern SCM scm_sym2ovcell_soft (SCM sym, SCM obarray); -extern SCM scm_sym2ovcell (SCM sym, SCM obarray); -extern SCM scm_intern_obarray_soft (const char *name, size_t len, SCM obarray, unsigned int softness); -extern SCM scm_intern_obarray (const char *name, size_t len, SCM obarray); -extern SCM scm_intern (const char *name, size_t len); -extern SCM scm_intern0 (const char *name); -extern SCM scm_sysintern (const char *name, SCM val); -extern SCM scm_sysintern0 (const char *name); -extern SCM scm_sysintern0_no_module_lookup (const char *name); -extern SCM scm_symbol_value0 (const char *name); - -extern SCM scm_string_to_obarray_symbol (SCM o, SCM s, SCM softp); -extern SCM scm_intern_symbol (SCM o, SCM s); -extern SCM scm_unintern_symbol (SCM o, SCM s); -extern SCM scm_symbol_binding (SCM o, SCM s); -extern SCM scm_symbol_interned_p (SCM o, SCM s); -extern SCM scm_symbol_bound_p (SCM o, SCM s); -extern SCM scm_symbol_set_x (SCM o, SCM s, SCM v); - -extern SCM scm_gentemp (SCM prefix, SCM obarray); - -extern void scm_init_symbols_deprecated (void); - -#endif /* SCM_ENABLE_VCELLS */ - #endif /* SCM_SYMBOLS_H */ /* diff --git a/libguile/vectors.c b/libguile/vectors.c index 1cc666a99..cd194a905 100644 --- a/libguile/vectors.c +++ b/libguile/vectors.c @@ -52,88 +52,6 @@ #include "libguile/unif.h" -#if (SCM_DEBUG_DEPRECATED == 0) - -/* The function scm_vector_set_length_x will disappear in the next release of - * guile. - */ - -/* - * This complicates things too much if allowed on any array. - * C code can safely call it on arrays known to be used in a single - * threaded manner. - * - * SCM_REGISTER_PROC(s_vector_set_length_x, "vector-set-length!", 2, 0, 0, scm_vector_set_length_x); - */ -static char s_vector_set_length_x[] = "vector-set-length!"; - - -SCM -scm_vector_set_length_x (SCM vect, SCM len) -{ - long l; - size_t siz; - size_t sz; - char *base; - - l = SCM_INUM (len); - SCM_ASRTGO (SCM_NIMP (vect), badarg1); - -#ifdef HAVE_ARRAYS - if (SCM_TYP7 (vect) == scm_tc7_bvect) - { - l = (l + SCM_LONG_BIT - 1) / SCM_LONG_BIT; - } - sz = scm_uniform_element_size (vect); - if (sz != 0) - base = SCM_UVECTOR_BASE (vect); - else -#endif - switch (SCM_TYP7 (vect)) - { - default: - badarg1: scm_wta (vect, (char *) SCM_ARG1, s_vector_set_length_x); - case scm_tc7_string: - SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullstr), badarg1); - sz = sizeof (char); - base = SCM_STRING_CHARS (vect); - l++; - break; - case scm_tc7_vector: - case scm_tc7_wvect: - SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullvect), badarg1); - sz = sizeof (SCM); - base = (char *) SCM_VECTOR_BASE (vect); - break; - } - SCM_ASSERT (SCM_INUMP (len), len, SCM_ARG2, s_vector_set_length_x); - if (!l) - l = 1L; - siz = l * sz; - if (siz != l * sz) - scm_memory_error (s_vector_set_length_x); - SCM_REDEFER_INTS; - SCM_SETCHARS (vect, - ((char *) - scm_must_realloc (base, - (size_t) SCM_LENGTH (vect) * sz, - (size_t) siz, - s_vector_set_length_x))); - if (SCM_VECTORP (vect)) - { - sz = SCM_LENGTH (vect); - while (l > sz) - SCM_VELTS (vect)[--l] = SCM_UNSPECIFIED; - } - else if (SCM_STRINGP (vect)) - SCM_STRING_CHARS (vect)[l - 1] = 0; - SCM_SETLENGTH (vect, SCM_INUM (len), SCM_TYP7 (vect)); - SCM_REALLOW_INTS; - return vect; -} - -#endif /* (SCM_DEBUG_DEPRECATED == 0) */ - SCM_DEFINE (scm_vector_p, "vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector, otherwise return\n" diff --git a/libguile/vectors.h b/libguile/vectors.h index 83ef491b4..0d98f9c5c 100644 --- a/libguile/vectors.h +++ b/libguile/vectors.h @@ -2,18 +2,19 @@ #ifndef SCM_VECTORS_H #define SCM_VECTORS_H + /* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -49,7 +50,7 @@ -#define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector)) +#define SCM_VECTORP(x) (!SCM_IMP (x) && (SCM_TYP7S (x) == scm_tc7_vector)) #define SCM_VECTOR_BASE(x) ((scm_t_bits *) SCM_CELL_WORD_1 (x)) #define SCM_SET_VECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b))) #define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1) @@ -89,14 +90,6 @@ extern SCM scm_vector_move_right_x (SCM vec1, SCM start1, SCM end1, SCM vec2, SCM start2); extern void scm_init_vectors (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -extern SCM scm_vector_set_length_x (SCM vect, SCM len); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_VECTORS_H */ /* From 8c494e99736a68a24d3004652c6f4aceb16d7ecf Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 14:42:31 +0000 Subject: [PATCH 042/107] * Removed lots of deprecated stuff. --- ChangeLog | 10 +- TODO | 111 ++------------------- acconfig.h | 4 +- configure.in | 4 +- guile-readline/ChangeLog | 7 ++ guile-readline/readline.c | 4 - ice-9/ChangeLog | 24 +++++ ice-9/boot-9.scm | 201 +------------------------------------- ice-9/format.scm | 5 - libguile/ChangeLog | 115 ++++++++++++++++++++++ libguile/__scm.h | 88 ++++++----------- libguile/deprecation.c | 12 +-- libguile/deprecation.h | 12 ++- libguile/dynl.c | 100 ------------------- libguile/dynl.h | 23 +++-- libguile/error.c | 53 ---------- libguile/error.h | 17 ++-- libguile/eval.c | 76 +++----------- libguile/eval.h | 21 ++-- libguile/filesys.c | 19 ---- libguile/fports.c | 2 - libguile/gc.c | 46 ++------- libguile/gc.h | 27 +---- libguile/gh_data.c | 1 - libguile/hash.c | 1 - libguile/init.c | 5 - libguile/ioext.c | 1 - libguile/modules.c | 86 ---------------- libguile/modules.h | 17 +--- libguile/net_db.c | 5 - libguile/objects.c | 1 - libguile/ports.c | 43 -------- libguile/ports.h | 36 +++---- libguile/posix.c | 15 --- libguile/print.c | 3 +- libguile/random.h | 21 ++-- libguile/regex-posix.c | 2 - libguile/simpos.c | 2 - libguile/socket.c | 1 - libguile/stime.c | 4 - libguile/strings.c | 116 ---------------------- libguile/strings.h | 34 ++----- libguile/tags.h | 35 ++----- libguile/variable.c | 61 ++---------- libguile/variable.h | 28 ++---- libguile/vports.c | 1 - srfi/ChangeLog | 5 + srfi/srfi-1.scm | 14 --- srfi/srfi-13.scm | 13 --- 49 files changed, 315 insertions(+), 1217 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7658e4a24..8967d93f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,17 @@ +2001-08-31 Dirk Herrmann + + * TODO: Added some points, and eliminated all done items. + + * acconfig.h, configure.in (SCM_DEBUG_DEPRECATED, + SCM_ENABLE_DEPRECATED): Renamed SCM_DEBUG_DEPRECATED to + SCM_ENABLE_DEPRECATED with the logic reversed. + 2001-08-31 Dirk Herrmann * libguile.h: Removed bogus comment, rearranged includes, removed deprecated definitions. - (LIBGUILEH, SCM_LIBGUILE_H): Renamed H to SCM__H. + (LIBGUILEH, SCM_LIBGUILE_H): Renamed H to SCM__H. 2001-08-30 Thien-Thi Nguyen diff --git a/TODO b/TODO index f5836ede6..9803054dd 100644 --- a/TODO +++ b/TODO @@ -19,7 +19,6 @@ See also file HACKING. === Eventually: -- deprecate `read-only-string?' - [after signal handling and threading have been fixed] remove the code corresponding to GUILE_OLD_ASYNC_CLICK and the corresponding GUILE_OLD_ASYNC_CLICK macro. @@ -56,6 +55,12 @@ See also file HACKING. to convert source correctly in unmemocopy - eliminate argument checking for closures - Implement a thread-safe alternative to SCM's environment caches +- rename ice-9 to something more obvious +- implement implicitly shared substrings (thread-safe, copy on write). In + this context, the concept of read-only-strings might be re-introduced to + implement the symbol->string semantics of R5RS. +- implement internationalized strings +- revise the uniform vector implementation === Before releasing 1.8.0: @@ -69,107 +74,9 @@ See also file HACKING. - Start a new THANKS file. -- remove deprecated functions scm_read_0str, scm_eval_0str. +=== Before releasing 1.10.0: -- remove deprecated "scm_*_t" type names in libguile.h. - -- remove re-exporting behaviour of `export'. - in boot-9.scm, remove begin-deprecated part of `module-export!' - in format.scm, remove kluge at top - in srfi-13.scm, likewise - in srfi-1.scm, likewise - -- remove deprecated subr and gsubr functions - in procs.h, procs.c: scm_make_subr, scm_make_subr_opt, - scm_make_subr_with_generic, - in gsubr.h, gsubr.c: scm_make_gsubr, scm_make_gsubr_with_generic. - -- remove deprecated C interface to modules - in modules.h, modules.c: - 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 - -- remove vcell and obarray support. - Remove all code bracketed by `#if SCM_ENABLE_VCELLS'. - Remove SCM_ENABLE_VCELLS itself. - Also remove `variable-set-name-hint' completely. - -- remove compatability module (ice-9 and-let*). It - has been replaced by (ice-9 and-let-star) and/or (srfi srfi-2). - -- remove support for autoloading compiled-code modules: - try-module-linked - try-module-dynamic-link - init-dynamic-module, etc. - scm_register_module_xxx - scm_registered_modules - scm_clear_registered_modules - -- remove deprecated variables: - scm_top_level_lookup_closure_var - scm_scm_system_transformer - Remove all code that still sets them: - `use-syntax', scm_set_current_module, ... - -- remove deprecated functions: - eval.c: scm_eval2, scm_eval_3 - load.c: scm_read_and_eval_x - smob.c: scm_make_smob_type_mfpe, scm_set_smob_mfpe - gc.c: scm_remember - string.c: scm_makstr, scm_makfromstr -- remove deprecated procedures: - boot-9.scm: eval-in-module, id, -1+, return-it, string-character-length, - flags -- remove deprecated macros: 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, SCM_SLOPPY_STRINGP, SCM_VALIDATE_STRINGORSUBSTR, - SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS, SCM_VALIDATE_ROSTRING, - SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, - SCM_LENGTH, SCM_HUGE_LENGTH, SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, - SCM_COERCE_SUBSTR, SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, - SCM_ROCHARS, SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS, SCM_LENGTH_MAX, - SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, - SCM_SUBR_DOC, SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, - SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY, - SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP, - SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR, - SCM_ARRAY_CONTIGUOUS, - SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, - SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9 -- remove scm_listify -- remove scm_vector_set_length_x -- remove function scm_call_catching_errors - (replaced by catch functions from throw.[ch]) -- remove support for "#&" reader syntax in (ice-9 optargs). -- remove scm_make_shared_substring -- remove scm_read_only_string_p -- remove scm_strhash -- remove scm_tc7_ssymbol -- remove scm_tc7_msymbol -- remove scm_tcs_symbols -- remove scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member -- consider removing the automatic loading of (ice-9 rdelim) when guile - starts up. This would be a brave move, since a lot of code will - assume that read-line is available by default. However it would make - it easier to use alternative implementations of this module, e.g., a - strictly scsh-compatible version which uses multiple values. For - interactive use it would be easy to load the module in ~/.guile. -- remove scm_close_all_ports_except -- remove scm_strprint_obj -- remove SCM_CONST_LONG -- remove scm_wta -- remove deprecated typedefs: long_long, ulong_long, scm_sizet -- remove deprecated macros: scm_contregs, scm_port_rw_active, - scm_port, scm_ptob_descriptor, scm_debug_info, scm_debug_frame, - scm_fport, SCM_FIXNUM_BIT, scm_option, scm_subr_entry, scm_rstate, - scm_rng, scm_i_rstate, scm_srcprops, scm_srcprops_chunk, - scm_info_frame, scm_stack, scm_array, scm_array_dim. -- remove deprecated functions: scm_mkbig, scm_big2num, scm_adjbig, - scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl. -- remove deprecated functions: scm_protect_object, - scm_unprotect_object, scm_create_hook. +- in boot-9.scm: + remove deprecated function `feature?´. [TODO ends here] diff --git a/acconfig.h b/acconfig.h index a449409aa..deff151c9 100644 --- a/acconfig.h +++ b/acconfig.h @@ -44,8 +44,8 @@ * If you do not wish that, delete this exception notice. */ -/* Define this if you want to exclude deprecated features */ -#undef SCM_DEBUG_DEPRECATED +/* Define this to 1 if you want to include deprecated features */ +#undef SCM_ENABLE_DEPRECATED /* Define this to control the default warning level for deprecated features */ #undef SCM_WARN_DEPRECATED_DEFAULT diff --git a/configure.in b/configure.in index 90401b040..c0c200273 100644 --- a/configure.in +++ b/configure.in @@ -111,7 +111,7 @@ AC_ARG_ENABLE(deprecated, [ --disable-deprecated omit deprecated features [no]]) if test "$enable_deprecated" = no; then - AC_DEFINE(SCM_DEBUG_DEPRECATED, 1) + AC_DEFINE(SCM_ENABLE_DEPRECATED, 0) else if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then warn_default=summary @@ -120,7 +120,7 @@ else else warn_default=$enable_deprecated fi - AC_DEFINE(SCM_DEBUG_DEPRECATED, 0) + AC_DEFINE(SCM_ENABLE_DEPRECATED, 1) AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default") fi diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index e5f9b5eea..8da222be4 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,10 @@ +2001-08-31 Dirk Herrmann + + * readline.c (scm_readline, scm_add_history, + scm_filename_completion_function, completion_function): Remove + calls to SCM_STRING_COERCE_0TERMINATION_X. Since the substring + type is gone, all strings are 0-terminated anyway. + 2001-08-31 Dirk Herrmann * readline.scm: `feature?´ is deprecated. Use `provided?´ diff --git a/guile-readline/readline.c b/guile-readline/readline.c index c9245caff..72d46c91c 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -171,7 +171,6 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0, --in_readline; scm_wrong_type_arg (s_scm_readline, SCM_ARG1, text); } - SCM_STRING_COERCE_0TERMINATION_X (text); } if (!((SCM_UNBNDP (inp) && SCM_OPINFPORTP (scm_cur_inp)) @@ -327,7 +326,6 @@ SCM_DEFINE (scm_add_history, "add-history", 1, 0, 0, { char* s; SCM_VALIDATE_STRING (1,text); - SCM_STRING_COERCE_0TERMINATION_X (text); s = SCM_STRING_CHARS (text); add_history (strdup (s)); @@ -377,7 +375,6 @@ SCM_DEFINE (scm_filename_completion_function, "filename-completion-function", 2, char *s; SCM ans; SCM_VALIDATE_STRING (1,text); - SCM_STRING_COERCE_0TERMINATION_X (text); #ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION s = rl_filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep)); #else @@ -417,7 +414,6 @@ completion_function (char *text, int continuep) scm_misc_error (s_scm_readline, "Completion function returned bogus value: %S", scm_list_1 (res)); - SCM_STRING_COERCE_0TERMINATION_X (res); return strdup (SCM_STRING_CHARS (res)); } } diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 2294c5d5b..842a8d90b 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,27 @@ +2001-08-31 Dirk Herrmann + + * boot-9.scm: Don't load module (ice-9 rdelim). + + (feature?): Deprecated. + + (id, -1+, return-it, string-character-length, flags, + eval-in-module, split-c-module-name, + (convert-c-registered-modules, registered-modules, + register-modules, warn-autoload-deprecation, init-dynamic-module, + dynamic-maybe-call, dynamic-maybe-link, + find-and-link-dynamic-module, try-using-libtool-name, + try-using-sharlib-name, link-dynamic-module, try-module-linked, + try-module-dynamic-link): Removed. + + (module-make-local-var!, module-ensure-local-variable!, + module-define!): Eliminate call to `variable-set-name-hint!´. + + (try-load-module, use-syntax, module-export!): Remove deprecated + functionality. + + * format.scm: Remove deprecated definition of format that was + needed to trick export. + 2001-08-31 Dirk Herrmann * optargs.scm: Remove #& reader extension. diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 0bfd735ac..396803d7b 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -82,8 +82,8 @@ (define (provided? feature) (and (memq feature *features*) #t)) -;;; presumably deprecated. -(define feature? provided?) +(begin-deprecated + (define feature? provided?)) ;;; let format alias simple-format until the more complete version is loaded (define format simple-format) @@ -135,17 +135,6 @@ (define (and=> value procedure) (and value (procedure value))) (define (make-hash-table k) (make-vector k '())) -(begin-deprecated - (define (id x) - (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.") - (identity x)) - (define (-1+ n) - (issue-deprecation-warning "`-1+' is deprecated. Use `1-' instead.") - (1- n)) - (define (return-it . args) - (issue-deprecation-warning "`return-it' is deprecated. Use `noop' instead.") - (apply noop args))) - ;;; apply-to-args is functionally redundant with apply and, worse, ;;; is less general than apply since it only takes two arguments. ;;; @@ -173,14 +162,6 @@ (if (even? k) acc (proc acc x)) proc)))) -(begin-deprecated - (define (string-character-length s) - (issue-deprecation-warning "`string-character-length' is deprecated. Use `string-length' instead.") - (string-length s)) - (define (flags . args) - (issue-deprecation-warning "`flags' is deprecated. Use `logior' instead.") - (apply logior args))) - ;;; {Symbol Properties} ;;; @@ -1054,12 +1035,6 @@ ;; to maximally one module. (set-procedure-property! closure 'module module)))) -(begin-deprecated - (define (eval-in-module exp mod) - (issue-deprecation-warning - "`eval-in-module' is deprecated. Use `eval' instead.") - (eval exp mod))) - ;;; {Observer protocol} ;;; @@ -1287,7 +1262,6 @@ ((module-binder m) m v #t)) (begin (let ((answer (make-undefined-variable))) - (variable-set-name-hint! answer v) (module-obarray-set! (module-obarray m) v answer) (module-modified m) answer)))) @@ -1301,7 +1275,6 @@ (define (module-ensure-local-variable! module symbol) (or (module-local-variable module symbol) (let ((var (make-undefined-variable))) - (variable-set-name-hint! var symbol) (module-add! module symbol var) var))) @@ -1458,7 +1431,6 @@ (variable-set! variable value) (module-modified module)) (let ((variable (make-variable value))) - (variable-set-name-hint! variable name) (module-add! module name variable))))) ;; MODULE-DEFINED? -- exported @@ -1646,9 +1618,7 @@ ;; (define-special-value '(app modules new-ws) (lambda () (make-scm-module))) (define (try-load-module name) - (or (begin-deprecated (try-module-linked name)) - (try-module-autoload name) - (begin-deprecated (try-module-dynamic-link name)))) + (try-module-autoload name)) (define (purify-module! module) "Removes bindings in MODULE which are inherited from the (guile) module." @@ -1839,152 +1809,6 @@ ;;; Dynamic linking of modules -;; This method of dynamically linking Guile Extensions is deprecated. -;; Use `load-extension' explicitely from Scheme code instead. - -(begin-deprecated - - (define (split-c-module-name str) - (let loop ((rev '()) - (start 0) - (pos 0) - (end (string-length str))) - (cond - ((= pos end) - (reverse (cons (string->symbol (substring str start pos)) rev))) - ((eq? (string-ref str pos) #\space) - (loop (cons (string->symbol (substring str start pos)) rev) - (+ pos 1) - (+ pos 1) - end)) - (else - (loop rev start (+ pos 1) end))))) - - (define (convert-c-registered-modules dynobj) - (let ((res (map (lambda (c) - (list (split-c-module-name (car c)) (cdr c) dynobj)) - (c-registered-modules)))) - (c-clear-registered-modules) - res)) - - (define registered-modules '()) - - (define (register-modules dynobj) - (set! registered-modules - (append! (convert-c-registered-modules dynobj) - registered-modules))) - - (define (warn-autoload-deprecation modname) - (issue-deprecation-warning - "Autoloading of compiled code modules is deprecated." - "Write a Scheme file instead that uses `load-extension'.") - (issue-deprecation-warning - (simple-format #f "(You just autoloaded module ~S.)" modname))) - - (define (init-dynamic-module modname) - ;; Register any linked modules which have been registered on the C level - (register-modules #f) - (or-map (lambda (modinfo) - (if (equal? (car modinfo) modname) - (begin - (warn-autoload-deprecation modname) - (set! registered-modules (delq! modinfo registered-modules)) - (let ((mod (resolve-module modname #f))) - (save-module-excursion - (lambda () - (set-current-module mod) - (set-module-public-interface! mod mod) - (dynamic-call (cadr modinfo) (caddr modinfo)) - )) - #t)) - #f)) - registered-modules)) - - (define (dynamic-maybe-call name dynobj) - (catch #t ; could use false-if-exception here - (lambda () - (dynamic-call name dynobj)) - (lambda args - #f))) - - (define (dynamic-maybe-link filename) - (catch #t ; could use false-if-exception here - (lambda () - (dynamic-link filename)) - (lambda args - #f))) - - (define (find-and-link-dynamic-module module-name) - (define (make-init-name mod-name) - (string-append "scm_init" - (list->string (map (lambda (c) - (if (or (char-alphabetic? c) - (char-numeric? c)) - c - #\_)) - (string->list mod-name))) - "_module")) - - ;; Put the subdirectory for this module in the car of SUBDIR-AND-LIBNAME, - ;; and the `libname' (the name of the module prepended by `lib') in the cdr - ;; field. For example, if MODULE-NAME is the list (inet tcp-ip udp), then - ;; SUBDIR-AND-LIBNAME will be the pair ("inet/tcp-ip" . "libudp"). - (let ((subdir-and-libname - (let loop ((dirs "") - (syms module-name)) - (if (null? (cdr syms)) - (cons dirs (string-append "lib" (symbol->string (car syms)))) - (loop (string-append dirs (symbol->string (car syms)) "/") - (cdr syms))))) - (init (make-init-name (apply string-append - (map (lambda (s) - (string-append "_" - (symbol->string s))) - module-name))))) - (let ((subdir (car subdir-and-libname)) - (libname (cdr subdir-and-libname))) - - ;; Now look in each dir in %LOAD-PATH for `subdir/libfoo.la'. If that - ;; file exists, fetch the dlname from that file and attempt to link - ;; against it. If `subdir/libfoo.la' does not exist, or does not seem - ;; to name any shared library, look for `subdir/libfoo.so' instead and - ;; link against that. - (let check-dirs ((dir-list %load-path)) - (if (null? dir-list) - #f - (let* ((dir (in-vicinity (car dir-list) subdir)) - (sharlib-full - (or (try-using-libtool-name dir libname) - (try-using-sharlib-name dir libname)))) - (if (and sharlib-full (file-exists? sharlib-full)) - (link-dynamic-module sharlib-full init) - (check-dirs (cdr dir-list))))))))) - - (define (try-using-libtool-name libdir libname) - (let ((libtool-filename (in-vicinity libdir - (string-append libname ".la")))) - (and (file-exists? libtool-filename) - libtool-filename))) - - (define (try-using-sharlib-name libdir libname) - (in-vicinity libdir (string-append libname ".so"))) - - (define (link-dynamic-module filename initname) - ;; Register any linked modules which have been registered on the C level - (register-modules #f) - (let ((dynobj (dynamic-link filename))) - (dynamic-call initname dynobj) - (register-modules dynobj))) - - (define (try-module-linked module-name) - (init-dynamic-module module-name)) - - (define (try-module-dynamic-link module-name) - (and (find-and-link-dynamic-module module-name) - (init-dynamic-module module-name)))) -;; end of deprecated section - - (define autoloads-done '((guile . guile))) (define (autoload-done-or-in-progress? p m) @@ -2737,9 +2561,7 @@ (list ,@(compile-interface-spec spec)))) (set-module-transformer! (current-module) ,(car (last-pair spec)))) - `((set-module-transformer! (current-module) ,spec))) - (begin-deprecated - (fluid-set! scm:eval-transformer (module-transformer (current-module))))) + `((set-module-transformer! (current-module) ,spec)))) (else (error "use-syntax can only be used at the top level")))) @@ -2783,17 +2605,6 @@ (define (module-export! m names) (let ((public-i (module-public-interface m))) (for-each (lambda (name) - (begin-deprecated - (if (not (module-local-variable m name)) - (let ((v (module-variable m name))) - (cond - (v - (issue-deprecation-warning - "Using `export' to re-export imported bindings is deprecated. Use `re-export' instead.") - (issue-deprecation-warning - (simple-format #f "(You just re-exported `~a' from `~a'.)" - name (module-name m))) - (module-define! m name (variable-ref v))))))) (let ((var (module-ensure-local-variable! m name))) (module-add! public-i name var))) names))) @@ -3068,8 +2879,4 @@ (define-module (guile-user)) -(begin-deprecated - ;; automatic availability of this module is deprecated. - (use-modules (ice-9 rdelim))) - ;;; boot-9.scm ends here diff --git a/ice-9/format.scm b/ice-9/format.scm index c3b8666a7..5de6ea9f2 100644 --- a/ice-9/format.scm +++ b/ice-9/format.scm @@ -15,11 +15,6 @@ :use-module (ice-9 and-let-star) :autoload (ice-9 pretty-print) (pretty-print)) -(begin-deprecated - ;; So that `export' below will not accidentally re-export the - ;; `format' of the `(guile)' module. - (define format #f)) - (export format format:symbol-case-conv format:iobj-case-conv diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 956953644..b886a422f 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,118 @@ +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. diff --git a/libguile/__scm.h b/libguile/__scm.h index bda6326f2..fb2d9c2cd 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -2,18 +2,19 @@ #ifndef SCM___SCM_H #define SCM___SCM_H + /* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + /* "What's the difference between _scm.h and __scm.h?" @@ -167,7 +169,7 @@ * common prefix for all option macros of this kind is "SCM_DEBUG_". It is * guaranteed that a macro named SCM_DEBUG_XXX is defined to be either 0 or 1, * i. e. there is no need to test for the undefined case. This allows to use - * these definitions comfortably in macro code, as in the following example: + * these definitions comfortably within code, as in the following example: * #define FOO do { if (SCM_DEBUG_XXX) bar(); else baz(); } while (0) * Any sane compiler will remove the unused branch without any performance * penalty for the resulting code. @@ -196,13 +198,6 @@ #define SCM_DEBUG_CELL_ACCESSES SCM_DEBUG #endif -/* If SCM_DEBUG_DEPRECATED is set to 1, deprecated code is not compiled. This - * can be used by developers to get rid of references to deprecated code. - */ -#ifndef SCM_DEBUG_DEPRECATED -#define SCM_DEBUG_DEPRECATED SCM_DEBUG -#endif - /* If SCM_DEBUG_INTERRUPTS is set to 1, with every deferring and allowing of * interrupts a consistency check will be performed. */ @@ -236,30 +231,34 @@ #define SCM_DEBUG_TYPING_STRICTNESS 1 #endif -/* If SCM_ENABLE_VCELLS is set to 1, a couple of functions that deal - * with vcells are defined for compatibility reasons. Supporting - * vcells reduces performance however. - * - * We use a dedicated macro instead of just SCM_DEBUG_DEPRECATED so - * that code the belongs to the `vcell' feature is easier to find. - */ -#define SCM_ENABLE_VCELLS !SCM_DEBUG_DEPRECATED - -#ifdef HAVE_LONG_LONGS - -/* Some auto-generated .h files contain unused prototypes - * that need these typedefs. +/* {Feature Options} + * + * These compile time options determine whether code for certain features + * should be compiled into guile. The common prefix for all option macros + * of this kind is "SCM_ENABLE_". It is guaranteed that a macro named + * SCM_ENABLE_XXX is defined to be either 0 or 1, i. e. there is no need to + * test for the undefined case. This allows to use these definitions + * comfortably within code, as in the following example: + * #define FOO do { if (SCM_ENABLE_XXX) bar(); else baz(); } while (0) + * Any sane compiler will remove the unused branch without any performance + * penalty for the resulting code. + * + * Note: Some SCM_ENABLE_XXX options are not settable at configure time. + * To change the value of such options you will have to edit this header + * file or give suitable options to make, like: + * make all CFLAGS="-DSCM_ENABLE_XXX=1 ..." */ -#if (SCM_DEBUG_DEPRECATED == 0) -typedef long long long_long; -typedef unsigned long long ulong_long; +/* If SCM_ENABLE_DEPRECATED is set to 1, deprecated code will be included in + * guile, as well as some functions to issue run-time warnings about uses of + * deprecated functions. + */ +#ifndef SCM_ENABLE_DEPRECATED +#define SCM_ENABLE_DEPRECATED 0 #endif -#endif /* HAVE_LONG_LONGS */ - /* {Architecture and compiler properties} @@ -319,10 +318,6 @@ typedef long ptrdiff_t; # include #endif /* def STDC_HEADERS */ -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_sizet size_t -#endif - #include "libguile/tags.h" @@ -629,31 +624,6 @@ extern SCM scm_apply_generic (SCM gf, SCM args); #define SCM_ARG6 6 #define SCM_ARG7 7 -#if (SCM_DEBUG_DEPRECATED == 0) - -/* Use SCM_WRONG_NUM_ARGS instead of: */ -#define SCM_WNA 8 - -/* Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of: */ -#define SCM_OUTOFRANGE 10 - -/* Use scm_memory_error instead of: */ -#define SCM_NALLOC 11 - -#define SCM_HUP_SIGNAL 14 -#define SCM_INT_SIGNAL 15 -#define SCM_FPE_SIGNAL 16 -#define SCM_BUS_SIGNAL 17 -#define SCM_SEGV_SIGNAL 18 -#define SCM_ALRM_SIGNAL 19 -#define SCM_GC_SIGNAL 20 -#define SCM_TICK_SIGNAL 21 -#define SCM_SIG_ORD(X) ((X) - SCM_HUP_SIGNAL) -#define SCM_ORD_SIG(X) ((X) + SCM_HUP_SIGNAL) -#define SCM_NUM_SIGS (SCM_SIG_ORD (SCM_TICK_SIGNAL) + 1) - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_MAGIC_SNARFER */ @@ -679,8 +649,6 @@ extern SCM scm_apply_generic (SCM gf, SCM args); #endif /* def vms */ #endif /* ndef SCM_EXIT_FAILURE */ - - #endif /* SCM___SCM_H */ /* diff --git a/libguile/deprecation.c b/libguile/deprecation.c index 9271fb0c5..192f25519 100644 --- a/libguile/deprecation.c +++ b/libguile/deprecation.c @@ -53,10 +53,10 @@ -#if (SCM_DEBUG_DEPRECATED == 0) +#if (SCM_ENABLE_DEPRECATED == 1) /* This is either a boolean (when a summary should be printed) or a - hashtab (when detailed warnings shouold be printed). + hashtab (when detailed warnings should be printed). */ SCM issued_msgs; @@ -121,11 +121,7 @@ SCM_DEFINE(scm_include_deprecated_features, "in public interfaces.") #define FUNC_NAME s_scm_include_deprecated_features { -#if SCM_DEBUG_DEPRECATED == 0 - return SCM_BOOL_T; -#else - return SCM_BOOL_F; -#endif + return SCM_BOOL (SCM_ENABLE_DEPRECATED == 1); } #undef FUNC_NAME @@ -135,7 +131,7 @@ SCM_DEFINE(scm_include_deprecated_features, void scm_init_deprecation () { -#if SCM_DEBUG_DEPRECATED == 0 +#if (SCM_ENABLE_DEPRECATED == 1) const char *level = getenv ("GUILE_WARN_DEPRECATED"); if (level == NULL) level = SCM_WARN_DEPRECATED_DEFAULT; diff --git a/libguile/deprecation.h b/libguile/deprecation.h index aa75824f2..726c64a05 100644 --- a/libguile/deprecation.h +++ b/libguile/deprecation.h @@ -2,18 +2,19 @@ #ifndef SCM_DEPRECATION_H #define SCM_DEPRECATION_H + /* Copyright (C) 2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,12 +43,14 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" -#if SCM_DEBUG_DEPRECATED == 0 +#if (SCM_ENABLE_DEPRECATED == 1) void scm_c_issue_deprecation_warning (const char *msg); SCM scm_issue_deprecation_warning (SCM msgs); @@ -55,7 +58,6 @@ SCM scm_issue_deprecation_warning (SCM msgs); #endif SCM scm_include_deprecated_features (void); - void scm_init_deprecation (void); #endif /* SCM_DEPRECATION_H */ diff --git a/libguile/dynl.c b/libguile/dynl.c index 70d36341f..136595780 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -127,104 +127,6 @@ scm_must_free_argv(char **argv) free (argv); } -#if SCM_DEBUG_DEPRECATED == 0 - -/* Module registry - */ - -/* We can't use SCM objects here. One should be able to call - SCM_REGISTER_MODULE from a C++ constructor for a static - object. This happens before main and thus before libguile is - initialized. */ - -struct moddata { - struct moddata *link; - char *module_name; - void *init_func; -}; - -static struct moddata *registered_mods = NULL; - -void -scm_register_module_xxx (char *module_name, void *init_func) -{ - struct moddata *md; - - scm_c_issue_deprecation_warning - ("`scm_register_module_xxx' is deprecated. Use extensions instead."); - - /* XXX - should we (and can we) DEFER_INTS here? */ - - for (md = registered_mods; md; md = md->link) - if (!strcmp (md->module_name, module_name)) - { - md->init_func = init_func; - return; - } - - md = (struct moddata *) malloc (sizeof (struct moddata)); - if (md == NULL) - { - fprintf (stderr, - "guile: can't register module (%s): not enough memory", - module_name); - return; - } - - md->module_name = module_name; - md->init_func = init_func; - md->link = registered_mods; - registered_mods = md; -} - -SCM_DEFINE (scm_registered_modules, "c-registered-modules", 0, 0, 0, - (), - "Return a list of the object code modules that have been imported into\n" - "the current Guile process. Each element of the list is a pair whose\n" - "car is the name of the module, and whose cdr is the function handle\n" - "for that module's initializer function. The name is the string that\n" - "has been passed to scm_register_module_xxx.") -#define FUNC_NAME s_scm_registered_modules -{ - SCM res; - struct moddata *md; - - res = SCM_EOL; - for (md = registered_mods; md; md = md->link) - res = scm_cons (scm_cons (scm_makfrom0str (md->module_name), - scm_ulong2num ((unsigned long) md->init_func)), - res); - return res; -} -#undef FUNC_NAME - -SCM_DEFINE (scm_clear_registered_modules, "c-clear-registered-modules", 0, 0, 0, - (), - "Destroy the list of modules registered with the current Guile process.\n" - "The return value is unspecified. @strong{Warning:} this function does\n" - "not actually unlink or deallocate these modules, but only destroys the\n" - "records of which modules have been loaded. It should therefore be used\n" - "only by module bookkeeping operations.") -#define FUNC_NAME s_scm_clear_registered_modules -{ - struct moddata *md1, *md2; - - SCM_DEFER_INTS; - - for (md1 = registered_mods; md1; md1 = md2) - { - md2 = md1->link; - free (md1); - } - registered_mods = NULL; - - SCM_ALLOW_INTS; - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - -#endif /* !SCM_DEBUG_DEPRECATED */ - /* Dispatch to the system dependent files * * They define some static functions. These functions are called with @@ -365,7 +267,6 @@ SCM_DEFINE (scm_dynamic_link, "dynamic-link", 1, 0, 0, void *handle; SCM_VALIDATE_STRING (1, filename); - SCM_STRING_COERCE_0TERMINATION_X (filename); handle = sysdep_dynl_link (SCM_STRING_CHARS (filename), FUNC_NAME); SCM_RETURN_NEWSMOB2 (scm_tc16_dynamic_obj, SCM_UNPACK (filename), handle); } @@ -433,7 +334,6 @@ SCM_DEFINE (scm_dynamic_func, "dynamic-func", 2, 0, 0, char *chars; SCM_DEFER_INTS; - SCM_STRING_COERCE_0TERMINATION_X (name); chars = SCM_STRING_CHARS (name); func = (void (*) ()) sysdep_dynl_func (chars, DYNL_HANDLE (dobj), FUNC_NAME); SCM_ALLOW_INTS; diff --git a/libguile/dynl.h b/libguile/dynl.h index e9b0a2d8a..9910499d5 100644 --- a/libguile/dynl.h +++ b/libguile/dynl.h @@ -1,15 +1,20 @@ -/* Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc. - * +/* classes: h_files */ + +#ifndef SCM_DYNL_H +#define SCM_DYNL_H + +/* Copyright (C) 1996,1998,2000,2001 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -38,19 +43,13 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - -#ifndef LIBGUILE_DYNL_H -#define LIBGUILE_DYNL_H + #include "libguile/__scm.h" -void scm_register_module_xxx (char *module_name, void *init_func); -SCM scm_registered_modules (void); -SCM scm_clear_registered_modules (void); - SCM scm_dynamic_link (SCM fname); SCM scm_dynamic_unlink (SCM dobj); SCM scm_dynamic_object_p (SCM obj); @@ -60,7 +59,7 @@ SCM scm_dynamic_args_call (SCM symb, SCM dobj, SCM args); void scm_init_dynamic_linking (void); -#endif /* LIBGUILE_DYNL_H */ +#endif /* SCM_DYNL_H */ /* Local Variables: diff --git a/libguile/error.c b/libguile/error.c index 052d07e06..33665a0f8 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -133,7 +133,6 @@ SCM_DEFINE (scm_error_scm, "scm-error", 5, 0, 0, else { SCM_VALIDATE_STRING (2, subr); - SCM_STRING_COERCE_0TERMINATION_X (subr); szSubr = SCM_STRING_CHARS (subr); } @@ -144,7 +143,6 @@ SCM_DEFINE (scm_error_scm, "scm-error", 5, 0, 0, else { SCM_VALIDATE_STRING (2, message); - SCM_STRING_COERCE_0TERMINATION_X (message); szMessage = SCM_STRING_CHARS (message); } @@ -293,57 +291,6 @@ scm_misc_error (const char *subr, const char *message, SCM args) scm_error (scm_misc_error_key, subr, message, args, SCM_BOOL_F); } -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_wta (SCM arg, const char *pos, const char *s_subr) -{ - if (!s_subr || !*s_subr) - s_subr = NULL; - if ((~0x1fL) & (long) pos) - { - /* error string supplied. */ - scm_misc_error (s_subr, pos, scm_list_1 (arg)); - } - else - { - /* numerical error code. */ - int error = (int) pos; - - switch (error) - { - case SCM_ARGn: - scm_wrong_type_arg (s_subr, 0, arg); - case SCM_ARG1: - scm_wrong_type_arg (s_subr, 1, arg); - case SCM_ARG2: - scm_wrong_type_arg (s_subr, 2, arg); - case SCM_ARG3: - scm_wrong_type_arg (s_subr, 3, arg); - case SCM_ARG4: - scm_wrong_type_arg (s_subr, 4, arg); - case SCM_ARG5: - scm_wrong_type_arg (s_subr, 5, arg); - case SCM_ARG6: - scm_wrong_type_arg (s_subr, 6, arg); - case SCM_ARG7: - scm_wrong_type_arg (s_subr, 7, arg); - case SCM_WNA: - scm_wrong_num_args (arg); - case SCM_OUTOFRANGE: - scm_out_of_range (s_subr, arg); - case SCM_NALLOC: - scm_memory_error (s_subr); - default: - /* this shouldn't happen. */ - scm_misc_error (s_subr, "Unknown error", SCM_EOL); - } - } - return SCM_UNSPECIFIED; -} - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - void scm_init_error () { diff --git a/libguile/error.h b/libguile/error.h index 37b8ee342..c7b7fd216 100644 --- a/libguile/error.h +++ b/libguile/error.h @@ -2,18 +2,19 @@ #ifndef SCM_ERROR_H #define SCM_ERROR_H + /* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,7 +43,9 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + + #include "libguile/__scm.h" @@ -74,14 +77,6 @@ extern void scm_misc_error (const char *subr, const char *message, SCM args) SCM_NORETURN; extern void scm_init_error (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -extern SCM scm_wta (SCM arg, const char *pos, const char *s_subr); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_ERROR_H */ /* diff --git a/libguile/eval.c b/libguile/eval.c index b896814d2..6ea2a9dd9 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -155,7 +155,7 @@ char *alloca (); ? *scm_lookupcar (x, env, 1) \ : SCM_CEVAL (SCM_CAR (x), env)) -#define EVALCAR(x, env) (!SCM_CELLP (SCM_CAR (x)) \ +#define EVALCAR(x, env) (SCM_IMP (SCM_CAR (x)) \ ? SCM_EVALIM (SCM_CAR (x), env) \ : EVALCELLCAR (x, env)) @@ -413,8 +413,7 @@ scm_unmemocar (SCM form, SCM env) c = SCM_CAR (form); if (SCM_VARIABLEP (c)) { - SCM sym = - scm_module_reverse_lookup (scm_env_module (env), c); + SCM sym = scm_module_reverse_lookup (scm_env_module (env), c); if (SCM_EQ_P (sym, SCM_BOOL_F)) sym = sym_three_question_marks; SCM_SETCAR (form, sym); @@ -1300,7 +1299,7 @@ unmemocopy (SCM x, SCM env) #ifdef DEBUG_EXTENSIONS SCM p; #endif - if (!SCM_CELLP (x) || !SCM_CONSP (x)) + if (!SCM_CONSP (x)) return x; #ifdef DEBUG_EXTENSIONS p = scm_whash_lookup (scm_source_whash, x); @@ -1468,15 +1467,17 @@ unmemocopy (SCM x, SCM env) env); } loop: - while (SCM_CELLP (x = SCM_CDR (x)) && SCM_CONSP (x)) + x = SCM_CDR (x); + while (SCM_CONSP (x)) { - if (SCM_ISYMP (SCM_CAR (x))) - /* skip body markers */ - continue; - SCM_SETCDR (z, unmemocar (scm_cons (unmemocopy (SCM_CAR (x), env), - SCM_UNSPECIFIED), - env)); - z = SCM_CDR (z); + SCM form = SCM_CAR (x); + if (!SCM_ISYMP (form)) + { + SCM copy = scm_cons (unmemocopy (form, env), SCM_UNSPECIFIED); + SCM_SETCDR (z, unmemocar (copy, env)); + z = SCM_CDR (z); + } + x = SCM_CDR (x); } SCM_SETCDR (z, x); #ifdef DEBUG_EXTENSIONS @@ -1975,7 +1976,7 @@ dispatch: } carloop: /* scm_eval car of last form in list */ - if (!SCM_CELLP (SCM_CAR (x))) + if (SCM_IMP (SCM_CAR (x))) { x = SCM_CAR (x); RETURN (SCM_EVALIM (x, env)) @@ -2508,7 +2509,6 @@ dispatch: #endif #endif case scm_tc7_string: - case scm_tc7_substring: case scm_tc7_smob: case scm_tcs_closures: case scm_tc7_cclo: @@ -4048,47 +4048,6 @@ SCM_DEFINE (scm_eval, "eval", 2, 0, 0, } #undef FUNC_NAME -#if (SCM_DEBUG_DEPRECATED == 0) - -/* Use scm_current_module () or scm_interaction_environment () - * instead. The former is the module selected during loading of code. - * The latter is the module in which the user of this thread currently - * types expressions. - */ - -SCM scm_top_level_lookup_closure_var; -SCM scm_system_transformer; - -/* Avoid using this functionality altogether (except for implementing - * libguile, where you can use scm_i_eval or scm_i_eval_x). - * - * Applications should use either C level scm_eval_x or Scheme - * scm_eval; or scm_primitive_eval_x or scm_primitive_eval. */ - -SCM -scm_eval_3 (SCM obj, int copyp, SCM env) -{ - if (copyp) - return scm_i_eval (obj, env); - else - return scm_i_eval_x (obj, env); -} - -SCM_DEFINE (scm_eval2, "eval2", 2, 0, 0, - (SCM obj, SCM env_thunk), - "Evaluate @var{exp}, a Scheme expression, in the environment\n" - "designated by @var{lookup}, a symbol-lookup function." - "Do not use this version of eval, it does not play well\n" - "with the module system. Use @code{eval} or\n" - "@code{primitive-eval} instead.") -#define FUNC_NAME s_scm_eval2 -{ - return scm_i_eval (obj, scm_top_level_env (env_thunk)); -} -#undef FUNC_NAME - -#endif /* DEPRECATED */ - /* At this point, scm_deval and scm_dapply are generated. */ @@ -4124,13 +4083,6 @@ scm_init_eval () /* acros */ /* end of acros */ -#if SCM_DEBUG_DEPRECATED == 0 - scm_top_level_lookup_closure_var = - scm_c_define ("*top-level-lookup-closure*", scm_make_fluid ()); - scm_system_transformer = - scm_c_define ("scm:eval-transformer", scm_make_fluid ()); -#endif - #ifndef SCM_MAGIC_SNARFER #include "libguile/eval.x" #endif diff --git a/libguile/eval.h b/libguile/eval.h index 18e245483..8895b9ccb 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -2,18 +2,19 @@ #ifndef SCM_EVAL_H #define SCM_EVAL_H + /* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -114,7 +116,7 @@ extern SCM scm_eval_options_interface (SCM setting); #define SCM_XEVAL(x, env) (SCM_IMP (x) \ ? SCM_EVALIM2(x) \ : (*scm_ceval_ptr) ((x), (env))) -#define SCM_XEVALCAR(x, env) (SCM_NCELLP (SCM_CAR (x)) \ +#define SCM_XEVALCAR(x, env) (SCM_IMP (SCM_CAR (x)) \ ? SCM_EVALIM (SCM_CAR (x), env) \ : (SCM_SYMBOLP (SCM_CAR (x)) \ ? *scm_lookupcar (x, env, 1) \ @@ -134,13 +136,6 @@ extern SCM scm_eval_options_interface (SCM setting); #define SCM_TOP_LEVEL_LOOKUP_CLOSURE (scm_current_module_lookup_closure()) -#if SCM_DEBUG_DEPRECATED == 0 - -extern SCM scm_top_level_lookup_closure_var; -extern SCM scm_system_transformer; -#endif - - extern const char scm_s_expression[]; extern const char scm_s_test[]; @@ -244,10 +239,6 @@ extern SCM scm_force (SCM x); extern SCM scm_promise_p (SCM x); extern SCM scm_cons_source (SCM xorig, SCM x, SCM y); extern SCM scm_copy_tree (SCM obj); -#if SCM_DEBUG_DEPRECATED == 0 -extern SCM scm_eval_3 (SCM obj, int copyp, SCM env); -extern SCM scm_eval2 (SCM obj, SCM env_thunk); -#endif extern SCM scm_i_eval_x (SCM exp, SCM env); extern SCM scm_i_eval (SCM exp, SCM env); extern SCM scm_primitive_eval (SCM exp); diff --git a/libguile/filesys.c b/libguile/filesys.c index f86f790f9..1482db521 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -179,7 +179,6 @@ SCM_DEFINE (scm_chown, "chown", 3, 0, 0, #endif { SCM_VALIDATE_STRING (1, object); - SCM_STRING_COERCE_0TERMINATION_X (object); SCM_SYSCALL (rv = chown (SCM_STRING_CHARS (object), SCM_INUM (owner), SCM_INUM (group))); } @@ -219,7 +218,6 @@ SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0, else { SCM_VALIDATE_STRING (1, object); - SCM_STRING_COERCE_0TERMINATION_X (object); SCM_SYSCALL (rv = chmod (SCM_STRING_CHARS (object), SCM_INUM (mode))); } if (rv == -1) @@ -264,7 +262,6 @@ SCM_DEFINE (scm_open_fdes, "open-fdes", 2, 1, 0, int imode; SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); iflags = SCM_NUM2INT (2, flags); imode = SCM_NUM2INT_DEF (3, mode, 0666); SCM_SYSCALL (fd = open (SCM_STRING_CHARS (path), iflags, imode)); @@ -556,7 +553,6 @@ SCM_DEFINE (scm_stat, "stat", 1, 0, 0, } else if (SCM_STRINGP (object)) { - SCM_STRING_COERCE_0TERMINATION_X (object); SCM_SYSCALL (rv = stat (SCM_STRING_CHARS (object), &stat_temp)); } else @@ -596,9 +592,7 @@ SCM_DEFINE (scm_link, "link", 2, 0, 0, int val; SCM_VALIDATE_STRING (1, oldpath); - SCM_STRING_COERCE_0TERMINATION_X (oldpath); SCM_VALIDATE_STRING (2, newpath); - SCM_STRING_COERCE_0TERMINATION_X (newpath); SCM_SYSCALL (val = link (SCM_STRING_CHARS (oldpath), SCM_STRING_CHARS (newpath))); if (val != 0) @@ -619,8 +613,6 @@ SCM_DEFINE (scm_rename, "rename-file", 2, 0, 0, int rv; SCM_VALIDATE_STRING (1, oldname); SCM_VALIDATE_STRING (2, newname); - SCM_STRING_COERCE_0TERMINATION_X (oldname); - SCM_STRING_COERCE_0TERMINATION_X (newname); #ifdef HAVE_RENAME SCM_SYSCALL (rv = rename (SCM_STRING_CHARS (oldname), SCM_STRING_CHARS (newname))); #else @@ -647,7 +639,6 @@ SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0, { int ans; SCM_VALIDATE_STRING (1, str); - SCM_STRING_COERCE_0TERMINATION_X (str); SCM_SYSCALL (ans = unlink (SCM_STRING_CHARS (str))); if (ans != 0) SCM_SYSERROR; @@ -667,7 +658,6 @@ SCM_DEFINE (scm_mkdir, "mkdir", 1, 1, 0, int rv; mode_t mask; SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); if (SCM_UNBNDP (mode)) { mask = umask (0); @@ -696,7 +686,6 @@ SCM_DEFINE (scm_rmdir, "rmdir", 1, 0, 0, int val; SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); SCM_SYSCALL (val = rmdir (SCM_STRING_CHARS (path))); if (val != 0) SCM_SYSERROR; @@ -732,7 +721,6 @@ SCM_DEFINE (scm_opendir, "opendir", 1, 0, 0, { DIR *ds; SCM_VALIDATE_STRING (1, dirname); - SCM_STRING_COERCE_0TERMINATION_X (dirname); SCM_SYSCALL (ds = opendir (SCM_STRING_CHARS (dirname))); if (ds == NULL) SCM_SYSERROR; @@ -841,7 +829,6 @@ SCM_DEFINE (scm_chdir, "chdir", 1, 0, 0, int ans; SCM_VALIDATE_STRING (1, str); - SCM_STRING_COERCE_0TERMINATION_X (str); SCM_SYSCALL (ans = chdir (SCM_STRING_CHARS (str))); if (ans != 0) SCM_SYSERROR; @@ -1266,8 +1253,6 @@ SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0, SCM_VALIDATE_STRING (1, oldpath); SCM_VALIDATE_STRING (2, newpath); - SCM_STRING_COERCE_0TERMINATION_X (oldpath); - SCM_STRING_COERCE_0TERMINATION_X (newpath); SCM_SYSCALL (val = symlink (SCM_STRING_CHARS (oldpath), SCM_STRING_CHARS (newpath))); if (val != 0) SCM_SYSERROR; @@ -1288,7 +1273,6 @@ SCM_DEFINE (scm_readlink, "readlink", 1, 0, 0, char *buf; SCM result; SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); buf = scm_must_malloc (size, FUNC_NAME); while ((rv = readlink (SCM_STRING_CHARS (path), buf, size)) == size) { @@ -1317,7 +1301,6 @@ SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0, struct stat stat_temp; SCM_VALIDATE_STRING (1, str); - SCM_STRING_COERCE_0TERMINATION_X (str); SCM_SYSCALL (rv = lstat (SCM_STRING_CHARS (str), &stat_temp)); if (rv != 0) { @@ -1344,9 +1327,7 @@ SCM_DEFINE (scm_copy_file, "copy-file", 2, 0, 0, struct stat oldstat; SCM_VALIDATE_STRING (1, oldfile); - SCM_STRING_COERCE_0TERMINATION_X (oldfile); SCM_VALIDATE_STRING (2, newfile); - SCM_STRING_COERCE_0TERMINATION_X (newfile); if (stat (SCM_STRING_CHARS (oldfile), &oldstat) == -1) SCM_SYSERROR; oldfd = open (SCM_STRING_CHARS (oldfile), O_RDONLY); diff --git a/libguile/fports.c b/libguile/fports.c index 886caadf6..7317ed17d 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -297,8 +297,6 @@ SCM_DEFINE (scm_open_file, "open-file", 2, 0, 0, SCM_VALIDATE_STRING (1, filename); SCM_VALIDATE_STRING (2, mode); - SCM_STRING_COERCE_0TERMINATION_X (filename); - SCM_STRING_COERCE_0TERMINATION_X (mode); file = SCM_STRING_CHARS (filename); md = SCM_STRING_CHARS (mode); diff --git a/libguile/gc.c b/libguile/gc.c index d63562f44..f9c7be170 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -94,6 +94,8 @@ +#define CELL_P(x) (SCM_ITAG3 (x) == scm_tc3_cons) + unsigned int scm_gc_running_p = 0; @@ -1227,7 +1229,7 @@ gc_mark_loop_first_time: SCM_MISC_ERROR ("rogue pointer in heap", SCM_EOL); #else /* In non-debug mode, do at least some cheap testing. */ - if (!SCM_CELLP (ptr)) + if (!CELL_P (ptr)) SCM_MISC_ERROR ("rogue pointer in heap", SCM_EOL); #endif @@ -1344,10 +1346,6 @@ gc_mark_loop_first_time: case scm_tc7_string: break; - case scm_tc7_substring: - ptr = SCM_CDR (ptr); - goto_gc_mark_loop; - case scm_tc7_wvect: SCM_SET_WVECT_GC_CHAIN (ptr, scm_weak_vectors); scm_weak_vectors = ptr; @@ -1509,7 +1507,7 @@ gc_mark_loop_first_time: static long int heap_segment (SCM obj) { - if (!SCM_CELLP (obj)) + if (!CELL_P (obj)) return -1; else { @@ -1783,8 +1781,6 @@ scm_gc_sweep () scm_must_free (SCM_UVECTOR_BASE (scmptr)); break; #endif - case scm_tc7_substring: - break; case scm_tc7_string: m += SCM_STRING_LENGTH (scmptr) + 1; scm_must_free (SCM_STRING_CHARS (scmptr)); @@ -2472,9 +2468,9 @@ alloc_some_heap (scm_t_freelist *freelist, policy_on_error error_policy) * scm_remember_upto_here* _behind_ the last code in your function, that * depends on the scheme object to exist. * - * Example: We want to make sure, that the string object str does not get - * garbage collected during the execution of 'some_function', because - * otherwise the characters belonging to str would be freed and + * Example: We want to make sure that the string object str does not get + * garbage collected during the execution of 'some_function' in the code + * below, because otherwise the characters belonging to str would be freed and * 'some_function' might access freed memory. To make sure that the compiler * keeps str alive on the stack or in a register such that it is visible to * the conservative gc we add the call to scm_remember_upto_here_1 _after_ the @@ -2503,34 +2499,6 @@ scm_remember_upto_here (SCM obj SCM_UNUSED, ...) /* Empty. Protects any number of objects from garbage collection. */ } - -#if (SCM_DEBUG_DEPRECATED == 0) - -void -scm_remember (SCM *ptr) -{ - scm_c_issue_deprecation_warning ("`scm_remember' is deprecated. " - "Use the `scm_remember_upto_here*' family of functions instead."); -} - -SCM -scm_protect_object (SCM obj) -{ - scm_c_issue_deprecation_warning ("`scm_protect_object' is deprecated. " - "Use `scm_gc_protect_object' instead."); - return scm_gc_protect_object (obj); -} - -SCM -scm_unprotect_object (SCM obj) -{ - scm_c_issue_deprecation_warning ("`scm_unprotect_object' is deprecated. " - "Use `scm_gc_unprotect_object' instead."); - return scm_gc_unprotect_object (obj); -} - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - /* These crazy functions prevent garbage collection of arguments after the first argument by diff --git a/libguile/gc.h b/libguile/gc.h index 07a11481b..3b0efff1e 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -2,6 +2,7 @@ #ifndef SCM_GC_H #define SCM_GC_H + /* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -390,32 +391,6 @@ extern int scm_init_storage (void); extern void *scm_get_stack_base (void); extern void scm_init_gc (void); - - -#if (SCM_DEBUG_DEPRECATED == 0) - -extern SCM scm_protect_object (SCM obj); -extern SCM scm_unprotect_object (SCM obj); - -#define SCM_SETAND_CAR(x, y) \ - (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y)))) -#define SCM_SETOR_CAR(x, y)\ - (SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y)))) -#define SCM_SETAND_CDR(x, y)\ - (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y)))) -#define SCM_SETOR_CDR(x, y)\ - (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y)))) -#define SCM_FREEP(x) (SCM_FREE_CELL_P (x)) -#define SCM_NFREEP(x) (!SCM_FREE_CELL_P (x)) -#define SCM_GC8MARKP(x) SCM_GCMARKP (x) -#define SCM_SETGC8MARK(x) SCM_SETGCMARK (x) -#define SCM_CLRGC8MARK(x) SCM_CLRGCMARK (x) -#define SCM_GCTYP16(x) SCM_TYP16 (x) -#define SCM_GCCDR(x) SCM_CDR (x) -extern void scm_remember (SCM * ptr); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_GC_H */ /* diff --git a/libguile/gh_data.c b/libguile/gh_data.c index f55b87ed9..0f503a950 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -288,7 +288,6 @@ gh_scm2chars (SCM obj, char *m) break; #endif case scm_tc7_string: - case scm_tc7_substring: n = SCM_STRING_LENGTH (obj); if (m == 0) m = (char *) malloc (n * sizeof (char)); diff --git a/libguile/hash.c b/libguile/hash.c index 70c12546f..3b8fcbc33 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -138,7 +138,6 @@ scm_hasher(SCM obj, unsigned long n, size_t d) obj = scm_number_to_string (obj, SCM_MAKINUM (10)); } case scm_tc7_string: - case scm_tc7_substring: return scm_string_hash (SCM_STRING_UCHARS (obj), SCM_STRING_LENGTH (obj)) % n; case scm_tc7_symbol: return SCM_SYMBOL_HASH (obj) % n; diff --git a/libguile/init.c b/libguile/init.c index 2c7901f50..f768cc7d9 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -176,11 +176,6 @@ start_stack (void *base) scm_exitval = SCM_BOOL_F; /* vestigial */ -#if SCM_DEBUG_DEPRECATED == 0 - scm_top_level_lookup_closure_var = SCM_BOOL_F; - scm_system_transformer = SCM_BOOL_F; -#endif - scm_root->fluids = scm_make_initial_fluids (); /* Create an object to hold the root continuation. diff --git a/libguile/ioext.c b/libguile/ioext.c index 4cb28ad62..dddd38dda 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -237,7 +237,6 @@ SCM_DEFINE (scm_fdopen, "fdopen", 2, 0, 0, { SCM_VALIDATE_INUM (1,fdes); SCM_VALIDATE_STRING (2, modes); - SCM_STRING_COERCE_0TERMINATION_X (modes); return scm_fdes_to_port (SCM_INUM (fdes), SCM_STRING_CHARS (modes), SCM_BOOL_F); } diff --git a/libguile/modules.c b/libguile/modules.c index ed8fdfdda..1d6040d62 100644 --- a/libguile/modules.c +++ b/libguile/modules.c @@ -91,13 +91,6 @@ SCM_DEFINE (scm_set_current_module, "set-current-module", 1, 0, 0, old = scm_current_module (); scm_fluid_set_x (the_module, module); -#if SCM_DEBUG_DEPRECATED == 0 - scm_fluid_set_x (SCM_VARIABLE_REF (scm_top_level_lookup_closure_var), - scm_current_module_lookup_closure ()); - scm_fluid_set_x (SCM_VARIABLE_REF (scm_system_transformer), - scm_current_module_transformer ()); -#endif - return old; } #undef FUNC_NAME @@ -429,9 +422,6 @@ scm_sym2var (SCM sym, SCM proc, SCM definep) if (var == SCM_BOOL_F) { var = scm_make_variable (SCM_UNDEFINED); -#if SCM_ENABLE_VCELLS - scm_variable_set_name_hint (var, sym); -#endif SCM_SETCDR (handle, var); } } @@ -573,18 +563,6 @@ SCM_DEFINE (scm_get_pre_modules_obarray, "%get-pre-modules-obarray", 0, 0, 0, } #undef FUNC_NAME -#if SCM_DEBUG_DEPRECATED == 0 - -static SCM root_module_lookup_closure; -SCM_SYMBOL (scm_sym_app, "app"); -SCM_SYMBOL (scm_sym_modules, "modules"); -static SCM module_prefix; -static SCM make_modules_in_var; -static SCM beautify_user_module_x_var; -static SCM try_module_autoload_var; - -#endif - SCM_SYMBOL (scm_sym_system_module, "system-module"); SCM @@ -635,73 +613,9 @@ scm_post_boot_init_modules () module_export_x_var = PERM (scm_c_lookup ("module-export!")); the_root_module_var = PERM (scm_c_lookup ("the-root-module")); -#if SCM_DEBUG_DEPRECATED == 0 - - module_prefix = PERM (scm_list_2 (scm_sym_app, scm_sym_modules)); - make_modules_in_var = PERM (scm_c_lookup ("make-modules-in")); - root_module_lookup_closure = - PERM (scm_module_lookup_closure (SCM_VARIABLE_REF (the_root_module_var))); - beautify_user_module_x_var = PERM (scm_c_lookup ("beautify-user-module!")); - try_module_autoload_var = PERM (scm_c_lookup ("try-module-autoload")); - -#endif - scm_module_system_booted_p = 1; } -#if SCM_DEBUG_DEPRECATED == 0 - -SCM -scm_the_root_module () -{ - scm_c_issue_deprecation_warning ("`scm_the_root_module' is deprecated. " - "Use `scm_c_resolve_module (\"guile\") " - "instead."); - - return the_root_module (); -} - -static SCM -scm_module_full_name (SCM name) -{ - if (SCM_EQ_P (SCM_CAR (name), scm_sym_app)) - return name; - else - return scm_append (scm_list_2 (module_prefix, name)); -} - -SCM -scm_make_module (SCM name) -{ - scm_c_issue_deprecation_warning ("`scm_make_module' is deprecated. " - "Use `scm_c_define_module instead."); - - return scm_call_2 (SCM_VARIABLE_REF (make_modules_in_var), - scm_the_root_module (), - scm_module_full_name (name)); -} - -SCM -scm_ensure_user_module (SCM module) -{ - scm_c_issue_deprecation_warning ("`scm_ensure_user_module' is deprecated. " - "Use `scm_c_define_module instead."); - - scm_call_1 (SCM_VARIABLE_REF (beautify_user_module_x_var), module); - return SCM_UNSPECIFIED; -} - -SCM -scm_load_scheme_module (SCM name) -{ - scm_c_issue_deprecation_warning ("`scm_load_scheme_module' is deprecated. " - "Use `scm_c_resolve_module instead."); - - return scm_call_1 (SCM_VARIABLE_REF (try_module_autoload_var), name); -} - -#endif - /* Local Variables: c-file-style: "gnu" diff --git a/libguile/modules.h b/libguile/modules.h index 55dd94744..ece08bb7b 100644 --- a/libguile/modules.h +++ b/libguile/modules.h @@ -2,18 +2,19 @@ #ifndef SCM_MODULES_H #define SCM_MODULES_H + /* Copyright (C) 1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -42,6 +43,7 @@ * If you write modifications of your own for GUILE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" @@ -130,15 +132,6 @@ extern SCM scm_system_module_env_p (SCM env); extern void scm_modules_prehistory (void); extern void scm_init_modules (void); -#if SCM_DEBUG_DEPRECATED == 0 - -extern SCM scm_the_root_module (void); -extern SCM scm_make_module (SCM name); -extern SCM scm_ensure_user_module (SCM name); -extern SCM scm_load_scheme_module (SCM name); - -#endif - #endif /* SCM_MODULES_H */ /* diff --git a/libguile/net_db.c b/libguile/net_db.c index bcb920708..91d0d8347 100644 --- a/libguile/net_db.c +++ b/libguile/net_db.c @@ -176,7 +176,6 @@ SCM_DEFINE (scm_gethost, "gethost", 0, 1, 0, } else if (SCM_STRINGP (host)) { - SCM_STRING_COERCE_0TERMINATION_X (host); entry = gethostbyname (SCM_STRING_CHARS (host)); } else @@ -248,7 +247,6 @@ SCM_DEFINE (scm_getnet, "getnet", 0, 1, 0, } else if (SCM_STRINGP (net)) { - SCM_STRING_COERCE_0TERMINATION_X (net); entry = getnetbyname (SCM_STRING_CHARS (net)); } else @@ -298,7 +296,6 @@ SCM_DEFINE (scm_getproto, "getproto", 0, 1, 0, } else if (SCM_STRINGP (protocol)) { - SCM_STRING_COERCE_0TERMINATION_X (protocol); entry = getprotobyname (SCM_STRING_CHARS (protocol)); } else @@ -360,10 +357,8 @@ SCM_DEFINE (scm_getserv, "getserv", 0, 2, 0, return scm_return_entry (entry); } SCM_VALIDATE_STRING (2, protocol); - SCM_STRING_COERCE_0TERMINATION_X (protocol); if (SCM_STRINGP (name)) { - SCM_STRING_COERCE_0TERMINATION_X (name); entry = getservbyname (SCM_STRING_CHARS (name), SCM_STRING_CHARS (protocol)); } else diff --git a/libguile/objects.c b/libguile/objects.c index 424cd466e..aca2e55d0 100644 --- a/libguile/objects.c +++ b/libguile/objects.c @@ -132,7 +132,6 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0, #endif return scm_class_vector; case scm_tc7_string: - case scm_tc7_substring: return scm_class_string; case scm_tc7_asubr: case scm_tc7_subr_0: diff --git a/libguile/ports.c b/libguile/ports.c index 266ac0ea4..4ee18fc3d 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -743,47 +743,6 @@ SCM_DEFINE (scm_port_for_each, "port-for-each", 1, 0, 0, } #undef FUNC_NAME -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1, - (SCM ports), - "[DEPRECATED] Close all open file ports used by the interpreter\n" - "except for those supplied as arguments. This procedure\n" - "was intended to be used before an exec call to close file descriptors\n" - "which are not needed in the new process. However it has the\n" - "undesirable side-effect of flushing buffes, so it's deprecated.\n" - "Use port-for-each instead.") -#define FUNC_NAME s_scm_close_all_ports_except -{ - long i = 0; - SCM_VALIDATE_REST_ARGUMENT (ports); - while (i < scm_port_table_size) - { - SCM thisport = scm_port_table[i]->port; - int found = 0; - SCM ports_ptr = ports; - - while (!SCM_NULLP (ports_ptr)) - { - SCM port = SCM_COERCE_OUTPORT (SCM_CAR (ports_ptr)); - if (i == 0) - SCM_VALIDATE_OPPORT (SCM_ARG1,port); - if (SCM_EQ_P (port, thisport)) - found = 1; - ports_ptr = SCM_CDR (ports_ptr); - } - if (found) - i++; - else - /* i is not to be incremented here. */ - scm_close_port (thisport); - } - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - -#endif - /* Utter miscellany. Gosh, we should clean this up some time. */ @@ -1392,7 +1351,6 @@ SCM_DEFINE (scm_truncate_file, "truncate-file", 1, 1, 0, else { SCM_VALIDATE_STRING (1, object); - SCM_STRING_COERCE_0TERMINATION_X (object); SCM_SYSCALL (rv = truncate (SCM_STRING_CHARS (object), c_length)); } if (rv == -1) @@ -1575,7 +1533,6 @@ SCM_DEFINE (scm_sys_make_void_port, "%make-void-port", 1, 0, 0, #define FUNC_NAME s_scm_sys_make_void_port { SCM_VALIDATE_STRING (1, mode); - SCM_STRING_COERCE_0TERMINATION_X (mode); return scm_void_port (SCM_STRING_CHARS (mode)); } #undef FUNC_NAME diff --git a/libguile/ports.h b/libguile/ports.h index 60877af8c..b0d97fd1e 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -2,18 +2,19 @@ #ifndef SCM_PORTS_H #define SCM_PORTS_H + /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -44,6 +45,7 @@ * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" #include "libguile/print.h" @@ -150,17 +152,17 @@ extern long scm_port_table_size; /* Number of ports in scm_port_table. */ #define SCM_BUF0 (8L<<16) /* Is it unbuffered? */ #define SCM_BUFLINE (64L<<16) /* Is it line-buffered? */ -#define SCM_PORTP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_port)) -#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN))) -#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG))) -#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG))) +#define SCM_PORTP(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_port)) +#define SCM_OPPORTP(x) (!SCM_IMP(x) && (((0x7f | SCM_OPN) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN))) +#define SCM_OPINPORTP(x) (!SCM_IMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG))) +#define SCM_OPOUTPORTP(x) (!SCM_IMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG))) #define SCM_INPUT_PORT_P(x) \ - (SCM_NIMP(x) \ + (!SCM_IMP(x) \ && (((0x7f | SCM_RDNG) & SCM_CELL_WORD_0(x)) == (scm_tc7_port | SCM_RDNG))) #define SCM_OUTPUT_PORT_P(x) \ - (SCM_NIMP(x) \ + (!SCM_IMP(x) \ && (((0x7f | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_WRTNG))) -#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_CELL_WORD_0 (x))) +#define SCM_OPENP(x) (!SCM_IMP(x) && (SCM_OPN & SCM_CELL_WORD_0 (x))) #define SCM_CLOSEDP(x) (!SCM_OPENP(x)) #define SCM_CLR_PORT_OPEN_FLAG(p) \ SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) & ~SCM_OPN) @@ -204,12 +206,6 @@ typedef struct scm_t_ptob_descriptor } scm_t_ptob_descriptor; -#if (SCM_DEBUG_DEPRECATED == 0) -# define scm_port scm_t_port -# define scm_ptob_descriptor scm_t_ptob_descriptor -# define scm_port_rw_active scm_t_port_rw_active -#endif - #define SCM_TC2PTOBNUM(x) (0x0ff & ((x) >> 8)) #define SCM_PTOBNUM(x) (SCM_TC2PTOBNUM (SCM_CELL_TYPE (x))) /* SCM_PTOBNAME can be 0 if name is missing */ @@ -318,14 +314,6 @@ extern SCM scm_pt_size (void); extern SCM scm_pt_member (SCM member); #endif /* GUILE_DEBUG */ - - -#if (SCM_DEBUG_DEPRECATED == 0) - -extern SCM scm_close_all_ports_except (SCM ports); - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ - #endif /* SCM_PORTS_H */ /* diff --git a/libguile/posix.c b/libguile/posix.c index 2fe0d4af2..54998f091 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -292,7 +292,6 @@ SCM_DEFINE (scm_getpwuid, "getpw", 0, 1, 0, else { SCM_VALIDATE_STRING (1, user); - SCM_STRING_COERCE_0TERMINATION_X (user); entry = getpwnam (SCM_STRING_CHARS (user)); } if (!entry) @@ -362,7 +361,6 @@ SCM_DEFINE (scm_getgrgid, "getgr", 0, 1, 0, else { SCM_VALIDATE_STRING (1, name); - SCM_STRING_COERCE_0TERMINATION_X (name); SCM_SYSCALL (entry = getgrnam (SCM_STRING_CHARS (name))); } if (!entry) @@ -895,7 +893,6 @@ SCM_DEFINE (scm_execl, "execl", 1, 0, 1, { char **execargv; SCM_VALIDATE_STRING (1, filename); - SCM_STRING_COERCE_0TERMINATION_X (filename); execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME); execv (SCM_STRING_CHARS (filename), execargv); SCM_SYSERROR; @@ -916,7 +913,6 @@ SCM_DEFINE (scm_execlp, "execlp", 1, 0, 1, { char **execargv; SCM_VALIDATE_STRING (1, filename); - SCM_STRING_COERCE_0TERMINATION_X (filename); execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME); execvp (SCM_STRING_CHARS (filename), execargv); SCM_SYSERROR; @@ -969,7 +965,6 @@ SCM_DEFINE (scm_execle, "execle", 2, 0, 1, char **exec_env; SCM_VALIDATE_STRING (1, filename); - SCM_STRING_COERCE_0TERMINATION_X (filename); execargv = scm_convert_exec_args (args, SCM_ARG1, FUNC_NAME); exec_env = environ_list_to_c (env, SCM_ARG2, FUNC_NAME); @@ -1099,7 +1094,6 @@ SCM_DEFINE (scm_mkstemp, "mkstemp!", 1, 0, 0, char *c_tmpl; int rv; - SCM_STRING_COERCE_0TERMINATION_X (tmpl); SCM_VALIDATE_STRING_COPY (1, tmpl, c_tmpl); SCM_SYSCALL (rv = mkstemp (c_tmpl)); if (rv == -1) @@ -1126,7 +1120,6 @@ SCM_DEFINE (scm_utime, "utime", 1, 2, 0, struct utimbuf utm_tmp; SCM_VALIDATE_STRING (1, pathname); - SCM_STRING_COERCE_0TERMINATION_X (pathname); if (SCM_UNBNDP (actime)) SCM_SYSCALL (time (&utm_tmp.actime)); else @@ -1174,7 +1167,6 @@ SCM_DEFINE (scm_access, "access?", 2, 0, 0, int rv; SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); SCM_VALIDATE_INUM (2, how); rv = access (SCM_STRING_CHARS (path), SCM_INUM (how)); return SCM_NEGATE_BOOL(rv); @@ -1245,7 +1237,6 @@ SCM_DEFINE (scm_setlocale, "setlocale", 1, 1, 0, else { SCM_VALIDATE_STRING (2, locale); - SCM_STRING_COERCE_0TERMINATION_X (locale); clocale = SCM_STRING_CHARS (locale); } @@ -1283,7 +1274,6 @@ SCM_DEFINE (scm_mknod, "mknod", 4, 0, 0, SCM_VALIDATE_SYMBOL (2,type); SCM_VALIDATE_INUM (3,perms); SCM_VALIDATE_INUM (4,dev); - SCM_STRING_COERCE_0TERMINATION_X (path); p = SCM_SYMBOL_CHARS (type); if (strcmp (p, "regular") == 0) @@ -1354,8 +1344,6 @@ SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0, SCM_VALIDATE_STRING (1, key); SCM_VALIDATE_STRING (2, salt); - SCM_STRING_COERCE_0TERMINATION_X (key); - SCM_STRING_COERCE_0TERMINATION_X (salt); p = crypt (SCM_STRING_CHARS (key), SCM_STRING_CHARS (salt)); return scm_makfrom0str (p); @@ -1374,7 +1362,6 @@ SCM_DEFINE (scm_chroot, "chroot", 1, 0, 0, #define FUNC_NAME s_scm_chroot { SCM_VALIDATE_STRING (1, path); - SCM_STRING_COERCE_0TERMINATION_X (path); if (chroot (SCM_STRING_CHARS (path)) == -1) SCM_SYSERROR; @@ -1512,7 +1499,6 @@ SCM_DEFINE (scm_getpass, "getpass", 1, 0, 0, SCM passwd; SCM_VALIDATE_STRING (1, prompt); - SCM_STRING_COERCE_0TERMINATION_X (prompt); p = getpass(SCM_STRING_CHARS (prompt)); passwd = scm_makfrom0str (p); @@ -1574,7 +1560,6 @@ SCM_DEFINE (scm_sethostname, "sethostname", 1, 0, 0, #define FUNC_NAME s_scm_sethostname { SCM_VALIDATE_STRING (1, name); - SCM_STRING_COERCE_0TERMINATION_X (name); if (sethostname (SCM_STRING_CHARS (name), SCM_STRING_LENGTH (name)) == -1) SCM_SYSERROR; diff --git a/libguile/print.c b/libguile/print.c index 6204a8738..e207f411a 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -507,7 +507,6 @@ scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate) scm_putc ('>', port); } break; - case scm_tc7_substring: case scm_tc7_string: if (SCM_WRITINGP (pstate)) { @@ -730,7 +729,7 @@ scm_ipruk (char *hdr, SCM ptr, SCM port) { scm_puts ("#string", 1, 0, 0, scm_string); @@ -118,33 +101,9 @@ SCM_DEFINE (scm_string, "string", 0, 0, 1, } #undef FUNC_NAME -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_makstr (size_t len, int dummy) -#define FUNC_NAME "scm_makstr" -{ - SCM s; - char *mem; - - SCM_ASSERT_RANGE (1, scm_long2num (len), len <= SCM_STRING_MAX_LENGTH); - - mem = (char *) scm_must_malloc (len + 1, FUNC_NAME); - mem[len] = 0; - - SCM_NEWCELL (s); - SCM_SET_STRING_CHARS (s, mem); - SCM_SET_STRING_LENGTH (s, len); - - return s; -} -#undef FUNC_NAME - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ /* converts C scm_array of strings to SCM scm_list of strings. */ /* If argc < 0, a null terminated scm_array is assumed. */ - SCM scm_makfromstrs (int argc, char **argv) { @@ -191,18 +150,6 @@ scm_take0str (char *s) return scm_take_str (s, strlen (s)); } -#if (SCM_DEBUG_DEPRECATED == 0) - -SCM -scm_makfromstr (const char *src, size_t len, int dummy SCM_UNUSED) -{ - scm_c_issue_deprecation_warning ("`scm_makfromstr' is deprecated. " - "Use `scm_mem2string' instead."); - - return scm_mem2string (src, len); -} - -#endif SCM scm_mem2string (const char *src, size_t len) @@ -320,11 +267,7 @@ SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0, "@var{str}.") #define FUNC_NAME s_scm_string_set_x { -#if (SCM_DEBUG_DEPRECATED == 0) - SCM_VALIDATE_RWSTRING (1, str); -#else SCM_VALIDATE_STRING (1, str); -#endif SCM_VALIDATE_INUM_RANGE (2,k,0,SCM_STRING_LENGTH(str)); SCM_VALIDATE_CHAR (3,chr); SCM_STRING_UCHARS (str)[SCM_INUM (k)] = SCM_CHAR (chr); @@ -390,65 +333,6 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1, } #undef FUNC_NAME -#if SCM_DEBUG_DEPRECATED == 0 - -/* Explicit shared substrings will disappear from Guile. - * - * Instead, "normal" strings will be implemented using sharing - * internally, combined with a copy-on-write strategy. - */ - -SCM_DEFINE (scm_make_shared_substring, "make-shared-substring", 1, 2, 0, - (SCM str, SCM start, SCM end), - "Return a shared substring of @var{str}. The arguments are the\n" - "same as for the @code{substring} function: the shared substring\n" - "returned includes all of the text from @var{str} between\n" - "indexes @var{start} (inclusive) and @var{end} (exclusive). If\n" - "@var{end} is omitted, it defaults to the end of @var{str}. The\n" - "shared substring returned by @code{make-shared-substring}\n" - "occupies the same storage space as @var{str}.") -#define FUNC_NAME s_scm_make_shared_substring -{ - long f; - long t; - SCM answer; - SCM len_str; - - SCM_VALIDATE_ROSTRING (1,str); - SCM_VALIDATE_INUM_DEF_COPY (2,start,0,f); - SCM_VALIDATE_INUM_DEF_COPY (3,end,SCM_ROLENGTH(str),t); - - SCM_ASSERT_RANGE (2,start,(f >= 0)); - SCM_ASSERT_RANGE (3,end, (f <= t) && (t <= SCM_ROLENGTH (str))); - - SCM_NEWCELL (answer); - SCM_NEWCELL (len_str); - - SCM_DEFER_INTS; - if (SCM_SUBSTRP (str)) - { - long offset; - offset = SCM_INUM (SCM_SUBSTR_OFFSET (str)); - f += offset; - t += offset; - SCM_SETCAR (len_str, SCM_MAKINUM (f)); - SCM_SETCDR (len_str, SCM_SUBSTR_STR (str)); - SCM_SETCDR (answer, len_str); - SCM_SETLENGTH (answer, t - f, scm_tc7_substring); - } - else - { - SCM_SETCAR (len_str, SCM_MAKINUM (f)); - SCM_SETCDR (len_str, str); - SCM_SETCDR (answer, len_str); - SCM_SETLENGTH (answer, t - f, scm_tc7_substring); - } - SCM_ALLOW_INTS; - return answer; -} -#undef FUNC_NAME - -#endif /* DEPRECATED */ void scm_init_strings () diff --git a/libguile/strings.h b/libguile/strings.h index 9307a1742..dc96ef201 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -2,18 +2,19 @@ #ifndef SCM_STRINGS_H #define SCM_STRINGS_H + /* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -49,24 +50,17 @@ -#define SCM_STRINGP(x) (!SCM_IMP (x) && (SCM_TYP7S (x) == scm_tc7_string)) -#if (SCM_DEBUG_DEPRECATED == 1) +#define SCM_STRINGP(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_string)) #define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x))) #define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) -#endif #define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c))) #define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL) #define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8)) #define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_string)) -#define SCM_STRING_COERCE_0TERMINATION_X(x) \ - { if (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_substring)) \ - x = scm_mem2string (SCM_STRING_CHARS (x), SCM_STRING_LENGTH (x)); } - extern SCM scm_string_p (SCM x); -extern SCM scm_read_only_string_p (SCM x); extern SCM scm_string (SCM chrs); extern SCM scm_makfromstrs (int argc, char **argv); extern SCM scm_take_str (char *s, size_t len); @@ -85,23 +79,11 @@ extern void scm_init_strings (void); -#if (SCM_DEBUG_DEPRECATED == 0) +#if (SCM_ENABLE_DEPRECATED == 1) -#define SCM_SLOPPY_STRINGP(x) (SCM_STRINGP(x)) -#define SCM_RWSTRINGP(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_string)) -#define SCM_STRING_UCHARS(x) \ - ((SCM_TYP7 (x) == scm_tc7_substring) \ - ? (unsigned char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \ - : (unsigned char *) SCM_CELL_WORD_1 (x)) -#define SCM_STRING_CHARS(x) \ - ((SCM_TYP7 (x) == scm_tc7_substring) \ - ? (char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \ - : (char *) SCM_CELL_WORD_1 (x)) -extern SCM scm_make_shared_substring (SCM str, SCM frm, SCM to); -extern SCM scm_makstr (size_t len, int); -extern SCM scm_makfromstr (const char *src, size_t len, int); +#define SCM_STRING_COERCE_0TERMINATION_X(x) (x) -#endif /* SCM_DEBUG_DEPRECATED == 0 */ +#endif #endif /* SCM_STRINGS_H */ diff --git a/libguile/tags.h b/libguile/tags.h index 5dec122fb..6304a2625 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -2,6 +2,7 @@ #ifndef SCM_TAGS_H #define SCM_TAGS_H + /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -43,7 +44,6 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - /** This file defines the format of SCM values and cons pairs. @@ -247,19 +247,6 @@ typedef signed long scm_t_signed_bits; * * TYP7S(X) returns TYP7, but masking out the option bit S. * - * For example, all strings have 0010 in the 'xxxx' bits - * in the diagram above, the S bit says whether it's a - * substring. - * - * for example: - * S - * scm_tc7_string = G0010101 - * scm_tc7_substring = G0010111 - * - * TYP7S turns both string tags into tc7_string; thus, - * testing TYP7S against tc7_string is a quick way to - * test for any kind of string, shared or unshared. - * * Some TC7 types are subdivided into 256 subtypes giving * rise to the macros: * @@ -292,9 +279,6 @@ typedef signed long scm_t_signed_bits; -#define SCM_CELLP(x) (((sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) -#define SCM_NCELLP(x) (!SCM_CELLP (x)) - /* See numbers.h for macros relating to immediate integers. */ @@ -323,7 +307,7 @@ typedef signed long scm_t_signed_bits; #define SCM_TYP16(x) (0xffff & SCM_CELL_TYPE (x)) #define SCM_TYP16S(x) (0xfeff & SCM_CELL_TYPE (x)) -#define SCM_TYP16_PREDICATE(tag,x) (SCM_NIMP (x) && SCM_TYP16 (x) == (tag)) +#define SCM_TYP16_PREDICATE(tag,x) (!SCM_IMP (x) && SCM_TYP16 (x) == (tag)) @@ -334,9 +318,8 @@ typedef signed long scm_t_signed_bits; #define scm_tc7_vector 13 #define scm_tc7_wvect 15 -/* couple */ #define scm_tc7_string 21 -#define scm_tc7_substring 23 +/* free 23 */ /* Many of the following should be turned * into structs or smobs. We need back some @@ -542,16 +525,12 @@ extern char *scm_isymnames[]; /* defined in print.c */ -#if (SCM_DEBUG_DEPRECATED == 0) +#if (SCM_ENABLE_DEPRECATED == 1) -#define SCM_SLOPPY_CONSP(x) ((1 & SCM_CELL_TYPE (x)) == 0) -#define SCM_SLOPPY_NCONSP(x) (!SCM_SLOPPY_CONSP(x)) +#define SCM_CELLP(x) (((sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) +#define SCM_NCELLP(x) (!SCM_CELLP (x)) -#define scm_tc7_ssymbol scm_tc7_symbol -#define scm_tc7_msymbol scm_tc7_symbol -#define scm_tcs_symbols scm_tc7_symbol - -#endif /* SCM_DEBUG_DEPRECATED == 0 */ +#endif #endif /* SCM_TAGS_H */ diff --git a/libguile/variable.c b/libguile/variable.c index 7ced1e9dd..7a4763b00 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -65,33 +65,15 @@ scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate) -#if SCM_ENABLE_VCELLS -SCM_SYMBOL (sym_huh, "???"); -#endif - static SCM make_variable (SCM init) { -#if !SCM_ENABLE_VCELLS - { - SCM z; - SCM_NEWCELL (z); - SCM_SET_CELL_WORD_1 (z, SCM_UNPACK (init)); - SCM_SET_CELL_TYPE (z, scm_tc7_variable); - scm_remember_upto_here_1 (init); - return z; - } -#else - { - SCM z; - SCM cell = scm_cons (sym_huh, init); - SCM_NEWCELL (z); - SCM_SET_CELL_WORD_1 (z, SCM_UNPACK (cell)); - SCM_SET_CELL_TYPE (z, scm_tc7_variable); - scm_remember_upto_here_1 (cell); - return z; - } -#endif + SCM z; + SCM_NEWCELL (z); + SCM_SET_CELL_WORD_1 (z, SCM_UNPACK (init)); + SCM_SET_CELL_TYPE (z, scm_tc7_variable); + scm_remember_upto_here_1 (init); + return z; } SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0, @@ -165,37 +147,6 @@ SCM_DEFINE (scm_variable_bound_p, "variable-bound?", 1, 0, 0, } #undef FUNC_NAME -SCM_DEFINE (scm_variable_set_name_hint, "variable-set-name-hint!", 2, 0, 0, - (SCM var, SCM hint), - "Do not use this function.") -#define FUNC_NAME s_scm_variable_set_name_hint -{ - SCM_VALIDATE_VARIABLE (1, var); - SCM_VALIDATE_SYMBOL (2, hint); -#if SCM_ENABLE_VCELLS - SCM_SETCAR (SCM_SMOB_DATA (var), hint); -#endif - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - -#if SCM_ENABLE_VCELLS - -SCM_DEFINE (scm_builtin_variable, "builtin-variable", 1, 0, 0, - (SCM name), - "Return the built-in variable with the name @var{name}.\n" - "@var{name} must be a symbol (not a string).\n" - "Then use @code{variable-ref} to access its value.\n") -#define FUNC_NAME s_scm_builtin_variable -{ - SCM_VALIDATE_SYMBOL (1,name); - scm_c_issue_deprecation_warning ("`builtin-variable' is deprecated. " - "Use module system operations instead."); - return scm_sym2var (name, SCM_BOOL_F, SCM_BOOL_T); -} -#undef FUNC_NAME - -#endif /* SCM_ENABLE_VCELLS */ void scm_init_variable () diff --git a/libguile/variable.h b/libguile/variable.h index 577f1f820..6a6a8a04d 100644 --- a/libguile/variable.h +++ b/libguile/variable.h @@ -2,18 +2,19 @@ #ifndef SCM_VARIABLE_H #define SCM_VARIABLE_H + /* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -44,29 +45,18 @@ * If you do not wish that, delete this exception notice. */ + #include "libguile/__scm.h" #include "libguile/smob.h" - /* Variables */ -#define SCM_VARIABLEP(X) (SCM_NIMP(X) && SCM_TYP7(X) == scm_tc7_variable) - -#if !SCM_ENABLE_VCELLS -#define SCM_VARIABLE_REF(V) SCM_CELL_OBJECT_1(V) +#define SCM_VARIABLEP(X) (!SCM_IMP (X) && SCM_TYP7(X) == scm_tc7_variable) +#define SCM_VARIABLE_REF(V) SCM_CELL_OBJECT_1 (V) #define SCM_VARIABLE_SET(V,X) SCM_SET_CELL_OBJECT_1 (V, X) #define SCM_VARIABLE_LOC(V) ((SCM *) SCM_CELL_WORD_LOC ((V), 1)) -#else -#define SCM_VARVCELL(V) SCM_CELL_OBJECT_1(V) -#define SCM_UDVARIABLEP(X) (SCM_VARIABLEP(X) && SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X)))) -#define SCM_DEFVARIABLEP(X) (SCM_VARIABLEP(X) && !SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X)))) - -#define SCM_VARIABLE_REF(V) SCM_CDR(SCM_VARVCELL(V)) -#define SCM_VARIABLE_SET(V,X) SCM_SETCDR(SCM_VARVCELL(V),X) -#define SCM_VARIABLE_LOC(V) SCM_CDRLOC(SCM_VARVCELL(V)) -#endif @@ -76,10 +66,6 @@ extern SCM scm_variable_p (SCM obj); extern SCM scm_variable_ref (SCM var); extern SCM scm_variable_set_x (SCM var, SCM val); extern SCM scm_variable_bound_p (SCM var); -extern SCM scm_variable_set_name_hint (SCM var, SCM hint); -#if SCM_ENABLE_VCELLS -extern SCM scm_builtin_variable (SCM name); -#endif extern void scm_i_variable_print (SCM var, SCM port, scm_print_state *pstate); diff --git a/libguile/vports.c b/libguile/vports.c index 68ed74c15..bce6bb867 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -189,7 +189,6 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0, SCM z; SCM_VALIDATE_VECTOR_LEN (1,pv,5); SCM_VALIDATE_STRING (2, modes); - SCM_STRING_COERCE_0TERMINATION_X (modes); SCM_NEWCELL (z); SCM_DEFER_INTS; pt = scm_add_to_port_table (z); diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 8bf12a69e..c72e8380e 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,8 @@ +2001-08-31 Dirk Herrmann + + * srfi-1.scm, srfi-13.scm: Remove the defines that were needed to + trick export from the beginning of the files. + 2001-08-25 Thien-Thi Nguyen * srfi-19.scm (add-duration): Fix bug: Call `add-duration!' w/ diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm index f58c1ebfe..b4605d97c 100644 --- a/srfi/srfi-1.scm +++ b/srfi/srfi-1.scm @@ -60,20 +60,6 @@ :use-module (ice-9 session) :use-module (ice-9 receive)) -(begin-deprecated - ;; Prevent `export' from re-exporting core bindings. This behaviour - ;; of `export' is deprecated and will disappear in one of the next - ;; releases. - (define iota #f) - (define map #f) - (define map-in-order #f) - (define for-each #f) - (define list-index #f) - (define member #f) - (define delete #f) - (define delete! #f) - (define assoc #f)) - (export ;;; Constructors ;; cons <= in the core diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm index b623c405e..90e7691a0 100644 --- a/srfi/srfi-13.scm +++ b/srfi/srfi-13.scm @@ -43,19 +43,6 @@ (define-module (srfi srfi-13)) -(begin-deprecated - ;; Prevent `export' from re-exporting core bindings. This behaviour - ;; of `export' is deprecated and will disappear in one of the next - ;; releases. - (define string->list #f) - (define string-copy #f) - (define string-fill! #f) - (define string-index #f) - (define string-upcase #f) - (define string-upcase! #f) - (define string-downcase #f) - (define string-downcase! #f)) - (export ;;; Predicates ;; string? string-null? <= in the core From 569c483b32905b6be869426fd8f57309ed562b5a Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 31 Aug 2001 14:48:19 +0000 Subject: [PATCH 043/107] * Improved the readability of some patterns. --- test-suite/ChangeLog | 4 ++++ test-suite/tests/numbers.test | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index 274d7cfc7..61f4bd107 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,7 @@ +2001-08-31 Dirk Herrmann + + * tests/numbers.test: Made some of the patterns better readable. + 2001-08-25 Thien-Thi Nguyen * tests/srfi-19.test (test-time-comparision, diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test index 68f2b7477..f7863bf65 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -857,9 +857,9 @@ (pass-if "non number strings" (for-each (lambda (x) (if (string->number x) (throw 'fail))) - '("" "q" "1q" "6+7iq" "8+9q" "10+11" "13+" "18@19 " "20@q" "23@" + '("" "q" "1q" "6+7iq" "8+9q" "10+11" "13+" "18@19q" "20@q" "23@" "+25iq" "26i" "-q" "-iq" "i" "5#.0" "8/" "10#11" ".#" "." - "#o.2" "3.4q" "15.16e17q" "18.19e+q" ".a" ".17#18" "10q" "#b2" + "#o.2" "3.4q" "15.16e17q" "18.19e+q" ".q" ".17#18" "10q" "#b2" "#b3" "#b4" "#b5" "#b6" "#b7" "#b8" "#b9" "#ba" "#bb" "#bc" "#bd" "#be" "#bf" "#q" "#b#b1" "#o#o1" "#d#d1" "#x#x1" "#e#e1" "#i#i1" "12@12+0i")) From 3cc0883ec0def956152ba0884f061f21c45d9bbf Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 1 Sep 2001 04:09:05 +0000 Subject: [PATCH 044/107] (Sample GDB Initialization File): New section. --- HACKING | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/HACKING b/HACKING index 92ce83225..dd491b11b 100644 --- a/HACKING +++ b/HACKING @@ -70,6 +70,50 @@ You are lost in a little maze of automatically generated files, all different. +Sample GDB Initialization File========================================= + +Here is a sample .gdbinit posted by Bill Schottstaedt (modified to +use `set' instead of `call' in some places): + + define gp + set gdb_print($arg0) + print gdb_output + end + document gp + Executes (object->string arg) + end + + define ge + call gdb_read($arg0) + call gdb_eval(gdb_result) + set gdb_print(gdb_result) + print gdb_output + end + document ge + Executes (print (eval (read arg))): ge "(+ 1 2)" => 3 + end + + define gh + call g_help(scm_str2symbol($arg0), 20) + set gdb_print($1) + print gdb_output + end + document gh + Prints help string for arg: gh "enved-target" + end + +Bill further writes: + + so in gdb if you see something useless like: + + #32 0x081ae8f4 in scm_primitive_load (filename=1112137128) at load.c:129 + + You can get the file name with gp: + + (gdb) gp 1112137128 + $1 = 0x40853fac "\"/home/bil/test/share/guile/1.5.0/ice-9/session.scm\"" + + Contributing Your Changes ============================================ - If you have put together a change that meets the coding standards From f2bd150b2de4a519e0ba50647164cf80e2f8b72b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 1 Sep 2001 04:10:21 +0000 Subject: [PATCH 045/107] (1.8.0): Add "move .gdbinit" entry. --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 9803054dd..e9f03ea2d 100644 --- a/TODO +++ b/TODO @@ -64,6 +64,8 @@ See also file HACKING. === Before releasing 1.8.0: +- Move sample .gdbinit in HACKING to somewhere more appropriate (manual?). + - Make sure we have appropriate interface numbers for shared libraries, and that we document and use the libtool conventions. [rlb]. From 6f84677a95883a0301978b51a7fb4d8c5f362f8d Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 1 Sep 2001 04:13:14 +0000 Subject: [PATCH 046/107] *** empty log message *** --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8967d93f9..142759933 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-08-31 Thien-Thi Nguyen + + * HACKING (Sample GDB Initialization File): New section. + + * TODO (1.8.0): Add "move .gdbinit" entry. + 2001-08-31 Dirk Herrmann * TODO: Added some points, and eliminated all done items. From b10586f098fd7d0303bc605de35af1ec4da68a29 Mon Sep 17 00:00:00 2001 From: Michael Livshin Date: Sat, 1 Sep 2001 17:17:50 +0000 Subject: [PATCH 047/107] * 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! --- libguile/ChangeLog | 9 ++++++++ libguile/num2integral.i.c | 8 ++++--- libguile/numbers.c | 46 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index b886a422f..4bbc49584 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/libguile/num2integral.i.c b/libguile/num2integral.i.c index e0982bac3..65afa2603 100644 --- a/libguile/num2integral.i.c +++ b/libguile/num2integral.i.c @@ -47,8 +47,10 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) res = new; } -#ifndef UNSIGNED if (SCM_BIGSIGN (num)) +#ifdef UNSIGNED + scm_out_of_range (s_caller, num); +#else { res = -res; if (res <= 0) @@ -56,6 +58,7 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) else scm_out_of_range (s_caller, num); } +#endif else { if (res >= 0) @@ -63,8 +66,7 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) else scm_out_of_range (s_caller, num); } -#endif - + return res; } else if (SCM_REALP (num)) diff --git a/libguile/numbers.c b/libguile/numbers.c index 3bead8ce6..266d09932 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -4407,6 +4407,52 @@ check_sanity () #endif } +#undef CHECK + +#define CHECK \ + scm_internal_catch (SCM_BOOL_T, check_body, &data, check_handler, &data); \ + if (!SCM_FALSEP (data)) abort(); + +static SCM +check_body (void *data) +{ + SCM num = *(SCM *) data; + scm_num2ulong (num, 1, NULL); + + return SCM_UNSPECIFIED; +} + +static SCM +check_handler (void *data, SCM tag, SCM throw_args) +{ + SCM *num = (SCM *) data; + *num = SCM_BOOL_F; + + return SCM_UNSPECIFIED; +} + +SCM_DEFINE (scm_sys_check_number_conversions, "%check-number-conversions", 0, 0, 0, + (), + "Number conversion sanity checking.") +#define FUNC_NAME s_scm_sys_check_number_conversions +{ + SCM data = SCM_MAKINUM (-1); + CHECK; + data = scm_int2num (INT_MIN); + CHECK; + data = scm_ulong2num (ULONG_MAX); + data = scm_difference (SCM_INUM0, data); + CHECK; + data = scm_ulong2num (ULONG_MAX); + data = scm_sum (SCM_MAKINUM (1), data); data = scm_difference (SCM_INUM0, data); + CHECK; + data = scm_int2num (-10000); data = scm_product (data, data); data = scm_product (data, data); + CHECK; + + return SCM_UNSPECIFIED; +} +#undef FUNC_NAME + #endif void From a2971fa9905c5b5e2904da646447f8f8383e76fc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 4 Sep 2001 19:32:43 +0000 Subject: [PATCH 048/107] Use outline mode instead of text. Reword protocol explanation. Add "make error-signalling functions more consistent" to Eventually. Move some C-related GOOPS tasks to 1.8.0, take ownership. --- TODO | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/TODO b/TODO index e9f03ea2d..6890d3d17 100644 --- a/TODO +++ b/TODO @@ -1,23 +1,22 @@ --*-text-*- +The Guile TODO List (actually, an -*-outline-*-) + +* Protocol These TODO items are grouped by target release version. The first group is the "Eventually" group, which is not associated w/ any particular version. -Move these items under a version upon completion (or better yet, ownership). +Items should be initially added to this group, and then later moved under a +version upon either ownership or sponsorship. + +Maintainers (w/ write privs) indicate ownership by `[USERNAME]'. Use +`[ACTUAL-OWNER:MAINTAINER]' to indicate sponsorship, where both elements are +usernames. Upon completion, simply change the "-" to a "+", but do not delete the item. At release time, the "+" entries will be deleted after review to make sure -that user-visible changes are reflected in NEWS (and that proper credit is -applied :-). +that user-visible changes are reflected in NEWS. -Ownership is indicated by `[USERNAME]'. Maintainers (w/ write privs) can -indicate sponsorship by `[ACTUAL-OWNER:MAINTAINER]', where both elements are -usernames. -See also file HACKING. - ------------------------------------------------------------------------------- - -=== Eventually: +* Eventually - [after signal handling and threading have been fixed] remove the code corresponding to GUILE_OLD_ASYNC_CLICK and the corresponding @@ -30,11 +29,7 @@ See also file HACKING. - revise the fluid implementation - implement the GC thread synchronization (all threads: go to sleep!) - implementing the libguileposix threads glue library -- GOOPS - - develop better representation for GOOPS objects - - rewrite method cache management in C - - rewrite core macros (define-class et al) in C - - define C API +- develop better representation for GOOPS objects - write Orbit CORBA interface - [after new module system] factor out modules sort.c and random.c should be factored out into separate modules @@ -61,8 +56,15 @@ See also file HACKING. implement the symbol->string semantics of R5RS. - implement internationalized strings - revise the uniform vector implementation +- make the set of error signalling functions more consistent -=== Before releasing 1.8.0: + +* Before releasing 1.8.0: + +- For GOOPS: [ttn] + - rewrite method cache management in C + - rewrite core macros (define-class et al) in C + - define C API - Move sample .gdbinit in HACKING to somewhere more appropriate (manual?). @@ -76,9 +78,11 @@ See also file HACKING. - Start a new THANKS file. -=== Before releasing 1.10.0: + +* Before releasing 1.10.0: - in boot-9.scm: remove deprecated function `feature?´. + [TODO ends here] From 06288138bae09a159c159af62c4576ebe69556fb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 4 Sep 2001 19:36:18 +0000 Subject: [PATCH 049/107] *** empty log message *** --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 142759933..61b2cc7df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-09-04 Thien-Thi Nguyen + + * TODO: + Use outline mode instead of text. + Reword protocol explanation. + Add "make error-signalling functions more consistent" to Eventually. + Move some C-related GOOPS tasks to 1.8.0, take ownership. + 2001-08-31 Thien-Thi Nguyen * HACKING (Sample GDB Initialization File): New section. From 5e7248f27240cc18eb57d979a2fbbda25e9c7a2d Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 6 Sep 2001 11:11:31 +0000 Subject: [PATCH 050/107] (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. --- libguile/gc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libguile/gc.c b/libguile/gc.c index f9c7be170..5629e9605 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1059,8 +1059,6 @@ scm_igc (const char *what) /* During the critical section, only the current thread may run. */ SCM_CRITICAL_SECTION_START; - /* fprintf (stderr, "gc: %s\n", what); */ - if (!scm_stack_base || scm_block_gc) { --scm_gc_running_p; @@ -1985,11 +1983,15 @@ scm_must_malloc (size_t size, const char *what) if (NULL != ptr) { scm_mallocated = nm; + if (nm > scm_mtrigger - SCM_MTRIGGER_HYSTERESIS) { + unsigned long old_trigger = scm_mtrigger; if (nm > scm_mtrigger) scm_mtrigger = nm + nm / 2; else scm_mtrigger += scm_mtrigger / 2; + if (scm_mtrigger < old_trigger) + abort (); } #ifdef GUILE_DEBUG_MALLOC scm_malloc_register (ptr, what); @@ -2053,10 +2055,13 @@ scm_must_realloc (void *where, { scm_mallocated = nm; if (nm > scm_mtrigger - SCM_MTRIGGER_HYSTERESIS) { + unsigned long old_trigger = scm_mtrigger; if (nm > scm_mtrigger) scm_mtrigger = nm + nm / 2; else scm_mtrigger += scm_mtrigger / 2; + if (scm_mtrigger < old_trigger) + abort (); } #ifdef GUILE_DEBUG_MALLOC scm_malloc_reregister (where, ptr, what); @@ -2158,7 +2163,7 @@ scm_done_free (long size) scm_mallocated, which underflowed. */ abort (); } else { - unsigned long nm = scm_mallocated + size; + unsigned long nm = scm_mallocated - size; if (nm < size) /* The byte count of allocated objects has overflowed. This is probably because you forgot to report the correct size of freed From a0d34a0be15a3314c87691d9d951a6ede10523de Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 6 Sep 2001 11:13:27 +0000 Subject: [PATCH 051/107] *** empty log message *** --- libguile/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4bbc49584..9578ccc34 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +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, From 05326ffd93421fce578fac8536766d28d41d1302 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 8 Sep 2001 02:30:20 +0000 Subject: [PATCH 052/107] (process-options, getopt-long): Fix omission bug: Handle multiple occurrances of an option. --- ice-9/getopt-long.scm | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/ice-9/getopt-long.scm b/ice-9/getopt-long.scm index 40fd4c4df..66a723ee5 100644 --- a/ice-9/getopt-long.scm +++ b/ice-9/getopt-long.scm @@ -301,7 +301,14 @@ (let loop ((argument-ls argument-ls) (found '()) (etc '())) (let ((eat! (lambda (spec ls) (let ((val!loop (lambda (val n-ls n-found n-etc) - (set-option-spec-value! spec val) + (set-option-spec-value! + spec + ;; handle multiple occurrances + (cond ((option-spec->value spec) + => (lambda (cur) + ((if (list? cur) cons list) + val cur))) + (else val))) (loop n-ls n-found n-etc))) (ERR:no-arg (lambda () (error (string-append @@ -417,10 +424,22 @@ to add a `single-char' clause to the option description." (and pred (pred name val))))) specifications) (cons (cons '() rest-ls) - (map (lambda (spec) - (cons (string->symbol (option-spec->name spec)) - (option-spec->value spec))) - found)))) + (let ((multi-count (map (lambda (desc) + (cons (car desc) 0)) + option-desc-list))) + (map (lambda (spec) + (let ((name (string->symbol (option-spec->name spec)))) + (cons name + ;; handle multiple occurrances + (let ((maybe-ls (option-spec->value spec))) + (if (list? maybe-ls) + (let* ((look (assq name multi-count)) + (idx (cdr look)) + (val (list-ref maybe-ls idx))) + (set-cdr! look (1+ idx)) ; ugh! + val) + maybe-ls))))) + found))))) (define (option-ref options key default) "Return value in alist OPTIONS using KEY, a symbol; or DEFAULT if not found. From 4b642b08d4b945962d04d5e8cd45e472404d8593 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 8 Sep 2001 02:33:30 +0000 Subject: [PATCH 053/107] ("apples-blimps-catalexis example", "multiple occurances"): New top-level sections. --- test-suite/tests/getopt-long.test | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/test-suite/tests/getopt-long.test b/test-suite/tests/getopt-long.test index f40fa5fb1..fcfe8905f 100644 --- a/test-suite/tests/getopt-long.test +++ b/test-suite/tests/getopt-long.test @@ -208,4 +208,67 @@ ) +(with-test-prefix "apples-blimps-catalexis example" + + (define (test8 . args) + (equal? (sort (getopt-long (cons "foo" args) + '((apples (single-char #\a)) + (blimps (single-char #\b) (value #t)) + (catalexis (single-char #\c) (value #t)))) + (lambda (a b) + (cond ((null? (car a)) #t) + ((null? (car b)) #f) + (else (stringstring (car a)) + (symbol->string (car b))))))) + '((()) + (apples . #t) + (blimps . "bang") + (catalexis . "couth")))) + + (pass-if "normal 1" (test8 "-a" "-b" "bang" "-c" "couth")) + (pass-if "normal 2" (test8 "-ab" "bang" "-c" "couth")) + (pass-if "normal 3" (test8 "-ac" "couth" "-b" "bang")) + + (pass-if-exception "bad ordering causes missing option" + exception:option-must-have-arg + (test8 "-abc" "couth" "bang")) + + ) + +(with-test-prefix "multiple occurrances" + + (define (test9 . args) + (equal? (getopt-long (cons "foo" args) + '((inc (single-char #\I) (value #t)) + (foo (single-char #\f)))) + '((()) (inc . "2") (foo . #t) (inc . "1")))) + + ;; terminology: + ;; sf -- single-char free + ;; sa -- single-char abutted + ;; lf -- long free + ;; la -- long abutted (using "=") + + (pass-if "sf/sf" (test9 "-I" "1" "-f" "-I" "2")) + (pass-if "sa/sa" (test9 "-I1" "-f" "-I2")) + (pass-if "sf/sa" (test9 "-I" "1" "-f" "-I2")) + (pass-if "sa/sf" (test9 "-I1" "-f" "-I" "2")) + + (pass-if "lf/lf" (test9 "--inc" "1" "-f" "--inc" "2")) + (pass-if "la/la" (test9 "--inc=1" "-f" "--inc=2")) + (pass-if "lf/la" (test9 "--inc" "1" "-f" "--inc=2")) + (pass-if "la/lf" (test9 "--inc=1" "-f" "--inc" "2")) + + (pass-if "sf/lf" (test9 "-I" "1" "-f" "--inc" "2")) + (pass-if "lf/sf" (test9 "--inc" "1" "-f" "-I" "2")) + (pass-if "sf/la" (test9 "-I" "1" "-f" "--inc=2")) + (pass-if "la/sf" (test9 "--inc=1" "-f" "-I" "2")) + + (pass-if "sa/lf" (test9 "-I1" "-f" "--inc" "2")) + (pass-if "lf/sa" (test9 "--inc" "1" "-f" "-I2")) + (pass-if "sa/la" (test9 "-I1" "-f" "--inc=2")) + (pass-if "la/sa" (test9 "--inc=1" "-f" "-I2")) + + ) + ;;; getopt-long.test ends here From 95e2cd37e96ca3f91f397233736f79dce6eacdf3 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 8 Sep 2001 02:34:27 +0000 Subject: [PATCH 054/107] *** empty log message *** --- ice-9/ChangeLog | 6 ++++++ test-suite/ChangeLog | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 842a8d90b..af1af1d35 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,9 @@ +2001-09-07 Thien-Thi Nguyen + + * getopt-long.scm (process-options, getopt-long): Fix omission + bug: Handle multiple occurrances of an option. Thanks to Daniel + Skarda. + 2001-08-31 Dirk Herrmann * boot-9.scm: Don't load module (ice-9 rdelim). diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index 61f4bd107..75bcb0db1 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,8 @@ +2001-09-07 Thien-Thi Nguyen + + * tests/getopt-long.test ("apples-blimps-catalexis example", + "multiple occurances"): New top-level sections. + 2001-08-31 Dirk Herrmann * tests/numbers.test: Made some of the patterns better readable. From 4a69c751efc2c7e587180250428fb686084782ff Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 9 Sep 2001 00:59:02 +0000 Subject: [PATCH 055/107] (lambda*): Record the broken-down argument list in the `arglist' procedure property. --- ice-9/optargs.scm | 51 ++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/ice-9/optargs.scm b/ice-9/optargs.scm index b098bc4f9..47e1a5045 100644 --- a/ice-9/optargs.scm +++ b/ice-9/optargs.scm @@ -252,7 +252,7 @@ (parse-arglist ARGLIST (lambda (non-optional-args optionals keys aok? rest-arg) - ; Check for syntax errors. + ;; Check for syntax errors. (if (not (every? symbol? non-optional-args)) (error "Syntax error in fixed argument declaration.")) (if (not (every? ext-decl? optionals)) @@ -262,27 +262,36 @@ (if (not (or (symbol? rest-arg) (eq? #f rest-arg))) (error "Syntax error in rest argument declaration.")) ;; generate the code. - (let ((rest-gensym (or rest-arg (gensym "lambda*:G")))) + (let ((rest-gensym (or rest-arg (gensym "lambda*:G"))) + (lambda-gensym (gensym "lambda*:L"))) (if (not (and (null? optionals) (null? keys))) - `(lambda (,@non-optional-args . ,rest-gensym) - ;; Make sure that if the proc had a docstring, we put it - ;; here where it will be visible. - ,@(if (and (not (null? BODY)) - (string? (car BODY))) - (list (car BODY)) - '()) - (let-optional* - ,rest-gensym - ,optionals - (let-keywords* ,rest-gensym - ,aok? - ,keys - ,@(if (and (not rest-arg) (null? keys)) - `((if (not (null? ,rest-gensym)) - (error "Too many arguments."))) - '()) - (let () - ,@BODY)))) + `(let ((,lambda-gensym + (lambda (,@non-optional-args . ,rest-gensym) + ;; Make sure that if the proc had a docstring, we put it + ;; here where it will be visible. + ,@(if (and (not (null? BODY)) + (string? (car BODY))) + (list (car BODY)) + '()) + (let-optional* + ,rest-gensym + ,optionals + (let-keywords* ,rest-gensym + ,aok? + ,keys + ,@(if (and (not rest-arg) (null? keys)) + `((if (not (null? ,rest-gensym)) + (error "Too many arguments."))) + '()) + (let () + ,@BODY)))))) + (set-procedure-property! ,lambda-gensym 'arglist + '(,non-optional-args + ,optionals + ,keys + ,aok? + ,rest-arg)) + ,lambda-gensym) `(lambda (,@non-optional-args . ,(if rest-arg rest-arg '())) ,@BODY)))))) From c7bb434f2f409cdfa8bea000b72390b6bdd023c4 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 9 Sep 2001 01:00:30 +0000 Subject: [PATCH 056/107] (arity): Use new `arglist' procedure property to present a more detailed argument list. --- ice-9/session.scm | 116 +++++++++++++++++++++++++++++++--------------- 1 file changed, 79 insertions(+), 37 deletions(-) diff --git a/ice-9/session.scm b/ice-9/session.scm index 5b2b6e720..23ae667f6 100644 --- a/ice-9/session.scm +++ b/ice-9/session.scm @@ -400,43 +400,85 @@ It is an image under the mapping EXTRACT." (else #f))) (define-public (arity obj) - (let ((arity (procedure-property obj 'arity))) - (display (car arity)) - (cond ((caddr arity) - (display " or more")) - ((not (zero? (cadr arity))) - (display " required and ") - (display (cadr arity)) - (display " optional"))) - (if (and (not (caddr arity)) - (= (car arity) 1) - (<= (cadr arity) 1)) - (display " argument") - (display " arguments")) - (if (closure? obj) - (let ((formals (cadr (procedure-source obj)))) - (if (pair? formals) - (begin - (display ": `") - (display (car formals)) - (let loop ((ls (cdr formals))) - (cond ((null? ls) - (display #\')) - ((not (pair? ls)) - (display "', the rest in `") - (display ls) - (display #\')) - (else - (if (pair? (cdr ls)) - (display "', `") - (display "' and `")) - (display (car ls)) - (loop (cdr ls)))))) - (begin - (display " in `") - (display formals) - (display #\'))))) - (display ".\n"))) + (define (display-arg-list arg-list) + (display #\`) + (display (car arg-list)) + (let loop ((ls (cdr arg-list))) + (cond ((null? ls) + (display #\')) + ((not (pair? ls)) + (display "', the rest in `") + (display ls) + (display #\')) + (else + (if (pair? (cdr ls)) + (display "', `") + (display "' and `")) + (display (car ls)) + (loop (cdr ls)))))) + (define (display-arg-list/summary arg-list type) + (let ((len (length arg-list))) + (display len) + (display " ") + (display type) + (if (> len 1) + (display " arguments: ") + (display " argument: ")) + (display-arg-list arg-list))) + (cond + ((procedure-property obj 'arglist) + => (lambda (arglist) + (let ((required-args (car arglist)) + (optional-args (cadr arglist)) + (keyword-args (caddr arglist)) + (allow-other-keys? (cadddr arglist)) + (rest-arg (car (cddddr arglist))) + (need-punctuation #f)) + (cond ((not (null? required-args)) + (display-arg-list/summary required-args "required") + (set! need-punctuation #t))) + (cond ((not (null? optional-args)) + (if need-punctuation (display ", ")) + (display-arg-list/summary optional-args "optional") + (set! need-punctuation #t))) + (cond ((not (null? keyword-args)) + (if need-punctuation (display ", ")) + (display-arg-list/summary keyword-args "keyword") + (set! need-punctuation #t))) + (cond (allow-other-keys? + (if need-punctuation (display ", ")) + (display "other keywords allowed") + (set! need-punctuation #t))) + (cond (rest-arg + (if need-punctuation (display ", ")) + (display "the rest in `") + (display rest-arg) + (display "'")))))) + (else + (let ((arity (procedure-property obj 'arity))) + (display (car arity)) + (cond ((caddr arity) + (display " or more")) + ((not (zero? (cadr arity))) + (display " required and ") + (display (cadr arity)) + (display " optional"))) + (if (and (not (caddr arity)) + (= (car arity) 1) + (<= (cadr arity) 1)) + (display " argument") + (display " arguments")) + (if (closure? obj) + (let ((formals (cadr (procedure-source obj)))) + (cond + ((pair? formals) + (display ": ") + (display-arg-list formals)) + (else + (display " in `") + (display formals) + (display #\')))))))) + (display ".\n")) (define-public system-module (procedure->syntax From 2851e5bc70ff79d2ba9c4a5bc4e2ac920bb45ba9 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 9 Sep 2001 01:03:43 +0000 Subject: [PATCH 057/107] *** empty log message *** --- ice-9/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index af1af1d35..0deee679e 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,12 @@ +2001-09-08 Thien-Thi Nguyen + + * optargs.scm (lambda*): Record the broken-down argument list in + the `arglist' procedure property. + * session.scm (arity): Use new `arglist' procedure property to + present a more detailed argument list. + + Thanks to Matthias Köppe! + 2001-09-07 Thien-Thi Nguyen * getopt-long.scm (process-options, getopt-long): Fix omission From 998bfc70f0e7692d40a9fc7b250aa1b7c4ad62dc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 9 Sep 2001 01:09:24 +0000 Subject: [PATCH 058/107] Add `arity' enhancement news. --- NEWS | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/NEWS b/NEWS index 5d8c5ff4b..8fc593a06 100644 --- a/NEWS +++ b/NEWS @@ -776,6 +776,32 @@ Note that the "5d" is dropped. Now it is like so: This enables single-char options to have adjoining arguments as long as their constituent characters are not potential single-char options. +** (ice-9 session) procedure `arity' now works with (ice-9 optargs) `lambda*' + +The `lambda*' and derivative forms in (ice-9 optargs) now set a procedure +property `arglist', which can be retrieved by `arity'. The result is that +`arity' can give more detailed information than before: + +Before: + + guile> (use-modules (ice-9 optargs)) + guile> (define* (foo #:optional a b c) a) + guile> (arity foo) + 0 or more arguments in `lambda*:G0'. + +After: + + guile> (arity foo) + 3 optional arguments: `a', `b' and `c'. + guile> (define* (bar a b #:key c d #:allow-other-keys) a) + guile> (arity bar) + 2 required arguments: `a' and `b', 2 keyword arguments: `c' + and `d', other keywords allowed. + guile> (define* (baz a b #:optional c #:rest r) a) + guile> (arity baz) + 2 required arguments: `a' and `b', 1 optional argument: `c', + the rest in `r'. + * Changes to the C interface ** Types have been renamed from scm_*_t to scm_t_*. From 6ddd941279dd6255ce5790b1b30247953092b06b Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Wed, 12 Sep 2001 19:15:33 +0000 Subject: [PATCH 059/107] 2001-09-12 Gary Houston * srfi-1.scm (filter): change "caller" to "filter" in check-arg-type. --- srfi/ChangeLog | 4 ++++ srfi/srfi-1.scm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index c72e8380e..f5691433e 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,7 @@ +2001-09-12 Gary Houston + + * srfi-1.scm (filter): change "caller" to "filter" in check-arg-type. + 2001-08-31 Dirk Herrmann * srfi-1.scm, srfi-13.scm: Remove the defines that were needed to diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm index b4605d97c..badd967fc 100644 --- a/srfi/srfi-1.scm +++ b/srfi/srfi-1.scm @@ -718,7 +718,7 @@ ;;; Filtering & partitioning (define (filter pred list) - (check-arg-type list? list "caller") ; reject circular lists. + (check-arg-type list? list "filter") ; reject circular lists. (letrec ((filiter (lambda (pred rest result) (if (null? rest) (reverse! result) From b00418df099b1c8d59a36834809d54902aa56d5d Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Wed, 12 Sep 2001 19:53:57 +0000 Subject: [PATCH 060/107] * Added function scm_str2string. Thanks to Martin Baulig. --- NEWS | 7 +++++++ THANKS | 51 ---------------------------------------------- TODO | 2 -- libguile/ChangeLog | 4 ++++ libguile/strings.c | 8 ++++++++ libguile/strings.h | 1 + 6 files changed, 20 insertions(+), 53 deletions(-) diff --git a/NEWS b/NEWS index 8fc593a06..d740f0ac3 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,13 @@ Previously, comparing two variables with `equal?' would recursivly compare their values. This is no longer done. Variables are now only `equal?' if they are `eq?'. +* Changes to the C interface + +** New function: scm_str2string + +This function creates a scheme string from a 0-terminated C string. The input +string is copied. + Changes since Guile 1.4: * Changes to the distribution diff --git a/THANKS b/THANKS index 872e63b53..337bd168d 100644 --- a/THANKS +++ b/THANKS @@ -7,58 +7,7 @@ The Guile maintainer committee consists of Contributors since the last release: - Jost Boekemeier - Rob Browning - Will Fitzgerald - Martin Grabmueller - Dirk Herrmann - Gary Houston - Neil Jerram - Matthias Koeppe - Michael Livshin - Thien-Thi Nguyen - Keisuke Nishida - Niibe Yutaka For fixes or providing information which led to a fix: - Lars J. Aas Martin Baulig - Ian Bicking - Quetzalcoatl Bradley - George Caswell - Albert Chin - Chris Cramer - I. N. Golubev - Eric Hanchrow - Utz-Uwe Haus - Karl M. Hegbloom - Anders Holst - Stefan Jahn - Steven G. Johnson - Richard Kim - Alexander Klimov - Brad Knotwell - Bruce Korb - Matthias Köppe - Ralf Mattes - Shuji Narazaki - Han-Wen Nienhuys - Bertrand Petit - David Pirotte - Sergey Poznyakoff - Ariel Rios - Julian Satchell - Bill Schottstaedt - Alex Shinn - Miroslav Silovic - Daniel Skarda - Dale P. Smith - Masao Uebayashi - Bernard Urban - Jacques A. Vidrine. - Brett Viren - Thomas Wawrzinek - Florian Weimer - Keith Wright - diff --git a/TODO b/TODO index 6890d3d17..00a58ce32 100644 --- a/TODO +++ b/TODO @@ -76,8 +76,6 @@ that user-visible changes are reflected in NEWS. - Start a new section of the NEWS file. -- Start a new THANKS file. - * Before releasing 1.10.0: diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 9578ccc34..e591bc7be 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/libguile/strings.c b/libguile/strings.c index 4d6201d5b..41cb50005 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -162,6 +162,14 @@ scm_mem2string (const char *src, size_t len) return s; } + +SCM +scm_str2string (const char *src) +{ + return scm_mem2string (src, strlen (src)); +} + + SCM scm_makfrom0str (const char *src) { diff --git a/libguile/strings.h b/libguile/strings.h index dc96ef201..319568ab8 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -66,6 +66,7 @@ extern SCM scm_makfromstrs (int argc, char **argv); extern SCM scm_take_str (char *s, size_t len); extern SCM scm_take0str (char *s); extern SCM scm_mem2string (const char *src, size_t len); +extern SCM scm_str2string (const char *src); extern SCM scm_makfrom0str (const char *src); extern SCM scm_makfrom0str_opt (const char *src); extern SCM scm_allocate_string (size_t len); From c3c4d80154dba4a9be2961f370648feb4f10fcba Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 13 Sep 2001 21:22:37 +0000 Subject: [PATCH 061/107] * Fixed some typing bugs. Thanks to Rob Browning. --- THANKS | 1 + libguile/ChangeLog | 7 +++++++ libguile/backtrace.c | 14 +++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/THANKS b/THANKS index 337bd168d..0c90ca398 100644 --- a/THANKS +++ b/THANKS @@ -11,3 +11,4 @@ Contributors since the last release: For fixes or providing information which led to a fix: Martin Baulig + Rob Browning diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e591bc7be..7e98f15d3 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/libguile/backtrace.c b/libguile/backtrace.c index f391a32e8..39d7563ac 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -460,14 +460,14 @@ display_backtrace_file (frame, last_file, port, pstate) display_backtrace_get_file_line (frame, &file, &line); - if (file == *last_file) + if (SCM_EQ_P (file, *last_file)) return; *last_file = file; scm_puts ("In ", port); - if (file == SCM_BOOL_F) - if (line == SCM_BOOL_F) + if (SCM_FALSEP (file)) + if (SCM_FALSEP (line)) scm_puts ("unknown file", port); else scm_puts ("current input", port); @@ -489,9 +489,9 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) if (SCM_EQ_P (SCM_SHOW_FILE_NAME, sym_base)) { - if (file == SCM_BOOL_F) + if (SCM_FALSEP (file)) { - if (line == SCM_BOOL_F) + if (SCM_FALSEP (line)) scm_putc ('?', port); else scm_puts ("", port); @@ -506,7 +506,7 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) scm_putc (':', port); } - else if (line != SCM_BOOL_F) + else if (!SCM_FALSEP (line)) { int i, j=0; for (i = SCM_INUM (line)+1; i > 0; i = i/10, j++) @@ -514,7 +514,7 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) indent (4-j, port); } - if (line == SCM_BOOL_F) + if (SCM_FALSEP (line)) scm_puts (" ?", port); else scm_intprint (SCM_INUM (line) + 1, 10, port); From 22ba637b1286fedf674a76bc80f32722f66169fd Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 13 Sep 2001 21:58:15 +0000 Subject: [PATCH 062/107] * Simplified handling of static glocal SCM variable. --- libguile/ChangeLog | 7 +++++++ libguile/guardians.c | 15 +++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 7e98f15d3..59dbe7efc 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +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, diff --git a/libguile/guardians.c b/libguile/guardians.c index c54395a20..edc07931f 100644 --- a/libguile/guardians.c +++ b/libguile/guardians.c @@ -464,8 +464,8 @@ mark_dependencies_in_tconc (tconc_t *tc) complain about it later. */ *prev_ptr = next_pair; SCM_SETGCMARK (pair); - SCM_SETCDR (pair, SCM_CDR (self_centered_zombies)); - SCM_SETCDR (self_centered_zombies, pair); + SCM_SETCDR (pair, self_centered_zombies); + self_centered_zombies = pair; } else { @@ -595,21 +595,21 @@ whine_about_self_centered_zombies (void *dummy1 SCM_UNUSED, void *dummy2 SCM_UNUSED, void *dummy3 SCM_UNUSED) { - if (! SCM_NULLP (SCM_CDR (self_centered_zombies))) + if (!SCM_NULLP (self_centered_zombies)) { SCM pair; scm_puts ("** WARNING: the following guarded objects were unguarded due to cycles:", scm_cur_errp); scm_newline (scm_cur_errp); - for (pair = SCM_CDR (self_centered_zombies); - ! SCM_NULLP (pair); pair = SCM_CDR (pair)) + for (pair = self_centered_zombies; + !SCM_NULLP (pair); pair = SCM_CDR (pair)) { scm_display (SCM_CAR (pair), scm_cur_errp); scm_newline (scm_cur_errp); } - SCM_SETCDR (self_centered_zombies, SCM_EOL); + self_centered_zombies = SCM_EOL; } return 0; @@ -627,8 +627,7 @@ scm_init_guardians () scm_c_hook_add (&scm_before_mark_c_hook, guardian_gc_init, 0, 0); scm_c_hook_add (&scm_before_sweep_c_hook, guardian_zombify, 0, 0); - self_centered_zombies = - scm_permanent_object (scm_cons (SCM_UNDEFINED, SCM_EOL)); + scm_gc_register_root (&self_centered_zombies); scm_c_hook_add (&scm_after_gc_c_hook, whine_about_self_centered_zombies, 0, 0); From 455c0ac82b288f254b3da7a93ae275594e5def87 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 13 Sep 2001 22:29:44 +0000 Subject: [PATCH 063/107] * Some renamings and minor fixes. --- libguile/ChangeLog | 13 ++++++++ libguile/guardians.c | 75 +++++++++++++++++++++----------------------- 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 59dbe7efc..b1c43c756 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,16 @@ +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, diff --git a/libguile/guardians.c b/libguile/guardians.c index edc07931f..4703bee74 100644 --- a/libguile/guardians.c +++ b/libguile/guardians.c @@ -39,7 +39,6 @@ * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ - /* This is an implementation of guardians as described in @@ -76,19 +75,19 @@ so that no synchronization between these needs to take place. */ -typedef struct tconc_t +typedef struct t_tconc { SCM head; SCM tail; -} tconc_t; +} t_tconc; #define TCONC_EMPTYP(tc) (SCM_EQ_P ((tc).head, (tc).tail)) #define TCONC_IN(tc, obj, pair) \ do { \ SCM_SETCAR ((tc).tail, obj); \ - SCM_SET_CELL_WORD_0 (pair, SCM_BOOL_F); \ SCM_SET_CELL_WORD_1 (pair, SCM_EOL); \ + SCM_SET_CELL_WORD_0 (pair, SCM_BOOL_F); \ SCM_SETCDR ((tc).tail, pair); \ (tc).tail = pair; \ } while (0) @@ -102,16 +101,16 @@ do { \ static scm_t_bits tc16_guardian; -typedef struct guardian_t +typedef struct t_guardian { - tconc_t live; - tconc_t zombies; - struct guardian_t *next; + t_tconc live; + t_tconc zombies; + struct t_guardian *next; unsigned long flags; -} guardian_t; +} t_guardian; #define GUARDIAN_P(x) SCM_SMOB_PREDICATE(tc16_guardian, x) -#define GUARDIAN(x) ((guardian_t *) SCM_CELL_WORD_1 (x)) +#define GUARDIAN_DATA(x) ((t_guardian *) SCM_CELL_WORD_1 (x)) #define F_GREEDY 1L #define F_LISTED (1L << 1) @@ -129,8 +128,8 @@ typedef struct guardian_t /* during the gc mark phase, live guardians are linked into the lists here. */ -static guardian_t *greedy_guardians = NULL; -static guardian_t *sharing_guardians = NULL; +static t_guardian *greedy_guardians = NULL; +static t_guardian *sharing_guardians = NULL; static SCM greedily_guarded_whash = SCM_EOL; @@ -141,7 +140,7 @@ static SCM self_centered_zombies = SCM_EOL; static void -add_to_live_list (guardian_t *g) +add_to_live_list (t_guardian *g) { if (LISTED_P (g)) return; @@ -164,7 +163,7 @@ add_to_live_list (guardian_t *g) static SCM guardian_mark (SCM ptr) { - add_to_live_list (GUARDIAN (ptr)); + add_to_live_list (GUARDIAN_DATA (ptr)); /* the objects protected by the guardian are not marked here: that would prevent them from ever getting collected. instead marking @@ -176,15 +175,15 @@ guardian_mark (SCM ptr) static size_t guardian_free (SCM ptr) { - scm_must_free (GUARDIAN (ptr)); - return sizeof (guardian_t); + scm_must_free (GUARDIAN_DATA (ptr)); + return sizeof (t_guardian); } static int guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED) { - guardian_t *g = GUARDIAN (guardian); + t_guardian *g = GUARDIAN_DATA (guardian); scm_puts ("#<", port); @@ -226,7 +225,7 @@ guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED) static SCM guardian_apply (SCM guardian, SCM obj, SCM throw_p) { - if (DESTROYED_P (GUARDIAN (guardian))) + if (DESTROYED_P (GUARDIAN_DATA (guardian))) scm_misc_error ("guard", "attempted use of destroyed guardian: ~A", scm_list_1 (guardian)); @@ -234,7 +233,7 @@ guardian_apply (SCM guardian, SCM obj, SCM throw_p) return scm_guard (guardian, obj, (SCM_UNBNDP (throw_p) ? 1 - : SCM_NFALSEP (throw_p))); + : !SCM_FALSEP (throw_p))); else return scm_get_one_zombie (guardian); } @@ -243,7 +242,7 @@ guardian_apply (SCM guardian, SCM obj, SCM throw_p) SCM scm_guard (SCM guardian, SCM obj, int throw_p) { - guardian_t *g = GUARDIAN (guardian); + t_guardian *g = GUARDIAN_DATA (guardian); if (!SCM_IMP (obj)) { @@ -279,14 +278,13 @@ scm_guard (SCM guardian, SCM obj, int throw_p) } return throw_p ? SCM_UNSPECIFIED : SCM_BOOL_T; - } SCM scm_get_one_zombie (SCM guardian) { - guardian_t *g = GUARDIAN (guardian); + t_guardian *g = GUARDIAN_DATA (guardian); SCM res = SCM_BOOL_F; /* This critical section barrier will be replaced by a mutex. */ @@ -295,8 +293,7 @@ scm_get_one_zombie (SCM guardian) if (!TCONC_EMPTYP (g->zombies)) TCONC_OUT (g->zombies, res); - if (SCM_NFALSEP (res) - && GREEDY_P (g)) + if (!SCM_FALSEP (res) && GREEDY_P (g)) scm_hashq_remove_x (greedily_guarded_whash, res); SCM_ALLOW_INTS; @@ -334,7 +331,7 @@ SCM_DEFINE (scm_make_guardian, "make-guardian", 0, 1, 0, "paper still (mostly) accurately describes the interface).") #define FUNC_NAME s_scm_make_guardian { - guardian_t *g = SCM_MUST_MALLOC_TYPE (guardian_t); + t_guardian *g = SCM_MUST_MALLOC_TYPE (t_guardian); SCM z1 = scm_cons (SCM_BOOL_F, SCM_EOL); SCM z2 = scm_cons (SCM_BOOL_F, SCM_EOL); SCM z; @@ -347,7 +344,7 @@ SCM_DEFINE (scm_make_guardian, "make-guardian", 0, 1, 0, g->flags = 0L; /* [cmm] the UNBNDP check below is redundant but I like it. */ - if (SCM_UNBNDP (greedy_p) || SCM_NFALSEP (greedy_p)) + if (SCM_UNBNDP (greedy_p) || !SCM_FALSEP (greedy_p)) SET_GREEDY (g); SCM_NEWSMOB (z, tc16_guardian, g); @@ -367,7 +364,7 @@ SCM_DEFINE (scm_guardian_destroyed_p, "guardian-destroyed?", 1, 0, 0, /* This critical section barrier will be replaced by a mutex. */ SCM_DEFER_INTS; - res = SCM_BOOL (DESTROYED_P (GUARDIAN (guardian))); + res = SCM_BOOL (DESTROYED_P (GUARDIAN_DATA (guardian))); SCM_ALLOW_INTS; @@ -380,7 +377,7 @@ SCM_DEFINE (scm_guardian_greedy_p, "guardian-greedy?", 1, 0, 0, "Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.\n") #define FUNC_NAME s_scm_guardian_greedy_p { - return SCM_BOOL (GREEDY_P (GUARDIAN (guardian))); + return SCM_BOOL (GREEDY_P (GUARDIAN_DATA (guardian))); } #undef FUNC_NAME @@ -391,7 +388,7 @@ SCM_DEFINE (scm_destroy_guardian_x, "destroy-guardian!", 1, 0, 0, "objects guarded by @var{guardian}.") #define FUNC_NAME s_scm_destroy_guardian_x { - guardian_t *g = GUARDIAN (guardian); + t_guardian *g = GUARDIAN_DATA (guardian); /* This critical section barrier will be replaced by a mutex. */ SCM_DEFER_INTS; @@ -437,7 +434,7 @@ guardian_gc_init (void *dummy1 SCM_UNUSED, } static void -mark_dependencies_in_tconc (tconc_t *tc) +mark_dependencies_in_tconc (t_tconc *tc) { SCM pair, next_pair; SCM *prev_ptr; @@ -472,7 +469,7 @@ mark_dependencies_in_tconc (tconc_t *tc) /* see if this is a guardian. if yes, list it (but don't mark it yet). */ if (GUARDIAN_P (obj)) - add_to_live_list (GUARDIAN (obj)); + add_to_live_list (GUARDIAN_DATA (obj)); prev_ptr = SCM_CDRLOC (pair); } @@ -481,14 +478,14 @@ mark_dependencies_in_tconc (tconc_t *tc) } static void -mark_dependencies (guardian_t *g) +mark_dependencies (t_guardian *g) { mark_dependencies_in_tconc (&g->zombies); mark_dependencies_in_tconc (&g->live); } static void -mark_and_zombify (guardian_t *g) +mark_and_zombify (t_guardian *g) { SCM tconc_tail = g->live.tail; SCM *prev_ptr = &g->live.head; @@ -498,7 +495,7 @@ mark_and_zombify (guardian_t *g) { SCM next_pair = SCM_CDR (pair); - if (SCM_NMARKEDP (SCM_CAR (pair))) + if (!SCM_MARKEDP (SCM_CAR (pair))) { /* got you, zombie! */ @@ -535,11 +532,11 @@ guardian_zombify (void *dummy1 SCM_UNUSED, void *dummy2 SCM_UNUSED, void *dummy3 SCM_UNUSED) { - guardian_t *last_greedy_guardian = NULL; - guardian_t *last_sharing_guardian = NULL; - guardian_t *first_greedy_guardian = NULL; - guardian_t *first_sharing_guardian = NULL; - guardian_t *g; + t_guardian *last_greedy_guardian = NULL; + t_guardian *last_sharing_guardian = NULL; + t_guardian *first_greedy_guardian = NULL; + t_guardian *first_sharing_guardian = NULL; + t_guardian *g; /* First, find all newly unreachable objects and mark their dependencies. From 6c1b7628703d7fac1751357153fd14e095535c2c Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Sat, 15 Sep 2001 21:56:52 +0000 Subject: [PATCH 064/107] * 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. --- libguile/ChangeLog | 11 +++++++++++ libguile/gc.c | 15 --------------- libguile/init.c | 8 -------- libguile/root.c | 4 ---- libguile/root.h | 4 ---- 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index b1c43c756..d78fd3fe7 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,14 @@ +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. diff --git a/libguile/gc.c b/libguile/gc.c index 5629e9605..f10e33350 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1074,21 +1074,6 @@ scm_igc (const char *what) ++scm_gc_heap_lock; - /* flush dead entries from the continuation stack */ - { - long x; - long bound; - SCM * elts; - elts = SCM_VELTS (scm_continuation_stack); - bound = SCM_VECTOR_LENGTH (scm_continuation_stack); - x = SCM_INUM (scm_continuation_stack_ptr); - while (x < bound) - { - elts[x] = SCM_BOOL_F; - ++x; - } - } - scm_c_hook_run (&scm_before_mark_c_hook, 0); clear_mark_space (); diff --git a/libguile/init.c b/libguile/init.c index f768cc7d9..5c96be4dc 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -162,7 +162,6 @@ restart_stack (void *base) SCM_DFRAME (scm_rootcont) = scm_last_debug_frame = 0; #endif SCM_BASE (scm_rootcont) = base; - scm_continuation_stack_ptr = SCM_MAKINUM (0); } static void @@ -187,13 +186,6 @@ start_stack (void *base) contregs->seq = 0; SCM_NEWSMOB (scm_rootcont, scm_tc16_continuation, contregs); } - /* The root continuation is further initialized by restart_stack. */ - - /* Create the look-aside stack for variables that are shared between - * captured continuations. - */ - scm_continuation_stack = scm_c_make_vector (512, SCM_UNDEFINED); - /* The continuation stack is further initialized by restart_stack. */ /* The remainder of stack initialization is factored out to another * function so that if this stack is ever exitted, it can be diff --git a/libguile/root.c b/libguile/root.c index 26a914948..e55c393a1 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -73,8 +73,6 @@ root_mark (SCM root) scm_gc_mark (s->rootcont); scm_gc_mark (s->dynwinds); - scm_gc_mark (s->continuation_stack); - scm_gc_mark (s->continuation_stack_ptr); scm_gc_mark (s->progargs); scm_gc_mark (s->exitval); scm_gc_mark (s->cur_inp); @@ -122,8 +120,6 @@ scm_make_root (SCM parent) /* Initialize everything right now, in case a GC happens early. */ root_state->rootcont = root_state->dynwinds - = root_state->continuation_stack - = root_state->continuation_stack_ptr = root_state->progargs = root_state->exitval = root_state->cur_inp diff --git a/libguile/root.h b/libguile/root.h index c3f83ed28..995ff14d3 100644 --- a/libguile/root.h +++ b/libguile/root.h @@ -89,8 +89,6 @@ typedef struct scm_root_state SCM rootcont; SCM dynwinds; - SCM continuation_stack; - SCM continuation_stack_ptr; #ifdef DEBUG_EXTENSIONS /* It is very inefficient to have this variable in the root state. */ scm_t_debug_frame *last_debug_frame; @@ -119,8 +117,6 @@ typedef struct scm_root_state #define scm_rootcont (scm_root->rootcont) #define scm_dynwinds (scm_root->dynwinds) -#define scm_continuation_stack (scm_root->continuation_stack) -#define scm_continuation_stack_ptr (scm_root->continuation_stack_ptr) #define scm_progargs (scm_root->progargs) #ifdef USE_THREADS #define scm_last_debug_frame (scm_root->last_debug_frame) From 662c5539640b6da8157a4e26744b0d10ae00a287 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Mon, 17 Sep 2001 20:32:53 +0000 Subject: [PATCH 065/107] * Removed function scm_gc_mark_cell_conservatively. --- THANKS | 1 + libguile/ChangeLog | 17 ++++++++++++++ libguile/gc.c | 57 ++-------------------------------------------- libguile/gc.h | 1 - 4 files changed, 20 insertions(+), 56 deletions(-) diff --git a/THANKS b/THANKS index 0c90ca398..6e9ad2a04 100644 --- a/THANKS +++ b/THANKS @@ -12,3 +12,4 @@ For fixes or providing information which led to a fix: Martin Baulig Rob Browning + Christopher Cramer diff --git a/libguile/ChangeLog b/libguile/ChangeLog index d78fd3fe7..b1eec946a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,9 +1,26 @@ +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 diff --git a/libguile/gc.c b/libguile/gc.c index f10e33350..3a2aeba22 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -114,19 +114,6 @@ unsigned int scm_debug_cell_accesses_p = 1; static unsigned int debug_cells_gc_interval = 0; -/* If an allocated cell is detected during garbage collection, this means that - * some code has just obtained the object but was preempted before the - * initialization of the object was completed. This meanst that some entries - * of the allocated cell may already contain SCM objects. Therefore, - * allocated cells are scanned conservatively. */ -static SCM -allocated_mark (SCM allocated) -{ - scm_gc_mark_cell_conservatively (allocated); - return SCM_BOOL_F; -} - - /* Assert that the given object is a valid reference to a valid cell. This * test involves to determine whether the object is a cell pointer, whether * this pointer actually points into a heap segment and whether the cell @@ -1419,23 +1406,6 @@ gc_mark_loop_first_time: /* We have detected a free cell. This can happen if non-object data * on the C stack points into guile's heap and is scanned during * conservative marking. */ -#if (SCM_DEBUG_CELL_ACCESSES == 0) - /* If cell debugging is disabled, there is a second situation in - * which a free cell can be encountered, namely if with preemptive - * threading one thread has just obtained a fresh cell and was - * preempted before the cell initialization was completed. In this - * case, some entries of the cell may already contain objects. - * Thus, if cell debugging is disabled, free cells are scanned - * conservatively. */ - scm_gc_mark_cell_conservatively (ptr); -#else /* SCM_DEBUG_CELL_ACCESSES == 1 */ - /* With cell debugging enabled, a freshly obtained but not fully - * initialized cell is guaranteed to be of type scm_tc16_allocated. - * Thus, no conservative scanning for free cells is necessary, but - * instead cells of type scm_tc16_allocated have to be scanned - * conservatively. This is done in the mark function of the - * scm_tc16_allocated smob type. */ -#endif break; case scm_tc16_big: case scm_tc16_real: @@ -1484,9 +1454,8 @@ gc_mark_loop_first_time: * heap segment. If this is the case, the number of the heap segment is * returned. Otherwise, -1 is returned. Binary search is used in order to * determine the heap segment that contains the cell.*/ -/* FIXME: To be used within scm_gc_mark_cell_conservatively, - * scm_mark_locations and scm_cellp this function should be an inline - * function. */ +/* FIXME: To be used within scm_mark_locations and scm_cellp this function + * should be an inline function. */ static long int heap_segment (SCM obj) { @@ -1549,27 +1518,6 @@ heap_segment (SCM obj) } -/* Mark the entries of a cell conservatively. The given cell is known to be - * on the heap. Still we have to determine its heap segment in order to - * figure out whether it is a single or a double cell. Then, each of the cell - * elements itself is checked and potentially marked. */ -void -scm_gc_mark_cell_conservatively (SCM cell) -{ - unsigned long int cell_segment = heap_segment (cell); - unsigned int span = scm_heap_table[cell_segment].span; - unsigned int i; - - for (i = 1; i != span * 2; ++i) - { - SCM obj = SCM_CELL_OBJECT (cell, i); - long int obj_segment = heap_segment (obj); - if (obj_segment >= 0) - scm_gc_mark (obj); - } -} - - /* Mark a region conservatively */ void scm_mark_locations (SCM_STACKITEM x[], unsigned long n) @@ -2737,7 +2685,6 @@ scm_init_storage () #if (SCM_DEBUG_CELL_ACCESSES == 1) scm_tc16_allocated = scm_make_smob_type ("allocated cell", 0); - scm_set_smob_mark (scm_tc16_allocated, allocated_mark); #endif /* SCM_DEBUG_CELL_ACCESSES == 1 */ j = SCM_NUM_PROTECTS; diff --git a/libguile/gc.h b/libguile/gc.h index 3b0efff1e..ac0d5c923 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -362,7 +362,6 @@ extern void scm_alloc_cluster (struct scm_t_freelist *master); extern void scm_igc (const char *what); extern void scm_gc_mark (SCM p); extern void scm_gc_mark_dependencies (SCM p); -extern void scm_gc_mark_cell_conservatively (SCM cell); extern void scm_mark_locations (SCM_STACKITEM x[], unsigned long n); extern int scm_cellp (SCM value); extern void scm_gc_sweep (void); From 29251befaebc68e6a3aeabae7f8120f02b710401 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Tue, 18 Sep 2001 18:17:17 +0000 Subject: [PATCH 066/107] * Makefile.am (psyntax.pp): Reference compile-psyntax.scm in $(srcdir) in order to support separate build trees. --- ice-9/ChangeLog | 5 +++++ ice-9/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 0deee679e..8ed6c30e7 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,8 @@ +2001-09-18 Mikael Djurfeldt + + * Makefile.am (psyntax.pp): Reference compile-psyntax.scm in + $(srcdir) in order to support separate build trees. + 2001-09-08 Thien-Thi Nguyen * optargs.scm (lambda*): Record the broken-down argument list in diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index 567444e9a..4034be602 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -43,5 +43,5 @@ EXTRA_DIST = $(ice9_sources) test.scm compile-psyntax.scm if MAINTAINER_MODE psyntax.pp: psyntax.ss - GUILE_LOAD_PATH=$(srcdir)/..:.. ../libguile/guile -s compile-psyntax.scm $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp + GUILE_LOAD_PATH=$(srcdir)/..:.. ../libguile/guile -s $(srcdir)/compile-psyntax.scm $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp endif From bd83482d50587084312bfa0be1a4e0ebd199bc9c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 12:56:28 +0000 Subject: [PATCH 067/107] (process-use-modules): Fix typo. --- ice-9/boot-9.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 396803d7b..e52b54947 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2539,7 +2539,7 @@ (for-each (lambda (mif-args) (let ((mod-iface (apply resolve-interface mif-args))) (or mod-iface - (error "no such module" mif-spec)) + (error "no such module" mif-args)) (module-use! (current-module) mod-iface))) module-interface-args)) From a7a6705efe258ef8da634a9634f138fbf84295aa Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 12:57:38 +0000 Subject: [PATCH 068/107] *** empty log message *** --- ice-9/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 8ed6c30e7..af5a8fefe 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,7 @@ +2001-09-19 Thien-Thi Nguyen + + * boot-9.scm (process-use-modules): Fix typo. + 2001-09-18 Mikael Djurfeldt * Makefile.am (psyntax.pp): Reference compile-psyntax.scm in From 0755b9dfcb13a3e57c8687b43a5aa854b27e95aa Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:03:25 +0000 Subject: [PATCH 069/107] Commentary fix; nfc. --- ice-9/expect.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ice-9/expect.scm b/ice-9/expect.scm index 1c46a9921..0fb55b7b7 100644 --- a/ice-9/expect.scm +++ b/ice-9/expect.scm @@ -48,7 +48,7 @@ ;; variables: expect-port, expect-timeout, expect-timeout-proc, ;; expect-eof-proc, expect-char-proc, ;; expect-strings-compile-flags, expect-strings-exec-flags, -;; macros: expect +;; macros: expect, expect-strings ;;; Code: From af40357bc937c541ef425550aed63dcb5d4e333c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:04:22 +0000 Subject: [PATCH 070/107] *** empty log message *** --- ice-9/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index af5a8fefe..33fd49435 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,5 +1,7 @@ 2001-09-19 Thien-Thi Nguyen + * expect.scm: Commentary fix; nfc. + * boot-9.scm (process-use-modules): Fix typo. 2001-09-18 Mikael Djurfeldt From fab8ab31130d9f6e46d4296f151d7c67de22551e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:14:43 +0000 Subject: [PATCH 071/107] Fix improper `@result' usage. --- doc/tutorial/guile-tut.texi | 142 ++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/doc/tutorial/guile-tut.texi b/doc/tutorial/guile-tut.texi index 3e1308d9c..a8b619ae5 100644 --- a/doc/tutorial/guile-tut.texi +++ b/doc/tutorial/guile-tut.texi @@ -86,17 +86,17 @@ by the author. @menu -* Jump Start:: -* Introduction:: -* Using Guile to program in Scheme:: -* Guile in a Library:: -* Regular Expression Support:: -* UNIX System Programming:: -* Where to find more Guile/Scheme resources:: -* Concept Index:: -* Procedure and Macro Index:: -* Variable Index:: -* Type Index:: +* Jump Start:: +* Introduction:: +* Using Guile to program in Scheme:: +* Guile in a Library:: +* Regular Expression Support:: +* UNIX System Programming:: +* Where to find more Guile/Scheme resources:: +* Concept Index:: +* Procedure and Macro Index:: +* Variable Index:: +* Type Index:: @end menu @node Jump Start @@ -173,9 +173,9 @@ that can be used along with Scheme (for now just @emph{ctax} and @menu -* What are scripting and extension languages:: -* History of Guile and its motivations:: -* How to characterize Guile:: +* What are scripting and extension languages:: +* History of Guile and its motivations:: +* How to characterize Guile:: @end menu @node What are scripting and extension languages @@ -460,41 +460,41 @@ guile> @kbd{(define ls (list 1 2 3 4 5 6 7))} @result{} ;; @r{display the list} guile> @kbd{ls} - @result{(1 2 3 4 5 6 7)} + @result{} (1 2 3 4 5 6 7) ;; @r{ask if @code{ls} is a vector; @code{#f} means it is not} guile> @kbd{(vector? ls)} - @result{#f} + @result{} #f ;; @r{ask if @code{ls} is a list; @code{#t} means it is} guile> @kbd{(list? ls)} - @result{#t} + @result{} #t ;; @r{ask for the length of @code{ls}} guile> @kbd{(length ls)} - @result{7} + @result{} 7 ;; @r{pick out the first element of the list} guile> @kbd{(car ls)} - @result{1} + @result{} 1 ;; @r{pick the rest of the list without the first element} guile> @kbd{(cdr ls)} - @result{(2 3 4 5 6 7} + @result{} (2 3 4 5 6 7) ;; @r{this should pick out the 3rd element of the list} guile> @kbd{(car (cdr (cdr ls)))} - @result{3} + @result{} 3 ;; @r{a shorthand for doing the same thing} guile> @kbd{(caddr ls)} - @result{3} + @result{} 3 ;; @r{append the given list onto @code{ls}, print the result} ;; @r{@strong{NOTE:} the original list @code{ls} is @emph{not} modified} guile> @kbd{(append ls (list 8 9 10))} - @result{(1 2 3 4 5 6 7 8 9 10)} + @result{} (1 2 3 4 5 6 7 8 9 10) guile> @kbd{(reverse ls)} - @result{(10 9 8 7 6 5 4 3 2 1)} + @result{} (10 9 8 7 6 5 4 3 2 1) ;; @r{ask if 12 is in the list --- it obviously is not} guile> @kbd{(memq 12 ls)} - @result{#f} + @result{} #f ;; @r{ask if 4 is in the list --- returns the list from 4 on.} ;; @r{Notice that the result will behave as true in conditionals} guile> @kbd{(memq 4 ls)} - @result{(4 5 6 7)} + @result{} (4 5 6 7) ;; @r{an @code{if} statement using the aforementioned result} guile> @kbd{(if (memq 4 ls) (display "hey, it's true!\n") @@ -507,43 +507,43 @@ guile> @kbd{(if (memq 12 ls) @print{dude, it's false} @result{} guile> @kbd{(memq 4 (reverse ls))} - @result{(4 3 2 1)} + @result{} (4 3 2 1) ;; @r{make a smaller list @code{ls2} to work with} guile> @kbd{(define ls2 (list 2 3 4))} ;; @r{make a list in which the function @code{sin} has been} ;; @r{applied to all elements of @code{ls2}} guile> @kbd{(map sin ls2)} - @result{(0.909297426825682 0.141120008059867 -0.756802495307928)} + @result{} (0.909297426825682 0.141120008059867 -0.756802495307928) ;; @r{make a list in which the squaring function has been} ;; @r{applied to all elements of @code{ls}} guile> @kbd{(map (lambda (n) (expt n n)) ls)} - @result{(1 4 27 256 3125 46656 823543)} + @result{} (1 4 27 256 3125 46656 823543) @end smalllisp @smalllisp ;; @r{make a vector and bind it to the symbol @code{v}} guile> @kbd{(define v #(1 2 3 4 5 6 7))} guile> @kbd{v} - @result{#(1 2 3 4 5 6 7)} + @result{} #(1 2 3 4 5 6 7) guile> @kbd{(vector? v)} - @result{#t} + @result{} #t guile> @kbd{(list? v)} - @result{#f} + @result{} #f guile> @kbd{(vector-length v)} - @result{7} + @result{} 7 ;; @r{vector-ref allows you to pick out elements by index} guile> @kbd{(vector-ref v 2)} - @result{3} + @result{} 3 ;; @r{play around with the vector: make it into a list, reverse} ;; @r{the list, go back to a vector and take the second element} guile> @kbd{(vector-ref (list->vector (reverse (vector->list v))) 2)} - @result{5} + @result{} 5 ;; @r{this demonstrates that the entries in a vector do not have} ;; @r{to be of uniform type} guile> @kbd{(vector-set! v 4 "hi there")} - @result{"hi there"} + @result{} "hi there" guile> @kbd{v} - @result{#(1 2 3 4 "hi there" 6 7)} + @result{} #(1 2 3 4 "hi there" 6 7) @end smalllisp @@ -560,7 +560,7 @@ Here are some typical examples of using recursion to process a list. l (append (my-reverse (cdr l)) (list (car l))))) (my-reverse '(27 32 33 40)) -@result{(40 33 32 27)} +@result{} (40 33 32 27) @end smalllisp @@ -596,7 +596,7 @@ This could be invoked with @code{(process-matrix m sin)} or @smalllisp (process-matrix m (lambda (x) (* x x))) -@result{((49 4 1 9 4 64 25 9 36) (16 1 1 1 9 64 81 64 1) (25 25 16 64 1 64 4 4 16))} +@result{} ((49 4 1 9 4 64 25 9 36) (16 1 1 1 9 64 81 64 1) (25 25 16 64 1 64 4 4 16)) @end smalllisp To print a representation of the matrix, we could define a generalized @@ -715,39 +715,39 @@ creates: ;; @r{retrieve the x and y coordinates} ((c 'x)) -@result{0} +@result{} 0 ((c 'y)) -@result{0} +@result{} 0 ;; @r{change the x coordinate} ((c 'set-x!) 5) -@result{5} +@result{} 5 ((c 'x)) -@result{5} +@result{} 5 ;; @r{change the color} ((c 'color)) -@result{"red"} +@result{} "red" ((c 'set-color!) "green") -@result{"green"} +@result{} "green" ((c 'color)) -@result{"green"} +@result{} "green" ;; @r{now use the next! message to move to the next cell} ((c 'next!)) -@result{(6 . 0)} +@result{} (6 . 0) ((c 'x)) -@result{6} +@result{} 6 ((c 'y)) -@result{0} +@result{} 0 ;; @r{now make things wrap around} ((c 'next!)) -@result{(0 . 1)} +@result{} (0 . 1) ((c 'next!)) -@result{(1 . 1)} +@result{} (1 . 1) ((c 'next!)) -@result{(2 . 1)} +@result{} (2 . 1) ((c 'x)) -@result{2} +@result{} 2 ((c 'y)) -@result{1} +@result{} 1 @end smallexample You will notice that expressions like @code{(c 'next)} return procedures @@ -775,19 +775,19 @@ type: @smallexample (define c2 (MAKE-CELL 0 0 "red" 10 7 9)) (send c2 'x) -@result{0} +@result{} 0 (send c2 'set-x! 5) -@result{5} +@result{} 5 (send c2 'color) -@result{"red"} +@result{} "red" (send c2 'set-color! "green") -@result{"green"} +@result{} "green" (send c2 'next!) -@result{(1 . 0)} +@result{} (1 . 0) (send c2 'x) -@result{1} +@result{} 1 (send c2 'y) -@result{0} +@result{} 0 @end smallexample @cindex object-based programming @@ -818,11 +818,11 @@ that is done, and how that can be useful. @menu -* Two world views:: -* What is libguile:: -* How to get started with libguile:: -* More interesting programming with libguile:: -* Further examples:: +* Two world views:: +* What is libguile:: +* How to get started with libguile:: +* More interesting programming with libguile:: +* Further examples:: @end menu @node Two world views @@ -1051,11 +1051,11 @@ Notice that @code{learn1} uses a Scheme master world, and the C routines in @code{c_builtins.c} are simply adding new primitives to Scheme. @menu -* learn1.c:: -* c_builtins.h:: -* c_builtins.c:: -* What learn1 is doing:: -* Compiling and running learn1:: +* learn1.c:: +* c_builtins.h:: +* c_builtins.c:: +* What learn1 is doing:: +* Compiling and running learn1:: @end menu @node learn1.c From aee0492fb80b46e153a2084f670e115dcec20f7c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:15:38 +0000 Subject: [PATCH 072/107] *** empty log message *** --- doc/tutorial/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/tutorial/ChangeLog b/doc/tutorial/ChangeLog index d7b7d1ea2..14ed1eb28 100644 --- a/doc/tutorial/ChangeLog +++ b/doc/tutorial/ChangeLog @@ -1,3 +1,7 @@ +2001-09-19 Thien-Thi Nguyen + + * guile-tut.texi: Fix improper `@result' usage. + 2001-08-27 Neil Jerram * Makefile.am (guile_tut_TEXINFOS): Removed. From 9365ee8a2068c625ecd75ab7aff30bfed72d3100 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:36:05 +0000 Subject: [PATCH 073/107] Fix number typo in "Jump Start" section. --- doc/tutorial/guile-tut.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial/guile-tut.texi b/doc/tutorial/guile-tut.texi index a8b619ae5..477cdac3e 100644 --- a/doc/tutorial/guile-tut.texi +++ b/doc/tutorial/guile-tut.texi @@ -148,7 +148,7 @@ the prompt; the interpreter's response is preceded (in this manual) by In this example we did some simple arithmetic @code{(+ 20 35)} and got the answer @code{55}. Then we coded the classic (and rather wasteful) factorial algorithm, and got a glimpse of Scheme's nice -@emph{bignumbers} by asking for the factorial of 1000. Then we quit +@emph{bignumbers} by asking for the factorial of 500. Then we quit with @code{(quit)}. @cindex bignumbers From 9d7e6c84cabbd2408a4c2b2c839f5b078a88661e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 Sep 2001 13:36:48 +0000 Subject: [PATCH 074/107] *** empty log message *** --- doc/tutorial/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/tutorial/ChangeLog b/doc/tutorial/ChangeLog index 14ed1eb28..b784f824c 100644 --- a/doc/tutorial/ChangeLog +++ b/doc/tutorial/ChangeLog @@ -1,6 +1,7 @@ 2001-09-19 Thien-Thi Nguyen * guile-tut.texi: Fix improper `@result' usage. + Fix number typo in "Jump Start" section. 2001-08-27 Neil Jerram From 147c18a0e4d196eb770a648b4cf1bf11a5ef7043 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Thu, 20 Sep 2001 08:17:25 +0000 Subject: [PATCH 075/107] * 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. --- NEWS | 10 +++++++++- libguile/ChangeLog | 11 +++++++++++ libguile/num2integral.i.c | 10 ---------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index d740f0ac3..5c4a214fc 100644 --- a/NEWS +++ b/NEWS @@ -1186,13 +1186,21 @@ intended to be used in user code. You should avoid dealing with bignums directly, and should deal with numbers in general (which can be bignums). +** Change in behavior: scm_num2long, scm_num2ulong + +The scm_num2[u]long functions don't any longer accept an inexact +argument. 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. + ** New functions: scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff, scm_num2size. These are conversion functions between the various ANSI C integral -types and Scheme numbers. +types and Scheme numbers. NOTE: The scm_num2xxx functions don't +accept an inexact argument. ** New number validation macros: SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF] diff --git a/libguile/ChangeLog b/libguile/ChangeLog index b1eec946a..6da89ae34 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,14 @@ +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, diff --git a/libguile/num2integral.i.c b/libguile/num2integral.i.c index 65afa2603..61b1255c8 100644 --- a/libguile/num2integral.i.c +++ b/libguile/num2integral.i.c @@ -69,16 +69,6 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) return res; } - else if (SCM_REALP (num)) - { /* inexact */ - - double u = SCM_REAL_VALUE (num); - ITYPE res = u; - if ((double) res == u) - return res; - else - scm_out_of_range (s_caller, num); - } else scm_wrong_type_arg (s_caller, pos, num); } From a7f54aed6a1edebd85521d9624d958141b87a1b7 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Thu, 20 Sep 2001 08:18:26 +0000 Subject: [PATCH 076/107] * 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. --- libguile/error.c | 14 +++++++------- libguile/error.h | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/libguile/error.c b/libguile/error.c index 33665a0f8..fd9b2a0d9 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -162,7 +162,7 @@ SCM_DEFINE (scm_strerror, "strerror", 1, 0, 0, } #undef FUNC_NAME -SCM_SYMBOL (scm_system_error_key, "system-error"); +SCM_GLOBAL_SYMBOL (scm_system_error_key, "system-error"); void scm_syserror (const char *subr) { @@ -185,7 +185,7 @@ scm_syserror_msg (const char *subr, const char *message, SCM args, int eno) scm_cons (SCM_MAKINUM (eno), SCM_EOL)); } -SCM_SYMBOL (scm_num_overflow_key, "numerical-overflow"); +SCM_GLOBAL_SYMBOL (scm_num_overflow_key, "numerical-overflow"); void scm_num_overflow (const char *subr) { @@ -196,7 +196,7 @@ scm_num_overflow (const char *subr) SCM_BOOL_F); } -SCM_SYMBOL (scm_out_of_range_key, "out-of-range"); +SCM_GLOBAL_SYMBOL (scm_out_of_range_key, "out-of-range"); void scm_out_of_range (const char *subr, SCM bad_value) { @@ -218,7 +218,7 @@ scm_out_of_range_pos (const char *subr, SCM bad_value, SCM pos) } -SCM_SYMBOL (scm_args_number_key, "wrong-number-of-args"); +SCM_GLOBAL_SYMBOL (scm_args_number_key, "wrong-number-of-args"); void scm_wrong_num_args (SCM proc) { @@ -241,7 +241,7 @@ scm_error_num_args_subr (const char *subr) } -SCM_SYMBOL (scm_arg_type_key, "wrong-type-arg"); +SCM_GLOBAL_SYMBOL (scm_arg_type_key, "wrong-type-arg"); void scm_wrong_type_arg (const char *subr, int pos, SCM bad_value) { @@ -273,7 +273,7 @@ scm_wrong_type_arg_msg (const char *subr, int pos, SCM bad_value, const char *sz } -SCM_SYMBOL (scm_memory_alloc_key, "memory-allocation-error"); +SCM_GLOBAL_SYMBOL (scm_memory_alloc_key, "memory-allocation-error"); void scm_memory_error (const char *subr) { @@ -284,7 +284,7 @@ scm_memory_error (const char *subr) SCM_BOOL_F); } -SCM_SYMBOL (scm_misc_error_key, "misc-error"); +SCM_GLOBAL_SYMBOL (scm_misc_error_key, "misc-error"); void scm_misc_error (const char *subr, const char *message, SCM args) { diff --git a/libguile/error.h b/libguile/error.h index c7b7fd216..0bdb10895 100644 --- a/libguile/error.h +++ b/libguile/error.h @@ -51,6 +51,14 @@ extern int scm_ints_disabled; +extern SCM scm_system_error_key; +extern SCM scm_num_overflow_key; +extern SCM scm_out_of_range_key; +extern SCM scm_args_number_key; +extern SCM scm_arg_type_key; +extern SCM scm_memory_alloc_key; +extern SCM scm_misc_error_key; + extern void scm_error (SCM key, const char *subr, const char *message, From b1bdf8ec8adda2503ba47f87dbba3af17e74792d Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:46:25 +0000 Subject: [PATCH 077/107] * versiondat.h.in: removed (obsolete). --- libguile/versiondat.h.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 libguile/versiondat.h.in diff --git a/libguile/versiondat.h.in b/libguile/versiondat.h.in deleted file mode 100644 index e69de29bb..000000000 From d2836a7db67bd373c90b9d36a25387ec86d6e604 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:46:37 +0000 Subject: [PATCH 078/107] * 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. --- libguile/version.h.in | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 libguile/version.h.in diff --git a/libguile/version.h.in b/libguile/version.h.in new file mode 100644 index 000000000..763c90bce --- /dev/null +++ b/libguile/version.h.in @@ -0,0 +1,70 @@ +/* classes: h_files */ + +#ifndef SCM_VERSION_H +#define SCM_VERSION_H + +/* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * As a special exception, the Free Software Foundation gives permission + * for additional uses of the text contained in its release of GUILE. + * + * The exception is that, if you link the GUILE library with other files + * to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the GUILE library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the + * Free Software Foundation under the name GUILE. If you copy + * code from other Free Software Foundation releases into a copy of + * GUILE, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for GUILE, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. */ + + + +#include "libguile/__scm.h" + + + +#define SCM_GUILE_MAJOR_VERSION @GUILE_MAJOR_VERSION@ +#define SCM_GUILE_MINOR_VERSION @GUILE_MINOR_VERSION@ +#define SCM_GUILE_MICRO_VERSION @GUILE_MICRO_VERSION@ + +extern SCM scm_major_version (void); +extern SCM scm_minor_version (void); +extern SCM scm_micro_version (void); +extern SCM scm_version (void); +extern void scm_init_version (void); + +#endif /* SCM_VERSION_H */ + +/* + Local Variables: + c-file-style: "gnu" + mode: c + End: +*/ From c8333bc59d1619b249a13d1455c38969d2d5c81e Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:46:52 +0000 Subject: [PATCH 079/107] * version.h: renamed to version.h.in. --- libguile/version.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 libguile/version.h diff --git a/libguile/version.h b/libguile/version.h deleted file mode 100644 index e69de29bb..000000000 From 3143f1093def7e1a9d874ce22d93d2cf8a70c024 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:47:01 +0000 Subject: [PATCH 080/107] * 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. --- libguile/version.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/libguile/version.c b/libguile/version.c index c74f66c56..3d130564a 100644 --- a/libguile/version.c +++ b/libguile/version.c @@ -42,13 +42,15 @@ +#include #include "libguile/_scm.h" #include "libguile/strings.h" -#include "libguile/versiondat.h" #include "libguile/version.h" +#define SCM_TMP_MACRO_MKSTR(x) #x + /* Return a Scheme string containing Guile's major version number. */ SCM_DEFINE (scm_major_version, "major-version", 0, 0, 0, @@ -57,7 +59,8 @@ SCM_DEFINE (scm_major_version, "major-version", 0, 0, 0, "E.g., the 1 in \"1.6.5\".") #define FUNC_NAME s_scm_major_version { - return scm_makfrom0str (GUILE_MAJOR_VERSION); + return scm_number_to_string (SCM_MAKINUM(SCM_GUILE_MAJOR_VERSION), + SCM_MAKINUM(10)); } #undef FUNC_NAME @@ -69,7 +72,8 @@ SCM_DEFINE (scm_minor_version, "minor-version", 0, 0, 0, "E.g., the 6 in \"1.6.5\".") #define FUNC_NAME s_scm_minor_version { - return scm_makfrom0str (GUILE_MINOR_VERSION); + return scm_number_to_string (SCM_MAKINUM(SCM_GUILE_MINOR_VERSION), + SCM_MAKINUM(10)); } #undef FUNC_NAME @@ -81,7 +85,8 @@ SCM_DEFINE (scm_micro_version, "micro-version", 0, 0, 0, "E.g., the 5 in \"1.6.5\".") #define FUNC_NAME s_scm_micro_version { - return scm_makfrom0str (GUILE_MICRO_VERSION); + return scm_number_to_string (SCM_MAKINUM(SCM_GUILE_MICRO_VERSION), + SCM_MAKINUM(10)); } #undef FUNC_NAME @@ -100,7 +105,15 @@ SCM_DEFINE (scm_version, "version", 0, 0, 0, "@end lisp") #define FUNC_NAME s_scm_version { - return scm_makfrom0str (GUILE_VERSION); + + char version_str[64]; + + snprintf(version_str, sizeof(version_str), "%d.%d.%d", + SCM_GUILE_MAJOR_VERSION, + SCM_GUILE_MINOR_VERSION, + SCM_GUILE_MICRO_VERSION); + + return scm_makfrom0str (version_str); } #undef FUNC_NAME From 70c07eed72808e9e44f179b92e335a05d8bf8715 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:47:41 +0000 Subject: [PATCH 081/107] * configure.in (AC_CONFIG_FILES): add libguile/version.h. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index c0c200273..590b33a10 100644 --- a/configure.in +++ b/configure.in @@ -622,7 +622,7 @@ AC_CONFIG_FILES([ libguile/guile-func-name-check libguile/guile-snarf-docs libguile/guile-snarf-docs-texi - libguile/versiondat.h + libguile/version.h ice-9/Makefile oop/Makefile oop/goops/Makefile From c13f0a90f4ffda52ee43427d9218186f3dbf889c Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 20 Sep 2001 16:48:02 +0000 Subject: [PATCH 082/107] *** empty log message *** --- ChangeLog | 9 +++++++++ RELEASE | 10 +--------- libguile/ChangeLog | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61b2cc7df..596a795b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-09-20 Rob Browning + + * configure.in (AC_CONFIG_FILES): add libguile/version.h. + +2001-09-11 Rob Browning + + * RELEASE: Deleted Ian Grant and Julian Satchell's addresses from + the testing list since they're no longer functional. + 2001-09-04 Thien-Thi Nguyen * TODO: diff --git a/RELEASE b/RELEASE index 8289964da..f1ae2e023 100644 --- a/RELEASE +++ b/RELEASE @@ -29,14 +29,6 @@ Tom Tromey : mips-sgi-irix6.3 sparc-sun-sunos4.1.4 -Ian Grant : - - alpha-dec-osf4.0e - -Julian Satchell : - - dec-mips-ultrix - Perry Metzger NetBSD @@ -201,7 +193,7 @@ Once you've got a disty that seems pretty solid: Punting checklist: -* Add "Guile N.M released." entry to the top-level ChangeLog, and commit it. +* Add "Guile X.Y.Z released." entry to the top-level ChangeLog, and commit it. * Tag the entire source tree with a tag of the form "release_X-Y-Z", i.e for release 1.6.0, use release_1-6-0 diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 6da89ae34..ce096c2a2 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,22 @@ +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. From 2830fd91c623979e3c82c15fd2c560febf1e93de Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Thu, 20 Sep 2001 18:53:32 +0000 Subject: [PATCH 083/107] * numbers.c (scm_integer_expt): Accept inexact integer in second argument. (Thanks to Bill Schottstaedt.) --- libguile/ChangeLog | 5 +++++ libguile/numbers.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ce096c2a2..0d4ec3953 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/libguile/numbers.c b/libguile/numbers.c index 266d09932..11fc86f55 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1118,7 +1118,15 @@ SCM_DEFINE (scm_integer_expt, "integer-expt", 2, 0, 0, else if (SCM_EQ_P (n, SCM_MAKINUM (-1L))) return SCM_FALSEP (scm_even_p (k)) ? n : acc; #endif - SCM_VALIDATE_ULONG_COPY (2,k,i2); + if (SCM_REALP (k)) + { + double r = SCM_REAL_VALUE (k); + i2 = r; + if (i2 != r) + SCM_WRONG_TYPE_ARG (2, k); + } + else + SCM_VALIDATE_ULONG_COPY (2,k,i2); if (i2 < 0) { i2 = -i2; From 8b7838b558fa70318be5f1bea14070718b5f0382 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:54:27 +0000 Subject: [PATCH 084/107] * tests/numbers.test (fixnum-bit): compute dynamically. --- test-suite/tests/numbers.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test index f7863bf65..ad02d62cb 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -50,7 +50,9 @@ (define (documented? object) (not (not (object-documentation object)))) -(define fixnum-bit 30) +(define fixnum-bit + (inexact->exact (+ (/ (log (+ most-positive-fixnum 1)) (log 2)) 1))) + (define fixnum-min most-negative-fixnum) (define fixnum-max most-positive-fixnum) From af297b33d8e1c8078c787afff57f18915471a699 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:54:35 +0000 Subject: [PATCH 085/107] * tests/bit-operations.test (fixnum-bit): compute dynamically. --- test-suite/tests/bit-operations.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/bit-operations.test b/test-suite/tests/bit-operations.test index f319648d3..47cca5fdc 100644 --- a/test-suite/tests/bit-operations.test +++ b/test-suite/tests/bit-operations.test @@ -57,7 +57,9 @@ (define (documented? object) (not (not (object-documentation object)))) -(define fixnum-bit 30) +(define fixnum-bit + (inexact->exact (+ (/ (log (+ most-positive-fixnum 1)) (log 2)) 1))) + (define fixnum-min most-negative-fixnum) (define fixnum-max most-positive-fixnum) From 3a868e486c5b040079903ce8569513b91e45d950 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:54:56 +0000 Subject: [PATCH 086/107] * srfi-14.h (SCM_CHARSET_GET): need 1L, not just 1 in "<<". --- srfi/srfi-14.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srfi/srfi-14.h b/srfi/srfi-14.h index 3989aadcc..cef7e5089 100644 --- a/srfi/srfi-14.h +++ b/srfi/srfi-14.h @@ -56,7 +56,7 @@ #define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\ [(idx) / SCM_BITS_PER_LONG] &\ - (1 << ((idx) % SCM_BITS_PER_LONG))) + (1L << ((idx) % SCM_BITS_PER_LONG))) #define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset)) From cc0ce1e7644d59805ca21fdc976883938514774c Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:55:07 +0000 Subject: [PATCH 087/107] * srfi-14.c (SCM_CHARSET_SET): need 1L, not just 1 in "<<". (scm_char_set_hash): val needs to be long, not just unsigned. (scm_char_set): need 1L, not just 1 in "<<". (scm_list_to_char_set): need 1L, not just 1 in "<<". (scm_list_to_char_set_x): need 1L, not just 1 in "<<". (scm_list_to_char_set_x): FUNC_NAME was wrong - added a _x. (scm_string_to_char_set): string length var needed to be scm_sizet, not int. (scm_string_to_char_set): need 1L, not just 1 in "<<". (scm_string_to_char_set_x): string length var needed to be scm_sizet, not int. (scm_string_to_char_set_x): need 1L, not just 1 in "<<". (scm_char_set_filter): need 1L, not just 1 in "<<". (scm_char_set_filter_x): need 1L, not just 1 in "<<". (scm_ucs_range_to_char_set): need 1L, not just 1 in "<<". (scm_ucs_range_to_char_set_x): need 1L, not just 1 in "<<". (scm_char_set_adjoin): need 1L, not just 1 in "<<". (scm_char_set_delete): need 1L, not just 1 in "<<". (scm_char_set_adjoin_x): need 1L, not just 1 in "<<". (scm_char_set_delete_x): need 1L, not just 1 in "<<". --- srfi/srfi-14.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c index 52d9419e3..c5a491786 100644 --- a/srfi/srfi-14.c +++ b/srfi/srfi-14.c @@ -51,8 +51,9 @@ #include "srfi-14.h" -#define SCM_CHARSET_SET(cs, idx) (((long *) SCM_SMOB_DATA (cs))[(idx) / SCM_BITS_PER_LONG] |= (1 << ((idx) % SCM_BITS_PER_LONG))) - +#define SCM_CHARSET_SET(cs, idx) \ + (((long *) SCM_SMOB_DATA (cs))[(idx) / SCM_BITS_PER_LONG] |= \ + (1L << ((idx) % SCM_BITS_PER_LONG))) #define BYTES_PER_CHARSET (SCM_CHARSET_SIZE / 8) #define LONGS_PER_CHARSET (SCM_CHARSET_SIZE / SCM_BITS_PER_LONG) @@ -191,7 +192,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0, const int default_bnd = 871; int bnd; long * p; - unsigned val = 0; + unsigned long val = 0; int k; SCM_VALIDATE_SMOB (1, cs, charset); @@ -479,7 +480,7 @@ SCM_DEFINE (scm_char_set, "char-set", 0, 0, 1, SCM_VALIDATE_CHAR_COPY (argnum, SCM_CAR (rest), c); argnum++; rest = SCM_CDR (rest); - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return cs; } @@ -513,7 +514,7 @@ SCM_DEFINE (scm_list_to_char_set, "list->char-set", 1, 1, 0, SCM_VALIDATE_CHAR_COPY (0, chr, c); list = SCM_CDR (list); - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return cs; } @@ -525,7 +526,7 @@ SCM_DEFINE (scm_list_to_char_set_x, "list->char-set!", 2, 0, 0, "Convert the character list @var{list} to a character set. The\n" "characters are added to @var{base_cs} and @var{base_cs} is\n" "returned.") -#define FUNC_NAME s_scm_list_to_char_set +#define FUNC_NAME s_scm_list_to_char_set_x { long * p; @@ -540,7 +541,7 @@ SCM_DEFINE (scm_list_to_char_set_x, "list->char-set!", 2, 0, 0, SCM_VALIDATE_CHAR_COPY (0, chr, c); list = SCM_CDR (list); - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return base_cs; } @@ -557,7 +558,7 @@ SCM_DEFINE (scm_string_to_char_set, "string->char-set", 1, 1, 0, SCM cs; long * p; char * s; - int k = 0; + size_t k = 0; SCM_VALIDATE_STRING (1, str); if (SCM_UNBNDP (base_cs)) @@ -572,7 +573,7 @@ SCM_DEFINE (scm_string_to_char_set, "string->char-set", 1, 1, 0, while (k < SCM_STRING_LENGTH (str)) { int c = s[k++]; - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return cs; } @@ -588,7 +589,7 @@ SCM_DEFINE (scm_string_to_char_set_x, "string->char-set!", 2, 0, 0, { long * p; char * s; - int k = 0; + size_t k = 0; SCM_VALIDATE_STRING (1, str); SCM_VALIDATE_SMOB (2, base_cs, charset); @@ -597,7 +598,7 @@ SCM_DEFINE (scm_string_to_char_set_x, "string->char-set!", 2, 0, 0, while (k < SCM_STRING_LENGTH (str)) { int c = s[k++]; - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return base_cs; } @@ -632,7 +633,7 @@ SCM_DEFINE (scm_char_set_filter, "char-set-filter", 2, 1, 0, SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k)); if (!SCM_FALSEP (res)) - p[k / SCM_BITS_PER_LONG] |= 1 << (k % SCM_BITS_PER_LONG); + p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG); } } return ret; @@ -661,7 +662,7 @@ SCM_DEFINE (scm_char_set_filter_x, "char-set-filter!", 3, 0, 0, SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k)); if (!SCM_FALSEP (res)) - p[k / SCM_BITS_PER_LONG] |= 1 << (k % SCM_BITS_PER_LONG); + p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG); } } return base_cs; @@ -715,7 +716,7 @@ SCM_DEFINE (scm_ucs_range_to_char_set, "ucs-range->char-set", 2, 2, 0, p = (long *) SCM_SMOB_DATA (cs); while (clower < cupper) { - p[clower / SCM_BITS_PER_LONG] |= 1 << (clower % SCM_BITS_PER_LONG); + p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG); clower++; } return cs; @@ -758,7 +759,7 @@ SCM_DEFINE (scm_ucs_range_to_char_set_x, "ucs-range->char-set!", 4, 0, 0, p = (long *) SCM_SMOB_DATA (base_cs); while (clower < cupper) { - p[clower / SCM_BITS_PER_LONG] |= 1 << (clower % SCM_BITS_PER_LONG); + p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG); clower++; } return base_cs; @@ -931,7 +932,7 @@ SCM_DEFINE (scm_char_set_adjoin, "char-set-adjoin", 1, 0, 1, SCM_VALIDATE_CHAR_COPY (1, chr, c); rest = SCM_CDR (rest); - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return cs; } @@ -959,7 +960,7 @@ SCM_DEFINE (scm_char_set_delete, "char-set-delete", 1, 0, 1, SCM_VALIDATE_CHAR_COPY (1, chr, c); rest = SCM_CDR (rest); - p[c / SCM_BITS_PER_LONG] &= ~(1 << (c % SCM_BITS_PER_LONG)); + p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG)); } return cs; } @@ -986,7 +987,7 @@ SCM_DEFINE (scm_char_set_adjoin_x, "char-set-adjoin!", 1, 0, 1, SCM_VALIDATE_CHAR_COPY (1, chr, c); rest = SCM_CDR (rest); - p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG); + p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG); } return cs; } @@ -1013,7 +1014,7 @@ SCM_DEFINE (scm_char_set_delete_x, "char-set-delete!", 1, 0, 1, SCM_VALIDATE_CHAR_COPY (1, chr, c); rest = SCM_CDR (rest); - p[c / SCM_BITS_PER_LONG] &= ~(1 << (c % SCM_BITS_PER_LONG)); + p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG)); } return cs; } From 27070f900d545d7139673fc5dc54c8ff77bc7057 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:56:17 +0000 Subject: [PATCH 088/107] * 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. --- libguile/strings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/strings.h b/libguile/strings.h index 319568ab8..271497a5d 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -56,7 +56,7 @@ #define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c))) #define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL) #define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8)) -#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_string)) +#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((long) (l)) << 8) + scm_tc7_string)) From 1aaa208e93428509188ac7bcd5ef5a48ebfaa0c6 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:56:31 +0000 Subject: [PATCH 089/107] * 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. --- libguile/numbers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/numbers.c b/libguile/numbers.c index 11fc86f55..1c26b91be 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -383,7 +383,7 @@ scm_gcd (SCM x, SCM y) } else if (yy == 0) { result = u; } else { - int k = 1; + long k = 1; long t; /* Determine a common factor 2^k */ From f6b115d97edb6cb6dcb0671f543537b64fad6b09 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:56:39 +0000 Subject: [PATCH 090/107] * chars.h (SCM_MAKE_CHAR): coerce value to intptr_t. --- libguile/chars.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/chars.h b/libguile/chars.h index fa24a374a..1e92f6679 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -53,7 +53,7 @@ */ #define SCM_CHARP(x) (SCM_ITAG8(x) == scm_tc8_char) #define SCM_CHAR(x) ((unsigned int)SCM_ITAG8_DATA(x)) -#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8(x, scm_tc8_char) +#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((intptr_t) x, scm_tc8_char) From b469bd68a691e415c126d6367f86e1707dbdcb3d Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:57:07 +0000 Subject: [PATCH 091/107] * .cvsignore: really add version.h --- libguile/.cvsignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/.cvsignore b/libguile/.cvsignore index e4cb95f62..6f57459a2 100644 --- a/libguile/.cvsignore +++ b/libguile/.cvsignore @@ -36,5 +36,5 @@ scmconfig.h scmconfig.h.in stamp-h stamp-h.in -versiondat.h +version.h c-tokenize.c From 0b073f0f148649a425edcb184e6b3a749b545919 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 21 Sep 2001 17:58:04 +0000 Subject: [PATCH 092/107] *** empty log message *** --- NEWS | 6 ++++++ THANKS | 4 ++-- TODO | 7 +++++++ libguile/ChangeLog | 20 ++++++++++++++++++++ srfi/ChangeLog | 25 +++++++++++++++++++++++++ test-suite/ChangeLog | 6 ++++++ 6 files changed, 66 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5c4a214fc..f29a14ef2 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,12 @@ The new configure option `--enable-deprecated=LEVEL' and the environment variable GUILE_WARN_DEPRECATED control this mechanism. See INSTALL and README for more information. +** Guile is much more likely to work on 64-bit architectures. + +Guile now compiles and passes "make check" with only two UNRESOLVED GC +cases on Alpha based machines now. Thanks to John Goerzen for the use +of a test machine. + ** New functions: setitimer and getitimer. These implement a fairly direct interface to the libc functions of the diff --git a/THANKS b/THANKS index 6e9ad2a04..1eb38dc64 100644 --- a/THANKS +++ b/THANKS @@ -7,9 +7,9 @@ The Guile maintainer committee consists of Contributors since the last release: - For fixes or providing information which led to a fix: Martin Baulig Rob Browning - Christopher Cramer + Christopher Cramer + John Goerzen diff --git a/TODO b/TODO index 00a58ce32..6ca4ff836 100644 --- a/TODO +++ b/TODO @@ -66,6 +66,13 @@ that user-visible changes are reflected in NEWS. - rewrite core macros (define-class et al) in C - define C API +- Compile with --enable-error-on-warning without failure. Requires a + number of fixes, including num2integral.i.c and on some platforms + gc_os_dep.c. Also SCM_FIXABLE etc. will produce unavoidable + warnings on some platforms with some vars as written now. i.e. on + alphas, SCM_FIXABLE(some_int) is always true. We need more + conditional compilation or similar. + - Move sample .gdbinit in HACKING to somewhere more appropriate (manual?). - Make sure we have appropriate interface numbers for shared diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 0d4ec3953..75e2c56d9 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,23 @@ +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 diff --git a/srfi/ChangeLog b/srfi/ChangeLog index f5691433e..7b0e54d8a 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,28 @@ +2001-09-21 Rob Browning + + * srfi-14.h (SCM_CHARSET_GET): need 1L, not just 1 in "<<". + + * srfi-14.c (SCM_CHARSET_SET): need 1L, not just 1 in "<<". + (scm_char_set_hash): val needs to be long, not just unsigned. + (scm_char_set): need 1L, not just 1 in "<<". + (scm_list_to_char_set): need 1L, not just 1 in "<<". + (scm_list_to_char_set_x): need 1L, not just 1 in "<<". + (scm_list_to_char_set_x): FUNC_NAME was wrong - added a _x. + (scm_string_to_char_set): string length var needed to be + scm_sizet, not int. + (scm_string_to_char_set): need 1L, not just 1 in "<<". + (scm_string_to_char_set_x): string length var needed to be + scm_sizet, not int. + (scm_string_to_char_set_x): need 1L, not just 1 in "<<". + (scm_char_set_filter): need 1L, not just 1 in "<<". + (scm_char_set_filter_x): need 1L, not just 1 in "<<". + (scm_ucs_range_to_char_set): need 1L, not just 1 in "<<". + (scm_ucs_range_to_char_set_x): need 1L, not just 1 in "<<". + (scm_char_set_adjoin): need 1L, not just 1 in "<<". + (scm_char_set_delete): need 1L, not just 1 in "<<". + (scm_char_set_adjoin_x): need 1L, not just 1 in "<<". + (scm_char_set_delete_x): need 1L, not just 1 in "<<". + 2001-09-12 Gary Houston * srfi-1.scm (filter): change "caller" to "filter" in check-arg-type. diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index 75bcb0db1..c70fc90ed 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,9 @@ +2001-09-21 Rob Browning + + * tests/numbers.test (fixnum-bit): compute dynamically. + + * tests/bit-operations.test (fixnum-bit): compute dynamically. + 2001-09-07 Thien-Thi Nguyen * tests/getopt-long.test ("apples-blimps-catalexis example", From b21cccf315b4a20d19ac064d5b4b98921e57f108 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Sat, 22 Sep 2001 21:17:31 +0000 Subject: [PATCH 093/107] * srfi-19.scm (priv:split-real): Inserted missing call to inexact->exact. --- srfi/ChangeLog | 5 +++++ srfi/srfi-19.scm | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 7b0e54d8a..f3f76740e 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,8 @@ +2001-09-22 Mikael Djurfeldt + + * srfi-19.scm (priv:split-real): Inserted missing call to + inexact->exact. + 2001-09-21 Rob Browning * srfi-14.h (SCM_CHARSET_GET): need 1L, not just 1 in "<<". diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm index 721fd7414..639408858 100644 --- a/srfi/srfi-19.scm +++ b/srfi/srfi-19.scm @@ -319,7 +319,8 @@ (make-time (time-type time) (time-nanosecond time) (time-second time))) (define (priv:split-real r) - (if (integer? r) (values r 0) + (if (integer? r) + (values (inexact->exact r) 0) (let ((l (truncate r))) (values (inexact->exact l) (- r l))))) From 5437598b36938332d3a0813b4311ec7f700a8db7 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Sat, 22 Sep 2001 21:39:42 +0000 Subject: [PATCH 094/107] * 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. --- NEWS | 6 +++++ libguile/ChangeLog | 10 +++++++++ libguile/Makefile.am | 3 ++- libguile/num2float.i.c | 50 ++++++++++++++++++++++++++++++++++++++++++ libguile/numbers.c | 10 +++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 libguile/num2float.i.c diff --git a/NEWS b/NEWS index f29a14ef2..d97db2ee7 100644 --- a/NEWS +++ b/NEWS @@ -1208,6 +1208,12 @@ These are conversion functions between the various ANSI C integral types and Scheme numbers. NOTE: The scm_num2xxx functions don't accept an inexact argument. +** New functions: scm_float2num, scm_double2num, + scm_num2float, scm_num2double. + +These are conversion functions between the two ANSI C float types and +Scheme numbers. + ** New number validation macros: SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF] diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 75e2c56d9..a7530216b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,13 @@ +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 diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 09fa64ae5..9ead1f8a6 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -111,7 +111,8 @@ install-exec-hook: ## compile, since they are #included. So instead we list them here. ## Perhaps we can deal with them normally once the merge seems to be ## working. -noinst_HEADERS = coop-threads.c coop-threads.h coop.c num2integral.i.c +noinst_HEADERS = coop-threads.c coop-threads.h coop.c \ + num2integral.i.c num2float.i.c libguile_la_DEPENDENCIES = @LIBLOBJS@ libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL) diff --git a/libguile/num2float.i.c b/libguile/num2float.i.c new file mode 100644 index 000000000..22efffb1d --- /dev/null +++ b/libguile/num2float.i.c @@ -0,0 +1,50 @@ +/* this file is #include'd (several times) by numbers.c */ + +FTYPE +NUM2FLOAT (SCM num, unsigned long int pos, const char *s_caller) +{ + if (SCM_INUMP (num)) + return SCM_INUM (num); + else if (SCM_BIGP (num)) + { /* bignum */ + + FTYPE res = 0.0; + size_t l; + + for (l = SCM_NUMDIGS (num); l--;) + res = SCM_BIGRAD * res + SCM_BDIGITS (num)[l]; + + if (SCM_BIGSIGN (num)) + res = -res; + + if (isfinite (res)) + return res; + else + scm_out_of_range (s_caller, num); + } + else if (SCM_REALP (num)) + return SCM_REAL_VALUE (num); + else + scm_wrong_type_arg (s_caller, pos, num); +} + +SCM +FLOAT2NUM (FTYPE n) +{ + SCM z; + SCM_NEWCELL2 (z); + SCM_SET_CELL_TYPE (z, scm_tc16_real); + SCM_REAL_VALUE (z) = n; + return z; +} + +/* clean up */ +#undef FLOAT2NUM +#undef NUM2FLOAT +#undef FTYPE + +/* + Local Variables: + c-file-style: "gnu" + End: +*/ diff --git a/libguile/numbers.c b/libguile/numbers.c index 1c26b91be..596bacb33 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -4365,6 +4365,16 @@ scm_i_big2dbl (SCM b) #endif /* HAVE_LONG_LONGS */ +#define NUM2FLOAT scm_num2float +#define FLOAT2NUM scm_float2num +#define FTYPE float +#include "libguile/num2float.i.c" + +#define NUM2FLOAT scm_num2double +#define FLOAT2NUM scm_double2num +#define FTYPE double +#include "libguile/num2float.i.c" + #ifdef GUILE_DEBUG #define CHECK(type, v) \ From 581ded70a3757201d3c18ecdff04c6c1ca1edabe Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Sun, 23 Sep 2001 21:25:26 +0000 Subject: [PATCH 095/107] * 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. --- libguile/ChangeLog | 8 ++++++++ libguile/numbers.h | 9 ++++++++- libguile/validate.h | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index a7530216b..e17b83cf8 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/libguile/numbers.h b/libguile/numbers.h index 4c3023ecd..350f43f3d 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -325,9 +325,16 @@ extern SCM scm_ulong_long2num (unsigned long long sl); extern long long scm_num2long_long (SCM num, unsigned long int pos, const char *s_caller); extern unsigned long long scm_num2ulong_long (SCM num, unsigned long int pos, - const char *s_caller); + const char *s_caller); #endif +extern SCM scm_float2num (float n); +extern SCM scm_double2num (double n); +extern float scm_num2float (SCM num, unsigned long int pos, + const char *s_caller); +extern double scm_num2double (SCM num, unsigned long int pos, + const char *s_caller); + extern void scm_init_numbers (void); #endif /* SCM_NUMBERS_H */ diff --git a/libguile/validate.h b/libguile/validate.h index ddbf98a48..f7b7aec53 100644 --- a/libguile/validate.h +++ b/libguile/validate.h @@ -116,6 +116,12 @@ #define SCM_NUM2ULONG_LONG_DEF(pos, arg, def) \ (SCM_UNBNDP (arg) ? def : scm_num2ulong_long (arg, pos, FUNC_NAME)) +#define SCM_NUM2FLOAT(pos, arg) \ + (scm_num2float (arg, pos, FUNC_NAME)) + +#define SCM_NUM2DOUBLE(pos, arg) \ + (scm_num2double (arg, pos, FUNC_NAME)) + #define SCM_OUT_OF_RANGE(pos, arg) \ do { scm_out_of_range_pos (FUNC_NAME, arg, SCM_MAKINUM (pos)); } while (0) @@ -232,6 +238,16 @@ cvar = SCM_NUM2LONG (pos, k); \ } while (0) +#define SCM_VALIDATE_FLOAT_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2FLOAT (pos, k); \ + } while (0) + +#define SCM_VALIDATE_DOUBLE_COPY(pos, k, cvar) \ + do { \ + cvar = SCM_NUM2DOUBLE (pos, k); \ + } while (0) + #define SCM_VALIDATE_BIGINT(pos, k) SCM_MAKE_VALIDATE (pos, k, BIGP) #define SCM_VALIDATE_INUM_MIN(pos, k, min) \ From 5d20b8c7fe66e39fb48249cd25efbf8f700f5001 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Mon, 24 Sep 2001 11:12:23 +0000 Subject: [PATCH 096/107] * boot-9.scm (process-define-module): Added :re-export. --- ice-9/ChangeLog | 4 ++++ ice-9/boot-9.scm | 26 +++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 33fd49435..abdf1fe75 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,7 @@ +2001-09-24 Mikael Djurfeldt + + * boot-9.scm (process-define-module): Added :re-export. + 2001-09-19 Thien-Thi Nguyen * expect.scm: Commentary fix; nfc. diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index e52b54947..fb9feef3b 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -1705,13 +1705,15 @@ (beautify-user-module! module) (let loop ((kws kws) (reversed-interfaces '()) - (exports '())) + (exports '()) + (re-exports '())) (if (null? kws) (begin (for-each (lambda (interface) (module-use! module interface)) (reverse reversed-interfaces)) - (module-export! module exports)) + (module-export! module exports) + (module-re-export! module re-exports)) (case (car kws) ((#:use-module #:use-syntax) (or (pair? (cdr kws)) @@ -1729,7 +1731,8 @@ #f))) (loop (cddr kws) (cons interface reversed-interfaces) - exports))) + exports + re-exports))) ((#:autoload) (or (and (pair? (cdr kws)) (pair? (cddr kws))) (unrecognized kws)) @@ -1738,19 +1741,28 @@ (cadr kws) (caddr kws)) reversed-interfaces) - exports)) + exports + re-exports)) ((#:no-backtrace) (set-system-module! module #t) - (loop (cdr kws) reversed-interfaces exports)) + (loop (cdr kws) reversed-interfaces exports re-exports)) ((#:pure) (purify-module! module) - (loop (cdr kws) reversed-interfaces exports)) + (loop (cdr kws) reversed-interfaces exports re-exports)) ((#:export) (or (pair? (cdr kws)) (unrecognized kws)) (loop (cddr kws) reversed-interfaces - (append (cadr kws) exports))) + (append (cadr kws) exports) + re-exports)) + ((#:re-export) + (or (pair? (cdr kws)) + (unrecognized kws)) + (loop (cddr kws) + reversed-interfaces + exports + (append (cadr kws) re-exports))) (else (unrecognized kws))))) module)) From 4a151b3da9283c5a52544a2e974be3b9221712eb Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Tue, 25 Sep 2001 22:46:13 +0000 Subject: [PATCH 097/107] * ports.c (scm_drain_input): extended the docstring. thanks to Alex Schroeder and Thien-Thi Nguyen. --- libguile/ChangeLog | 5 +++++ libguile/ports.c | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e17b83cf8..df99c73eb 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +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, diff --git a/libguile/ports.c b/libguile/ports.c index 4ee18fc3d..9e1acad54 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -311,8 +311,19 @@ size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len) /* Clear a port's read buffers, returning the contents. */ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0, (SCM port), - "Drain @var{port}'s read buffers (including any pushed-back\n" - "characters) and return the content as a single string.") + "This procedure clears a port's input buffers, similar\n" + "to the way that force-output clears the output buffer. The\n" + "contents of the buffers are returned as a single string, e.g.,\n" + "\n" + "@lisp\n" + "(define p (open-input-file ...))\n" + "(drain-input p) => empty string, nothing buffered yet.\n" + "(unread-char (read-char p) p)\n" + "(drain-input p) => initial chars from p, up to the buffer size.\n" + "@end lisp\n\n" + "Draining the buffers may be useful for cleanly finishing\n" + "buffered I/O so that the file descriptor can be used directly\n" + "for further input.") #define FUNC_NAME s_scm_drain_input { SCM result; From fa08b58ea83814ab5294141806ab89d9e2c8db1b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 02:17:12 +0000 Subject: [PATCH 098/107] Add bugfix item to "Eventually". --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 6ca4ff836..98f85a45f 100644 --- a/TODO +++ b/TODO @@ -57,6 +57,8 @@ that user-visible changes are reflected in NEWS. - implement internationalized strings - revise the uniform vector implementation - make the set of error signalling functions more consistent +- Fix bug reported by Sven.Hartrumpf@fernuni-hagen.de 2001-08-31: + (debug-disable 'debug) has no effect if it is the first form in ~/.guile. * Before releasing 1.8.0: From 2cbad7d91396b5cad59f125c4d746ac75ce35432 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 02:19:28 +0000 Subject: [PATCH 099/107] *** empty log message *** --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 596a795b6..748f28f48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-09-25 Thien-Thi Nguyen + + * TODO: Add bugfix item to "Eventually". + 2001-09-20 Rob Browning * configure.in (AC_CONFIG_FILES): add libguile/version.h. From a55040896d379a3b0a4eb3bb1336a2760b2ae200 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 02:45:17 +0000 Subject: [PATCH 100/107] (Syntax Rules): Add `cindex' directive. Thanks to suggestion by Alex Schroeder. --- doc/ref/scheme-procedures.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/ref/scheme-procedures.texi b/doc/ref/scheme-procedures.texi index b6886a325..194d2dd99 100644 --- a/doc/ref/scheme-procedures.texi +++ b/doc/ref/scheme-procedures.texi @@ -573,6 +573,7 @@ For example: @node Syntax Rules @section The R5RS @code{syntax-rules} System +@cindex R5RS syntax-rules system R5RS defines an alternative system for macro and syntax transformations using the keywords @code{define-syntax}, @code{let-syntax}, From 523f81bad8b9eb5913e8ab811962f575139e76cf Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 02:46:30 +0000 Subject: [PATCH 101/107] *** empty log message *** --- doc/ref/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index e3b3bbcc6..903255e68 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,8 @@ +2001-09-25 Thien-Thi Nguyen + + * scheme-procedures.texi (Syntax Rules): Add `cindex' directive. + Thanks to suggestion by Alex Schroeder. + 2001-08-30 Neil Jerram * guile.texi (Top): Group all index nodes together so that From f5dd4f54192b15235c446c7418cfc3efb243b2ab Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 03:14:15 +0000 Subject: [PATCH 102/107] (SCM_MAKE_CHAR): Use `scm_t_bits' instead of `intptr_t'. Thanks to Golubev I. N. --- libguile/chars.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/chars.h b/libguile/chars.h index 1e92f6679..221a4039b 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -53,7 +53,7 @@ */ #define SCM_CHARP(x) (SCM_ITAG8(x) == scm_tc8_char) #define SCM_CHAR(x) ((unsigned int)SCM_ITAG8_DATA(x)) -#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((intptr_t) x, scm_tc8_char) +#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((scm_t_bits) x, scm_tc8_char) From cf4ee84106aa9683a94853fd4a036812a5e43d1b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 26 Sep 2001 03:15:44 +0000 Subject: [PATCH 103/107] *** empty log message *** --- libguile/ChangeLog | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index df99c73eb..3f81af82a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +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 @@ -87,7 +92,7 @@ * 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): 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.) @@ -150,7 +155,7 @@ * 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 @@ -222,7 +227,7 @@ 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.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] From 40f316d0b704af63cab248b0d635fc9d3557b0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Grabm=C3=BCller?= Date: Wed, 26 Sep 2001 17:24:54 +0000 Subject: [PATCH 104/107] Some cosmetic doc fixes. --- doc/ref/ChangeLog | 12 ++++++++++++ doc/ref/misc-modules.texi | 6 +++--- doc/ref/srfi-modules.texi | 12 ++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 903255e68..17c12b23d 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,15 @@ +2001-09-26 Martin Grabmueller + + * srfi-modules.texi (SRFI-13): Tyop fix. + (SRFI-13): Changed paragraph about bindings both in the code and + in SRFI-13. + + * misc-modules.texi (Formatted Output): Tyop fix. + (Formatted Output): Document ~g properly. + + Thanks to Alex Schroeder for pointing out the typos and sending + suggestions. + 2001-09-25 Thien-Thi Nguyen * scheme-procedures.texi (Syntax Rules): Add `cindex' directive. diff --git a/doc/ref/misc-modules.texi b/doc/ref/misc-modules.texi index 30f821937..9dd6d99f0 100644 --- a/doc/ref/misc-modules.texi +++ b/doc/ref/misc-modules.texi @@ -124,7 +124,7 @@ Output a newline character, thus advancing to the next output line. @item ~& Start a new line, that is, output a newline character if not already -at the statr of a line. +at the start of a line. @item ~_ Output a single space character. @@ -173,8 +173,8 @@ Output the corresponding @var{arg} in exponential notation, such as @code{1.34E+0}. @item ~g -%% FIXME::martin: There must be a difference. Does anybody know? -Like @code{~f}. +This works either like @code{~f} or like @code{~e}, whichever produces +less characters to be written. @item ~$ Like @code{~f}, but only with two digits after the decimal point. diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index 2f48f7dd1..56e4ff718 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -1124,11 +1124,11 @@ please refer to the relevant chapters in the Guile Reference Manual, for example the documentation of strings and string procedures (@pxref{Strings}). -All of the procedures defined in SRFI-13, which are not already included -in the Guile core library, are implemented in the module @code{(srfi -srfi-13)}. The procedures which are both in Guile and in SRFI-13, but -which are slightly extended, have been implemented in this module, and -the bindings overwrite those in the Guile core. +All of the procedures defined in SRFI-13, which are not already +included in the Guile core library, are implemented in the module +@code{(srfi srfi-13)}. The procedures which are both in Guile and in +SRFI-13 are slightly extended in this module. Their bindings +overwrite those in the Guile core. The procedures which are defined in the section @emph{Low-level procedures} of SRFI-13 for parsing optional string indices, substring @@ -1152,7 +1152,7 @@ soon as possible. * SRFI-13 Case Mapping:: Mapping to lower-/upper-case. * SRFI-13 Reverse/Append:: Reverse and append strings. * SRFI-13 Fold/Unfold/Map:: Construct/deconstruct strings. -* SRFI-13 Replicate/Rotate:: Replacate and rotate portions of strings. +* SRFI-13 Replicate/Rotate:: Replicate and rotate portions of strings. * SRFI-13 Miscellaneous:: Left-over string procedures. * SRFI-13 Filtering/Deleting:: Filter and delete characters from strings. @end menu From 109f654e7f25cd3a3b59f5c3cf0d00e8585d8d14 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 30 Sep 2001 18:24:10 +0000 Subject: [PATCH 105/107] (module-name->filename-frag, display-module-commentary): New procs. (display-commentary): Also handle refs that look like module names. --- scripts/display-commentary | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/scripts/display-commentary b/scripts/display-commentary index 21ce2c03a..59b0890fc 100755 --- a/scripts/display-commentary +++ b/scripts/display-commentary @@ -26,9 +26,11 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" ;;; Commentary: -;; Usage: display-commentary FILE1 FILE2 ... +;; Usage: display-commentary REF1 REF2 ... ;; -;; Display Commentary section from FILE1, FILE2 and so on. +;; Display Commentary section from REF1, REF2 and so on. +;; Each REF may be a filename or module name (list of symbols). +;; In the latter case, a filename is computed by searching `%load-path'. ;;; Code: @@ -39,8 +41,29 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" (define (display-commentary-one file) (format #t "~A commentary:\n~A" file (file-commentary file))) -(define (display-commentary . files) - (for-each display-commentary-one files)) +(define (module-name->filename-frag ls) ; todo: export or move + (let ((ls (map symbol->string ls))) + (let loop ((ls (cdr ls)) (acc (car ls))) + (if (null? ls) + acc + (loop (cdr ls) (string-append acc "/" (car ls))))))) + +(define (display-module-commentary module-name) + (cond ((%search-load-path (module-name->filename-frag module-name)) + => (lambda (file) + (format #t "module ~A\n" module-name) + (display-commentary-one file))))) + +(define (display-commentary . refs) + (for-each (lambda (ref) + (cond ((string? ref) + (if (equal? 0 (string-index ref #\()) + (display-module-commentary + (with-input-from-string ref read)) + (display-commentary-one ref))) + ((list? ref) + (display-module-commentary ref)))) + refs)) (define main display-commentary) From 53b5d2ccf8a3727f3c8fa0e3e343588b1eb25b84 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 30 Sep 2001 18:25:17 +0000 Subject: [PATCH 106/107] *** empty log message *** --- scripts/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 04ee6ceb7..d6445e73b 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2001-09-30 Thien-Thi Nguyen + + * display-commentary (module-name->filename-frag, + display-module-commentary): New procs. + (display-commentary): Also handle refs that look like module + names. + 2001-08-25 Marius Vollmer * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu". From c14bde861d2a45d09f7d8e857581d115da37cadc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 30 Sep 2001 22:29:56 +0000 Subject: [PATCH 107/107] Initial revision --- BUGS | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 BUGS diff --git a/BUGS b/BUGS new file mode 100644 index 000000000..303b89974 --- /dev/null +++ b/BUGS @@ -0,0 +1,30 @@ +BUGS + +This file contains bugs we haven't fixed yet, and some we have. +The format is very simple (one bug per page): + +bug NUMBER -- ONE-LINE-DESCRIPTION +reported-by: SOMEONE / DATE +fixed: DATE (for guile VERSION) +OTHER-NOTES + + +bug 0 -- no BUGS file +reported-by: ttn / 2001-09-25 +fixed: 2001-09-30 (1.5.x, 1.7.x) + +all bugs are good bugs! + + +bug 1 -- (debug-disable 'debug) has no effect if first form in ~/.guile +reported-by: Sven.Hartrumpf@fernuni-hagen.de / 2001-08-31 +fixed: + +buggy behavior confirmed on both 1.5.x and 1.7.x (ttn). + +on the other hand, when second or later, the expected effect (disabling use of +debugging evaluator) seems to be reflected when viewing the debug options. it +could be that the bug is in display and not the actual setting. + + +[BUGS ends here]