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

437 commits

Author SHA1 Message Date
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
de3d1fc988 bump default stack limit to 160000 words
* libguile/eval.c (scm_debug_opts): Up the default stack limit by a
  factor of 4. Psyntax expansions currently bounce back and forth between
  the VM and the interpreter, due to `map'. (Hopefully that won't be the
  case in the future, when have map in scheme, and we get an inliner.)
  Anyway when expanding a big nested expression, as for example in
  (language ecmascript compile-ghil) -- the pmatch code ends up being
  super-nested -- we can consume loads o stack.

  So given that on desktop machines, where rlimit is likely to be unset,
  default rlimits are around 8 or 10 MB or so, let's bump up our default
  limit to 640KB (on 32-bit). Should be enough for anyone.

  See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
  more info. Thanks to Mark H. Weaver for the diagnosis!
2009-06-10 10:53:22 +02:00
Andy Wingo
b3501b8043 all of guile compiles now, expanded with syncase
* libguile/eval.c (scm_m_eval_when): Whoops, eval-when has an implicit
  begin. Fix.

* module/oop/goops.scm: Syncase doesn't like definitions in expression
  context, and grudgingly I have decided to go along with that. But that
  doesn't mean we can't keep the old semantics, via accessing the module
  system directly. So do so. I took the opportunity to rewrite some
  macros with syntax-rules and syntax-case -- the former is nicer than
  the latter, of course.

* module/oop/goops/save.scm: Don't define within an expression.

* module/oop/goops/simple.scm (define-class): Use define-syntax.

* module/oop/goops/stklos.scm (define-class): Use define-syntax.
2009-04-25 14:10:08 +02:00
Andy Wingo
9c35c5796c make sure we compile boot code in (guile), not (guile-user)
* libguile/eval.h:
* libguile/eval.c (scm_m_eval_when): Define a cheap eval-when, used
  before syncase has booted.

* module/Makefile.am: Reorder to put (system vm) and (system repl)
  modules after the compiler, as they are not needed at runtime.

* module/ice-9/boot-9.scm: Move the eval-when earlier, to be the first
  thing -- so when we recompile Guile we do so all in the '(guile)
  module, not '(guile-user).

* module/ice-9/compile-psyntax.scm: Rewrite to assume that psyntax.scm
  will eval-when to set its module, etc. Have everything in a let --
  otherwise the `format' call is in (guile), but `target' was defined
  in (guile-user). Also, write in an eval-when to the expanded file.

* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/networking.scm:
* module/ice-9/psyntax.scm:
* module/ice-9/r4rs.scm: Sprinkles of eval-when, for flavor.
2009-04-24 23:10:31 +02:00
Andy Wingo
181f1cd7d0 allow eval to be called before modules are booted
* libguile/eval.c (scm_eval): If the module system isn't booted, assert
  not on the module argument.
2009-04-21 23:02:46 +02:00
Andy Wingo
69dd78d7c8 no positions when reading psyntax-pp, validation in @/@@, cleanups
* module/ice-9/syncase.scm (old-debug): Re-disable position recording
  when reading psyntax-pp.

* libguile/eval.c (scm_m_at, scm_m_atat): More input validation.

* libguile/debug.c (scm_procedure_module): Use scm_env_module. Remove
  extraneous docstring.
2009-04-17 15:20:19 +02:00
Andy Wingo
249bab1c53 @ and @@ as primitive macros
* libguile/eval.h:
* libguile/eval.c (error_unbound_variable, error_defined_variable):
  Move these prototypes up earlier.
  (scm_m_at, scm_m_atat): New functions, provide the @ and @@
  functionality. Moved here from defmacros because they are
  "special", inasmuch as syncase doesn't really understand them in
  interpreted code.

* module/ice-9/boot-9.scm (@, @@): Don't define as defmacros, as
  defmacros have to actually return source now.
2009-04-17 15:20:18 +02:00
Andy Wingo
3b91e017e3 Merge commit 'e20d7001c3' into vm-check
Conflicts:

	libguile/stacks.c
2009-03-17 16:40:52 +01:00
Ludovic Courtès
e20d7001c3 Remove "compiled closures" ("cclos") in favor of a simpler mechanism.
The idea is to introduce `gsubrs' whose arity is encoded in their type
(more precisely in the sizeof (void *) - 8 MSBs).  This removes the
indirection introduced by cclos and simplifies the code.

* libguile/__scm.h (CCLO): Remove.

* libguile/debug.c (scm_procedure_source, scm_procedure_environment):
  Remove references to `scm_tc7_cclo'.

* libguile/eval.c (scm_trampoline_0, scm_trampoline_1,
  scm_trampoline_2): Replace `scm_tc7_cclo' with `scm_tc7_gsubr'.

* libguile/eval.i.c (CEVAL): Likewise.  No longer make PROC the first
  argument.  Directly invoke `scm_gsubr_apply ()' instead of jump to the
  `evap(N+1)' label or call to `SCM_APPLY ()'.

* libguile/evalext.c (scm_self_evaluating_p): Remove reference to
  `scm_tc7_cclo'.

* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name): Likewise.

* libguile/gc-mark.c (scm_gc_mark_dependencies): Likewise.

* libguile/goops.c (scm_class_of): Likewise.

* libguile/print.c (iprin1): Likewise.

* libguile/gsubr.c (create_gsubr): Use `unsigned int's for REQ, OPT and
  RST.  Use `scm_tc7_gsubr' instead of `scm_makcclo ()' in the default
  case.
  (scm_gsubr_apply): Remove calls to `SCM_GSUBR_PROC ()'.
  (scm_f_gsubr_apply): Remove.

* libguile/gsubr.h (SCM_GSUBR_TYPE): New definition.
  (SCM_GSUBR_MAX): Changed to 33.
  (SCM_SET_GSUBR_TYPE, SCM_GSUBR_PROC, SCM_SET_GSUBR_PROC,
  scm_f_gsubr_apply): Remove.

* libguile/procprop.c (scm_i_procedure_arity): Remove reference to
  `scm_tc7_cclo'; add proper handling of `scm_tc7_gsubr'.

* libguile/procs.c (scm_makcclo, scm_make_cclo): Remove.
  (scm_procedure_p): Remove reference to `scm_tc7_cclo'.
  (scm_thunk_p): Likewise, plus add proper `scm_tc7_gsubr' handling.

* libguile/procs.h (SCM_CCLO_LENGTH, SCM_MAKE_CCLO_TAG,
  SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, SCM_SET_CCLO_BASE, SCM_CCLO_REF,
  SCM_CCLO_SET, SCM_CCLO_SUBR, SCM_SET_CCLO_SUBR, scm_makcclo,
  scm_make_cclo): Remove.

* libguile/stacks.c (read_frames): Remove reference to `scm_f_gsubr_apply'.

* libguile/tags.h (scm_tc7_cclo): Remove.
  (scm_tc7_gsubr): New.
  (scm_tcs_subrs): Add `scm_tc7_gsubr'.
2009-03-02 00:20:43 +01:00
Andy Wingo
4abef68f61 scm_call_N doesn't cons for calling programs
* libguile/eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3)
  (scm_call_4): Special-case compiled procedures here, to avoid consing.

* libguile/vm.h:
* libguile/vm.c (scm_c_vm_run): Take a SCM after all.
  (scm_vm_apply, scm_load_compiled_with_vm): Adapt to vm_run change.
2009-02-05 00:51:34 +01:00
Andy Wingo
32c8ae2009 rashly bump stack limit to 40k words
* libguile/eval.c (scm_debug_opts): Whereas, today's machines are larger
  than yesterday's; GCC consumes more words per stack frame than it used
  to; and you can get quite some recursion in a halfway-compiled system,
  be it resolved: let's bump up the C stack limit to 40k words (160 kB /
  320 kB, depending on word size).
2008-11-11 23:11:27 +01:00
Andy Wingo
999f1b26e7 Merge commit 'origin/master' into vm
Conflicts:

	doc/Makefile.am
	ice-9/Makefile.am
	libguile/gc.c
2008-09-30 21:12:16 +02:00
Andy Wingo
7c455996e8 export `make-promise' to scheme
* libguile/eval.h:
* libguile/eval.c (scm_make_promise): Rename from `scm_makprom', and
  export as the scheme procedure, `make-promise'.

* libguile/eval.i.c (CEVAL): s/makprom/make_promise/.
2008-09-25 16:16:35 +02:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Han-Wen Nienhuys
39d275916b * eval.c: Mark #endif with comment. 2008-09-03 23:27:42 -03:00
Ludovic Courtès
417566ebc9 Never define _GNU_SOURCE' explicitly since AC_USE_SYSTEM_EXTENSIONS'
takes care of it.

Conflicts:

	ChangeLog
	configure.in
	libguile/eval.c
	libguile/srfi-14.c
	libguile/threads.c
2008-08-20 19:31:46 +02:00
Ludovic Courtès
61b6542aa6 Fix type-checking for the second argument of `eval'. 2008-03-06 09:51:44 +00:00
Ludovic Courtès
9cc37597af Changes from arch/CVS synchronization 2007-12-08 16:00:56 +00:00
Neil Jerram
acbfb5946b (unmemoize_delay): Extend the environment before
unmemoizing the promise thunk.  This fixes a segmentation fault
reported by Frank Schwidom.
2007-10-21 20:43:14 +00:00
Ludovic Courtès
f743909974 Changes from arch/CVS synchronization 2007-07-29 15:16:46 +00:00
Ludovic Courtès
e08f3f7a30 Changes from arch/CVS synchronization 2007-07-24 23:17:54 +00:00
Ludovic Courtès
3dcf33733c Changes from arch/CVS synchronization 2007-05-26 14:30:50 +00:00
Han-Wen Nienhuys
3d178652b8 * eval.c: remove superfluous ifndef DEVAL.
* eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h
2007-01-22 15:29:56 +00:00
Han-Wen Nienhuys
243ebb6113 * private-options.h: idem.
* eval.i.c: copyright nitpicking.

* eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* eval.i.c: new file.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h

* private-options.h: new file: contain hardcoded option
definitions.
2007-01-22 15:20:35 +00:00
Han-Wen Nienhuys
0ee05b85ee * eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* eval.i.c: new file.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h
2007-01-22 15:16:44 +00:00
Han-Wen Nienhuys
72f19c2646 * debug.h (SCM_RESET_DEBUG_MODE): switch to debugging if
memoize-symbol is set.

* eval.h (SCM_MEMOIZE_HDLR): add macros for memoize symbol trap.

* eval.c (CEVAL): add memoize_symbol trap.

* read.c: idem.

* eval.c: terminate option lists with 0.
2007-01-19 20:05:05 +00:00
Han-Wen Nienhuys
b0763985c4 * srcprop.c: use double cell for storing source-properties. Put
filename in the plist, and share between srcprops if possible.
Remove specialized storage.

* srcprop.h: remove macros without SCM_ prefix from
interface. Remove specialized storage/type definitions.

* eval.c: terminate option lists with 0.
2007-01-19 19:33:10 +00:00
Han-Wen Nienhuys
6256065013 * readline.c: terminate option list with NULL.
* read.c: idem.

* print.c: idem.

* eval.c: terminate option lists with 0.

* options.c: remove n (for length) from scm_option_X
functions. Detect option list length by looking for NULL name.
2007-01-19 19:26:36 +00:00
Kevin Ryde
23d7256628 merge from 1.8 2007-01-15 23:42:45 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Kevin Ryde
23f2b9a3de merge from 1.8 branch 2006-06-17 23:15:59 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
cce0e9c875 (scm_eval_body): Lock source_mutex with a dynwind context
so that it gets unlocked in all cases.
(SCM_APPLY, CEVAL): Likewise.
2006-01-29 23:12:01 +00:00
Marius Vollmer
2f263a6a0b * futures.h, futures.c: Wrap whole contents in "#if 0"/"#endif".
* eval.c, init.c: Comment out all 'future' related things.
2006-01-29 19:09:52 +00:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
1fe1fc0a92 (scm_m_cond): Recognize SRFI 61 cond syntax.
(CEVAL): Evaluate SRFI 61 cond clauses.
2005-12-06 21:31:26 +00:00
Neil Jerram
7c9c0169b4 * eval.c (sym_instead): New symbol.
(ENTER_APPLY): Remove optional use of a continuation when making
trap call.
(scm_debug_opts): Change doc for 'cheap option to make clear that
it is now obsolete.
(CEVAL, SCM_APPLY): Remove optional use of a continuation when
making trap calls, and implement substitution of eval expressions
and return values using the values that the trap call handlers
return.

* debug.h (SCM_CHEAPTRAPS_P): Removed.
2005-11-04 21:20:24 +00:00
Marius Vollmer
d1138028c9 * null-threads.h, pthread-threads.h
(SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Removed.
(scm_i_pthread_mutexattr_recursive): New.

* threads.c (scm_i_pthread_mutexattr_recursive): Declare.
(scm_i_critical_section_mutex): Do not initialize statically.
(scm_threads_prehistory): Initialize
scm_i_pthread_mutexattr_recursive and scm_i_critical_section_mutex
here.

* eval.c (source_mutex): Do not initialiaze statically.
(scm_init_eval): Do it here, using
scm_i_pthread_mutexattr_recursive.
2005-10-23 20:47:49 +00:00
Neil Jerram
5defc05d45 * eval.c (eval_letrec_inits): New.
(CEVAL): Eval letrec initializer forms using eval_letrec_inits.

* tests/r5rs_pitfall.test (1.1): Now passes.
2005-08-15 20:43:16 +00:00
Kevin Ryde
c3c97a34e7 (scm_dbg_make_iloc): Should be SCM_IFRAMEMAX and
SCM_IDISTMAX, and cast uints through scm_t_bits to make gcc happy.
Reported by Ken Raeburn.
2005-07-12 00:28:09 +00:00
Marius Vollmer
876099d4ef (scm_eval_options_interface): Use scm_frame_critical_section instead
of SCM_CRITICAL_SECTION_START and SCM_CRITICAL_SECTION_END.
2005-06-06 18:49:55 +00:00
Marius Vollmer
e9ed042cbc Added comment on how to make case 1.1 of r5rs_pitfall.test succeed. 2005-06-05 20:52:23 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Neil Jerram
2b0fb0a50e Critical section review. 2005-03-30 18:43:49 +00:00
Marius Vollmer
de527efba5 Define _GNU_SOURCE. 2005-03-04 12:11:10 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
76da80e788 Reverted changed from 2005/01/24 19:14:54, which was a commit to the
wrong branch.  Sorry.
2005-01-24 23:41:14 +00:00
Marius Vollmer
a54a94b397 Threading changes. 2005-01-24 19:14:54 +00:00
Marius Vollmer
65bc1f7a0b * eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.
* deprecation.c (scm_issue_deprecation_warning,
scm_c_issue_deprecation_warning_fmt): Use it.
(mode): Removed.
(print_summary): New.
(scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of
mode.
2005-01-11 17:43:37 +00:00
Marius Vollmer
6be1fab900 (scm_eval): Added example to docstring. Thanks to Issac Trotts! 2005-01-10 20:20:58 +00:00