1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

30 commits

Author SHA1 Message Date
Andy Wingo
1234bb1850 Update license notices in all C files
Update to newest recommended license notices from the FSF.  Everything
stays LGPLv3+ except guile-readline which is GPLv3+.
2018-06-20 20:07:34 +02:00
Andy Wingo
791eb0c01a Remove (C) from copyright statements
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.
2018-06-20 19:17:06 +02:00
Andy Wingo
97cc65fee4 Rename __scm.h to scm.h
* libguile/scm.h: Rename.  Update all includers.
2018-06-20 16:33:33 +02:00
Andy Wingo
c495b44714 Remove Emacs local variables comments in Guile source
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.
2018-06-20 14:32:28 +02:00
Andy Wingo
5534c2817e Remove useless "classes: h_files" from Guile headers.
* 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.
2018-06-20 14:26:16 +02:00
Andy Wingo
e809758a7e clean up macros.[ch]
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.
2010-01-05 15:33:46 +01:00
Andy Wingo
bab9804661 remove mmacros, SCM_SYNTAX snarf macro
* 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.
2010-01-05 11:47:16 +01:00
Andy Wingo
9f09b127d4 remove scm_makacro and scm_makmacro
* 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.
2010-01-05 10:39:40 +01:00
Ludovic Courtès
0eb934f1f0 Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.
* 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'.
2009-10-02 14:48:22 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
5a0132b337 a different tack for syncase macro representation
* 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.
2009-04-29 00:38:12 +02:00
Ludovic Courtès
102dbb6f6c Add `SCM_INTERNAL' macro, use it. 2008-05-31 23:21:02 +02:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
f5710d53b1 Use SCM_SMOB_* instead of SCM_CELL_* as appropriate. Use
SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS instead of accessing the
zeroth word directly.  Use SCM_SMOB_PREDICATE as appropriate.
2004-05-06 16:43:14 +00:00
Dirk Herrmann
3b88ed2a4d The purpose of this patch is to make guile's internal memoizers
distinguishable from memoizing macros created on the scheme level
	or from user provided primitive memoizing macros.  The reason is,
	that the internal memoizers are the only ones that are allowed to
	transform their scheme input into memoizer byte code, while all
	other memoizing macros may only transform scheme code into new
	scheme code.

	To achieve this, a new macro type 'builtin-macro!' is introduced.
	Currently, 'builtin-macro!'s are handled as memoizing macros, but
	this will change when the memoizer and executor are separated.

	* macros.[ch] (scm_i_makbimacro): New.

	* macros.h (SCM_BUILTIN_MACRO_P): New.

	* macros.c (macro_print, scm_macro_type): Support builtin-macro!s.

	* eval.c, goops.c: All of guile's primitive memoizing macros are
	primitive builtin-macros now.

	* eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
	builtin-macros are handled equally to memoizing macros.
2003-05-04 08:36:56 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Dirk Herrmann
3063e30a6d * eval.c (SCM_CEVAL), macros.c (macro_print, scm_makmacro,
scm_sym_macro, scm_macro_type), macros.h (scm_makmacro):
Deprecated the special kind of built-in dynamic syntax transformer
that was inaccurately named "macro".  Note:  The built-in syntax
transformers that are named "mmacro" or "memoizing-macro" still
exist, and it is these which come much closer to what one would
call a macro.
2002-07-15 20:39:53 +00:00
Marius Vollmer
33b001fd89 Prefixed each each exported symbol with SCM_API. 2001-11-02 00:19:12 +00:00
Dirk Herrmann
0527e68763 * Renamed header macros to the SCM_<filename>_H format. 2001-08-31 10:42:19 +00:00
Marius Vollmer
92c2555f69 replace "scm_*_t" with "scm_t_*". 2001-06-14 19:50:43 +00:00
Dirk Herrmann
22a52da14d * Replaced a lot of calls to SCM_C[AD]R with more appropriate macros.
* Minor cleanups to hashtable implementation.
* Minor code beautifications.
2001-03-30 15:03:23 +00:00
Dirk Herrmann
160bb34a53 * Removed unused object parameter from SCM_ASSYNT. 2001-03-15 09:50:20 +00:00
Dirk Herrmann
e11208ca72 * Cleaned up uses and definition of SCM_ASSYNT. 2001-03-12 14:34:44 +00:00
Keisuke Nishida
e841c3e0c0 Smob-related creanup. 2000-12-08 17:32:56 +00:00
Mikael Djurfeldt
f2c9fcb07e Updated copyrights 2000-06-12 12:28:24 +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
Greg J. Badros
7866a09b5b * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,
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!
2000-03-02 20:54:43 +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
Mikael Djurfeldt
99027e3c78 * macros.c, macros.h: New files.
(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.
1998-10-31 13:32:21 +00:00