bpt/guile.git
14 years agoImplemented unless, when and dotimes using built-in macros.
Daniel Kraft [Sat, 18 Jul 2009 16:38:42 +0000 (18:38 +0200)]
Implemented unless, when and dotimes using built-in macros.

* module/language/elisp/README: Document that.
* module/language/elisp/runtime.scm: Defined built-in-macro macro.
* module/language/elisp/runtime/macro-slot.scm: Implement unless, when, dotimes.
* test-suite/tests/elisp-compiler.test: Test for those constructs.

14 years agoReturn correct value for setq form.
Daniel Kraft [Sat, 18 Jul 2009 15:58:01 +0000 (17:58 +0200)]
Return correct value for setq form.

* module/language/elisp/compile-tree-il.scm: Fix implementation of setq.
* test-suite/tests/elisp-compiler.test: Check for value of setq form.

14 years agoImplemented real quotation (added support for backquotation).
Daniel Kraft [Sat, 18 Jul 2009 15:32:59 +0000 (17:32 +0200)]
Implemented real quotation (added support for backquotation).

* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement backquote.
* test-suite/tests/elisp-compiler.test: Test quotation and backquotes.

14 years agoImplemented eq and equal built-in predicates.
Daniel Kraft [Sat, 18 Jul 2009 15:21:55 +0000 (17:21 +0200)]
Implemented eq and equal built-in predicates.

* module/language/elisp/runtime/function-slot.scm: Implement eq and equal.
* test-suite/tests/elisp-compiler.test: Test them.

14 years agoImplemented macros in elisp compiler.
Daniel Kraft [Thu, 16 Jul 2009 13:23:38 +0000 (15:23 +0200)]
Implemented macros in elisp compiler.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
* test-suite/tests/elisp-compiler.test: Basic macro tests.

14 years agoExtended test-suite to cover already implemented built-ins and fixed errors found.
Daniel Kraft [Thu, 16 Jul 2009 12:28:07 +0000 (14:28 +0200)]
Extended test-suite to cover already implemented built-ins and fixed errors found.

* module/language/elisp/runtime/function-slot.scm: Fixed errors in number preds.
* test-suite/tests/elisp-compiler.test: Test built-ins already implemented.

14 years agoTest-suite for elisp compiler so far, excluding the built-ins.
Daniel Kraft [Wed, 15 Jul 2009 20:08:36 +0000 (22:08 +0200)]
Test-suite for elisp compiler so far, excluding the built-ins.

* test-suite/tests/elisp-compiler.test: Tests for compiler so far.

14 years agoRemoved wrong not in zerop built-in.
Daniel Kraft [Wed, 15 Jul 2009 11:51:19 +0000 (13:51 +0200)]
Removed wrong not in zerop built-in.

* module/language/elisp/runtime/function-slot.scm: Fix zerop.

14 years agoImplemented defconst, defvar, defun special forms for elisp.
Daniel Kraft [Tue, 14 Jul 2009 19:18:07 +0000 (21:18 +0200)]
Implemented defconst, defvar, defun special forms for elisp.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement defconst/defvar/defun.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/guile into elisp
Daniel Kraft [Tue, 14 Jul 2009 18:20:03 +0000 (20:20 +0200)]
Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

14 years agoRemove potential "uninitialized variable" GCC warnings.
Ludovic Courtès [Tue, 14 Jul 2009 15:12:04 +0000 (17:12 +0200)]
Remove potential "uninitialized variable" GCC warnings.

* libguile/vm-i-scheme.c (vector_ref, vector_set, BV_FIXABLE_INT_REF,
  BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET,
  BV_FLOAT_SET): Explicitly initialize all locals, to make some versions
  of GCC happier.  Patch by Dale P. Smith <dsmich@roadrunner.com>.

14 years agoFix tests that assumed little endian.
Ludovic Courtès [Tue, 14 Jul 2009 14:07:13 +0000 (16:07 +0200)]
Fix tests that assumed little endian.

* test-suite/tests/asm-to-bytecode.test (u32->u8-list): New procedure.
  ("compiler")[(load-program 3 2 1 0 () 3 #f (make-int8 3) (return)),
  (load-program 3 2 1 0 () 3 (load-program 3 2 1 0 ...))]: Make these
  tests work on hosts whose endianness is not little endian.

14 years agoSome bug fixes on the way and mainly implemented some built-ins (arithmetic).
Daniel Kraft [Mon, 13 Jul 2009 16:35:57 +0000 (18:35 +0200)]
Some bug fixes on the way and mainly implemented some built-ins (arithmetic).

* module/language/elisp/README: Document changes.
* module/language/elisp/compile-tree-il.scm: Bug fixes to fluid-creation.
* module/language/elisp/runtime.scm: Some helping definitions for built-ins.
* module/language/elisp/runtime/function-slot.scm: Defined artihmetic built-ins.

14 years agoAutomatically create fluids when necessary.
Daniel Kraft [Mon, 13 Jul 2009 15:26:07 +0000 (17:26 +0200)]
Automatically create fluids when necessary.

* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Create fluids when necessary.
* module/language/elisp/runtime/function-slot.scm: Fix module name.

14 years agoFixed lambda expressions and implemented function calls using the basic list notation.
Daniel Kraft [Mon, 13 Jul 2009 14:51:05 +0000 (16:51 +0200)]
Fixed lambda expressions and implemented function calls using the basic list notation.

* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement function calls.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/guile into elisp
Daniel Kraft [Mon, 13 Jul 2009 13:46:46 +0000 (15:46 +0200)]
Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

14 years agoLambda expressions in elisp, but not yet function calls.
Daniel Kraft [Mon, 13 Jul 2009 13:43:53 +0000 (15:43 +0200)]
Lambda expressions in elisp, but not yet function calls.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement lambda expressions.

14 years agoImplemented let and let* in elisp.
Daniel Kraft [Tue, 7 Jul 2009 17:38:25 +0000 (19:38 +0200)]
Implemented let and let* in elisp.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement let and let*.

14 years agoImplemented while construct in elisp.
Daniel Kraft [Tue, 7 Jul 2009 15:26:22 +0000 (17:26 +0200)]
Implemented while construct in elisp.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement while construct.

14 years agoUse Gnulib's `vsnprintf' module.
Ludovic Courtès [Sun, 5 Jul 2009 21:57:37 +0000 (23:57 +0200)]
Use Gnulib's `vsnprintf' module.

* m4/gnulib-cache.m4: Use `vsnprintf', needed by `deprecation.c'.

14 years agoUpdate `NEWS'.
Ludovic Courtès [Sun, 5 Jul 2009 20:19:30 +0000 (22:19 +0200)]
Update `NEWS'.

* NEWS: Update.

14 years agoEnclose `bit-operations.test' in its own module.
Ludovic Courtès [Sun, 5 Jul 2009 19:13:51 +0000 (21:13 +0200)]
Enclose `bit-operations.test' in its own module.

* test-suite/tests/bit-operations.test: Use the `define-module' clause.

14 years agoFix the `BUILD_PTHREAD_SUPPORT' Automake conditional when not using pthread.
Ludovic Courtès [Sun, 5 Jul 2009 19:10:35 +0000 (21:10 +0200)]
Fix the `BUILD_PTHREAD_SUPPORT' Automake conditional when not using pthread.

* configure.in: Set $build_pthread_support to "no" when thread support
  isn't built.  This fixes the `BUILD_PTHREAD_SUPPORT' Automake
  conditional.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/guile into elisp
Daniel Kraft [Sat, 4 Jul 2009 09:09:38 +0000 (11:09 +0200)]
Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

14 years agoImplemented fluid-based variable references and setting using setq.
Daniel Kraft [Fri, 3 Jul 2009 21:00:12 +0000 (23:00 +0200)]
Implemented fluid-based variable references and setting using setq.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement variable references, setq
* module/language/elisp/runtime.scm: New file for runtime definitions.
* module/language/elisp/runtime/function-slot.scm: Ditto.
* module/language/elisp/runtime/value-slot.scm: Ditto.

14 years agofix error message for bad objcode cookie
Andy Wingo [Thu, 2 Jul 2009 19:55:28 +0000 (21:55 +0200)]
fix error message for bad objcode cookie

* libguile/objcodes.c: Whoop-dee :)

14 years agoImplemented elisp's or form.
Daniel Kraft [Thu, 2 Jul 2009 19:22:25 +0000 (21:22 +0200)]
Implemented elisp's or form.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement or.

14 years agoFor elisp's (cond ...) and (condition) forms without body, return the condition as...
Daniel Kraft [Thu, 2 Jul 2009 19:10:38 +0000 (21:10 +0200)]
For elisp's (cond ...) and (condition) forms without body, return the condition as value.

* compile-tree-il.scm: Fix compilation of (cond ...) for bodyless conditions.

14 years agoRead complex numbers where both parts are inexact decimals
Neil Jerram [Wed, 1 Jul 2009 00:39:24 +0000 (01:39 +0100)]
Read complex numbers where both parts are inexact decimals

Thanks to Bill Schottstaedt for reporting this problem!

* libguile/numbers.c (mem2ureal): Don't be misled by *p_exactness
  being INEXACT on entry (as is possible when reading a complex
  number): use local exactness variable x which starts as EXACT.
  Call mem2decimal_from_point () with &x instead of p_exactness.

* test-suite/tests/numbers.test ("string->number"): Add complex number
  tests suggested by Bill.

14 years agoCorrection to doc on Accessing Arrays from C
Neil Jerram [Tue, 30 Jun 2009 22:56:40 +0000 (23:56 +0100)]
Correction to doc on Accessing Arrays from C

Thanks to Ludovic for the new wording!

* doc/ref/api-compound.texi (Accessing Arrays from C): Correct text to
  reflect the current implementation of scm_array_get_handle and
  scm_array_handle_release - which don't actuall do any dynwind stuff.

14 years agoAdded make-nil instruction to VM and use it for Emacs' nil in the compiler.
Daniel Kraft [Mon, 29 Jun 2009 11:16:27 +0000 (13:16 +0200)]
Added make-nil instruction to VM and use it for Emacs' nil in the compiler.

* doc/ref/vm.texi: Document new instruction.
* libguile/vm-i-system.c: Add it to the VM.
* module/language/assembly.scm: Compile (const %nil) to (make-nil) assembly.
* module/language/glil/decompile-assembly.scm: Handle (make-nil)
* module/language/elisp/compile-tree-il.scm: Use (const %nil) for nil.

14 years agoRemove seek/truncate shortcuts to file ports.
Ludovic Courtès [Sun, 28 Jun 2009 21:33:17 +0000 (23:33 +0200)]
Remove seek/truncate shortcuts to file ports.

Suggested by Neil.

* libguile/fports.c (fport_seek_or_seek64): Rename to `fport_seek ()'.
  (fport_seek, scm_i_fport_seek, scm_i_fport_truncate): Remove.

* libguile/fports.h (scm_i_fport_seek, scm_i_fport_truncate): Remove
  declarations.

* libguile/ports.c (scm_seek): Remove shortcut that would call out to
  `scm_i_fport_seek ()'.
  (scm_truncate_file): Likewise.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/guile into elisp
Daniel Kraft [Sat, 27 Jun 2009 18:07:11 +0000 (20:07 +0200)]
Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

14 years agobytevector ops now compile down to low-level VM ops
Andy Wingo [Fri, 26 Jun 2009 10:41:34 +0000 (12:41 +0200)]
bytevector ops now compile down to low-level VM ops

* libguile/instructions.c (scm_instruction_list): Fix a longstanding bug
  in this humble function.

* libguile/vm-i-scheme.c (BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET):
  Fix some bugs in these macros -- now the bytevector ops work.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
  bytevector calls to VM ops.

* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Resolve bytevector calls to primitive
  calls.

14 years agorun bytevectors tests under the compiler and evaluator
Andy Wingo [Fri, 26 Jun 2009 09:12:37 +0000 (11:12 +0200)]
run bytevectors tests under the compiler and evaluator

* test-suite/tests/bytevectors.test: Run a number of tests under the
  compiler/vm and the evaluator.

14 years agovector-ref and vector-set! now have opcodes
Andy Wingo [Thu, 25 Jun 2009 22:15:37 +0000 (00:15 +0200)]
vector-ref and vector-set! now have opcodes

* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Resolve vector-ref and vector-set!.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): And compile
  vector-ref and vector-set! to their opcodes.

* libguile/vm-i-scheme.c (vector-ref, vector-set): New opcodes, placed
  before the bytevector ops. The renumbering shouldn't affect anyone,
  given that the bytevector ops were not yet used. Fix a few bugs in the
  bytevector ops.

14 years agoadd bytevector ops to the vm
Andy Wingo [Wed, 24 Jun 2009 21:49:11 +0000 (23:49 +0200)]
add bytevector ops to the vm

* libguile/instructions.h (SCM_VM_NUM_INSTRUCTIONS): Enlarge to 255. Not
  sure what performance effects this will have.

* libguile/vm-engine.c: Add new error case, vm_error_not_a_bytevector.

* libguile/vm-engine.h: Don't assign specific registers for i386. Having
  added the new VM vector ops, GCC 4.4 is erroring for me now.

* libguile/vm-i-scheme.c: Add bytevector-specific ops to the VM.
  We don't actually use them yet, though.

14 years agobytevectors provide scm_i_native_endianness to the vm
Andy Wingo [Wed, 24 Jun 2009 21:46:42 +0000 (23:46 +0200)]
bytevectors provide scm_i_native_endianness to the vm

* libguile/bytevectors.h (scm_i_native_endianness): Allow the VM to use
  scm_i_native_endianness, but still keep it marked as internal.

* libguile/bytevectors.c: Adjust to use scm_i_native_endianness instead
  of native_endianness. Define it at bootstrap time.

14 years agominor doc tweaks
Andy Wingo [Wed, 24 Jun 2009 21:44:03 +0000 (23:44 +0200)]
minor doc tweaks

* doc/ref/api-compound.texi: Generalized vector doc fixups.

* doc/ref/api-data.texi: Minor fixes to bytevector docs.

14 years agoRevert "* FAQ: New file."
Neil Jerram [Thu, 25 Jun 2009 22:24:57 +0000 (23:24 +0100)]
Revert "* FAQ: New file."

This reverts commit d53f85dd859fa69af8a0b67482774d2a88aaf407.

It was a confusing mistake to create an FAQ file in the Guile
repository/distribution, because there was already an FAQ page on the
Guile web site.  The information that was in the FAQ file is now in
the FAQ web page.

14 years agoAdd `scm_t_off' type so that `scm_t_port' has a fixed layout.
Ludovic Courtès [Thu, 25 Jun 2009 21:32:44 +0000 (23:32 +0200)]
Add `scm_t_off' type so that `scm_t_port' has a fixed layout.

* libguile/gen-scmconfig.c (main): Produce a definition for
  `scm_t_off'.

* libguile/ports.h (scm_t_port)[read_buf_size, saved_read_buf_size,
  write_buf_size, seek, truncate]: Use `scm_t_off' instead of `off_t' so
  that the layout and size of the structure does not depend on the
  application's `_FILE_OFFSET_BITS' value.  Reported by Bill
  Schottstaedt, see
  http://lists.gnu.org/archive/html/bug-guile/2009-06/msg00018.html.
  (scm_set_port_seek, scm_set_port_truncate): Update.

* libguile/ports.c (scm_set_port_seek, scm_set_port_truncate): Use
  `scm_t_off' and `off_t_or_off64_t'.

* libguile/fports.c (fport_seek, fport_truncate): Use `scm_t_off'
  instead of `off_t'.

* libguile/r6rs-ports.c (bip_seek, cbp_seek, bop_seek): Use `scm_t_off'
  instead of `off_t'.

* libguile/rw.c (scm_write_string_partial): Likewise.

* libguile/strports.c (st_resize_port, st_seek, st_truncate): Likewise.

* doc/ref/api-io.texi (Port Implementation): Update prototype of
  `scm_set_port_seek ()' and `scm_set_port_truncate ()'.

* NEWS: Update.

14 years agoFix `load-objcode' FD/mapping leak occurring upon failure.
Ludovic Courtès [Thu, 25 Jun 2009 20:45:12 +0000 (22:45 +0200)]
Fix `load-objcode' FD/mapping leak occurring upon failure.

* libguile/objcodes.c (make_objcode_by_mmap): Close FD and unmap ADDR
  upon failure.

14 years agoallow primcall ops to push 0 values
Andy Wingo [Wed, 24 Jun 2009 13:14:00 +0000 (15:14 +0200)]
allow primcall ops to push 0 values

* libguile/objcodes.c (OBJCODE_COOKIE): Bump the objcode cookie. We'll
  be doing this on incompatible changes until 2.0.

* libguile/vm-i-scheme.c (set_car, set_cdr, slot_set): These
  instructions don't have natural return values -- so declare them that
  way, that they push 0 values.

* module/language/tree-il/compile-glil.scm (flatten): When compiling
  primitive calls, check `(instruction-pushes op)' to see how many
  values that instruction will push, and do something appropriate,
  instead of just assuming that all primcall ops push 1 value.

14 years agoremove lambda wrap hack of brainfuck tree-il compiler
Andy Wingo [Wed, 24 Jun 2009 11:42:59 +0000 (13:42 +0200)]
remove lambda wrap hack of brainfuck tree-il compiler

* module/language/brainfuck/compile-tree-il.scm (compile-tree-il):
  Remove the hack where we wrapped the compiled code in a `lambda',
  because not only should the tree-il compiler optimize that away, it
  was really papering around other inefficiencies, and obtuse to boot.

14 years agoRemove AC_SYS_RESTARTABLE_SYSCALLS and related code
Neil Jerram [Thu, 18 Jun 2009 19:35:45 +0000 (20:35 +0100)]
Remove AC_SYS_RESTARTABLE_SYSCALLS and related code

As the Autoconf documentation says, "These days portable programs
[...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays
whether a system call is restartable is a dynamic issue, not a
configuration-time issue."

In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are
at the mercy of any code that Guile happens to be linked with, because
that code could install a signal handler without the SA_RESTART flag,
and then a Guile system call could unexpectedly return EINTR.

The readline part of this goes back to this problem report:
http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an
excellent example of the above paragraph.  It was noted during the
discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the
problem, but that solution wasn't adopted - I guess because Guile was
still using cooperative threads then (not pthreads) and so there was a
significant concern (whether founded or not) that not using
restartable syscalls (where available) could lead to a loss of
performance.

Now Guile's default mode of operation is with pthreads, where we
already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so
there is no possible further performance loss.  And in any case we
really have no choice, if we want correct operation.

Thanks to Sylvain Beucler for reporting this and suggesting the fix.

* configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed.

* doc/ref/posix.texi (Signals): Remove statement that Guile always
  sets SA_RESTART flag.

* guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED):
  Remove this setting, together with its test code.
  (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no
  longer needed.

* guile-readline/readline.c (sigwinch_enable_restart): Removed.
  (scm_init_readline): Remove setting of rl_pre_input_hook.

* libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on
  HAVE_RESTARTABLE_SYSCALLS.

* libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the
  SA_RESTART flag if available.  Update docstring accordingly.
  (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all
  signals.

* THANKS: Add Sylvain.

14 years agoflush whitespace from the repl input buffer *before* evaluation
Andy Wingo [Mon, 22 Jun 2009 20:57:48 +0000 (22:57 +0200)]
flush whitespace from the repl input buffer *before* evaluation

* module/system/repl/repl.scm (start-repl): Given that the input port of
  the repl is line-buffered, it's likely we have #\newline in the input
  that is strictly extraneous, an in-band indicator to the repl that it
  should begin reading now. So flush out that newline, so that you can
  (read-char) at the repl, and it actually does wait for you to type in
  a char instead of just returning #\newline.

  While it's not an overriding concern, this does fix some brainfuck
  programs that want to input from the user.

14 years agomore docs to brainfuck->tree-il compiler
Andy Wingo [Mon, 22 Jun 2009 20:44:34 +0000 (22:44 +0200)]
more docs to brainfuck->tree-il compiler

* module/language/brainfuck/compile-tree-il.scm (compile-tree-il): Wrap
  the result in a ((lambda () ...)), so we can use toplevel-ref. Add
  lots more comments.

14 years agometa-commands read off their own arguments
Andy Wingo [Mon, 22 Jun 2009 18:45:01 +0000 (20:45 +0200)]
meta-commands read off their own arguments

* module/system/repl/command.scm: Update copyright.
  (meta-command): Rework so that it's the various meta-commands that do
  the reading for their arguments. This way you can compile forms that
  span more than one line, and forms that need to be read with another
  language's reader.
  (define-meta-command): New helper macro. Update commands to use it.
  (help): Allow ,help on commands too.

* module/system/repl/repl.scm: Update copyright.
  (start-repl): Adjust to give meta-command what it wants.

14 years agoAlways create the bytevector SMOB type.
Ludovic Courtès [Sun, 21 Jun 2009 22:56:00 +0000 (00:56 +0200)]
Always create the bytevector SMOB type.

* libguile/bytevectors.c (scm_tc16_bytevector, print_bytevector,
  bytevector_equal_p, free_bytevector): Don't use the snarfing macros.
  (scm_bootstrap_bytevectors): New.
  (scm_init_bytevectors): No longer initialize SCM_NULL_BYTEVECTOR,
  which is done by `scm_bootstrap_bytevectors ()'.

* libguile/bytevectors.h (scm_bootstrap_bytevectors): New declaration.
  (scm_init_bytevectors): Made internal.  This can be done because we
  explicitly register it with `scm_c_register_extension ()' in
  `scm_bootstrap_bytevectors ()'.

* libguile/init.c (scm_i_init_guile): Call `scm_bootstrap_bytevectors ()'.
  This is so that expressions like "(generalized-vector-length #vu8())"
  work even when `(rnrs bytevector)' hasn't been loaded.

14 years agoMake bytevectors accessible using the generalized-vector API.
Ludovic Courtès [Sun, 21 Jun 2009 22:51:08 +0000 (00:51 +0200)]
Make bytevectors accessible using the generalized-vector API.

As a side effect, this allows compilation of literal bytevectors
("#vu8(...)"), which gets done by the generic array handling
of the GLIL->assembly compiler.

* doc/ref/api-compound.texi (Generalized Vectors): Mention bytevectors.
  (Arrays, Array Syntax): Likewise.

* doc/ref/api-data.texi (Bytevectors as Generalized Vectors): New node.

* libguile/bytevectors.c (scm_i_bytevector_generalized_set_x): New.

* libguile/bytevectors.h (scm_i_bytevector_generalized_set_x): New
  declaration.

* libguile/srfi-4.c (scm_i_generalized_vector_type,
  scm_array_handle_uniform_element_size,
  scm_array_handle_uniform_writable_elements): Add support for
  bytevectors.

* libguile/unif.c (type_creator_table): Add `vu8'.
  (bytevector_ref, bytevector_set): New functions.
  (memoize_ref, memoize_set): Add support for bytevectors.

* libguile/vectors.c (scm_is_generalized_vector,
  scm_c_generalized_vector_length, scm_c_generalized_vector_ref,
  scm_c_generalized_vector_set_x): Add support for bytevectors.

* test-suite/tests/bytevectors.test ("Generalized Vectors"): New test
  set.

14 years agobytevectors: Add a C-friendly API.
Ludovic Courtès [Sun, 21 Jun 2009 21:16:57 +0000 (23:16 +0200)]
bytevectors: Add a C-friendly API.

* doc/ref/api-data.texi (Bytevector Manipulation): Add
  `scm_is_bytevector ()', `scm_c_bytevector_length ()',
  `scm_c_bytevector_length ()', and `scm_c_bytevector_set_x ()'.

* libguile/bytevectors.c (scm_is_bytevector, scm_c_bytevector_length,
  scm_c_bytevector_ref, scm_c_bytevector_set_x): New functions.
  (scm_bytevector_p): Use `scm_is_bytevector ()'.
  (scm_bytevector_length): Use `scm_c_bytevector_length ()'.

* libguile/bytevectors.h (scm_is_bytevector, scm_c_bytevector_length,
  scm_c_bytevector_ref, scm_c_bytevector_set_x): New declarations.

14 years agobytevectors: Use `size_t' rather than `unsigned' for sizes.
Ludovic Courtès [Sun, 21 Jun 2009 14:55:58 +0000 (16:55 +0200)]
bytevectors: Use `size_t' rather than `unsigned' for sizes.

* doc/ref/api-data.texi (Bytevector Manipulation): Update.

* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE,
  make_bytevector_from_buffer, scm_c_make_bytevector,
  scm_c_take_bytevector, scm_i_shrink_bytevector): Use `size_t' for
  bytevector lengths.

14 years agoFix documentation of `make-bytevector'.
Ludovic Courtès [Sun, 21 Jun 2009 21:32:19 +0000 (23:32 +0200)]
Fix documentation of `make-bytevector'.

* doc/ref/api-data.texi (Bytevector Manipulation): Fix documentation of
  the FILL argument of `make-bytevector'.

14 years agoadd brainfuck->tree-il compiler
Andy Wingo [Sun, 21 Jun 2009 12:53:33 +0000 (14:53 +0200)]
add brainfuck->tree-il compiler

* module/Makefile.am (BRAINFUCK_LANG_SOURCES): Compile at the end. Add
  compile-tree-il.scm.

* module/language/brainfuck/compile-tree-il.scm: New compiler, compiles
  to tree-il instead of scheme. I thought it would be more illustrative,
  though there are some uncommented bits.

* module/language/brainfuck/parse.scm: Modify not to put a header on the
  scheme representation. After all, we don't put <scheme> before scheme
  code, do we? :)

* module/language/brainfuck/spec.scm: Add tree-il compiler.

* module/language/tree-il.scm: Understand (set! (lexical foo) ...).

* module/system/base/language.scm: Update license. Actually, updates
  licenses on all these.

14 years agoformatting changes to (language brainfuck compile-scheme)
Andy Wingo [Sun, 21 Jun 2009 11:36:39 +0000 (13:36 +0200)]
formatting changes to (language brainfuck compile-scheme)

* module/language/brainfuck/compile-scheme.scm: Standalone comments
  should have more than one semicolon, and update copyright to LGPLv3+.

14 years agolink to brainfuck wikipedia page
Andy Wingo [Sun, 21 Jun 2009 11:10:56 +0000 (13:10 +0200)]
link to brainfuck wikipedia page

* doc/ref/compiler.texi: Point to more info on Brainfuck. Patch by
  Daniel Kraft.

14 years agoadded documenting comments to the brainfuck compiler and mention it in the VM documen...
Daniel Kraft [Sat, 23 May 2009 07:58:54 +0000 (09:58 +0200)]
added documenting comments to the brainfuck compiler and mention it in the VM documentation.

* doc/ref/compiler.texi: Mention the new brainfuck compiler as an example.
* module/language/brainfuck/compile-scheme.scm: Add a lot of documentation comments.
* module/language/brainfuck/parse.scm: Ditto.
* module/language/brainfuck/spec.scm: Ditto.

14 years agobasic brainfuck -> scheme example compiler.
Daniel Kraft [Sat, 23 May 2009 07:58:54 +0000 (09:58 +0200)]
basic brainfuck -> scheme example compiler.

* module/Makefile.am: Install the brainfuck compiler modules.
* module/language/brainfuck/spec.scm: New file.
* module/language/brainfuck/parse.scm: New file.
* module/language/brainfuck/compile-scheme.scm: New file.

14 years agoremove obsolete guile-vm.texi
Andy Wingo [Sun, 21 Jun 2009 10:57:55 +0000 (12:57 +0200)]
remove obsolete guile-vm.texi

* doc/guile-vm.texi: Remove, has been folded into the Guile manual for a
  while now.

* doc/Makefile.am: Remove guile-vm.texi.

14 years agoupdate .gitignore
Andy Wingo [Sun, 21 Jun 2009 10:51:16 +0000 (12:51 +0200)]
update .gitignore

* .gitignore: Update.

14 years agoDeterministic test for the r6rs-ports.test segmentation fault
Neil Jerram [Sun, 21 Jun 2009 12:31:20 +0000 (13:31 +0100)]
Deterministic test for the r6rs-ports.test segmentation fault

* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports"): Add (gc), to
  test the (ex-)bug in cbp_mark () when marking a closed port.

14 years agoFix crash when marking closed custom bytevector port
Andy Wingo [Sun, 21 Jun 2009 10:41:46 +0000 (12:41 +0200)]
Fix crash when marking closed custom bytevector port

* libguile/r6rs-ports.c (cbp_mark): A closed port will have had its
  stream destroyed, so don't dereference the stream in that case. Patch by
  Mike Gran.

14 years agoput autocompiled files into ~/.cache or $XDG_CACHE_HOME
Andy Wingo [Sat, 20 Jun 2009 12:26:54 +0000 (14:26 +0200)]
put autocompiled files into ~/.cache or $XDG_CACHE_HOME

* module/system/base/compile.scm (compiled-file-name): Remove unneeded
  path separator.

* libguile/load.c (scm_init_load_path): Change so the default cache path
  is ~/.cache/guile/ccache/1.9, and respect $XDG_CACHE_HOME.

14 years agofix source information lossage for (define (foo) ...) lambda sugar
Andy Wingo [Sat, 20 Jun 2009 10:41:11 +0000 (12:41 +0200)]
fix source information lossage for (define (foo) ...) lambda sugar

* module/ice-9/psyntax.scm (source-wrap): Use decorate-source, for
  clarity.
  (syntax-type): When turning the RHS of (define (foo) ...) into a
  lambda, decorate the resulting lambda expression with source
  information, as the RHS later goes to chi-expr, which receives no
  source information. Perhaps that is a bug. In any case, fixes some
  source location lossage, reported by Jao.

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

14 years agobetter error in make_objcode_by_mmap
Andy Wingo [Sat, 20 Jun 2009 09:41:50 +0000 (11:41 +0200)]
better error in make_objcode_by_mmap

* libguile/objcodes.c (make_objcode_by_mmap): Better error when the
  object header is incorrect.

14 years agosource information for the interpreter
Andy Wingo [Sat, 20 Jun 2009 08:47:37 +0000 (10:47 +0200)]
source information for the interpreter

* module/ice-9/psyntax.scm: Try to propagate source information when
  generating output for the interpreter.

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

14 years agoMake `cond-expand' compilable.
Ludovic Courtès [Fri, 19 Jun 2009 20:46:07 +0000 (22:46 +0200)]
Make `cond-expand' compilable.

* module/ice-9/boot-9.scm (cond-expand): Changed into a `define-macro'
  macro.

14 years agoFix copyright year and authorship of `guile-tools'.
Ludovic Courtès [Fri, 19 Jun 2009 20:01:56 +0000 (22:01 +0200)]
Fix copyright year and authorship of `guile-tools'.

14 years agoSlightly improve `NEWS'.
Ludovic Courtès [Fri, 19 Jun 2009 19:55:53 +0000 (21:55 +0200)]
Slightly improve `NEWS'.

14 years agoFix "guile-tools disassemble".
Ludovic Courtès [Fri, 19 Jun 2009 19:54:51 +0000 (21:54 +0200)]
Fix "guile-tools disassemble".

* module/scripts/disassemble.scm (disassemble): Accept a variable number
  of arguments.  Invoke the right `disassemble' procedure.

14 years agodon't autocompile at installcheck
Andy Wingo [Fri, 19 Jun 2009 12:27:56 +0000 (14:27 +0200)]
don't autocompile at installcheck

* examples/Makefile.am: Don't autocompile our tests at installcheck
  time.

14 years agonew function: canonicalize-path. use when autocompiling
Andy Wingo [Fri, 19 Jun 2009 12:26:47 +0000 (14:26 +0200)]
new function: canonicalize-path. use when autocompiling

* libguile/filesys.h:
* libguile/filesys.c (scm_canonicalize_path): New function,
  canonicalize-path.

* module/system/base/compile.scm (compiled-file-name): Canonicalize the
  filename so that compiling e.g. ../foo.scm doesn't compile to
  ~/.guile-ccache/1.9/../foo.scm.

14 years agognulib-tool --import canonicalize-lgpl
Andy Wingo [Fri, 19 Jun 2009 11:01:11 +0000 (13:01 +0200)]
gnulib-tool --import canonicalize-lgpl

14 years agogenerate changelogs at dist time
Andy Wingo [Fri, 19 Jun 2009 10:32:01 +0000 (12:32 +0200)]
generate changelogs at dist time

* Makefile.am: Add rule to make a ChangeLog at dist-time. The rule comes
  from coreutils.

* build-aux/gitlog-to-changelog: New helper script, from gnulib.

14 years agorename SCM_SNAME to SCM_SUBR_NAME
Andy Wingo [Fri, 19 Jun 2009 09:20:34 +0000 (11:20 +0200)]
rename SCM_SNAME to SCM_SUBR_NAME

* libguile/procs.h: Rename SCM_SNAME to SCM_SUBR_NAME.

* libguile/debug.c:
* libguile/eval.c:
* libguile/eval.i.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/print.c:
* libguile/procs.c: Update callers.

14 years agoanother draft of NEWS
Andy Wingo [Fri, 19 Jun 2009 09:19:34 +0000 (11:19 +0200)]
another draft of NEWS

* NEWS: Another draft.

14 years agoFix decompilation of the `load-array' instruction.
Ludovic Courtès [Fri, 19 Jun 2009 00:35:57 +0000 (02:35 +0200)]
Fix decompilation of the `load-array' instruction.

This allows, e.g., ",c #u8(1 2 3)" at the REPL to actually work instead
of failing to decode `load-array'.

* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
  Account for the `load-array' instruction, which is followed by a
  bytevector instead of a string.  We should find a more elegant way to
  do that.

14 years agoFix the REPL's `,compile' command.
Ludovic Courtès [Fri, 19 Jun 2009 00:14:22 +0000 (02:14 +0200)]
Fix the REPL's `,compile' command.

* module/system/repl/command.scm (compile): Use `guile:disassemble'
  instead of the former `disassemble-objcode'.

14 years agoImplement R6RS bytevector read syntax.
Ludovic Courtès [Thu, 18 Jun 2009 22:47:11 +0000 (00:47 +0200)]
Implement R6RS bytevector read syntax.

* libguile/read.c (scm_read_bytevector): New function.
  (scm_read_sharp): Add `v' case for bytevectors.

* test-suite/lib.scm (exception:read-error): New variable.

* test-suite/tests/bytevectors.test ("Datum Syntax"): New test set.

14 years agoFix `equal?' on bytevectors.
Ludovic Courtès [Thu, 18 Jun 2009 22:10:21 +0000 (00:10 +0200)]
Fix `equal?' on bytevectors.

* libguile/bytevectors.c (bytevector_equal_p): New function.

* test-suite/tests/bytevectors.test ("2.3 Operations on Bytes and
  Octets")["equal?"]: New test.

14 years agoImport documentation for the R6RS bytevector and port APIs.
Ludovic Courtès [Thu, 28 May 2009 21:57:31 +0000 (23:57 +0200)]
Import documentation for the R6RS bytevector and port APIs.

* doc/ref/api-compound.texi (Uniform Numeric Vectors): Add xref to the
  bytevector API.

* doc/ref/api-data.texi (Bytevectors): New node.

* doc/ref/api-io.texi (R6RS I/O Ports): New node.

14 years agoupdate NEWS, THANKS
Andy Wingo [Thu, 18 Jun 2009 21:02:51 +0000 (23:02 +0200)]
update NEWS, THANKS

* NEWS: Update, but only partially. I wanted to push out this
  incomplete, not yet organized draft for review, if anyone had
  comments. I'll pick it up tomorrow morning.

* THANKS: Add Juhani, whose last name changed?

14 years agoChange guile-readline license to GPLv3+
Neil Jerram [Wed, 17 Jun 2009 21:35:30 +0000 (22:35 +0100)]
Change guile-readline license to GPLv3+

14 years agoComplete changing license to LGPLv3+
Neil Jerram [Wed, 17 Jun 2009 21:30:26 +0000 (22:30 +0100)]
Complete changing license to LGPLv3+

(Still guile-readline to do, but that will all be GPLv3+.)

14 years agoReinstate lines removed by mistake from chars.test
Neil Jerram [Wed, 17 Jun 2009 20:34:38 +0000 (21:34 +0100)]
Reinstate lines removed by mistake from chars.test

14 years agoChange Guile license to LGPLv3+
Neil Jerram [Tue, 16 Jun 2009 23:22:09 +0000 (00:22 +0100)]
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/*
)

14 years agoUpdate README on using libraries in non-standard locations
Neil Jerram [Sun, 14 Jun 2009 17:41:50 +0000 (18:41 +0100)]
Update README on using libraries in non-standard locations

* README: Update instructions on using libraries in non-standard
  locations.  Also change expected next stable release number from
  1.10.0 to 2.0.0.

14 years agoAdd Tex and texinfo output and auxiliary suffixes to .gitignore
Neil Jerram [Sun, 14 Jun 2009 17:07:01 +0000 (18:07 +0100)]
Add Tex and texinfo output and auxiliary suffixes to .gitignore

14 years agoProvide easier configure options for GMP and readline
Neil Jerram [Sun, 14 Jun 2009 16:58:15 +0000 (17:58 +0100)]
Provide easier configure options for GMP and readline

This patch uses the AC_LIB_LINKFLAGS macro, provided by Gnulib's
havelib module, to provide --with-gmp-prefix and
--with-readline-prefix configure options.  Many thanks to Bruno Haible
for suggesting and explaining this to me.

* configure.in (top level): Add AC_LIB_LINKFLAGS(gmp).

* guile-readline/configure.in (AC_CONFIG_AUX_DIR): Change to
  ../build-aux, to share the main build-aux directory and so avoid
  having to distribute multiple copies of config.rpath.
  (top level): Add AC_LIB_LINKFLAGS(readline).

* lib/Makefile.am, m4/gnulib-cache.m4: Regenerated by gnulib-tool for
  new import of the `havelib' module.

14 years agoFix for make distcheck
Neil Jerram [Sat, 13 Jun 2009 09:45:45 +0000 (10:45 +0100)]
Fix for make distcheck

* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Set PATH so that
  guile-config can find guile.

14 years agoFix `make distcheck'
Neil Jerram [Fri, 12 Jun 2009 22:04:48 +0000 (23:04 +0100)]
Fix `make distcheck'

* libguile/r6rs-ports.c (scm_init_r6rs_ports): Add libguile/ to
  included .x file name.

14 years agoNote Andy as a contributor
Neil Jerram [Thu, 11 Jun 2009 22:24:34 +0000 (23:24 +0100)]
Note Andy as a contributor

14 years agofix defmacro*, defmacro*-public
Andy Wingo [Wed, 10 Jun 2009 08:53:00 +0000 (10:53 +0200)]
fix defmacro*, defmacro*-public

* module/ice-9/boot-9.scm (define-private): Remove apocyphal comment. The
  FIXME would really be to remove `define-private', though...

* module/ice-9/optargs.scm (defmacro*, defmacro*-public): Fix these
  macros. Thanks to Dale Smith for the report.

14 years agobump default stack limit to 160000 words
Andy Wingo [Wed, 10 Jun 2009 08:51:02 +0000 (10:51 +0200)]
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!

14 years agofix debug-options
Andy Wingo [Tue, 9 Jun 2009 22:03:52 +0000 (00:03 +0200)]
fix debug-options

* module/ice-9/boot-9.scm (define-option-interface): Fix (debug-options
  'full), along with other options. Thanks to Mark Weaver for the tip.

* THANKS: Update, though many more names need to be added.

14 years agosome attempts to solve the ecmascript stack overflow problem
Andy Wingo [Tue, 9 Jun 2009 21:42:05 +0000 (23:42 +0200)]
some attempts to solve the ecmascript stack overflow problem

* module/language/ecmascript/compile-ghil.scm (comp): Just use pmatch,
  not ormatch. Now with syncase running over everything, it doesn't
  matter.

* module/ice-9/boot-9.scm (false-if-exception): Avoid saving stacks
  inside false-if-exception. There's probably a more general solution to
  this, though. Fixes getting bogus backtraces sometimes.

* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Reorder things so that
  spec comes last.

14 years agoFirst code for elisp compilation, handling a very limited set of operations (but...
Daniel Kraft [Tue, 9 Jun 2009 19:37:13 +0000 (21:37 +0200)]
First code for elisp compilation, handling a very limited set of operations (but not really usable yet).

* module/language/elisp/README: New file containing some notes.
* module/language/elisp/compile-tree-il.scm: New file with compilation code.
* module/language/elisp/spec.scm: Updated language definition.

14 years agoa start to changing VM scheme copyrights
Andy Wingo [Mon, 8 Jun 2009 20:43:28 +0000 (22:43 +0200)]
a start to changing VM scheme copyrights

* module/language/tree-il/primitives.scm: Change copyright to LGPLv2.1.
  Others will follow.

14 years agopretty-print psyntax-pp.scm
Andy Wingo [Mon, 8 Jun 2009 20:24:15 +0000 (22:24 +0200)]
pretty-print psyntax-pp.scm

* module/ice-9/compile-psyntax.scm: Pretty-print psyntax-pp.scm, given
  that we are going to compile it anyway.

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

14 years agodon't autocompile snarfing m4 docs
Andy Wingo [Mon, 8 Jun 2009 09:44:51 +0000 (11:44 +0200)]
don't autocompile snarfing m4 docs

* doc/ref/Makefile.am (autoconf-macros.texi): Yet another place we
  shouldn't autocompile.