Mark H Weaver
8de355d08e
psyntax: toplevel variable definitions discard previous syntactic binding.
...
* module/ice-9/psyntax.scm (expand-top-sequence): When defining a
toplevel variable, use the value of the same-named imported
_variable_, if any. Do _not_ use an existing syntactic binding.
* module/ice-9/psyntax-pp.scm: Regenerate.
2014-01-09 17:40:43 -05:00
Mark H Weaver
1df515a077
Merge branch 'stable-2.0'
...
Conflicts:
module/system/vm/traps.scm
test-suite/tests/peval.test
2014-01-09 02:52:34 -05:00
Ian Price
306cc01d39
Fix trap handlers to handle applicable structs.
...
Reported by Jordy Dickinson <jordy.dickinson@gmail.com>.
Fixes <http://bugs.gnu.org/15691 >.
* module/system/vm/traps.scm (frame-matcher): Extract procedure when
proc is an applicable struct.
2014-01-09 03:12:05 +00:00
Mark H Weaver
793e8a9317
Fix 'string-copy!' to work properly with overlapping src/dest.
...
* libguile/srfi-13.c (scm_string_copy_x): Fix to work properly with
overlapping src/dest.
* test-suite/tests/srfi-13.test ("string-copy!"): Add tests.
2014-01-08 21:42:24 -05:00
Mark H Weaver
900a897cd3
Implement 'exact-integer?' and 'scm_is_exact_integer'.
...
* libguile/numbers.c (scm_exact_integer_p, scm_is_exact_integer):
New procedures.
(scm_integer_p): Improve docstring.
* libguile/numbers.h (scm_exact_integer_p, scm_is_exact_integer):
New prototypes.
* doc/ref/api-data.texi (Integers): Add docs.
* test-suite/tests/numbers.test ("exact-integer?"): Add tests.
2014-01-08 21:42:16 -05:00
Mark H Weaver
f659df4495
Fix doc that incorrectly claimed (integer? +inf.0) => #t.
...
Fixes <http://bugs.gnu.org/16356 >.
Reported by Zefram <zefram@fysh.org>.
* doc/ref/api-data.texi (Integers): Add docs. Fix outdated example
that incorrectly showed (integer? +inf.0) => #t.
2014-01-08 21:41:37 -05:00
Mark H Weaver
4101d14f2e
scm_primitive_load: Simplify code using 'scm_open_file_with_encoding'.
...
* libguile/load.c (scm_primitive_load): Use
'scm_open_file_with_encoding'.
2014-01-08 20:57:21 -05:00
Mark H Weaver
6146984cc5
boot-9: add comment about autoload thread-unsafety.
...
* module/ice-9/boot-9.scm: Add comment about lack of thread-safety in
handling of autoloads.
2014-01-08 20:57:13 -05:00
Mark H Weaver
a662686a25
read: Avoid signed integer overflow in 'read_decimal_integer'.
...
* libguile/read.c (read_decimal_integer): Avoid overflow.
2014-01-08 20:57:04 -05:00
Mark H Weaver
b6203a189b
Increment SCM_N_READ_OPTIONS for 'curly-infix' option.
...
* libguile/private-options.h (SCM_N_READ_OPTIONS): Increment to 8.
This should have been done when the 'curly-infix' was added.
2014-01-08 20:56:56 -05:00
pcpa
b1d3217b63
GNU lightning 2.0.3 release
2014-01-08 17:48:33 -02:00
Ian Price
265e7bd92a
Fix inlining of tail list to apply.
...
Fixes <http://bugs.gnu.org/15533 >.
* module/language/tree-il/peval.scm (peval): Final list argument to
`apply' should not be inlined if it is mutable.
* test-suite/tests/peval.test ("partial evaluation"): Add test.
2014-01-07 03:37:21 +00:00
Ludovic Courtès
70511cc403
Thank Aleix.
2013-12-21 22:01:45 +01:00
Aleix Conchillo Flaque
ecf0498df5
allow specifying a required version in GUILE_PROGS
...
* meta/guile.m4: GUILE_PROGS now takes an optional argument to specify a
required Guile version. By default, it requires Guile >= 2.0. A micro
version can also be specified (e.g. GUILE_PROGS([2.0.10])).
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2013-12-21 22:01:45 +01:00
Mark H Weaver
0b83be7eb6
Revert "Fix bound-identifier=? to compare binding names, not just symbolic names."
...
This reverts commit 70c74b8476
.
2013-12-16 22:55:25 -05:00
Mark H Weaver
70c74b8476
Fix bound-identifier=? to compare binding names, not just symbolic names.
...
Fixes <http://bugs.gnu.org/16158 >.
* module/ice-9/psyntax.scm (bound-id=?): Use 'id-var-name' to compare
binding names (gensyms), not just symbolic names.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/syntax.test: Add test.
2013-12-15 19:04:59 -05:00
Ludovic Courtès
032a16fced
Hide EINTR returns from 'accept'.
...
* libguile/socket.c (scm_accept): Wrap 'accept' call in 'SCM_SYSCALL'.
2013-12-15 22:48:41 +01:00
Mark H Weaver
aa8630efb3
syntax-case: fix error reporting for misplaced ellipses.
...
Reported by taylanbayirli@gmail.com (Taylan Ulrich B.).
* module/ice-9/psyntax.scm (cvt*): Use 'syntax-case' to destructure
the pattern tail, instead of 'pair?', 'car', and 'cdr'.
(gen-clause): When checking for errors, check for misplaced ellipsis
before duplicate pattern variables, to improve the error message in
case of multiple misplaced ellipses.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/syntax.test: Add tests.
2013-12-13 13:25:07 -05:00
Mark H Weaver
d8c476b68d
THANKS Tom Tromey.
...
* THANKS: Add Tom Tromey to fixes section.
2013-12-13 00:35:39 -05:00
Mark H Weaver
61989c7053
Merge branch 'stable-2.0'
...
Conflicts:
libguile/pairs.c
libguile/vm.c
test-suite/tests/control.test
2013-12-12 23:44:46 -05:00
Tom Tromey
e0096e4798
Remove unused function scm_i_tag_name.
...
* libguile/gc.c (scm_i_tag_name): Remove.
2013-12-12 23:39:31 -05:00
Tom Tromey
97dd74c00e
Add missing FUNC_NAME defines for pair accessors.
...
* libguile/pairs.c (scm_car, scm_cdr, scm_caar, scm_cadr, scm_cdar,
scm_cddr, scm_caaar, scm_caadr, scm_cadar, scm_caddr, scm_cdaar,
scm_cdadr, scm_cddar, scm_cdddr, scm_caaaar, scm_caaadr, scm_caadar,
scm_caaddr, scm_cadaar, scm_cadadr, scm_caddar, scm_cadddr,
scm_cdaaar, scm_cdaadr, scm_cdadar, scm_cdaddr, scm_cddaar,
scm_cddadr, scm_cdddar, scm_cddddr): Add missing FUNC_NAME defines.
2013-12-12 21:53:01 -05:00
Tom Tromey
2bbdd2ce1c
Fix computation of LIBLOBJS.
...
Fixes <http://bugs.gnu.org/14193 >.
* configure.ac (LIBLOBJS): Add prefix to computed .lo file name so
dependencies work properly.
2013-12-12 21:43:31 -05:00
Andy Wingo
812c83d48b
Fix section table writing for non-loadable sections
...
* module/system/vm/linker.scm (add-elf-objects): Don't fill in the
sh_addr field if the section is not loadable.
2013-12-10 20:03:59 +01:00
Andy Wingo
18e1113513
Quick documentation fixes.
...
* doc/ref/compiler.texi: Make it build.
2013-12-10 19:53:55 +01:00
Andy Wingo
a236867dc1
Non-loadable sections should not have an sh_addr field set
...
* module/system/vm/linker.scm (relocate-section-header):
(write-linker-object): Sections that are not loadable should not have
their sh_addr fields set. Fix.
2013-12-10 19:49:56 +01:00
Andy Wingo
58b2315657
Beginnings of CPS section in manual
...
* doc/ref/compiler.texi (Continuation-Passing Style): Beginnings of this
section. Will be finished when we fix implicit truncation.
2013-12-10 19:49:56 +01:00
Andy Wingo
660f2775e9
Fix cross-references in api-macros.texi
...
* doc/ref/api-macros.texi (Macro Expansion): Fix cross-references.
2013-12-10 19:49:56 +01:00
Andy Wingo
7bbfc02959
Arities-fixing pass handles incoming $ktrunc with rest args
...
* module/language/cps/arities.scm (fix-clause-arities): Allow $ktrunc
arities with rest arguments.
2013-12-06 12:04:10 +01:00
Andy Wingo
67b5d06c1a
Elide values primcalls with continuations with rest arguments
...
* module/language/cps/elide-values.scm (elide-values): Elide values
primcalls when continuation has rest arguments.
2013-12-06 11:39:04 +01:00
Andy Wingo
fa48a2f79a
(call-with-values foo (lambda (a . b) a)) avoids consing rest list
...
* module/language/cps/slot-allocation.scm (allocate-slots): Don't
allocate slots to unused results of function calls. This can allow us
to avoid consing a rest list for call-with-values with an ignored rest
parameter, and can improve the parallel move code.
* module/language/cps/compile-bytecode.scm (compile-fun): Adapt to avoid
emitting bind-rest in values context if the rest arg is unused.
2013-12-06 11:08:45 +01:00
Ludovic Courtès
70057f3408
vm: Gracefully handle stack overflows.
...
Fixes <http://lists.gnu.org/archive/html/guile-user/2013-12/msg00017.html >.
Reported by rvclayton@verizon.net (R. Clayton).
* libguile/vm.c (reinstate_stack_reserve): New function.
(vm_error_stack_overflow): Install it as an unwind handler.
* test-suite/tests/control.test ("the-vm")["stack overflow reinstates
stack reserve"]: New test.
2013-12-05 22:19:01 +01:00
Andy Wingo
d297e544d9
compiler.texi tweaks
...
* doc/ref/compiler.texi (Compiler Tower): Reword a couple things.
(Tree-IL): Add more vertical space, for readability in info.
2013-12-05 11:55:10 +01:00
Andy Wingo
67915ab079
Doc updates to macroexpansion, compiled procs, and compiler.texi
...
* doc/ref/api-macros.texi (Macro Expansion): New section.
* doc/ref/api-procedures.texi (Compiled Procedures): Beginnings of a
revision. Not finished.
* doc/ref/compiler.texi (Compiling to the Virtual Machine): Beginnings
of a revision. CPS and bytecode are not done yet.
2013-12-04 20:46:02 +01:00
pcpa
8567d28d60
x86: Correct wrong x87 optimization.
...
* lib/jit_x86-x87.c: Correct wrong optimization when
loading the log(2) constant.
2013-12-03 15:11:11 -02:00
pcpa
0b0d63d892
x86: Ensure the x87 stack is empty when calling a function.
...
* lib/jit_x86-cpu.c: Use the emms instruction before
calling any function. This is particularly important
when using c99 complex functions as it can easily
overflow the x87 stack due to the way lightning uses
the x87 stack as a flat register file.
2013-12-03 15:09:48 -02:00
pcpa
c162b9d836
x86: Correct wrong x87 float indexed store code generation.
...
* lib/jit_x86-x87.c: Correct wrong code generation due
to comparing the base and not the value register with
%st(0) in stxi_f.
2013-12-02 19:17:03 -02:00
Andy Wingo
691697de09
Rename "RTL" to "bytecode"
...
"RTL" didn't make any sense, and now that there's no other bytecode to
disambiguate against, just call it bytecode.
* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/cps/arities.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/primitives.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/spec.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/rtl.scm:
* module/language/rtl/spec.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* module/system/repl/common.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* test-suite/tests/cross-compilation.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test:
* test-suite/vm/run-vm-tests.scm: Fixups.
2013-12-02 21:31:47 +01:00
pcpa
4e5368d291
Correct wrong call in ldi_f if address does not fit in 32 bit.
...
This would only happen in x86_64, where x87 registers are not used
neither "exported".
2013-12-02 18:15:14 -02:00
pcpa
479c2eda3c
x86: Use aligned offset for x87 to/from sse move.
...
* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
stack offset for float/double x87 to/from sse move.
2013-12-02 17:58:00 -02:00
Andy Wingo
e54c7dd67c
Fix brainfuck comment
...
* module/language/brainfuck/parse.scm: Fix outdated comment.
2013-12-02 19:03:50 +01:00
Andy Wingo
60ce72b9b9
Fix brainfuck->scheme compiler.
...
* module/language/brainfuck/compile-scheme.scm (compile-scheme): Fix
brainfuck compiler.
2013-12-02 19:03:48 +01:00
Andy Wingo
7f71030837
Fix brainfuck comment
...
* module/language/brainfuck/parse.scm: Fix outdated comment.
2013-12-02 19:02:38 +01:00
Andy Wingo
cdc75fd001
Fix brainfuck->scheme compiler.
...
* module/language/brainfuck/compile-scheme.scm (compile-scheme): Fix
brainfuck compiler.
2013-12-02 19:02:38 +01:00
Mark H Weaver
7cfcb60bc1
GOOPS doc fix: #:dsupers is the init keyword for the dsupers slot.
...
* doc/ref/goops.texi (Metaclasses): #:dsupers is the initialization
keyword for the dsupers slot, not #:supers.
2013-12-01 18:41:31 -05:00
Mark H Weaver
79657fd3ec
Thread safe port properties.
...
* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
Lock the port mutex while accessing the port alist.
* libguile/read.c (set_port_read_option): Lock the port mutex
while modifying port read options.
2013-12-01 18:34:30 -05:00
Andy Wingo
1f6f591d66
Add section to vm.texi about Guile's use of ELF
...
* doc/ref/vm.texi (Object File Format): New section.
2013-12-01 12:35:12 +01:00
Andy Wingo
9e9745b355
vm.texi tweak
...
* doc/ref/vm.texi (Why a VM?): Small tense tweak.
2013-11-30 20:59:14 +01:00
Andy Wingo
69aecc6abb
Update vm.texi's "Instruction Set" section.
...
* doc/ref/vm.texi (Instruction Set): Update.
2013-11-30 18:46:14 +01:00
Andy Wingo
ddf0d7bb2e
Fix more vm-engine comments
...
* libguile/vm-engine.c: Fix more comments.
2013-11-30 18:46:14 +01:00