bpt/guile.git
14 years agoAllow lexical binding of lambda arguments.
Daniel Kraft [Sat, 1 Aug 2009 11:00:27 +0000 (13:00 +0200)]
Allow lexical binding of lambda arguments.

* module/language/elisp/compile-tree-il.scm: Rework lambda compiler to allow
  opional lexical binding of (some) lambda arguments.
* test-suite/tests/elisp-compiler.test: Check this.

14 years agoCompiler option to always bind certain symbols lexically.
Daniel Kraft [Fri, 31 Jul 2009 16:00:01 +0000 (18:00 +0200)]
Compiler option to always bind certain symbols lexically.
Affects so far let-bound symbols, lambda arguments to come in the future.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Add :always-lexical option.
* test-suite/tests/elisp-compiler.test: Test it.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/guile into elisp
Daniel Kraft [Fri, 31 Jul 2009 15:18:34 +0000 (17:18 +0200)]
Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

14 years agoAdd unused variable analysis in the tree-il->glil compiler.
Ludovic Courtès [Thu, 30 Jul 2009 22:42:58 +0000 (00:42 +0200)]
Add unused variable analysis in the tree-il->glil compiler.

* module/language/tree-il/analyze.scm (<binding-info>): New record type.
  (report-unused-variables): New procedure.

* module/language/tree-il/compile-glil.scm (%warning-passes): New
  variable.
  (compile-glil): Honor `#:warnings' from OPTS.

* test-suite/tests/tree-il.test (call-with-warnings): New procedure.
  (%opts-w-unused): New variable.
  ("warnings"): New test prefix.

14 years agoAdd `(system base message)', a simple warning framework.
Ludovic Courtès [Thu, 30 Jul 2009 22:06:59 +0000 (00:06 +0200)]
Add `(system base message)', a simple warning framework.

* module/Makefile.am (SOURCES): Add `system/base/message.scm'.

* module/scripts/compile.scm (%options): Add `--warn'.
  (parse-args): Update default value for `warnings'.
  (show-warning-help): New procedure.
  (compile)[compile-opts]: Add `#:warnings'.
  Update help message.

* module/system/base/compile.scm (compile): Sanity-check the requested
  warnings.

* module/system/base/message.scm: New file.

14 years agoAdd `tree-il-fold', a purely functional iterator on `tree-il'.
Ludovic Courtès [Wed, 29 Jul 2009 22:48:04 +0000 (00:48 +0200)]
Add `tree-il-fold', a purely functional iterator on `tree-il'.

* module/language/tree-il.scm (tree-il-fold): New procedure.

* test-suite/tests/tree-il.test ("tree-il-fold"): New test prefix.

14 years agoUse explicit guile-primitive forms in the macro expansion of dotimes and dolist.
Daniel Kraft [Thu, 30 Jul 2009 19:49:00 +0000 (21:49 +0200)]
Use explicit guile-primitive forms in the macro expansion of dotimes and dolist.

14 years agoImplement some elisp constructs in macros instead of hard-coded compiler code.
Daniel Kraft [Thu, 30 Jul 2009 19:43:24 +0000 (21:43 +0200)]
Implement some elisp constructs in macros instead of hard-coded compiler code.

* module/language/elisp/compile-tree-il.scm: Remove implementation of prog1,
  and, or, cond, dolist.
* module/language/elisp/runtime/macro-slot.scm: Implement them here instead.

14 years agoSwitch use of guile-primitive to now available funcall in test.
Daniel Kraft [Thu, 30 Jul 2009 11:54:07 +0000 (13:54 +0200)]
Switch use of guile-primitive to now available funcall in test.

14 years agowithout-void-checks as new extension for fine-control
Daniel Kraft [Thu, 30 Jul 2009 11:51:45 +0000 (13:51 +0200)]
without-void-checks as new extension for fine-control

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Handle without-void-checks.
* test-suite/tests/elisp-compiler.test: Test it.

14 years agofuncall, apply and eval built-ins.
Daniel Kraft [Wed, 29 Jul 2009 14:27:45 +0000 (16:27 +0200)]
funcall, apply and eval built-ins.

* module/language/elisp/README: Document new features.
* module/language/elisp/runtime/function-slot.scm: Implement funcall, apply and
  eval by using the existing compiler code.
* test-suite/tests/elisp-compiler.test: Test those.

14 years agoAdd 32-bit characters
Michael Gran [Wed, 29 Jul 2009 13:38:32 +0000 (06:38 -0700)]
Add 32-bit characters

This adds the 32-bit standalone characters.  Strings are still
8-bit.  Characters larger than 8-bit can only be entered or
displayed in octal format at this point.  At this point, the
terminal's display encoding is expected to be Latin-1.

        * module/language/assembly/compile-bytecode.scm (write-bytecode):
        add 32-bit char

        * module/language/assembly.scm (object->assembly): add 32-bit char
        (assembly->object): add 32-bit char

        * libguile/vm-i-system.c (make-char32): new op

        * libguile/print.c (iprin1): print 32-bit char

        * libguile/numbers.h: add type scm_t_wchar

        * libguile/numbers.c: add type scm_t_wchar

        * libguile/chars.h: new type scm_t_wchar
        (SCM_CODEPOINT_MAX): new
        (SCM_IS_UNICODE_CHAR): new
        (SCM_MAKE_CHAR): operate on 32-bit char

        * libguile/chars.c: comparison operators now use Unicode
        codepoints
        (scm_c_upcase): now receives and returns scm_t_wchar
        (scm_c_downcase): now receives and returns scm_t_wchar

14 years agoAdded guile-primitive construct for references to primitives from Elisp.
Daniel Kraft [Wed, 29 Jul 2009 12:25:33 +0000 (14:25 +0200)]
Added guile-primitive construct for references to primitives from Elisp.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement guile-primitive.
* test-suite/tests/elisp-compiler.test: Switched a usage of guile-ref to
  the now available guile-primitive.

14 years agoAdded length built-in.
Daniel Kraft [Wed, 29 Jul 2009 11:45:40 +0000 (13:45 +0200)]
Added length built-in.

* module/language/elisp/runtime/function-slot.scm: Add length built-in.
* test-suite/tests/elisp-compiler.test: Test length.

14 years agoImplemented lexical-let and lexical-let* for elisp.
Daniel Kraft [Wed, 29 Jul 2009 10:09:43 +0000 (12:09 +0200)]
Implemented lexical-let and lexical-let* for elisp.

* module/language/elisp/README: Document it.
* module/language/elisp/bindings.scm: New fields in bindings data structure
  to keep track of lexical bindings for symbols.
* module/language/elisp/compile-tree-il.scm: Implement lexical-let(*).
* test-suite/tests/elisp-compiler.test: Test lexical scoping with lexical-let.

14 years agoReplace global charnames variables with accessors
Michael Gran [Tue, 28 Jul 2009 04:02:23 +0000 (21:02 -0700)]
Replace global charnames variables with accessors

The global variables scm_charnames and scm_charnums are replaced with
the accessor functions scm_i_charname and scm_i_charname_to_num.
Also, the incomplete and broken EBCDIC support is removed.

       * libguile/print.c (iprin1): use new func scm_i_charname

        * libguile/read.c (scm_read_character): use new func
        scm_i_charname_to_num

        * libguile/chars.c (scm_i_charname): new function
        (scm_i_charname_to_char): new function
        (scm_charnames, scm_charnums): removed

        * libguile/chars.h: new declarations

14 years agoIn elisp-compiler.test, check that let* works without values given, too.
Daniel Kraft [Mon, 27 Jul 2009 08:55:23 +0000 (10:55 +0200)]
In elisp-compiler.test, check that let* works without values given, too.

14 years agoincrease range of relative jumps by aligning blocks to 8-byte boundaries
Andy Wingo [Sun, 26 Jul 2009 12:01:56 +0000 (14:01 +0200)]
increase range of relative jumps by aligning blocks to 8-byte boundaries

* libguile/objcodes.c (OBJCODE_COOKIE): Bump again, as our jump offsets
  are now multiplied by 8.

* libguile/vm-i-system.c (BR): Interpret the 16-bit offset as a relative
  jump to the nearest 8-byte-aligned block -- increasing relative jump
  range from +/-32K to +/-240K.
  (mvra): Do the same for the mvra jump.

* libguile/vm.c (really_make_boot_program): Align the mvra.

* module/language/assembly.scm (align-block): New export, for aligning
  blocks.

* module/language/assembly/compile-bytecode.scm (write-bytecode): Emit
  jumps to the nearest 8-byte-aligned block. Effectively our range is 18
  bits in either direction. I would like to do this differently -- have
  long-br and long-br-if, and all the other br instructions go to 8 bits
  only. But the assembler doesn't have an appropriate representation to
  allow me to do this yet, so for now this is what we have.

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  Decode the 19-bit jumps.

14 years agomake sure all programs are 8-byte aligned
Andy Wingo [Sun, 26 Jul 2009 10:56:11 +0000 (12:56 +0200)]
make sure all programs are 8-byte aligned

* libguile/objcodes.c (OBJCODE_COOKIE): Bump objcode cookie, as we added
  to struct scm_objcode.
* libguile/objcodes.h (struct scm_objcode): Add a uint32 after metalen
  and before base, so that if the structure has 8-byte alignment, base
  will have 8-byte alignment too. (Before, base was 12 bytes from the
  start of the structure, now it's 16 bytes.)

* libguile/vm-engine.h (ASSERT_ALIGNED_PROCEDURE): Add a check that can
  be turned on with VM_ENABLE_PARANOID_ASSERTIONS.
  (CACHE_PROGRAM): Call ASSERT_ALIGNED_PROCEDURE.

* libguile/vm-i-system.c (long-local-ref): Add a missing semicolon.

* libguile/vm.c (really_make_boot_program): Rework to operate directly
  on a malloc'd buffer, so that the program will be 8-byte aligned.

* module/language/assembly.scm (*program-header-len*): Add another 4 for
  the padding.
  (object->assembly): Fix case in which we would return (make-int8 0)
  instead of (make-int8:0). This would throw off compile-assembly.scm's
  use of addr+.

* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
  out the padding int.

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  And pop off the padding int too.

* module/language/glil/compile-assembly.scm (glil->assembly): Don't pack
  the assembly, assume that assembly.scm has done it for us. If a
  program has a meta, pad out the program so that meta will be aligned.

* test-suite/tests/asm-to-bytecode.test: Adapt to expect programs to
  have the extra 4-byte padding int.

14 years agofix alignment of subprograms of subprograms
Andy Wingo [Sun, 26 Jul 2009 09:54:05 +0000 (11:54 +0200)]
fix alignment of subprograms of subprograms

* module/language/glil/compile-assembly.scm (glil->assembly)
  (dump-object): Fix an exciting bug! Subprograms of subprograms were
  not being aligned correctly, because the code was generated too early.
  So instead delay dumping the object table until the proper time.

14 years agofix unused SCM_FRAME_SET_DYNAMIC_LINK macro
Andy Wingo [Sun, 26 Jul 2009 09:21:18 +0000 (11:21 +0200)]
fix unused SCM_FRAME_SET_DYNAMIC_LINK macro

* libguile/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): Fix for new stack
  layout, though this macro is not used.

14 years agofix vmstack gdb macro for new stack frame layout
Andy Wingo [Sun, 26 Jul 2009 09:20:39 +0000 (11:20 +0200)]
fix vmstack gdb macro for new stack frame layout

* gdbinit (vmstack): No more external link.

14 years agocheck that jumps are within the range of a signed 16-bit int
Andy Wingo [Fri, 24 Jul 2009 10:06:40 +0000 (12:06 +0200)]
check that jumps are within the range of a signed 16-bit int

* module/language/assembly/compile-bytecode.scm (write-bytecode): Check
  that the offset is within the range of a signed int16 value.

14 years agofix gensym creation in psyntax
Andy Wingo [Fri, 24 Jul 2009 10:06:19 +0000 (12:06 +0200)]
fix gensym creation in psyntax

* module/ice-9/psyntax.scm (build-lexical-var): Make our gensyms really
  unique. Before, there was a chance that different lexicals could
  result in the same gensym.
* module/ice-9/psyntax-pp.scm: Regenerate.

14 years agoincrease default stack size to 64 kilowords
Andy Wingo [Fri, 24 Jul 2009 10:05:54 +0000 (12:05 +0200)]
increase default stack size to 64 kilowords

* libguile/vm.c (VM_DEFAULT_STACK_SIZE): Increase to 64 kilowords.
  Really, we should simply add overflow handlers, but in the meantime,
  this will do.

14 years agoCompiler option to disable void-checks in elisp.
Daniel Kraft [Fri, 24 Jul 2009 09:09:57 +0000 (11:09 +0200)]
Compiler option to disable void-checks in elisp.

* module/language/elisp/README: Document the change.
* module/language/elisp/compile-tree-il.scm: Add disable-void-check option.
* test-suite/tests/elisp-compiler.test: Test it.

14 years agocompiler support for nlocs >= 256
Andy Wingo [Fri, 24 Jul 2009 09:00:32 +0000 (11:00 +0200)]
compiler support for nlocs >= 256

* libguile/vm-i-system.c (long-local-ref, long-local-set)
  (make-variable): New intructions, for handling nlocs >= 256.
* module/language/glil/compile-assembly.scm (glil->assembly): Compile
  <glil-lexical> with support for nlocs >= 256.

14 years agoDon't pass the bindings-data all around in compile-tree-il, but use fluids for this...
Daniel Kraft [Fri, 24 Jul 2009 08:40:07 +0000 (10:40 +0200)]
Don't pass the bindings-data all around in compile-tree-il, but use fluids for this dynamic binding.

* module/language/elisp/compile-tree-il.scm: Use fluid for bindings-data.

14 years agonlocs is now 16 bits wide
Andy Wingo [Fri, 24 Jul 2009 08:12:01 +0000 (10:12 +0200)]
nlocs is now 16 bits wide

* libguile/objcodes.h (struct scm_objcode): Remove the "unused" field --
  the old "nexts" -- and expand nlocs to 16 bits.

* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
  the nlocs as a uint16.

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  Decompile 16-bit nlocs. It seems this decompilation is little-endian
  :-/

* test-suite/tests/asm-to-bytecode.test: Fix up to understand nlocs as a
  little-endian value. The test does the right thing regarding
  endianness.

14 years agoImplemented the flet and flet* extensions.
Daniel Kraft [Fri, 24 Jul 2009 07:56:13 +0000 (09:56 +0200)]
Implemented the flet and flet* extensions.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement flet and flet*.
* test-suite/tests/elisp-compiler.test: Test flet and flet*.

14 years agoremove all mentions of "external" from the compiler and related code
Andy Wingo [Thu, 23 Jul 2009 14:50:47 +0000 (16:50 +0200)]
remove all mentions of "external" from the compiler and related code

With this, GHIL is effectively bitrotten. I need to port the ECMAScript
compiler to tree-il, then I'll remove it.

* module/language/assembly.scm (byte-length):
* module/language/assembly/compile-bytecode.scm (write-bytecode):
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
* module/language/assembly/disassemble.scm (disassemble-load-program):
  (disassemble-free-vars, code-annotation):
* module/language/glil.scm (<glil-program>, <glil-local>)
  (<glil-exteral>, parse-glil, unparse-glil):
* module/language/glil/compile-assembly.scm (make-meta):
  (compile-assembly, glil->assembly):
* module/language/glil/decompile-assembly.scm (decompile-toplevel):
  (decompile-load-program):
* module/language/objcode/spec.scm (decompile-value):
* module/language/tree-il/compile-glil.scm (flatten-lambda):
* module/system/vm/frame.scm (frame-binding-ref):
  (frame-binding-set!):
* module/system/vm/program.scm (binding:boxed?):
* module/system/vm/trace.scm (trace-next):
* test-suite/tests/asm-to-bytecode.test ("compiler"):
* test-suite/tests/tree-il.test: Remove all mentions of "external", and
  of <glil-local>. Docs updates will come soon.

14 years agorename "closure-ref" to "free-ref"; s/vars/variables/ in some names
Andy Wingo [Thu, 23 Jul 2009 12:36:22 +0000 (14:36 +0200)]
rename "closure-ref" to "free-ref"; s/vars/variables/ in some names

* libguile/programs.h:
* libguile/programs.c: (SCM_PROGRAM_FREE_VARIABLES): Rename from
  SCM_PROGRAM_FREE_VARS. Callers changed.
* libguile/programs.c (scm_make_program): Rename arg to
  "free_variables".
  (scm_program_free_variables): Rename from program-free-vars.

* libguile/vm-engine.h:
* libguile/vm-engine.c (VM_CHECK_FREE_VARIABLES): Rename from
  VM_CHECK_CLOSURE.
  (vm_engine, CACHE_PROGRAM): Rename closure and closure_count to free_vars and
  free_vars_vount.

* libguile/vm-i-system.c (FREE_VARIABLE_REF): Rename from CLOSURE_REF.
  (free-ref, free-boxed-ref, free-boxed-set): Rename from closure-ref,
  closure-boxed-ref, closure-boxed-set.
  (make-closure): Renamed from make-closure2.

* module/language/glil/compile-assembly.scm (glil->assembly): Hack to
  never write out the the old "make-closure" instruction. Will fix
  better later. Change to emit free-ref etc instead of closure-ref.

* module/language/tree-il/compile-glil.scm (flatten): Emit make-closure
  instead of make-closure2, now that the old make-closure is gone.

* module/system/vm/program.scm (system): Rename program-free-vars to
  program-free-variables.

* test-suite/tests/tree-il.test ("lambda"): Update for make-closure.

14 years agoremove "externals" from the vm
Andy Wingo [Thu, 23 Jul 2009 15:12:10 +0000 (17:12 +0200)]
remove "externals" from the vm

* libguile/frames.c (scm_frame_external_link): Removed.
* libguile/frames.h: No need to have the "external link" in the stack
  frame -- update macros to take the new situation into account.

* libguile/objcodes.h (struct scm_objcode): Rename the nexts field to
  "unused". In the future we can use it for nlocs, I think.
  (SCM_OBJCODE_NEXTS): removed.

* libguile/programs.h:
* libguile/programs.c (scm_make_program): Expect the third argument to
  be a vector of free variables, not a list of free variables.
  SCM_BOOL_F indicates no free variables, not SCM_EOL.
  (program_mark): Adapt.
  (scm_program_arity): No more nexts.
  (scm_program_free_vars): Replaces scm_program_externals.

* libguile/vm-engine.c (VM_CHECK_EXTERNAL)
  (vm_engine): No need for the "external" var.
* libguile/vm-engine.h (CACHE_PROGRAM): Update for SCM_PROGRAM_FREE_VARS
  instead of SCM_PROGRAM_EXTERNALS.
  (NEW_FRAME): Update for new frame size, and no need to cons up
  externals. Yay :)

* libguile/vm-i-loader.c (load-program): Update for scm_make_program.

* libguile/vm-i-system.c (external-ref, external-set): No more.
  (make-closure): No more.
  (goto/args): No need to re-cons externals here. Update for new stack
  frame size.
  (mv-call, return, return/values): Update for new frame size. No need
  to reinstate externals on return.

* libguile/vm.c (really_make_boot_program, scm_load_compiled_with_vm):
  Update for scm_make_program.
* module/language/objcode/spec.scm (objcode-env-externals): Treat '() as
  #f, for the externals. Need to clean this up later...
* module/system/vm/program.scm (arity:nexts): Remove. Rename
  program-external to program-free-vars.

14 years agocompile lexical variable access and closure creation to the new ops
Andy Wingo [Thu, 23 Jul 2009 15:00:56 +0000 (17:00 +0200)]
compile lexical variable access and closure creation to the new ops

* module/language/glil.scm (<glil>): New GLIL type, <glil-lexical>,
  which will subsume other lexical types.
* module/language/glil/compile-assembly.scm: Compile <glil-lexical>.
  (make-open-binding): Change the interpretation of the second argument
  -- instead of indicating an "external" var, it now indicates a boxed
  var.
  (open-binding): Adapt to new glil-bind format.
* module/language/tree-il/analyze.scm: Add a lot more docs.
  (analyze-lexicals): Change the allocation algorithm and output format
  to allow the tree-il->glil compiler to capture free variables
  appropriately and to reference bound variables in boxes if necessary.
  Amply documented.

* module/language/tree-il/compile-glil.scm (compile-glil): Compile
  lexical variable access to <glil-lexical>. Emit variable capture and
  closure creation code here, instead of leaving that task to the
  GLIL->assembly compiler.

* test-suite/tests/tree-il.test: Update expected code emission.

14 years agoImplemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)
Daniel Kraft [Thu, 23 Jul 2009 12:09:55 +0000 (14:09 +0200)]
Implemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Moved ensure-fluid! to runtime function.
* module/language/elisp/runtime.scm: Runtime functions to support dynamic value access.
* module/language/elisp/runtime/function-slot.scm: Defined the built-ins.
* test-suite/tests/elisp-compiler.test: Test them.

14 years agoAdded guile-ref extension construct, change throw implementation to easier one using...
Daniel Kraft [Wed, 22 Jul 2009 10:50:56 +0000 (12:50 +0200)]
Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.

* module/language/elisp/README: Document the changes.
* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
* module/language/elisp/runtime/function-slot.scm: throw as built-in.
* test-suite/tests/elisp-compiler.test: Test unwind-protect.

14 years agoImplemented catch and throw in elisp.
Daniel Kraft [Wed, 22 Jul 2009 10:23:03 +0000 (12:23 +0200)]
Implemented catch and throw in elisp.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement catch and throw.
* test-suite/tests/elisp-compiler.test: Test catch/throw.

14 years agovm support for display closures
Andy Wingo [Sun, 19 Jul 2009 17:48:26 +0000 (19:48 +0200)]
vm support for display closures

* libguile/vm-i-system.c (box, empty-box): Boxing values and storing
  them in local variables.
  (local-boxed-ref, local-boxed-set): A combination of local-ref then
  variable-ref/set.
  (make-closure2, closure-ref, closure-boxed-ref, closure-boxed-set):
  New ops. The idea is to migrate Guile over to using flat dispay
  closures. See the paper "Three Implementation Models for Scheme" by
  Kent Dybvig for more details; this is the "stack-based" model.

* libguile/vm-engine.c:
* libguile/vm-engine.h: Add the necessary infrastructure to keep track
  of a "closure" variable, like our "externals" in semantics, but
  minimal, flat, and O(1) in implementation.

14 years agorenumber vm ops (objcode cookie bumped)
Andy Wingo [Sun, 19 Jul 2009 17:02:30 +0000 (19:02 +0200)]
renumber vm ops (objcode cookie bumped)

* libguile/objcodes.c (OBJCODE_COOKIE): Bump.

* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Renumber instructions, so I can have a bit
  more space to work.

14 years agoDon't ensure fluids all over the place but scan for variables needed and ensure just...
Daniel Kraft [Tue, 21 Jul 2009 14:45:10 +0000 (16:45 +0200)]
Don't ensure fluids all over the place but scan for variables needed and ensure just before the compiled code all those.

* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement it here, pass bindings all around the compilation.
* module/language/elisp/bindings.scm: New module with symbol-tracking abilities needed for this.

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

14 years agoImplemented prog1, prog2, dotimes, dolist control structures.
Daniel Kraft [Mon, 20 Jul 2009 18:52:00 +0000 (20:52 +0200)]
Implemented prog1, prog2, dotimes, dolist control structures.

* module/language/elisp/README: Document it and some further ideas written down.
* module/language/elisp/compile-tree-il.scm: Implement prog1, dolist.
* module/language/elisp/runtime/macro-slot.scm: prog2 and dotimes.
* test-suite/tests/elisp-compiler.test: Test prog1, prog2, dotimes, dolist.

14 years agoImplemented some important list built-ins.
Daniel Kraft [Sat, 18 Jul 2009 18:10:24 +0000 (20:10 +0200)]
Implemented some important list built-ins.

* module/language/elisp/runtime.scm: Updated/added convenience macros.
* module/language/elisp/runtime/function-slot.scm: Implement list built-ins.
* module/language/elisp/runtime/macro-slot.scm: Implement list built-ins.
* test-suite/tests/elisp-compiler.test: Test the implemented built-ins.

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 agoBump version number for 1.9.1.
Ludovic Courtès [Wed, 15 Jul 2009 21:57:18 +0000 (23:57 +0200)]
Bump version number for 1.9.1.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

14 years agoMake the non-integrated VM test-suite less verbose.
Ludovic Courtès [Wed, 15 Jul 2009 21:56:27 +0000 (23:56 +0200)]
Make the non-integrated VM test-suite less verbose.

* testsuite/run-vm-tests.scm (run-vm-tests): Don't display the number of
  tests passed since it's always 1 or 0.

14 years agoAdd FIXMEs about misaligned objcode-metas.
Ludovic Courtès [Wed, 15 Jul 2009 21:53:22 +0000 (23:53 +0200)]
Add FIXMEs about misaligned objcode-metas.

* libguile/objcodes.c (scm_c_make_objcode_slice): Add comment about
  misaligned `objcode-meta'.

* module/language/assembly/compile-bytecode.scm (write-bytecode):
  Likewise.

14 years agoFix unaligned access in the VM code.
Ludovic Courtès [Wed, 15 Jul 2009 21:51:42 +0000 (23:51 +0200)]
Fix unaligned access in the VM code.

* libguile/vm.c (struct t_32bit_aligned): New.
  (really_make_boot_program)[bytes]: Use it.  This fixes possibly
  unaligned accesses, which cause a "bus error" on some platforms (e.g.,
  sparc-*).

14 years agoConst-qualify buffers passed to `scm_c_make_objcode_slice ()'.
Ludovic Courtès [Wed, 15 Jul 2009 21:12:43 +0000 (23:12 +0200)]
Const-qualify buffers passed to `scm_c_make_objcode_slice ()'.

* libguile/objcodes.c (scm_c_make_objcode_slice): Add `const' qualifier
  for PTR and DATA.

* libguile/objcodes.h: Update accordingly.

14 years agoSwitch remaining GPLv2+ Guile-VM headers to LGPLv3+.
Ludovic Courtès [Wed, 15 Jul 2009 20:46:54 +0000 (22:46 +0200)]
Switch remaining GPLv2+ Guile-VM headers to LGPLv3+.

* module/system/base/compile.scm, module/system/base/syntax.scm,
  module/system/repl/common.scm, module/system/repl/describe.scm,
  module/system/vm/instruction.scm, module/system/vm/objcode.scm,
  module/system/vm/profile.scm, module/system/vm/program.scm,
  module/system/vm/trace.scm: Switch header from GPLv2+ to LGPLv3+.

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 agoFix typo in the compile-type verification of `OBJCODE_COOKIE'.
Ludovic Courtès [Tue, 14 Jul 2009 23:17:32 +0000 (01:17 +0200)]
Fix typo in the compile-type verification of `OBJCODE_COOKIE'.

* libguile/objcodes.c: Fix `sizeof (OBJCODE_COOKIE)' assertion: the
  trailing 0 must not be taken into account, and multiple of 8 means the
  3 LSBs are clear.

14 years agoMake sure at compile-time that `OBJCODE_COOKIE' has the right size.
Ludovic Courtès [Tue, 14 Jul 2009 23:03:35 +0000 (01:03 +0200)]
Make sure at compile-time that `OBJCODE_COOKIE' has the right size.

* libguile/objcodes.c: Use `verify' to assert that the size of
  `OBJCODE_COOKIE' is a multiple of 8.

14 years agoExplicitly use Gnulib's `verify' module.
Ludovic Courtès [Tue, 14 Jul 2009 22:58:01 +0000 (00:58 +0200)]
Explicitly use Gnulib's `verify' module.

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

14 years agoAugment `OBJCODE_COOKIE' to detect wrong endianness or word size.
Ludovic Courtès [Tue, 14 Jul 2009 22:55:33 +0000 (00:55 +0200)]
Augment `OBJCODE_COOKIE' to detect wrong endianness or word size.

* libguile/objcodes.c (OBJCODE_ENDIANNESS, _OBJCODE_STRINGIFY,
  OBJCODE_STRINGIFY, OBJCODE_WORD_SIZE): New macros.
  (OBJCODE_COOKIE): Use them.  The intent is that `.go' files compiled
  for a different endianness or word size are detected.

14 years agoRemove the `long_long' and `ulong_long' types.
Ludovic Courtès [Tue, 14 Jul 2009 22:32:05 +0000 (00:32 +0200)]
Remove the `long_long' and `ulong_long' types.

* libguile/gen-scmconfig.c (main): Don't emit typedefs for `long_long'
  and `ulong_long'.  This was already deprecated in 1.8 and known to
  cause conflicts with other libraries such as HDF5, as reported by Mark
  Patterson <mpatterson@physics.queensu.ca>
  (http://lists.gnu.org/archive/html/bug-guile/2009-02/msg00003.html).

14 years agoupdate NEWS
Andy Wingo [Tue, 14 Jul 2009 20:55:35 +0000 (22:55 +0200)]
update NEWS

* NEWS: Update.

14 years agoNEWS has info on 1.9.N to 1.9.N+1 in addition to 1.8 to 2.0
Andy Wingo [Thu, 2 Jul 2009 15:46:23 +0000 (17:46 +0200)]
NEWS has info on 1.9.N to 1.9.N+1 in addition to 1.8 to 2.0

* NEWS: Update to have an incremental section in addition to a
  comprehensive 1.8->2.0 section.

14 years agofix race in which some instruction name symbols could go unmarked
Andy Wingo [Thu, 2 Jul 2009 15:46:23 +0000 (17:46 +0200)]
fix race in which some instruction name symbols could go unmarked

* libguile/instructions.c: In loops, replace scm_op_last with
  SCM_VM_NUM_INSTRUCTIONS.
  (fetch_instruction_table): Protect the instruction symbols from
  collection. Before they were only marked by the name->opcode hash
  table, leading to races in which they could be collected.
  (scm_lookup_instruction_by_name): Protect the hash table earlier, as
  it's not actually a stack variable, since it's static.

14 years agofix bounds checks for the last element of bv-*-{ref,set}
Andy Wingo [Thu, 2 Jul 2009 15:43:07 +0000 (17:43 +0200)]
fix bounds checks for the last element of bv-*-{ref,set}

* libguile/vm-i-scheme.c (BV_FIXABLE_INT_REF, BV_INT_REF):
  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Fix the
  bounds check for the last element.

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.