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

12177 commits

Author SHA1 Message Date
Ludovic Courtès
1cd4fffcde Use Gnulib's `sys_stat' module; update Gnulib.
* .x-sc_prohibit_S_IS_definition: New file.

* m4/gnulib-cache.m4: Add `sys_stat'.

* libguile/filesys.c: Remove `S_IS*' macro definitions for Ultrix and
  MinGW.
2009-12-15 20:14:19 +01:00
Ludovic Courtès
20ccae8dbb Remove obsolete test-suite makefile snippets.
* test-suite/Makefile.am (SCM_TESTS_DIRS): Remove.
  (dist-hook): Remove target.
2009-12-15 19:23:08 +01:00
Ludovic Courtès
d7297d3923 Disable thread-local storage on Solaris 8.
* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Special-case `*solaris2.8'.
2009-12-15 19:22:19 +01:00
Ludovic Courtès
eb80072df0 Change the Elisp compiler from GPLv2+ to LGPLv3+.
* module/language/elisp/bindings.scm, module/language/elisp/lexer.scm,
  module/language/elisp/parser.scm, module/language/elisp/runtime.scm,
  module/language/elisp/runtime/function-slot.scm,
  module/language/elisp/runtime/macro-slot.scm,
  module/language/elisp/runtime/value-slot.scm: Switch from GPLv2+ to
  LGPLv3+; fix copyright year.
2009-12-15 19:10:48 +01:00
Ludovic Courtès
66e18d1c7c Use portable shell in `meta/uninstalled-env'.
* meta/uninstalled-env.in: Don't use the `-q' and `-E' options, which are
  specific to GNU grep.  Don't set-and-export environment variables at
  once since this is a GNU Bash extension.
2009-12-15 01:11:01 +01:00
Ludovic Courtès
5c14636357 Use the right `grep' command.
* libguile/Makefile.am (.c.i): Use $(GREP), not `grep'.
  (check_signals, check_errnos): Use $(EGREP), not `egrep'.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
4ea57d5b48 Remove GNU Make-specific function call.
* libguile/Makefile.am (c-tokenize.$(OBJEXT)): Remove use of GNU Make's
  `filter-out' function.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
f65e0168d5 Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' & co.
* libguile/bitvectors.c, libguile/srfi-4.c, libguile/strings.c,
  libguile/vectors.c: Remove extraneous semicolon after
  `SCM_ARRAY_IMPLEMENTATION' and `SCM_VECTOR_IMPLEMENTATION'
  invocations.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
1bf291e497 Remove extraneous functions from `AC_REPLACE_FUNCS'.
* configure.ac: Remove `inet_aton' and `putenv' from `AC_REPLACE_FUNCS'.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
62316c7f81 Avoid `SCM_UNPACK ()' in constant expressions.
They made Sun C 5.8 emit a warning such as:

  line 71: warning: dead part of constant expression is nonconstant

* libguile/print.c (scm_print_opts): Don't use `SCM_UNPACK ()' here.

* libguile/read.c (scm_read_opts): Likewise.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
ab33782cb3 Remove return' from void' function.
* libguile/print.c (scm_print_symbol_name): Remove `return' statement.
2009-12-15 01:01:17 +01:00
Ludovic Courtès
3dbbe28dfd Don't use GCC zero-length arrays.
* libguile/frames.c, libguile/objcodes.c, libguile/programs.c,
  libguile/vm-engine.c, libguile/vm-i-system.c, libguile/vm.c: Use
  `SCM_C_OBJCODE_BASE ()' instead of accessing the `base' field of
  `struct scm_objcode'.

* libguile/objcodes.h (struct scm_objcode)[base]: Remove.
2009-12-15 01:01:16 +01:00
Ludovic Courtès
cd169c5a22 Remove uses of the non-standard `__FUNCTION__'.
* libguile/gc.c (scm_gc_sweep): Replace `__FUNCTION__' by `FUNC_NAME'.

* libguile/read.c (scm_read_r6rs_block_comment): Likewise.
2009-12-15 01:01:16 +01:00
Andy Wingo
93dbc31b9a expose frame-previous, once again
* libguile/frames.h:
* libguile/frames.c (scm_frame_previous): Rename from scm_c_frame_prev,
  and expose to Scheme. Skip boot frames.

* libguile/stacks.c (stack_depth, narrow_stack, scm_make_stack)
  (scm_stack_ref): Adjust for scm_frame_previous skipping boot frames.
2009-12-15 00:22:02 +01:00
Ludovic Courtès
5b98517a65 Fix test environment issue with ltdl from Libtool 2.2.6b.
Earlier versions of ltdl would look for extensions under $PWD; this
behavior changed in 2.2.6b.

* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Define
  $builddir.

* test-suite/standalone/test-asmobs: Specify the full path to
  `libtest-asmobs', using $builddir.

* test-suite/standalone/test-extensions: Likewise.
2009-12-14 10:59:25 +01:00
Andy Wingo
61521ea034 more NEWS updates
* NEWS: Update some more.
2009-12-13 20:18:50 +01:00
Andy Wingo
9331f91cc4 primitive-eval passes first N args on stack directly, not via apply
* libguile/memoize.c (MAKMEMO_CALL): Memoize in the number of arguments
  at the call site.
  (memoize, scm_m_cond, memoize_named_let, unmemoize):
* libguile/eval.c (eval): Adapt to changes in call memoization.

* module/ice-9/eval.scm (primitive-eval): For calls, pass the first N
  arguments directly on the stack, and only the rest as a consed
  argument list to apply. Currently N is 4.
2009-12-13 17:19:59 +01:00
Andy Wingo
4abb824cdb interpreted closures cons less.
* module/ice-9/eval.scm (primitive-eval): When making a closure with N
  formals, actuall return a closure with N formals, if N is less than
  *max-static-argument-count*, which currently is 8. If N is greater
  than 8, do the arg-parsing loop as we did before. Requires some
  macrology, but should reduce unnecessary consing for interpreted
  closures.

* test-suite/tests/goops.test:
* test-suite/tests/hooks.test: Now that checks like (thunk? foo) are
  going to work as a for interpreted code, remove some (throw
  'unresolved).
2009-12-13 16:18:39 +01:00
Andy Wingo
271a32dbc2 commit draft of NEWS 2009-12-12 00:10:36 +01:00
Andy Wingo
492e7efe6d lame tweak to the inliner
* module/language/tree-il/inline.scm: Tweak to avoid a (if #t #t #f).
  Yes, it's lame.
2009-12-12 00:10:35 +01:00
Andy Wingo
5bb408ccaf prepare NEWS for 1.9.6
* NEWS: Prepare NEWS for 1.9.6.
2009-12-12 00:10:35 +01:00
Ludovic Courtès
9035e9d6db Tweak the "unused modules are removed" test.
* test-suite/tests/gc.test ("gc")["unused modules are removed"]: Add
  loop to clean up stale references from the stack.
2009-12-11 23:27:47 +01:00
Ludovic Courtès
2cf7ff2e79 SRFI-1: Use the built-in optional argument support.
* module/srfi/srfi-1.scm (iota, unfold, unfold-right, alist-delete,
  alist-delete!): Use `define*' and optional arguments instead of rest
  arguments.
2009-12-11 15:20:12 +01:00
Ludovic Courtès
dd902692fd Fix expansion of `(+ 1 x)'.
* module/language/tree-il/primitives.scm (+): Fix typo.
2009-12-11 14:56:49 +01:00
Ludovic Courtès
056905c3cf Typo.
* test-suite/Makefile.am (SCM_TESTS): Fix typos:
  `.text' -> `.test'.
2009-12-11 14:32:34 +01:00
Ludovic Courtès
fe258c43a1 SRFI-9: Make accessors inlinable.
* module/srfi/srfi-9.scm (define-inlinable): New macro.
  (define-record-type): Use it.
2009-12-11 13:03:46 +01:00
Ludovic Courtès
09a8dc97db SRFI-9: Reimplement in terms of structs, using `syntax-case'.
* module/srfi/srfi-9.scm (define-record-type): Rewrite to use raw
  structs instead of records.  Use `syntax-case' instead of
  `define-macro'.
2009-12-11 13:03:46 +01:00
Ludovic Courtès
f680bdd762 Add struct & vector benchmarks.
* benchmark-suite/benchmarks/structs.bm,
  benchmark-suite/benchmarks/vectors.bm: New files.

* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add.

* benchmark-suite/benchmarks/bytevectors.bm: Fix copyright.
2009-12-11 13:03:46 +01:00
Ludovic Courtès
bd91ecce14 Add opcodes for struct?', struct-vtable', and `make-struct'.
* libguile/vm-engine.c (VM_NAME)[vm_error_not_a_struct]: New label.

* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): New macro.
  (struct_p, struct_vtable, make_struct): New instructions.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
  `struct?', `struct-vtable', and `make-struct'.

* module/language/tree-il/primitives.scm (*interesting-primitive-names*,
  *effect-free-primitives*): Likewise.
2009-12-11 13:03:45 +01:00
Andy Wingo
6c20a0b34b vm no longer measures bogoclock or times, relies on os for that
* libguile/vm.h (struct scm_vm): Remove "time" and "clock" members. The
  time was bogusly measured, and the "clock" measured instructions
  retired, which is not a very useful measurement, and it was causing
  lots of memory accesses. Not that I have done a proper profile,
  though...
  (scm_vm_stats): Remove this procedure, which provided access to "time"
  and "clock".

* libguile/vm.c:
* libguile/vm-engine.h:
* libguile/vm-engine.c:
* libguile/vm-i-system.c: Adapt to scm_vm changes and scm_vm_stats
  removal.

* module/system/repl/command.scm:
* module/system/vm/vm.scm: Adapt to vm-stats removal by removing
  vm-stats from <repl>.
2009-12-11 12:39:02 +01:00
Andy Wingo
349d5c4428 inline calls to (memv foo CONSTANT-LIST)
* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Recognize memv and memq as well.

* module/language/tree-il/inline.scm (inline!): Inline calls to memq and
  memv where the list is a constant.
2009-12-11 12:20:55 +01:00
Andy Wingo
b6d93b1182 rename <conditional> then and else to consequent and alternate
* module/language/tree-il.scm (<tree-il>): Rename the "then" and "else"
  clauses of <conditional> to "consequent" and "alternate". More
  verbose, yes, but that way we avoid unexpected behavior with "else".
  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold):
  (make-tree-il-folder, post-order!, pre-order!)
* module/language/tree-il/analyze.scm (analyze-lexicals):
* module/language/tree-il/compile-glil.scm (flatten):
* module/language/tree-il/fix-letrec.scm (simple-expression?): Update
  callers.
2009-12-11 12:00:27 +01:00
Andy Wingo
3a88cb3b17 rename lambda-case-else to lambda-case-alternate
* module/language/tree-il.scm (<tree-il>): Rename the "else" field of
  <lambda-case> to "alternate". Conflicts less with the "else" keyword
  as used by case, cond, record-case, pmatch, etc.
  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
  (make-tree-il-folder, post-order!, pre-order!): Adapt traversal
  operators for <lambda-case> change.

* module/language/tree-il/analyze.scm (analyze-lexicals)
  (validate-arity):
* module/language/tree-il/compile-glil.scm (flatten):
* module/language/tree-il/inline.scm (inline!): Adapt for <lambda-case>
  change.
2009-12-11 11:49:14 +01:00
Andy Wingo
5b09b37f81 vm: handle interrupts on backwards jumps
* libguile/vm-i-system.c (BR, br): Handle interrupts on backwards jumps,
  so we can Ctrl-C an endless loop.
2009-12-11 11:17:03 +01:00
Andy Wingo
e8c3777214 less overhead for handling interrupts in the vm
* libguile/__scm.h (SCM_ASYNC_TICK): Add some branch prediction.
  (SCM_ASYNC_TICK_WITH_CODE): New helper for when BUILDING_LIBGUILE,
  runs code only if we're going to call async_click().
* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): New helper, uses
  SCM_ASYNC_TICK_WITH_CODE to only save regs if we'll handle an
  interrupt.
* libguile/vm-i-system.c (call, goto/args, return): use
  VM_HANDLE_INTERRUPTS.
2009-12-11 11:15:12 +01:00
Andreas Rottmann
aa3819aa34 add partial support for tail patterns in syntax-rules/syntax-case
I've prepared a patch that adds partial support for tail patterns.
Things like the the SRFI-34 `guard' macro from [0] are supported, but
you still can't combine dotted patterns with tail patterns, e.g.

(syntax-rules (else)
  ((foo bar ... (else something) . rest)
   <TEMPLATE-HERE>))

will *not* work; there's the issue that one can't just transcribe
the implementation of this feature from the latest version of psyntax,
as I've done for non-dotted tail patterns, as it's implemented using a
dotted pattern like the above. Alas!

[0] <http://article.gmane.org/gmane.lisp.guile.devel/9442>

* module/ice-9/psyntax.scm (syntax-case, $sc-dispatch): Add support for
  tail patterns, transcribed from the latest psyntax.

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

* test-suite/tests/syncase.test: Add tests for tail patterns.
2009-12-11 10:57:29 +01:00
Andy Wingo
e42573315b merge from master to elisp
* module/language/elisp/compile-tree-il.scm: Update for changes to
  tree-il (lambda-case, mainly).

* module/language/elisp/spec.scm: Update GPL version to 3. Update reader
  for new taking a port and environment argument.

* libguile/_scm.h: Bump objcode version.

* libguile/vm-i-system.c: Fix conflicts.

* module/Makefile.am: Fix conflicts, and add elisp modules to the build.
2009-12-11 10:45:18 +01:00
Andy Wingo
51423b0188 add ice-9/quasisyntax.scm to NOCOMP_SOURCES
* module/Makefile.am (NOCOMP_SOURCES): Add quasisyntax.scm.
2009-12-10 21:43:47 +01:00
Andy Wingo
8986ff7ae9 fix emission of meta procedures
* module/language/glil/compile-assembly.scm: Fix the check for when to
  emit a "meta" procedure. Fixes
  http://thread.gmane.org/gmane.lisp.guile.user/7469/focus=7470.
2009-12-10 20:26:54 +01:00
Andy Wingo
ed1bf2c85c if we have no eval.go, load no .go
* libguile/load.c (scm_init_eval_in_scheme): If we have no eval.go, null
  out the load-compiled path so that we load no compiled code. Prevents
  partially compiled Guile from turning tail-calls into stack-munching
  calls.
2009-12-10 20:26:13 +01:00
Andy Wingo
08d7492cf0 add gbt macro to gdbinit, and fix a bug in program-arity
* gdbinit: Add gbt macro, to make a Guile backtrace whenever you want.
* module/system/vm/program.scm (program-arity): If ip is #f, just take
  the first arity.
2009-12-10 16:03:23 +01:00
Andy Wingo
393301c519 fix arbiter compilation with the generic codepath
* libguile/arbiters.c (scm_try_arbiter, scm_release_arbiter): Fix for
  the generic case; not sure why it wasn't working.
2009-12-09 10:21:31 +01:00
Andy Wingo
7230aaf961 fix FUNC_NAME of scm_memoize_variable_access_x
* libguile/memoize.c (scm_memoize_variable_access_x): Fix FUNC_NAME
  definition.
2009-12-09 10:07:04 +01:00
Andy Wingo
735bcfe579 add SCM_SMOB_TYPE_BITS and SCM_SMOB_TYPE_MASK
* libguile/smob.h (SCM_SMOB_TYPE_BITS, SCM_SMOB_TYPE_MASK): New macros,
  for when you want to identify a SMOB by type and mask.

* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/srfi-4.c: Use the new macros.
2009-12-08 23:13:21 +01:00
Andy Wingo
75a029aa25 fix SCM_CELL macro usage.
* libguile/vm.h (SCM_VM_CONT_DATA): Fix SCM_CELL macro usage.
2009-12-08 23:13:21 +01:00
Andy Wingo
0b1733c7d1 SCM_CELL in throw.c
* libguile/throw.c (JBACTIVE, ACTIVATEJB, DEACTIVATEJB, JBJMPBUF)
  (SETJBJMPBUF, SCM_JBPREUNWIND, SCM_SETJBPREUNWIND)
  (pre_unwind_data_print, scm_ithrow): Fix SCM_CELL macro usage.
2009-12-08 23:13:20 +01:00
Andy Wingo
0e163c06f2 SCM_VALIDATE_SMOB uses SCM_SMOB_PREDICATE
* libguile/validate.h (SCM_VALIDATE_SMOB): Change to use
  SCM_SMOB_PREDICATE instead of SCM_TYP16_PREDICATE.
2009-12-08 23:13:20 +01:00
Andy Wingo
00f8b368ca SCM_CELL in srfi-4.c
* libguile/srfi-4.c (SCM_UVEC_TYPE, SCM_UVEC_LENGTH, SCM_UVEC_BASE): Fix
  SCM_CELL macro usage.
2009-12-08 23:13:20 +01:00
Andy Wingo
9e9e54eb19 SCM_CELL in srcprop.c
* libguile/srcprop.c (SRCPROPPOS, SRCPROPCOPY, SRCPROPALIST)
  (SETSRCPROPPOS, SETSRCPROPCOPY, SETSRCPROPALIST): Fix erroneous
  SCM_CELL macro usage.
2009-12-08 23:13:20 +01:00
Andy Wingo
bbd41a6a21 use the new public metatables from struct.c
* libguile/procs.c (scm_init_procs): No need to lookup the
  applicable-struct-with-setter vtable, as it is now exported.
2009-12-08 23:13:20 +01:00