summaryrefslogtreecommitdiff
path: root/libguile/macros.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license notices in all C filesAndy Wingo2018-06-201-17/+17
| | | | | Update to newest recommended license notices from the FSF. Everything stays LGPLv3+ except guile-readline which is GPLv3+.
* Remove (C) from copyright statementsAndy Wingo2018-06-201-1/+1
| | | | | | As the FSF advises, 'There is no legal significance to using the three-character sequence “(C)”, but it does no harm.' It does take up space though! For that reason, we remove it here from our C files.
* Rename __scm.h to scm.hAndy Wingo2018-06-201-1/+1
| | | | * libguile/scm.h: Rename. Update all includers.
* Remove Emacs local variables comments in Guile sourceAndy Wingo2018-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .dir-locals.el file in the repository is sufficient for Emacs users. * libguile/__scm.h: * libguile/alist.c: * libguile/alist.h: * libguile/array-handle.c: * libguile/array-handle.h: * libguile/array-map.c: * libguile/array-map.h: * libguile/arrays.c: * libguile/arrays.h: * libguile/async.c: * libguile/async.h: * libguile/backtrace.c: * libguile/backtrace.h: * libguile/bitvectors.c: * libguile/bitvectors.h: * libguile/boolean.c: * libguile/boolean.h: * libguile/chars.c: * libguile/chars.h: * libguile/chooks.c: * libguile/chooks.h: * libguile/continuations.c: * libguile/continuations.h: * libguile/control.c: * libguile/conv-integer.i.c: * libguile/debug-malloc.h: * libguile/debug.c: * libguile/debug.h: * libguile/deprecation.c: * libguile/deprecation.h: * libguile/dynl.c: * libguile/dynl.h: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/dynwind.c: * libguile/dynwind.h: * libguile/eq.c: * libguile/eq.h: * libguile/error.c: * libguile/error.h: * libguile/eval.c: * libguile/eval.h: * libguile/evalext.c: * libguile/evalext.h: * libguile/expand.c: * libguile/expand.h: * libguile/extensions.c: * libguile/extensions.h: * libguile/feature.c: * libguile/feature.h: * libguile/filesys.c: * libguile/filesys.h: * libguile/fluids.c: * libguile/fluids.h: * libguile/foreign.c: * libguile/fports.c: * libguile/fports.h: * libguile/frames.c: * libguile/frames.h: * libguile/gc-inline.h: * libguile/gc.c: * libguile/gc.h: * libguile/generalized-arrays.c: * libguile/generalized-arrays.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/gettext.c: * libguile/gettext.h: * libguile/goops.c: * libguile/goops.h: * libguile/gsubr.c: * libguile/gsubr.h: * libguile/guardians.c: * libguile/guardians.h: * libguile/guile.c: * libguile/hash.c: * libguile/hash.h: * libguile/hashtab.c: * libguile/hashtab.h: * libguile/hooks.c: * libguile/hooks.h: * libguile/i18n.c: * libguile/i18n.h: * libguile/init.c: * libguile/init.h: * libguile/instructions.c: * libguile/instructions.h: * libguile/intrinsics.c: * libguile/intrinsics.h: * libguile/ioext.c: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.c: * libguile/keywords.h: * libguile/list.c: * libguile/list.h: * libguile/load.c: * libguile/load.h: * libguile/loader.c: * libguile/loader.h: * libguile/macros.c: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memmove.c: * libguile/memoize.c: * libguile/memoize.h: * libguile/modules.c: * libguile/modules.h: * libguile/net_db.c: * libguile/net_db.h: * libguile/null-threads.c: * libguile/null-threads.h: * libguile/numbers.c: * libguile/numbers.h: * libguile/objprop.c: * libguile/objprop.h: * libguile/options.c: * libguile/options.h: * libguile/pairs.c: * libguile/pairs.h: * libguile/poll.c: * libguile/poll.h: * libguile/ports.c: * libguile/ports.h: * libguile/posix.c: * libguile/posix.h: * libguile/print.c: * libguile/print.h: * libguile/procprop.c: * libguile/procprop.h: * libguile/procs.c: * libguile/procs.h: * libguile/programs.c: * libguile/programs.h: * libguile/promises.c: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.c: * libguile/random.h: * libguile/rdelim.c: * libguile/rdelim.h: * libguile/read.c: * libguile/read.h: * libguile/regex-posix.c: * libguile/regex-posix.h: * libguile/rw.c: * libguile/rw.h: * libguile/scmsigs.c: * libguile/scmsigs.h: * libguile/script.c: * libguile/script.h: * libguile/simpos.c: * libguile/simpos.h: * libguile/smob.c: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.c: * libguile/socket.h: * libguile/sort.c: * libguile/sort.h: * libguile/srcprop.c: * libguile/srcprop.h: * libguile/stackchk.c: * libguile/stackchk.h: * libguile/stacks.c: * libguile/stacks.h: * libguile/stime.c: * libguile/stime.h: * libguile/strerror.c: * libguile/strings.c: * libguile/strings.h: * libguile/strorder.c: * libguile/strorder.h: * libguile/strports.c: * libguile/strports.h: * libguile/struct.c: * libguile/struct.h: * libguile/symbols.c: * libguile/symbols.h: * libguile/syntax.c: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.c: * libguile/threads.h: * libguile/throw.c: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.c: * libguile/unicode.h: * libguile/uniform.c: * libguile/uniform.h: * libguile/values.c: * libguile/values.h: * libguile/variable.c: * libguile/variable.h: * libguile/vectors.c: * libguile/vectors.h: * libguile/version.c: * libguile/vm-engine.c: * libguile/vm-expand.h: * libguile/vm.c: * libguile/vm.h: * libguile/vports.c: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.c: * libguile/weak-set.h: * libguile/weak-table.c: * libguile/weak-table.h: * libguile/weak-vector.c: * libguile/weak-vector.h: Remove needless trailing comments.
* Remove useless "classes: h_files" from Guile headers.Andy Wingo2018-06-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/__scm.h: * libguile/alist.h: * libguile/array-handle.h: * libguile/array-map.h: * libguile/arrays.h: * libguile/async.h: * libguile/backtrace.h: * libguile/bitvectors.h: * libguile/boolean.h: * libguile/chars.h: * libguile/chooks.h: * libguile/continuations.h: * libguile/debug-malloc.h: * libguile/debug.h: * libguile/deprecation.h: * libguile/dynl.h: * libguile/dynstack.h: * libguile/dynwind.h: * libguile/eq.h: * libguile/error.h: * libguile/eval.h: * libguile/evalext.h: * libguile/expand.h: * libguile/extensions.h: * libguile/feature.h: * libguile/filesys.h: * libguile/fluids.h: * libguile/fports.h: * libguile/gc-inline.h: * libguile/gc.h: * libguile/generalized-arrays.h: * libguile/generalized-vectors.h: * libguile/gettext.h: * libguile/goops.h: * libguile/gsubr.h: * libguile/guardians.h: * libguile/hash.h: * libguile/hashtab.h: * libguile/hooks.h: * libguile/i18n.h: * libguile/init.h: * libguile/inline.h: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.h: * libguile/list.h: * libguile/load.h: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memoize.h: * libguile/modules.h: * libguile/net_db.h: * libguile/null-threads.h: * libguile/numbers.h: * libguile/objprop.h: * libguile/options.h: * libguile/pairs.h: * libguile/poll.h: * libguile/ports.h: * libguile/posix-w32.h: * libguile/posix.h: * libguile/print.h: * libguile/procprop.h: * libguile/procs.h: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.h: * libguile/rdelim.h: * libguile/read.h: * libguile/regex-posix.h: * libguile/rw.h: * libguile/scmsigs.h: * libguile/script.h: * libguile/simpos.h: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.h: * libguile/sort.h: * libguile/srcprop.h: * libguile/stackchk.h: * libguile/stacks.h: * libguile/stime.h: * libguile/strings.h: * libguile/strorder.h: * libguile/strports.h: * libguile/struct.h: * libguile/symbols.h: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.h: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.h: * libguile/uniform.h: * libguile/values.h: * libguile/variable.h: * libguile/vectors.h: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.h: * libguile/weak-table.h: * libguile/weak-vector.h: Remove "classes: h_files". Reformat copyrights if needed.
* clean up macros.[ch]Andy Wingo2010-01-051-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some incompatible changes here, but only to interfaces that were introduced earlier in 1.9, or interfaces which have been broken since early in 1.9. * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, as the macro changes affect the interface that is called by psyntax-generated macro definitions. * libguile/inline.h (scm_words): New function, allocates a variable number of contiguous scm_t_bits locations, with a given value in the 0th word, and 0 in the rest of the words. * libguile/macros.h: Rework interface to correspond more closely, and minimally, to the needs of memoize.c and psyntax. (SCM_ASSYNT, SCM_MACRO_TYPE_BITS, SCM_MACRO_TYPE_MASK) (SCM_F_MACRO_EXTENDED, SCM_MACROP, SCM_MACRO_TYPE) (SCM_MACRO_IS_EXTENDED, SCM_BUILTIN_MACRO_P, SCM_SYNCASE_MACRO_P) (SCM_MACRO_CODE, scm_tc16_macro): Remove CPP macros related to the representation of Scheme macros. (scm_i_make_primitive_macro): Renamed from scm_i_makbimacro. (scm_i_macro_primitive): New accessor so that memoize.c can get to the primitive syntax transformer. (scm_make_syncase_macro, scm_make_extended_syncase_macro) (scm_syncase_macro_type, scm_syncase_macro_binding): Removed these functions, replaced by make-syntax-transformer and its accessors. (scm_macro_binding): New accessor, the same as what scm_syncase_macro_binding was. * libguile/macros.c: All representation details of syntax transformers are private to this file now. (macro_print): Print macros as #<syntax-transformer ...>, or #<primitive-syntax-transformer ...> if psyntax has not attached a transformer of its own. (scm_i_make_primitive_macro): Represent macros as 5-word smobs. (scm_make_syntax_transformer): New constructor for syntax transformers (macros), exported to scheme. Takes a name, and looks it up in the current module to determine the previous primitive transformer, if any. (scm_macro_type): Instead of returning 'builtin-macro!, etc, return the type as set by psyntax, or #f if it's a primitive. (scm_macro_name): Return the stored macro name. (scm_macro_transformer): Return the psyntax-set syntax transformer. Hacky, but should help introspection somewhat. * libguile/memoize.c (memoize_env_ref_transformer): Use the new scm_i_macro_primitive, and adapt to other macro API changes. * module/ice-9/psyntax.scm (put-global-definition-hook) (get-global-definition-hook, chi-install-global): Call (and generate calls to) the new macro constructors and accessors. * module/ice-9/psyntax-pp.scm: Doubly regenerated. * module/ice-9/debugging/traps.scm (trap-here): Comment out this definition and export, while it's not working.
* remove mmacros, SCM_SYNTAX snarf macroAndy Wingo2010-01-051-5/+1
| | | | | | | | | | | | | | | | | | * libguile/snarf.h (SCM_SYNTAX): Remove snarf macro, users can't define primitive syntax any more. * libguile/memoize.c (SCM_SYNTAX): Define locally, and just call scm_i_makbimacro as there's no difference between that and scm_makmmacro. Alter invocations to suit. * libguile/macros.h: * libguile/macros.c (scm_i_makmmacro): Remove; users can't define primitive syntax any more. Use define-syntax instead. (scm_make_synt): Remove, this was only used by the SCM_SYNTAX snarf macro. (scm_i_makbimacro): Change prototype of this internal function to make the gsubr on behalf of the caller. (macro_print, scm_macro_type): Remove cases for mmacros.
* remove scm_makacro and scm_makmacroAndy Wingo2010-01-051-5/+1
| | | | | | | | | | * libguile/macros.h: * libguile/macros.c (scm_makacro): Remove this function for making "acros", as it is unused and won't work with the compiler. (scm_makmacro): Remove this deprecated function for making non-memoizing macros, as they won't work with the compiler. (macro_print, scm_macro_type): Remove a couple of cases for macros that can't be created any more.
* Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.Ludovic Courtès2009-10-021-2/+2
| | | | | | | | | | | | | | * libguile/deprecated.c (SCM_BUILDING_DEPRECATED_CODE): New macro. * libguile/async.c (SCM_BUILDING_DEPRECATED_CODE): Likewise. * libguile/macros.c (SCM_BUILDING_DEPRECATED_CODE): Likewise. * libguile/async.h, libguile/deprecated.h, libguile/eval.h, libguile/gc.h, libguile/gc.h, libguile/macros.h, libguile/ports.h, libguile/srfi-4.h, libguile/strings.h: Change declarations of deprecated functions and variables to use `SCM_DEPRECATED' instead of `SCM_API'.
* Change Guile license to LGPLv3+Neil Jerram2009-06-171-6/+7
| | | | | | | | | | (Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
* a different tack for syncase macro representationAndy Wingo2009-04-291-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/macros.c (macro_print): Show syntax-case bindings, if present. (macro_mark): Mark the extra two words if they're there. (scm_make_syncase_macro, scm_make_extended_syncase_macro): OK! A new take at the "how do we represent syncase macros in Guile" problem. Whereas we need a disjoint type, but would like it to be compatible with old predicates (e.g. `macro?'), and need to be able to extend existing syntax definitions (e.g. `cond'), let's add a bit to macros to indicate whether they have syncase macro bindings or not, and a fourth macro type for native syncase macros. (scm_macro_type): Return 'syntax-case for native syntax-case macros. Note that other macro types may have syntax-case bindings. (scm_macro_name): Return #f if the transformer is not a procedure. (scm_syncase_macro_type, scm_syncase_macro_binding): New accessors for the syncase macro bindings. * libguile/macros.h: Add API for syncase macros. * module/ice-9/boot-9.scm (module-define-keyword!): Adapt to use syncase macros, though they are not yet used. Reorder other syncase API. * module/ice-9/psyntax.scm (chi-expr): Fix syntax-violation invocation.
* Add `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-3/+3
|
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
|
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
|
* Use SCM_SMOB_* instead of SCM_CELL_* as appropriate. UseMarius Vollmer2004-05-061-3/+3
| | | | | SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS instead of accessing the zeroth word directly. Use SCM_SMOB_PREDICATE as appropriate.
* The purpose of this patch is to make guile's internal memoizersDirk Herrmann2003-05-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | distinguishable from memoizing macros created on the scheme level or from user provided primitive memoizing macros. The reason is, that the internal memoizers are the only ones that are allowed to transform their scheme input into memoizer byte code, while all other memoizing macros may only transform scheme code into new scheme code. To achieve this, a new macro type 'builtin-macro!' is introduced. Currently, 'builtin-macro!'s are handled as memoizing macros, but this will change when the memoizer and executor are separated. * macros.[ch] (scm_i_makbimacro): New. * macros.h (SCM_BUILTIN_MACRO_P): New. * macros.c (macro_print, scm_macro_type): Support builtin-macro!s. * eval.c, goops.c: All of guile's primitive memoizing macros are primitive builtin-macros now. * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive builtin-macros are handled equally to memoizing macros.
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
|
* * eval.c (SCM_CEVAL), macros.c (macro_print, scm_makmacro,Dirk Herrmann2002-07-151-2/+5
| | | | | | | | | scm_sym_macro, scm_macro_type), macros.h (scm_makmacro): Deprecated the special kind of built-in dynamic syntax transformer that was inaccurately named "macro". Note: The built-in syntax transformers that are named "mmacro" or "memoizing-macro" still exist, and it is these which come much closer to what one would call a macro.
* Prefixed each each exported symbol with SCM_API.Marius Vollmer2001-11-021-12/+12
|
* * Renamed header macros to the SCM_<filename>_H format.Dirk Herrmann2001-08-311-4/+6
|
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-1/+1
|
* * Replaced a lot of calls to SCM_C[AD]R with more appropriate macros.Dirk Herrmann2001-03-301-4/+8
| | | | | * Minor cleanups to hashtable implementation. * Minor code beautifications.
* * Removed unused object parameter from SCM_ASSYNT.Dirk Herrmann2001-03-151-1/+1
|
* * Cleaned up uses and definition of SCM_ASSYNT.Dirk Herrmann2001-03-121-1/+2
|
* Smob-related creanup.Keisuke Nishida2000-12-081-1/+1
|
* Updated copyrightsMikael Djurfeldt2000-06-121-1/+1
|
* * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin2000-03-191-0/+6
| | | | indentation style.
* * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros2000-03-021-11/+11
| | | | | | | | | | | | | | added append docs from R4RS. * strings.c: Docstring typo fix, + eliminate unneeded IMP tests. Thanks Dirk Hermann! * chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann! * *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout. Drop use of SCM_P for function prototypes... assume an ANSI C compiler. Thanks Dirk Hermann!
* * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),Jim Blandy1999-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * macros.c, macros.h: New files.Mikael Djurfeldt1998-10-311-0/+67
(procedure->syntax, procedure->macro, procedure->memoizing-macro, macro?, macro-type, macro-name, macro-transformer): Moved from eval.c (scm_make_synt): Moved from eval.c * Makefile.am: Added evalext.c, evalext.h, macros.c, macros.h.