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

55 commits

Author SHA1 Message Date
Marius Vollmer
7d81830dd2 The FSF has a new address. 2005-05-23 20:15:36 +00:00
Mikael Djurfeldt
071d6b0ecc * tests/goops.test: New tests.
* goops.scm (equal?): Provide default method for `equal?'.
(compute-getters-n-setters): Check for bad init-thunks.

* eq.c (scm_equal_p): Turned into a primitive generic.

* snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
macros.
2003-04-17 17:50:57 +00:00
Neil Jerram
5a5464e533 * Docstring fixes and corresponding manual updates. 2002-03-15 09:23:19 +00:00
Martin Grabmüller
226be35413 * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,
chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c,
	feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c,
	gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c,
	gh_predicates.c, gsubr.c, gsubr.h, guardians.h,
	guile-func-name-check.in, guile-snarf-docs-texi.in,
	guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in,
	hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h,
	objprop.c, objprop.h, options.c, options.h, random.h,
	regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c,
	strerror.c, strop.h, strports.h, threads.h, values.c, values.h,
	version.c, version.h: Updated copyright notice.
2001-07-19 21:28:54 +00:00
Thien-Thi Nguyen
d47795627b Remove "face-lift" comment. 2001-07-09 07:31:05 +00:00
Michael Livshin
ac13d9d210 * snarf.h (SCM_SNARF_DOCS): change the "grammar" slightly.
* guile-snarf-docs.in, guile-snarf-docs-texi.in: rewrite &
simplify.

* eval.c: all hash signs are in column 0.

* Makefile.am (guile_filter_doc_snarfage): build using
c-tokenize.c, not filter-doc-snarfage.c.
rearrange snarfing dependencies a bit.

* c-tokenize.lex: new file.
2001-06-25 03:30:02 +00:00
Michael Livshin
a88ff5b650 * snarf.h, filter-doc-snarfage.c: more changes to cope with
space-happy C preprocessors.
2001-06-08 14:49:05 +00:00
Michael Livshin
c99f960518 * guile-snarf-docs.in, guile-snarf-docs-texi.in,
filter-doc-snarfage.c: new files.

* Makefile.am: add stuff to [build,] use and distribute
guile-snarf-docs, guile-snarf-docs-texi, guile_filter_doc_snarfage.

* guile-snarf.in: grok the new snarf output.

* snarf.h: make the output both texttools- and `read'-friendly.

* guile-doc-snarf.in (bindir): reimplement in terms of guile-snarf
and guile-snarf-docs.  (should also deprecate, I guess.  maybe
not).
2001-05-31 13:15:54 +00:00
Marius Vollmer
a0f3e74752 (SCM_CONST_LONG): Use SCM_VCELL_INIT instead of
SCM_VARIABLE_INIT since that it what it used to be.
2001-05-22 22:46:14 +00:00
Marius Vollmer
9a441ddb34 (scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic,
scm_c_define_gsubr_with_generic): New functions.  They replace
scm_make_gsubr and scm_make_gsubr_with_generic.  The `make' variants
only create the gsubr object, while the `define' variants also put it
into the current module.  Changed all callers.  (scm_make_gsubr,
scm_make_gsubr_with_generic): Deprecated.

(scm_c_make_subr, scm_c_define_subr, scm_c_make_subr_with_generic,
scm_c_define_subr_with_generic): New functions.  They replace
scm_make_subr, scm_make_subr_opt and scm_make_subr_with_generic.  The
`make' variants only create the subr object, while the `define'
variants also put it into the current module.  Changed all callers.
(scm_make_subr, scm_make_subr_opt, scm_make_subr_with_generic):
Deprecated.
2001-05-20 00:35:43 +00:00
Marius Vollmer
86d31dfe7d Merge from mvo-vcell-cleanup-1-branch. 2001-05-15 14:57:22 +00:00
Marius Vollmer
e1fbffa9f4 (SCM_FUNC_CAST_ARBITRARY_ARGS): Use "SCM (*)()" for C++
as well.  "SCM (*)(...)" does not work on RedHat 7.1.
2001-05-06 21:19:53 +00:00
Keisuke Nishida
a9205f0774 * snarf.h (SCM_CONST_LONG): Deprecated.
* tag.c (CONST_INUM): New macro.  Use it to define scm_utag_*.
2001-03-16 05:11:34 +00:00
Dirk Herrmann
a3fc3be99d * Make the creation of bindings more straightforward. 2000-12-12 14:07:06 +00:00
Dirk Herrmann
38ae064c6e * Use scm_mem2symbol or scm_str2symbol to create symbol objects. 2000-12-08 17:08:34 +00:00
Dirk Herrmann
3c6d9d717f * Renamed SCM__X tokens to better readable ones that also follow the
SCM_SNARF_ prefix convention.
2000-06-21 08:43:12 +00:00
Mikael Djurfeldt
94a708591f * snarf.h (SCM_SNARF_HERE, SCM_SNARF_INIT, SCM_SNARF_DOCS):
Renamed from SCM_HERE, SCM_INIT, SCM_DOCS.
2000-06-12 11:59:57 +00:00
Mikael Djurfeldt
d80f396e99 * snarf.h, guile-snarf.awk.in, guile-snarf.in: Replaced snarf
markers with identifiers (SCM__I, SCM__D, SCM__S, SCM__E).
(Thanks to Bernard Urban.)
2000-06-08 18:48:24 +00:00
Dirk Herrmann
54778cd312 Lots of fixes to make guile (at some time) compile with strict typing. 2000-04-03 08:47:51 +00:00
Michael Livshin
89e00824a0 * *.[hc]: add Emacs magic at the end of file, to ensure GNU
indentation style.
2000-03-19 19:01:16 +00:00
Mikael Djurfeldt
e282f286eb * alist.c, eval.c, net_db.c, posix.c, print.c, snarf.h, struct.c,
tags.h: Fixed copyright notices.
2000-03-12 16:08:24 +00:00
Mikael Djurfeldt
fd61ba9ee2 * snarf.h (SCM_PROC1): Replaced SCM (*) (...) with
SCM_FUNC_CAST_ARBITRARY_ARGS.
2000-01-12 01:29:42 +00:00
Greg J. Badros
2fdcf8bdf0 * backtrace.c: Fix spelling typo in a comment.
* snarf.h: Use new SCM_DOCS macro to encapsulate the non SCM_INIT
text.  Reformatted some of the expansions.
2000-01-09 01:07:17 +00:00
Greg J. Badros
1e76143f0f * scm_validate.h (SCM_OUT_OF_RANGE): Use scm_out_of_range_pos to
report the position of the argument.

* error.h, error.c (scm_out_of_range_pos):  Added this function to
take extra "pos" argument, the position number of the errant
argument.

* debug.c: Use SCM_OUT_OF_RANGE instead of scm_out_of_range.

* snarf.h: Use SCM_HERE and SCM_INIT as names, not SCM_NOTSNARF
and SCM_SNARFING.  Also put the %%% in the SCM_INIT since Mikael
prefers that and I'm reasonably indifferent.
2000-01-07 23:53:20 +00:00
Mikael Djurfeldt
73d8385e9f * snarf.h (SCM_INSITU, SCM_INIT): Resurrected. 2000-01-07 23:33:29 +00:00
Greg J. Badros
4b4d0898a6 * snarf.h: Factor out differences between C++ and non-C++ into
SCM_FUNC_CAST_ARBITRARY_ARGS macro.  Modify all the snarf macro
definitions to use SCM_NOTSNARF and SCM_SNARFING macros (like
Mikael's macros, below, but changed names and SCM_SNARFING no
longer expands to include %%% -- that must appear in the argument
so that the token appears at the call-site as a reminder).
2000-01-07 23:05:04 +00:00
Mikael Djurfeldt
03ec84b88b Added extra newline in SCM_INIT macro. 2000-01-07 00:51:16 +00:00
Mikael Djurfeldt
bfe19b466f * snarf.h (SCM_INSITU, SCM_INIT): New snarf macros for use in user
snarf macro definitions.
2000-01-07 00:29:28 +00:00
Greg J. Badros
c3ee75204c * *.c, snarf.h: Replace GUILE_PROC1 with SCM_DEFINE1 throughout. 2000-01-06 19:51:45 +00:00
Greg J. Badros
a1ec69163d *.[ch]: Replace GUILE_PROC w/ SCM_DEFINE. 2000-01-05 19:05:23 +00:00
Greg J. Badros
5a237c9d5d * snarf.h (SCM_ASSERT): Give new definition of SCM_ASSERT when in
snarfing mode to output a lexically-identifiable sequence that the
guile-snarf.awk script uses to verify argument/position matching.
2000-01-05 18:19:54 +00:00
Mikael Djurfeldt
8f151b4264 Completed last change 1999-12-14 21:47:03 +00:00
Greg J. Badros
9b1594fd19 * snarf.h: Put SCM_PROC and SCM_PROC1 back in for
backward-compatibility of packages that use Guile.  Internally
Guile should not use them, though.  (Maybe enforce this with a new
-DBUILDING_GUILE compile-time flag?).
1999-12-14 18:54:31 +00:00
Greg J. Badros
eff08ab65d * scm_validate.h: Drop the SCM_DOCSTRING_SNARF for turning off
SCM_VALIDATE macros;  the SCM_VALIDATE macros should be checked
for argument mismatches (along with the FUNC_NAME macro checking)
by a static tool that runs directly over the .c files.

* snarf.h: Handle SCM_REGISTER_PROC better when snarfing.  The
docstring is still missing from the .doc file;  it just gives the
name of the C function that gets called instead.

* guile-doc-snarf.awk: Be sure to touch the output files to help
make out.  Also handle SCM_REGISTER_PROC better, and change the
output format slightly.
1999-12-13 00:52:43 +00:00
Greg J. Badros
3dc81fbace * snarf.h: Drop SCM_PROC, SCM_PROC1. Added extra output for
guile-doc-snarf script.

* guile-doc-snarf.in, guile-doc-snarf.awk: New, simple doc
extraction system.  Builds foo.x, foo.doc from foo.{c,cc}.
There are dependencies between these files and snarf.h.  This
replaces guile-snarf.

* guile-snarf.in: Drop everything after $$$ for the new snarf.h
macros.  This is obsoleted by guile-doc-snarf, but kept here for
now for good measure.

* Makefile.am: Added guile-doc-snarf, guile-doc-snarf.awk to
bin_SCRIPTS.  Added .doc to SUFFIXES, and give rule for creating
.doc files to use guile-doc-snarf.  Update the rule for creating
.x files to use guile-doc-snarf.
1999-12-12 23:37:40 +00:00
Greg J. Badros
6e8d25a695 * *.c: Finish replacing K&R style prototypes with ANSI C
prototypes.

* eval.c: Make scm_m_mody's 3rd argument be a const char *, not a
char *.  ANSI prototypes caught this.

* strorder.c: Use GUILE_PROC1 for the couple SCM_PROC1 expansions
that I missed.

* scm_validate.h: Use SCM_BOOLP for validating bools.  Do not
expand macros if SCM_DOCSTRING_SNARF.
1999-12-12 20:35:02 +00:00
Greg J. Badros
1bbd0b849f * *.c: Pervasive software-engineering-motivated rewrite of
function headers and argument checking.  Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header.  Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy.  This is very similar to what I did for Scwm.

Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile.  I'll work on
that tomorrow, I expect.

* Makefile.am: Added scm_validate.h to modinclude_HEADERS.

* chars.c: Added docstrings for the primitives defined in here.

* snarf.h:  Added GUILE_PROC, GUILE_PROC1.  Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now.  Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.

* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile.  Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.
1999-12-12 02:36:16 +00:00
Jim Blandy
1bf17bb472 * snarf.h (SCM_GLOBAL_KEYWORD): Call scm_c_make_keyword, not
scm_makekey, which doesn't exist any more.  Guess nobody's using
this.
1999-09-05 12:41:52 +00:00
Mikael Djurfeldt
9de33deb2e * procs.c, procs.h (scm_subr_entry): New type: Stores data
associated with subrs.
(SCM_SUBRNUM, SCM_SUBR_ENTRY, SCM_SUBR_GENERIC, SCM_SUBR_PROPS,
SCM_SUBR_DOC): New macros.
(scm_subr_table): New variable.
(scm_mark_subr_table): New function.

* init.c (scm_boot_guile_1): Call scm_init_subr_table.

* gc.c (scm_gc_mark): Don't mark subr names here.
(scm_igc): Call scm_mark_subr_table.

* snarf.h (SCM_GPROC, SCM_GPROC1): New macros.

* procs.c, procs.h (scm_subr_p): New function (used internally).

* gsubr.c, gsubr.h (scm_make_gsubr_with_generic): New function.

* objects.c, objects.h (scm_primitive_generic): New class.

* objects.h (SCM_CMETHOD_CODE, SCM_CMETHOD_ENV): New macros.

* print.c (scm_iprin1): Print primitive-generics.

* __scm.h (SCM_WTA_DISPATCH_1, SCM_GASSERT1,
SCM_WTA_DISPATCH_2, SCM_GASSERT2): New macros.

* eval.c (SCM_CEVAL, SCM_APPLY): Replace scm_wta -->
SCM_WTA_DISPATCH_1 for scm_cxr's (unary floating point
primitives).  NOTE: This means that it is now *required* to use
SCM_GPROC1 when creating float scm_cxr's (float scm_cxr's is an
obscured representation that will be removed in the future anyway,
so backward compatibility is no problem here).

* numbers.c: Converted most numeric primitives (all but bit
comparison operations and bit operations) to dispatch on generic
if args don't match.

* eval.c, eval.h (scm_eval_body): New function.

* objects.c (scm_call_generic_0, scm_call_generic_1,
scm_call_generic_2, scm_call_generic_3, scm_apply_generic): New
functions.

* eval.c (SCM_CEVAL): Apply the cmethod directly after having
called scm_memoize_method instead of doing a second lookup.

* objects.h (scm_memoize_method): Now returns the memoized cmethod.

* procs.c (scm_make_subr_opt): Use scm_sysintern0 instead of
scm_sysintern so that the binding connected with the subr name
isn't cleared when we give set = 0.
1999-08-26 04:24:42 +00:00
Jim Blandy
af68fb843b * snarf.h (SCM_CONST_LONG): Remove trailing semicolon from
definition.
1999-07-19 07:53:51 +00:00
Jim Blandy
37a33fed28 Patch from Greg Badros:
* snarf.h (SCM_PROC, SCM_PROC1): Use __cplusplus or
GUILE_CPLUSPLUS_SNARF macros to force adding a cast to the last
(function pointer) argument to scm_make_gsubr and scm_make_subr
calls.  This avoids warnings in C++ programs using guile-snarf.
1999-07-17 05:49:20 +00:00
Mikael Djurfeldt
37b83f68b0 * snarf.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): New macros. 1999-06-23 11:16:52 +00:00
Jim Blandy
e4755e5c7b * numbers.c (s_bignum): Renamed to s_bignum, and made static.
Libguile should not be exporting random little strings.
* numbers.h (s_bignum): Extern declaration removed.
More const changes from Ken Raeburn.
* numbers.c (scm_s_bignum, fx): Now const.
(scm_logtab, scm_ilentab, s_adjbig): Now static and const.
* numbers.h (scm_s_bignum): Update declaration.
* eval.c (bodycheck): Argument WHAT now points to const.
* snarf.h (SCM_SYNTAX): Name is const.
* eval.c (scm_i_let): Make this globally visible, to avoid dynamic
linking crashes on NetBSD.  (Thanks to Ken Raeburn.)
1999-04-17 16:03:32 +00:00
Jim Blandy
3eeba8d4f5 * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
s_clauses, s_formals): Variables now const.
* eval.c (promsmob): Now const.
* macros.c (macrosmob): Now const.
* smob.c (scm_newsmob): Smobfuns argument now points to const.
(freecell, flob, bigob): Now const.
* dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
error.c (scm_error, scm_syserror, scm_syserror_msg,
scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
scm_memory_error, scm_misc_error, scm_wta), macros.c
(scm_make_synt), feature.c (scm_add_feature), filesys.c
(scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
scm_num2long_long, scm_num2ulong),
options.c (scm_options), posix.c (scm_convert_exec_args,
environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
(scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
(setzone, restorezone, bdtime2c), strop.c (scm_i_index),
strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
scm_intern_obarray, scm_intern, scm_intern0,
scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
indicating calling subr, error message text, reason for error,
symbol name or feature name are now pointer to const.
* snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
* procs.c (scm_init_iprocs): iproc argument now points to const.
* pairs.c (cxrs): Now const.
* chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
strports.h, symbols.h, unif.h: Update variable declarations and
function prototypes for above changes.
* dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
SYMB now point to const.
1999-02-06 12:31:04 +00:00
Maciej Stachowiak
b8229a3bab * snarf.h (SCM_SYNTAX): New macro to allow convenient declaration of
syntactic forms, similar to SCM_PROC.
* debug.c, eval.c, evalext.c: use SCM_SYNTAX to declare all special
forms, and SCM_SYMBOL or SCM_GLOBAL_SYMBOL to delcare C variables for
the name symbols when needed.
1998-12-14 15:19:59 +00:00
Jim Blandy
e9b6a0fb97 Bug reports from Russ McManus:
* guile-snarf.in: If the CPP environment variable is set, use that
as the C preprocessor, instead of the preprocessor autoconf
found.
* snarf.h (SCM_PROC): Cast the function pointer passed to
scm_make_gsubr, to satisfy C++.
1998-10-24 20:55:23 +00:00
Jim Blandy
7dc6e7547a * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,
continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h,
dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h,
feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h,
genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c,
hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h,
list.c, list.h, load.c, load.h, mallocs.c, markers.c,
mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c,
regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c,
script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c,
srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h,
strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c,
symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c,
vectors.c, vectors.h, version.h, vports.c, weaks.c: Update
copyright years.
1998-10-19 21:36:50 +00:00
Jim Blandy
d021129f24 * snarf.h (SCM_PROC, SCM_PROC1): Remove very odd code in #ifdef
__cplusplus clause.  I seriously doubt this ever worked the way
the author seems to have intended.
1998-10-06 13:01:46 +00:00
Jim Blandy
2e07d03336 * snarf.h: Add SCM_VCELL_INIT and SCM_GLOBAL_VCELL_INIT macros;
these are analogous to SCM_VCELL and SCM_GLOBAL_VCELL but take a
third argument, a C expression that should result in a SCM value,
which is used to initialize the variable. Reimplemented
SCM_CONST_LONG in terms of SCM_VCELL_INIT.  (Thanks to Maciej
Stachowiak.)
1998-09-29 19:57:22 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00