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

1986 commits

Author SHA1 Message Date
Andy Wingo
3fd8807eab make-procedure-with-setter inherits name from getter
* libguile/procs.c (scm_make_procedure_with_setter): Patch through the
  getter's procedure name to the procedure-with-setter. Fixes part of the
  srfi-17 test, as the VM doesn't set procedure-name on define -- but
  perhaps that is the bug that should be fixed. In any case this patching
  is cheap.

* test-suite/tests/eval.test: Change so that (define name pws) is
  initially passed an anonymous procedure-with-setter, as was the case
  before the procs.c change.
2008-11-01 17:12:23 +01:00
Andy Wingo
5192c9e89b compile goops accessors. woot!
* oop/goops.scm: Define compiler hooks for dealing with @slot-ref and
  @slot-set!.
  (make-bound-check-get, make-get, make-set): Compile these indexed
  accessors instead of having them be closures. Probably slower for the
  memoizer, but faster for the vm... not sure what the perfect solution
  is.

* test-suite/tests/goops.test ("defining classes"): Add a test that
  defining a class with accessors works (it didn't until I figured out
  that (@ (system base compile) compile) thing).
2008-10-31 18:30:27 +01:00
Andy Wingo
3de80ed52f recompiling with compile environments, fluid languages, cleanups
* ice-9/boot-9.scm (compile-time-environment): Remove definition from
  boot-9 -- instead, autoload it and `compile' from (system base
  compile).

* libguile/objcodes.h:
* libguile/objcodes.c (scm_objcode_to_program): Add an optional argument,
  `external', the external list to set on the returned program.

* libguile/vm-i-system.c (externals): New instruction, returns the
  external list. Only used by (compile-time-environment).

* libguile/vm.c (scm_load_compiled_with_vm): Adapt to
  scm_objcode_to_program change.

* module/language/scheme/translate.scm (translate): Actually pay
  attention to the environment passed as an argument.
  (custom-transformer-table): Expand out (compile-time-environment) to
  something that can be passed to `compile'.

* module/system/base/compile.scm (*current-language*): Instead of
  hard-coding `scheme' in various places, use a current language fluid,
  initialized to `scheme'.
  (compile-file, load-source-file): Adapt to *current-language*.
  (load-source-file): Ada
  (scheme-eval): Removed, no one used this.
  (compiled-file-name): Don't hard-code "scm" and "go"; instead use the
  %load-extensions and %load-compiled-extensions.
  (cenv-module, cenv-ghil-env, cenv-externals): Some accessors for
  compile-time environments.
  (compile-time-environment): Here we define (compile-time-environment)
  to something that will return #f; the compiler however produces
  different code as noted above.
  (compile): New function, compiles an expression into a thunk, then runs
  the thunk to get the value. Useful for procedures. The optional second
  argument can be either a module or a compile-time-environment; in the
  latter case, we can recompile even with lexical bindings.
  (compile-in): If the env specifies a module, set that module for the
  duration of the compilation.

* module/system/base/syntax.scm (%compute-initargs): Fix a bug where the
  default value for a field would always replace a user-supplied value.
  Whoops.

* module/system/il/ghil.scm (ghil-env-dereify): New function, takes the
  result of ghil-env-reify and turns it back into a GHIL environment.

* scripts/compile (compile): Remove some of the tricky error handling, as
  the library procedures handle this for us.

* test-suite/tests/compiler.test: Add a test for the dynamic compilation
  bits.
2008-10-30 10:57:36 +01:00
Andy Wingo
ec5cb82591 elisp.test: apply to nil-terminated list is UNRESOLVED with compiled boot-9
* test-suite/tests/elisp.test: If running the '(apply foo nil) test
  fails with a vm-error, throw UNRESOLVED. This allows the test suite to
  pass in the compiled boot-9.scm while still keeping the elisp apply
  issue open.
2008-10-16 14:16:53 +02:00
Andy Wingo
62f803617e run the elisp test with a larger stack limit
* test-suite/tests/elisp.test: Enlarge the stack for the duration of the
  elisp test. It's a hack, but it at least allows the test to run with a
  compiled ice-9.
2008-10-16 13:58:59 +02:00
Ludovic Courtès
074f69cdf2 Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/threads.c
2008-10-11 19:25:54 +02:00
Ludovic Courtès
1ffa692322 Add test case to make sure `read' returns mutable strings.
* test-suite/tests/reader.test ("reading")["returned strings are
  mutable"]: New test, as reported by szgyg <szgyg@ludens.elte.hu>.
2008-10-09 22:32:16 +02:00
Ludovic Courtès
45a9f43049 Revert "Make literal strings (i.e., returned by `read') read-only."
This reverts commit fb2f8886c4.

The rationale is that `read' must return mutable strings, as reported
by szgyg <szgyg@ludens.elte.hu>.
2008-10-09 22:21:33 +02: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
7ff017002d Fix continuation marking, and some tests.
* libguile/continuations.c (continuation_mark): Mark the vm
  continuations.

* libguile/vm.c (vm_cont_mark): Fix the marking function.
  (vm_mark): Fix this one too -- the size is a number of STACKITEMS,
  which we foolishly assume are the same size as SCM.

* test-suite/tests/ftw.test: Make our stat hacks verifyable without
  assuming that they are interpreted.

* test-suite/tests/r5rs_pitfall.test: Re-indent.
2008-09-26 13:42:09 +02:00
Ludovic Courtès
76ed3e877f Enclose `regexp.test' in a module.
* test-suite/tests/regexp.test: Add `define-module' clause.
2008-09-25 21:36:14 +02:00
Ludovic Courtès
c633310265 Fix handling of the FLAGS argument in `fold-matches'.
* ice-9/regex.scm (fold-matches): If FLAGS is non-null, use
  `(car flags)', not `flags'.

* test-suite/tests/regexp.test ("fold-matches"): New test prefix.

* NEWS: Update.
2008-09-25 21:07:06 +02:00
Ludovic Courtès
b66a552487 Merge branch 'master' into boehm-demers-weiser-gc 2008-09-23 19:01:01 +02:00
Ludovic Courtès
fb2f8886c4 Make literal strings (i.e., returned by `read') read-only.
* libguile/read.c (scm_read_string): Use `scm_i_make_read_only_string ()' to
  return a read-only string, as mandated by R5RS.  Reported by Bill
  Schottstaedt <bil@ccrma.Stanford.EDU>.

* libguile/strings.c (scm_i_make_read_only_string): New function.
  (scm_i_shared_substring_read_only): Special-case the empty string
  so that the read-only and read-write empty strings are `eq?'.  This
  optimization is relied on by the `substring/shared' `empty string'
  test case in `srfi-13.test'.

* libguile/strings.h (scm_i_make_read_only_string): New declaration.

* test-suite/tests/strings.test ("string-set!")["literal string"]: New test.

* NEWS: Update.
2008-09-23 18:45:27 +02:00
Ludovic Courtès
fd2b17b9cb Make `symbol->string' return a read-only string.
* libguile/strings.c (scm_i_symbol_substring): Return a read-only string
  since R5RS requires `symbol->string' to return a read-only string.
  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

* test-suite/tests/symbols.test: Add `define-module' clause.
  (exception:immutable-string): Adjust to current exception.
  ("symbol->string")["result is an immutable string"]: Use
  `pass-if-exception' instead of `expect-fail-exception'.

* NEWS: Update.
2008-09-23 18:44:27 +02:00
Neil Jerram
1dd797921c Fix for incorrect (gcd -2) => -2; should give 2.
(reported by Bill Schottstaedt)

* libguile/numbers.c (scm_gcd): When only one arg given, use scm_abs
  to ensure that result is non-negative.

* test-suite/tests/numbers.test ("gcd"): New test, (gcd -2).
2008-09-22 21:21:20 +01:00
Ludovic Courtès
6f03035fe8 Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/coop-defs.h
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-malloc.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/gc.h
	libguile/gc_os_dep.c
	libguile/hashtab.c
	libguile/hashtab.h
	libguile/inline.h
	libguile/private-gc.h
	libguile/struct.c
	libguile/struct.h
	libguile/threads.c
	libguile/threads.h
	libguile/vectors.h
	libguile/weaks.h
	test-suite/tests/gc.test
2008-09-10 23:09:30 +02:00
Ludovic Courtes
328efeb9a6 Document the failure of `gc.test' wrt. unused modules.
* test-suite/tests/gc.test (Unused modules are removed): Use guardians
  instead of `gc-live-object-stats'.  Explain failure (FIXME).

* ice-9/boot-9.scm (make-module): Add `FIXME' about circular reference.

git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-9
2008-09-10 22:52:21 +02:00
Ludovic Courtès
e0513d4d77 Merge commit '2e77f7202b' into boehm-demers-weiser-gc
Conflicts:
	libguile/threads.c
2008-09-10 22:51:46 +02:00
Ludovic Courtès
6774820f1e Merge commit '29776e85da' into boehm-demers-weiser-gc
Conflicts:
	libguile/gc-card.c
	libguile/gc.c
	libguile/gc.h
	libguile/ports.c
2008-09-10 22:50:04 +02:00
Ludovic Courtès
e9b8556ec9 Merge commit '7337d56d57' into boehm-demers-weiser-gc
Conflicts:
	libguile/struct.c
2008-09-10 22:44:31 +02:00
Ludovic Courtès
4a4849dbe0 Merge commit '0329137392' into boehm-demers-weiser-gc
Conflicts:
	libguile/gc.c
	libguile/srcprop.c
	libguile/srcprop.h
2008-09-10 22:33:40 +02:00
Ludovic Courtès
35a9197ccc Merge commit 'f30e1bdf97' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/coop-pthreads.c
	libguile/gc-freelist.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/private-gc.h
	test-suite/tests/environments.nottest
2008-09-10 22:27:30 +02:00
Ludovic Courtes
e13f1cbdff Fixed `guardians.test' so that it does not use symbols.
* test-suite/tests/guardians.test: Use strings instead of symbols for
  `g3-garbage' et al.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-42
2008-09-10 20:28:03 +02:00
Ludovic Courtès
53f4876abc Merge branch 'master' into strftime-gnulib
Conflicts:
	libguile/ChangeLog
	srfi/ChangeLog
	test-suite/ChangeLog
2008-09-09 22:03:42 +02:00
Ludovic Courtes
080ecf3f7b Disabled the `environments' unit test.
* test-suite/Makefile.am (SCM_TESTS): Removed `tests/environments.test'.

* test-suite/tests/environments.nottest: Disabled.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-19
2008-09-05 00:48:47 +02:00
Ludovic Courtès
69f23174d3 Use Gnulib's `strftime' to address bug #24130.
* libguile/stime.c (scm_strftime): Use `nstrftime ()' from Gnulib.
  This provides the same semantics on all platforms, thereby fixing
  bug #24130.

* doc/ref/posix.texi (Time): Remove note about non-portable `%Z'
  behavior.  Describe the new, portable behavior.

* test-suite/tests/time.test ("strftime")["strftime %Z doesn't return
  garbage"]: Reinstate.
  ["C99 %z format"](have-strftime-%z): Remove.
  ("GMT", "EST+5"): Don't use `have-strftime-%z'.
2008-09-02 21:58:58 +02:00
Julian Graham
d0b6ad3491 Raise error on SRFI-18 load if Guile built without threading support
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2008-08-30 21:08:50 +02:00
Ludovic Courtès
70eca63557 Fix builds `--without-threads'. 2008-08-27 23:05:44 +02:00
Ludovic Courtès
82d8d6d9e8 Add test case for the GOOPS `class-redefinition' memory corruption. 2008-08-20 00:44:20 +02:00
Julian Graham
b046219e51 Scheme SRFI-18 implementation and tests file 2008-05-24 10:44:09 +01:00
Neil Jerram
74926120a3 Delete trailing whitespace. 2008-05-14 23:52:49 +01:00
Julian Graham
adc085f17c latest set of SRFI-18 support changes to core threads 2008-05-14 23:33:16 +01:00
Ludovic Courtès
0fb11ae432 Fix type-checking of SRFI-1 `partition'. 2008-04-28 18:03:27 +02:00
Ludovic Courtès
816e3edf15 Make (srfi srfi-35)' visible through cond-expand'. 2008-04-26 21:09:40 +02:00
Ludovic Courtès
189681f55b Add `(srfi srfi-88)'. 2008-04-26 19:34:37 +02:00
Ludovic Courtès
ef4cbc08c8 Add support for SRFI-88-like postfix keyword read syntax. 2008-04-15 19:52:43 +02:00
Ludovic Courtès
cac3960028 Test the interaction of GOOPS objects with `struct-{ref,set!}'. 2008-04-13 20:41:23 +02:00
Ludovic Courtès
eedcb08a25 Honor $TMPDIR in the test suite. 2008-03-13 14:03:58 +00:00
Ludovic Courtès
62c5382b88 Fix SRFI-37 `args-fold' with short option names of argument-less options. 2008-03-12 17:01:19 +00:00
Neil Jerram
6180e336b2 Core enhancements, by Julian Graham, to Guile's thread, mutex and
condvar primitives, in preparation for SRFI-18 support.
2008-03-08 16:22:40 +00:00
Neil Jerram
b226295af8 Release stuff: missing NEWS and 2007/2008 copyrights. 2008-02-15 23:13:59 +00:00
Ludovic Courtès
f937ce3741 Add `gc.test' hack for SPARC GNU/Linux. 2008-02-15 16:02:22 +00:00
Neil Jerram
15bd90eafd * hashtab.c (scm_hash_fn_create_handle_x): If supplied assoc_fn
returns neither a pair nor #f, signal a wrong-type-arg error.
(Thanks to Gregory Marton for reporting this.)

* tests/hash.test: New "hashx" test supplied by Gregory Marton;
prior to today's fix in libguile/hashtab.c, this caused a
segmentation fault.
2008-01-18 23:33:41 +00:00
Ludovic Courtès
70a4404429 Changes from arch/CVS synchronization 2007-12-13 12:27:37 +00:00
Ludovic Courtès
2ae87f26a8 Add missing SRFI-69 files. 2007-12-13 12:23:40 +00:00
Neil Jerram
2d04022ce2 * tests/continuations.test ("continuations"): Use
with-debugging-evaluator.

* lib.scm (with-debugging-evaluator*, with-debugging-evaluator):
New utilities.

* standalone/test-use-srfi: Use -q to avoid picking up the user's
~/.guile file.

* tests/eval.test (promises)[unmemoizing a promise]: New test.
2007-10-21 20:45:45 +00:00
Ludovic Courtès
2e77f7202b Changes from arch/CVS synchronization 2007-10-20 11:09:58 +00:00
Ludovic Courtès
d41668faec Changes from arch/CVS synchronization 2007-10-17 21:56:10 +00:00
Ludovic Courtès
454866e052 Changes from arch/CVS synchronization 2007-09-03 16:58:20 +00:00