summaryrefslogtreecommitdiff
path: root/libguile/procs.c
AgeCommit message (Collapse)AuthorFilesLines
2001-05-20(scm_c_make_subr, scm_c_define_subr,Marius Vollmer1-21/+58
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-15Merge from mvo-vcell-cleanup-1-branch.Marius Vollmer1-10/+7
2001-05-09 * procs.c: Increased `scm_subr_table_room' to 800 because Guile nowMartin Grabmüller1-1/+4
has 779 primitives on startup.
2001-04-19* Fixed scm_thunk_p's results when applied to closures.Dirk Herrmann1-4/+3
* Extracted macro printing code from print.c to macros.c. * Minor cleanups.
2001-03-09Remove #include <stdio.h>. Add #include <string.h>.Keisuke Nishida1-1/+1
2001-02-16(scm_make_cclo, scm_procedure_p, scm_closure_p, scm_thunk_p,Martin Grabmüller1-9/+13
scm_procedure_with_setter_p, scm_make_procedure_with_setter, scm_procedure): Added docstrings.
2000-12-28* Re-introduces the unused member "documentation" of struct scm_subr_entry.Dirk Herrmann1-0/+3
2000-12-23* Removed unused member "properties" from struct scm_subr_entry.Dirk Herrmann1-3/+0
2000-12-22* Removed unused member "documentation" from struct scm_subr_entry.Dirk Herrmann1-5/+11
* Eliminate use of scm_intern0/scm_sysintern0 in procs.c.
2000-12-06* eval.c: remove commented code, remove #ifdef CCLO conditionalsDirk Herrmann1-1/+1
* remove uses of older GC marking and cell accessing macros
2000-11-25 * use an applicable SMOB to represent continuations, instead of aGary Houston1-3/+1
custom tc7 type. This will make it easier to support R5RS multiple value continuations, without the use of a Scheme-level wrapper. * continuations.c (scm_tc16_continuation, continuation_mark, continuation_free, continuation_print, continuation_apply): new SMOB support. (scm_make_continuation): new procedure, replaces scm_make_cont with a different interface. (copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten. (CHEAP_CONTINUATIONS): removed non-working code completely. (scm_call_continuation): removed. * continuations.h (struct scm_contregs): add num_stack_items and stack fields. previously stack was stored following this struct: use a tail array instead. (SCM_CONTINUATIONP): new macro. (SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH): rewritten. (SCM_SET_CONTREGS): removed. * tags.h: removed scm_tc7_contin (was tag 61). * debug.c, gc.c, hash.c, print.c, procprop.c, procs.c: removed scm_tc7_contin support. * eval.c: use scm_make_continuation instead of scm_make_cont. don't set jump buffers here. remove scm_tc7_contin support. * init.c, root.c: create SMOB continuation for rootcont instead of scm_tc7_contin. call scm_init_continuations before scm_init_root. * root.c: remove support for static jmpbuf. It's not used by default and I broke it. create SMOB continuation for rootcont. * stacks.c: use SCM_CONTINUATIONP.
2000-11-17* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,Marius Vollmer1-0/+2
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c, hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c, list.c, load.c, macros.c, modules.c, net_db.c, numbers.c, objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c, print.c, procprop.c, procs.c, properties.c, ramap.c, random.c, read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c, socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c, version.c, vports.c, weaks.c: Makes sure the snarfer output inclusion is disabled when the snarfer is run on the file. Thanks to Lars J. Aas! * Makefile.am: Install guile-procedures.txt in version-specific directory to enable multiple installed guile versions. Suggested by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-09-26* Don't use string or vector macros when accessing compiled closures.Dirk Herrmann1-5/+9
2000-08-25* smob.h (scm_smob_descriptor): Added `apply\' and `gsubr_type\'.Keisuke Nishida1-0/+3
* smob.c (scm_make_smob_type): Initialize `apply\' and `gsubr_type\'. (scm_set_smob_apply): New function. (scm_smob_apply_0, scm_smob_apply_1, scm_smob_apply_2, scm_smob_apply_3): New functions. * eval.c (SCM_CEVAL, SCM_APPLY): Added dispatch for applicable smobs. * procs.c (s_scm_procedure_p): Check applicable smobs.
2000-06-12Added commentMikael Djurfeldt1-1/+1
2000-06-05* Don't assign to SCM_SUBRF, use new SCM_SET_SUBRF macro instead.Dirk Herrmann1-1/+1
2000-06-05* Removed SCM_TRUE_P since it may get confused with !SCM_FALSEP.Dirk Herrmann1-2/+3
2000-04-25* Remove function scm_init_iprocs, remove struct scm_iproc and simplifyDirk Herrmann1-10/+0
initialization of c[ad]+r functions. * Remove structs scm_subr and scm_dsubr and access the function cell words directly instead of casting a cell to a C struct.
2000-04-21* Makefile.am (DEFS): Added. automake adds -I options to DEFS,Mikael Djurfeldt1-7/+7
and we don't want that. (INCLUDES): Removed all -I options except for the root source directory and the root build directory. * *.*: Change includes so that they always use the "prefixes" libguile/, qt/, guile-readline/, or libltdl/. (Thanks to Tim Mooney.)
2000-04-19* procs.c (scm_make_subr_opt): Tell scm_must_realloc that we'reMikael Djurfeldt1-1/+1
realloc:ing scm_subr_table ("what" instead of "who").
2000-04-04Lots of fixes with respect to strict typing.Dirk Herrmann1-2/+2
2000-04-03Lots of fixes to make guile (at some time) compile with strict typing.Dirk Herrmann1-3/+3
2000-03-24Added a set of low level macros for accessing cell entries.Dirk Herrmann1-2/+2
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-17Only include strings.h where it is actually needed.Dirk Herrmann1-0/+1
2000-03-17Only include vectors.h in those files, where it is actually needed.Dirk Herrmann1-0/+1
2000-03-14* procs.c, procs.h: changed the procedure-with-setter representationMikael Djurfeldt1-6/+7
to double cell.
2000-03-03* error.h, error.c: Added `scm_wrong_type_arg_msg' to supportGreg J. Badros1-1/+1
displaying the expected type. Use SCM_LISTn in a couple places instead of scm_cons-ing by hand. * __scm.h: Added SCM_ASSERT_TYPE macro. * validate.h, scm_validate.h: Added the former, as a renamed version of the latter with SCM_ASSERT_TYPE used in SCM_MAKE_VALIDATE (instead of just SCM_ASSERT) * Makefile.am: Rename scm_validate.h to validate.h. * *.c, *.h: Include validate.h, not scm_validate.h (old name's prefix was superfluous).
2000-01-18* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,Mikael Djurfeldt1-7/+7
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c, keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c, objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c, ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c, stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c, symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c, weaks.c: Converted docstrings to ANSI C format.
2000-01-05* *.[ch]: Whitespace changes -- added space after SCM_VALIDATE_*Greg J. Badros1-6/+6
macros and SCM_DEFINE macros to match GNU coding standards.
2000-01-05*.[ch]: Replace GUILE_PROC w/ SCM_DEFINE.Greg J. Badros1-8/+8
1999-12-16* coop-threads.c: Remove K&R function headers.Greg J. Badros1-2/+2
* scm_validate.h: Added SCM_VALIDATE_THREAD. * *.c: Remove SCM_NIMP(X) when it is an extraneous pre-test given that SCM_FOOP macros all now include SCM_NIMP in their expansion. This simplifies lots of code, making it far more readable.
1999-12-13* Makefile.am: Fix ETAGS_ARGS to recognize GUILE_PROC,Greg J. Badros1-1/+4
GUILE_PROC1. Build guile-procedures.txt, and add that file to pkgdata_DATA. * load.c: Added `pkgdata-dir', `site-dir', `library-dir' primitives. * guile-doc-snarf.awk: Drop trailing space when no arguments: e.g., "(foo )" is now "(foo)". * *.c: moved all the documentation for primitives from guile-doc/ref/{appendices,posix,scheme}.texi into the source code. This leaves about half of the primitives undocumented. Also, all the markup is currently still texinfo. I don't have a problem with texinfo per se, but the markup is not very descriptive or accurate.
1999-12-13Remove leading whitespace before empty docstrings.Greg J. Badros1-3/+3
1999-12-12* *.c, scm_validate.h: Use SCM_VALIDATE_NIM, not SCM_VALIDATE_NIMPGreg J. Badros1-1/+1
(none of the other validate macros have the trailing P).
1999-12-12* *.c: Pervasive software-engineering-motivated rewrite ofGreg J. Badros1-70/+57
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-09-12* __scm.h, backtrace.c, backtrace.h, debug.c, debug.h, dynl-dld.c,Mikael Djurfeldt1-1/+1
dynwind.c, dynwind.h, eval.h, evalext.c, evalext.h, feature.c, feature.h, hashtab.c, hashtab.h, objects.c, objects.h, print.c, procs.c, procs.h, smob.c, smob.h, srcprop.c, strorder.c, struct.c, struct.h: Updated copyrigth notices.
1999-09-09* procs.c (scm_setter): Signal WTA if handed an entity or operatorMikael Djurfeldt1-3/+7
lacking a setter.
1999-08-31* procs.c (scm_make_subr_opt): Fix typo. Remember to multipleJim Blandy1-6/+7
table lengths by the size of a single element when growing the table.
1999-08-29* procs.c (scm_setter): Converted to use generic dispatch.Mikael Djurfeldt1-4/+5
1999-08-26* procs.c, procs.h (scm_subr_entry): New type: Stores dataMikael Djurfeldt1-11/+92
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-03-11* eval.c, procs.c, procs.h, procprop.c: Renamed getter ->Mikael Djurfeldt1-15/+88
procedure throughout. * procs.c (scm_procedure, scm_setter): Handle entity and operator setter slots. * procs.c, procs.h (SCM_PROCEDURE_WITH_SETTER_P, SCM_GETTER, SCM_SETTER): New macros. (scm_procedure_with_setter_p, scm_make_procedure_with_setter, scm_getter, scm_setter): New procedures. * procprop.c (scm_i_procedure_arity), procs.c (scm_thunk_p): Added entry for scm_tc7_pws. * procs.c (scm_procedure_p): Added case label for scm_tc7_pws.
1999-02-06* chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),Jim Blandy1-3/+3
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.
1998-11-21* procs.c: #include "objects.h"Mikael Djurfeldt1-0/+5
(scm_procedure_p): Return #t also on structs which are operators.
1998-10-31* procs.c, procs.h (procedure-documentation): Moved from eval.c.Mikael Djurfeldt1-0/+31
1998-10-19* __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,Jim Blandy1-1/+1
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.
1997-09-11* procprop.h: Added declaration of scm_i_inner_name.Mikael Djurfeldt1-8/+1
* gsubr.c: New global symbol scm_i_inner_name. * debug.c (scm_procedure_name): Try procedure property `inner-name' if `name' fails. * print.c (scm_iprin1): Use scm_macro_name. * eval.c (scm_m_define): Give names to macros as well; Only the first top-level definition gives a procedure/macro a name. Otherwise confusing names can turn up in backtraces. (SCM_CEVAL): SCM_IM_DEFINE: Set `inner-name' property instead of `name'; Give names to macros as well. * procs.c (scm_closure_p), print.c (scm_iprin1), eval.c (scm_macro_transformer): Use SCM_CLOSUREP instead of scm_closure_p.
1997-05-26* Lots of files: New address for FSF.Jim Blandy1-3/+3
1997-03-08* procs.c (make-cclo): New undocumented debugging procedure: MakeMikael Djurfeldt1-0/+13
compiled closure with internal procedure PROC and length LENGTH. Only compiled if GUILE_DEBUG is defined.
1997-02-28* procs.c: Introduce the existent C function scm_thunk_p at theMikael Djurfeldt1-0/+2
Scheme level as well.