bpt/guile.git
11 years ago<dynwind> no longer has "pre" or "post" fields
Andy Wingo [Sun, 16 Jun 2013 13:06:59 +0000 (15:06 +0200)]
<dynwind> no longer has "pre" or "post" fields

* module/language/tree-il.scm (<tree-il>): Remove pre and post fields
  from <dynwind>.  A dynwind now assumes that in normal entry and exit,
  that the code runs the winders and unwinders using <seq> and
  <let-values> and such things.
  (parse-tree-il, unparse-tree-il, make-tree-il-folder, pre-post-order):
  Adapt <dynwind> users.

* module/language/tree-il/analyze.scm (analyze-lexicals):
* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
* module/language/tree-il/cse.scm (cse):
* module/language/tree-il/debug.scm (verify-tree-il):
* module/language/tree-il/effects.scm (make-effects-analyzer): Adapt.

* module/language/tree-il/peval.scm (peval):
* module/language/tree-il/primitives.scm (*primitive-expand-table*):
  Produce tree-il that calls the winder and unwinder.  Recognize
  singly-valued dynamic-wind expressions.

* test-suite/tests/peval.test ("partial evaluation"): Add tests.

11 years agotests: Don't rely on $TMPDIR and /tmp on Windows.
Ludovic Courtès [Sun, 16 Jun 2013 14:42:01 +0000 (16:42 +0200)]
tests: Don't rely on $TMPDIR and /tmp on Windows.

* test-suite/standalone/test-unwind.c (check_ports)[__MINGW32__]: Use
  $TEMP, $TMP, or / as the value for TMPDIR.
  Patch by Eli Zaretskii <eliz@gnu.org>.

11 years agotests: Use double quotes around shell arguments, for Windows.
Ludovic Courtès [Sun, 16 Jun 2013 14:39:14 +0000 (16:39 +0200)]
tests: Use double quotes around shell arguments, for Windows.

* test-suite/standalone/test-system-cmds (test-system-cmd): Use double
  quotes around shell arguments.
  Reported by Eli Zaretskii <eliz@gnu.org>.

11 years agoDefine `AF_UNIX' only when Unix-domain sockets are supported.
Ludovic Courtès [Sun, 16 Jun 2013 14:19:21 +0000 (16:19 +0200)]
Define `AF_UNIX' only when Unix-domain sockets are supported.

* libguile/socket.c (scm_init_socket): Defined `AF_UNIX' only when
  `HAVE_UNIX_DOMAIN_SOCKETS' is defined.
  Reported by Eli Zaretskii <eliz@gnu.org>.

11 years agoReduce call-with-values to let for singly-valued producers
Andy Wingo [Sun, 16 Jun 2013 13:02:34 +0000 (15:02 +0200)]
Reduce call-with-values to let for singly-valued producers

* module/language/tree-il/peval.scm (singly-valued-expression?): Add
  support for conditionals.  In the future we should add more
  expressions here.
  (peval): Don't inline values into the body of a dynwind, as that could
  cause the consumer to run in the wrong dynamic context.
  If the producer is singly-valued and the consumer just has a rest arg,
  reduce to "let" and cons up a list in the consumer.  This may reduce
  further.

* test-suite/tests/peval.test ("partial evaluation"): Add a test.

11 years agoRewrite make-tree-il-folder to use the Wright matcher.
Andy Wingo [Tue, 28 May 2013 16:38:16 +0000 (12:38 -0400)]
Rewrite make-tree-il-folder to use the Wright matcher.

* module/language/tree-il.scm (make-tree-il-folder): Rewrite to use the
  Wright matcher instead of record-case.

11 years agoRewrite unparse-tree-il to use the Wright matcher.
Andy Wingo [Tue, 28 May 2013 16:28:56 +0000 (12:28 -0400)]
Rewrite unparse-tree-il to use the Wright matcher.

* module/language/tree-il.scm (unparse-tree-il): Rewrite to use the
  Wright matcher.

11 years agoRewrite parse-tree-il to use the Wright matcher.
Andy Wingo [Tue, 28 May 2013 16:20:48 +0000 (12:20 -0400)]
Rewrite parse-tree-il to use the Wright matcher.

* module/language/tree-il.scm (parse-tree-il): Rewrite to use match
  instead of pmatch.  Remove pmatch import.

11 years agoImplement tree-il-fold in terms of make-tree-il-folder.
Andy Wingo [Tue, 28 May 2013 16:06:30 +0000 (12:06 -0400)]
Implement tree-il-fold in terms of make-tree-il-folder.

* module/language/tree-il.scm (tree-il-fold): Implement using
  make-tree-il-folder.  This is an incompatible change: there is no more
  "leaf" procedure, and tree-il-fold only works on tree-il and not
  lists.

* module/language/tree-il/analyze.scm (<tree-analysis>, analyze-tree):
  Adapt to tree-il-fold change, losing the "leaf" handler.
  (unused-variable-analysis, unused-toplevel-analysis)
  (unbound-variable-analysis, arity-analysis): Adapt to tree-analysis
  change.

* module/language/tree-il/canonicalize.scm (tree-il-any)
* module/language/tree-il/cse.scm (build-assigned-var-table)
* module/language/tree-il/peval.scm (tree-il-any, build-var-table)
  (peval): Adapt to tree-il-fold change.

* test-suite/tests/tree-il.test ("tree-il-fold"): Adapt tests for new
  interface and expectations.

11 years agoRewrite tree-il pre-post-order in terms of (ice-9 match)
Andy Wingo [Tue, 28 May 2013 15:07:02 +0000 (11:07 -0400)]
Rewrite tree-il pre-post-order in terms of (ice-9 match)

* module/language/tree-il.scm (pre-post-order): Re-implement in terms
  of (ice-9 match), so that we standardize on one matcher (more or
  less).

11 years agoPre-order tree-il rewrites are now non-destructive
Andy Wingo [Tue, 28 May 2013 15:02:25 +0000 (11:02 -0400)]
Pre-order tree-il rewrites are now non-destructive

* module/language/tree-il.scm (pre-order): Re-implement in terms of
  pre-post-order, and rename from pre-order!.

* module/language/tree-il/primitives.scm (expand-primitives): Adapt to
  pre-order change, and rename from expand-primitives!.

* module/language/tree-il/optimize.scm (optimize): Adapt to
  expand-primitives! change, and rename from optimize!.

* module/language/tree-il/compile-glil.scm:
* module/system/repl/common.scm:
* test-suite/tests/cse.test:
* test-suite/tests/peval.test:
* test-suite/tests/tree-il.test: Adapt to expand-primitives and optimize
  changes.

11 years agoTree-il post-order rewriter no longer destructive
Andy Wingo [Tue, 28 May 2013 14:56:05 +0000 (10:56 -0400)]
Tree-il post-order rewriter no longer destructive

* module/language/tree-il.scm (pre-post-order): New helper, like
  pre-order! and post-order! but not destructive.
  (post-order): Implement in terms of pre-post-order, and rename from
  post-order!.

* module/ice-9/compile-psyntax.scm (squeeze-tree-il):
* module/language/tree-il/canonicalize.scm (canonicalize):
* module/language/tree-il/fix-letrec.scm (fix-letrec):
* module/language/tree-il/primitives.scm (resolve-primitives): Use
  post-order, and rename from the destructive
  variants (squeeze-tree-il!, canonicalize!, etc).  Adapt callers.

* test-suite/tests/tree-il.test (strip-source): Adapt to post-order.

* test-suite/tests/cse.test:
* test-suite/tests/peval.test:
* module/language/tree-il/optimize.scm: Adapt callers.

11 years agoSimplify let-values to let if consumer binds only one variable
Andy Wingo [Tue, 28 May 2013 15:20:29 +0000 (11:20 -0400)]
Simplify let-values to let if consumer binds only one variable

* module/language/tree-il/peval.scm (peval): let-values with a consumer
  that has only one argument is the same as let.

* test-suite/tests/peval.test ("partial evaluation"): Add test.

11 years agofix linker.test
Andy Wingo [Mon, 10 Jun 2013 20:42:46 +0000 (22:42 +0200)]
fix linker.test

* test-suite/tests/linker.test (link-elf-with-one-main-section): Fix
  test after string table change.

11 years agoAllow #f as timeout argument to unlock-mutex and SRFI-18 mutex-unlock!
Mark H Weaver [Mon, 10 Jun 2013 06:05:17 +0000 (02:05 -0400)]
Allow #f as timeout argument to unlock-mutex and SRFI-18 mutex-unlock!

Reported by Chaos Eternal <chaoseternal@shlug.org>
Based on a patch by Nala Ginrut <nalaginrut@gmail.com>

* libguile/threads.c (scm_unlock_mutex_timed): If 'timeout' argument
  is false, interpret that as no timeout.

* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
  Update documentation.

11 years agoFix tests for 'scm_c_bind_keyword_arguments'.
Mark H Weaver [Mon, 10 Jun 2013 06:26:11 +0000 (02:26 -0400)]
Fix tests for 'scm_c_bind_keyword_arguments'.

* test-suite/standalone/test-scm-c-bind-keyword-arguments.c (error_handler):
  Remove function.
  (unrecognized_keyword_error_handler, invalid_keyword_error_handler,
  odd_length_error_handler): New functions.
  (test_scm_c_bind_keyword_arguments): Use new error handler functions.

11 years agoprocedure-properties for RTL functions
Andy Wingo [Fri, 17 May 2013 20:10:16 +0000 (22:10 +0200)]
procedure-properties for RTL functions

* module/system/vm/assembler.scm (link-procprops, link-objects): Arrange
  to write procedure property links out to a separate section.

* libguile/procprop.c (scm_procedure_properties):
* libguile/programs.h:
* libguile/programs.c (scm_i_rtl_program_properties):
* module/system/vm/debug.scm (find-program-properties): Wire up
  procedure-properties for RTL procedures.  Yeah!  Fistpumps!  :)

* module/system/vm/debug.scm (find-program-debug-info): Return #f if the
  string is "", as it is if we don't have a name.  Perhaps
  elf-symbol-name should return #f in that case...

* test-suite/tests/rtl.test: Add some tests.

11 years agoprocedure-documentation works on RTL procedures
Andy Wingo [Thu, 16 May 2013 21:38:29 +0000 (23:38 +0200)]
procedure-documentation works on RTL procedures

* libguile/procprop.h:
* libguile/procprop.c (scm_procedure_documentation): Move here from
  procs.c, and to make the logic more similar to that of procedure-name,
  which allows RTL programs to dispatch to rtl-program-documentation.

* libguile/programs.c (scm_i_rtl_program_documentation):
* libguile/programs.h:
* module/system/vm/program.scm (rtl-program-documentation): New
  plumbing.

* module/system/vm/debug.scm (find-program-docstring): New interface to
  grovel ELF for a docstring.

11 years agoWrite docstrings into RTL ELF images
Andy Wingo [Thu, 16 May 2013 20:30:51 +0000 (22:30 +0200)]
Write docstrings into RTL ELF images

* module/system/vm/assembler.scm (link-docstrs): Write docstrings.
  (link-objects): Link docstrings into the ELF.

11 years agoWire up ability to print RTL program arities
Andy Wingo [Thu, 16 May 2013 18:58:54 +0000 (20:58 +0200)]
Wire up ability to print RTL program arities

* libguile/procprop.c (scm_i_procedure_arity): Allow RTL programs to
  dispatch to scm_i_program_arity.

* libguile/programs.c (scm_i_program_print): Refactor reference to
  write-program.
  (scm_i_rtl_program_minimum_arity): New procedure, dispatches to
  Scheme.
  (scm_i_program_arity): Dispatch to scm_i_rtl_program_minimum_arity if
  appropriate.

* module/system/vm/debug.scm (program-minimum-arity): New export.

* module/system/vm/program.scm (rtl-program-minimum-arity): New internal
  function.
  (program-arguments-alists): New helper, implemented also for RTL
  procedures.
  (write-program): Refactor a bit, and call program-arguments-alists.

* test-suite/tests/rtl.test ("simply procedure arity"): Add tests that
  arities make it all the way to cold ELF and back to warm Guile.

11 years ago(system vm debug) can read arity information
Andy Wingo [Thu, 16 May 2013 16:56:22 +0000 (18:56 +0200)]
(system vm debug) can read arity information

* module/system/vm/debug.scm (<arity>): New object, for reading
  arities.  Unlike <arity> in the assembler, this one only holds on to a
  couple of pointers, and doesn't even load in argument names.  Unlike
  the arity lists in (system vm program), it can load in names.  Very
  early days but it does seem to work.
  (find-program-arities, arity-arguments-alist): New higher-level
  interfaces.

11 years agoRTL assembler writes arities information into separate section.
Andy Wingo [Thu, 16 May 2013 12:06:10 +0000 (14:06 +0200)]
RTL assembler writes arities information into separate section.

* module/system/vm/assembler.scm: Write arities into a .guile.arities
  section and associated .guile.arities.strtab.

11 years agoBeginnings of tracking of procedure arities in assembler
Andy Wingo [Tue, 14 May 2013 09:18:05 +0000 (11:18 +0200)]
Beginnings of tracking of procedure arities in assembler

* module/system/vm/assembler.scm (<meta>, <arity>): Assembler now tracks
  arities of a function.
  (begin-standard-arity, begin-opt-arity, begin-kw-arity, end-arity):
  New macro-assemblers.

* test-suite/tests/rtl.test: Adapt all tests to use begin-standard-arity
  and end-arity.

11 years agoadd procedure prelude macro-instructions
Andy Wingo [Tue, 14 May 2013 08:33:43 +0000 (10:33 +0200)]
add procedure prelude macro-instructions

* module/system/vm/assembler.scm (pack-flags): New helper.
  (standard-prelude, opt-prelude, kw-prelude): New macro-instructions.

* test-suite/tests/rtl.test: Update tests to use standard-prelude.

11 years agobegin-program takes properties alist
Andy Wingo [Tue, 14 May 2013 08:25:38 +0000 (10:25 +0200)]
begin-program takes properties alist

* module/system/vm/assembler.scm (assert-match): New helper macro to
  check argument types.
  (<meta>): Add properties field.  Rename name field to "label" to
  indicate that it should be unique.
  (make-meta, meta-name): New helpers.
  (begin-program): Take additional properties argument.
  (emit-init-constants): Adapt to begin-program change.
  (link-symtab): Allow for anonymous procedures.

* test-suite/tests/rtl.test: Adapt tests.

11 years agoAdd RTL disassembler
Andy Wingo [Wed, 1 May 2013 20:45:19 +0000 (22:45 +0200)]
Add RTL disassembler

* module/Makefile.am:
* module/system/vm/disassembler.scm: New module.

* module/system/repl/command.scm (disassemble): Work with RTL programs.

11 years agoRTL programs print with their name
Andy Wingo [Sun, 5 May 2013 16:26:53 +0000 (18:26 +0200)]
RTL programs print with their name

* libguile/print.c (iprin1): Use scm_i_program_print for RTL programs
  too.

* libguile/procprop.c (scm_procedure_name): For RTL programs, call
  scm_i_rtl_program_name if there is no override.

* libguile/programs.h:
* libguile/programs.c (scm_i_rtl_program_name): New helper, dispatches
  to (system vm program).
  (scm_i_program_print): For RTL programs, the fallback prints the code
  pointer too.

* module/system/vm/program.scm (rtl-program-name): Use the debug info to
  get an RTL program name.
  (write-program): Work with RTL programs too.

* test-suite/tests/rtl.test ("procedure name"): Add test.

11 years agomove procedure-name and procedure-source to procprop.c
Andy Wingo [Sun, 5 May 2013 15:52:59 +0000 (17:52 +0200)]
move procedure-name and procedure-source to procprop.c

* libguile/procprop.h:
* libguile/procprop.c (scm_procedure_name, scm_procedure_source): Move
  these functions here, from debug.[ch].

11 years agoAdd runtime support for reading debug information from ELF
Andy Wingo [Wed, 1 May 2013 20:17:51 +0000 (22:17 +0200)]
Add runtime support for reading debug information from ELF

* module/Makefile.am:
* module/system/vm/debug.scm: New module.

* module/system/vm/elf.scm (elf-section-by-name): New helper.
  (elf-symbol-table-len): New helper.

* test-suite/tests/rtl.test: Add test for finding debug info.

11 years agoAdd RTL assembler
Andy Wingo [Mon, 28 May 2012 10:37:56 +0000 (12:37 +0200)]
Add RTL assembler

* module/Makefile.am:
* module/system/vm/assembler.scm: New module, implementing an assembler
  for RTL.

* test-suite/Makefile.am:
* test-suite/tests/rtl.test: New test suite.

* module/system/vm/elf.scm (make-elf-symbol*): Add constructor; export
  as make-elf-symbol.
  (elf-symbol-len): New export.
  (write-elf32-symbol, write-elf64-symbol): New helpers.
  (write-elf-symbol): New export.

11 years agolinker string tables are stateful objects
Andy Wingo [Sun, 9 Jun 2013 14:03:18 +0000 (16:03 +0200)]
linker string tables are stateful objects

* module/system/vm/linker.scm (make-string-table): Rework to be a
  stateful object instead of a function object.  Works better in this
  case.  Adapt users.
  (string-table-intern!): Rename from string-table-intern, and just
  return the index of the string.
  (link-string-table!): Rename from link-string-table, and set a flag to
  prevent interning strings after linking, as that's not going to work
  well.

* module/language/objcode/elf.scm (bytecode->elf): Adapt.

11 years agoconst cleanups in instructions.c
Andy Wingo [Sat, 8 Jun 2013 12:58:10 +0000 (14:58 +0200)]
const cleanups in instructions.c

* libguile/instructions.c (fetch_rtl_instruction_table)
  (fetch_instruction_table): Make the returned table const.  Adapt
  callers.
  (scm_rtl_instruction_list): Fix comment about format of return value.

11 years agoReport the faulty keyword in errors raised by `scm_c_bind_keyword_arguments'.
Ludovic Courtès [Tue, 4 Jun 2013 22:25:39 +0000 (00:25 +0200)]
Report the faulty keyword in errors raised by `scm_c_bind_keyword_arguments'.

Reported by Mark H. Weaver.

* libguile/keywords.c (scm_c_bind_keyword_arguments): Use
  `scm_error_scm' instead of `scm_error'.  Pass the faulty keyword
  enclosed in a list as the last argument.
* test-suite/tests/optargs.test ("scm_c_bind_keyword_arguments"): New
  test prefix.

11 years agoPrint the faulty object upon invalid-keyword errors.
Ludovic Courtès [Mon, 3 Jun 2013 22:29:59 +0000 (00:29 +0200)]
Print the faulty object upon invalid-keyword errors.

* libguile/vm.c (vm_error_kwargs_invalid_keyword,
  vm_error_kwargs_unrecognized_keyword): Add parameter.  Pass it
  enclosed in a list as the last argument to `scm_error_scm'.
* libguile/vm-i-system.c (bind_kwargs): Adjust accordingly.
* libguile/eval.c (error_invalid_keyword, error_unrecognized_keyword):
  Add parameter.
  (prepare_boot_closure_env_for_apply): Adjust accordingly.
* module/ice-9/eval.scm (primitive-eval): Likewise.
* libguile/error.c (scm_error_scm): Mention `keyword-argument-error' in
  docstring.
* module/ice-9/boot-9.scm (keyword-error-printer): New procedure; use it.
* test-suite/tests/optargs.test (c&e, with-test-prefix/c&e): Remove.
  ("define*")["unrecognized keyword"]: Test the value passed along the
  `keyword-argument-error' exception.
  ["invalid keyword"]: New test.
* doc/ref/api-control.texi (Error Reporting): Update `scm-error'
  description.

11 years agoadd new rtl vm
Andy Wingo [Thu, 23 May 2013 12:52:29 +0000 (14:52 +0200)]
add new rtl vm

* libguile/vm-engine.c (rtl_vm_engine): Add new VM.
  (vm_engine): Add support for calling RTL programs.

* libguile/tags.h (scm_tc7_rtl_program): New type for procedures that
  run on the new VM.
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of):
* libguile/print.c (iprin1):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p): Add hooks for the new tc7.

* libguile/programs.h:
* libguile/programs.c (scm_make_rtl_program, scm_i_rtl_program_print)
  (scm_rtl_program_p, scm_rtl_program_code):
* module/system/vm/program.scm: Add constructors and accessors for the
  new "RTL programs".

* libguile/vm.c (rtl_boot_continuation): Define a boot program.
  (rtl_apply, rtl_values): New static RTL programs.

* libguile/frames.c (scm_frame_num_locals): Adapt for frames of RTL
  programs.

* libguile/frames.h: Add description of RTL frames.

* libguile/Makefile.am: Add rules to generate vm-operations.h.
* .gitignore: Ignore vm-operations.h.
* module/system/vm/instruction.scm:
* libguile/instructions.c:
* libguile/instructions.h: Use vm-operations.h to define enumerated
  values for the new RTL opcodes.  Define some helper macros to pack and
  unpack 32-bit instruction words.
  (rtl-instruction-list): New function, exported by (system vm
  instruction).

* libguile/objcodes.c: Wire up the bits needed to detect the new RTL
  bytecode and load it, as appropriate.

11 years agoDo not assume `pthread_t' is an integer type.
Ludovic Courtès [Thu, 30 May 2013 21:30:27 +0000 (23:30 +0200)]
Do not assume `pthread_t' is an integer type.

Fixes <http://bugs.gnu.org/14469>.
Reported by Panicz Maciej Godek <godek.maciek@gmail.com>.

* libguile/finalizers.c (finalization_thread_is_running): New variable.
  (start_finalization_thread): Use it to determine whether
  FINALIZATION_THREAD is up and running.
  (stop_finalization_thread): Likewise.

11 years agorefactor to resolve_variable
Andy Wingo [Mon, 28 May 2012 10:25:43 +0000 (12:25 +0200)]
refactor to resolve_variable

* libguile/vm.c (resolve_variable): Slight refactor.

11 years agocpp hygiene in the vm
Andy Wingo [Thu, 17 May 2012 16:35:05 +0000 (18:35 +0200)]
cpp hygiene in the vm

* libguile/vm-engine.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: CPP hygiene: the code that #defines, #undefs.
  Makes things cleaner given the multiple inclusion dance we do.

11 years agopop-continuation abort-continuation hooks pass return vals directly
Andy Wingo [Thu, 23 May 2013 13:07:37 +0000 (15:07 +0200)]
pop-continuation abort-continuation hooks pass return vals directly

* doc/ref/api-debug.texi (VM Hooks): Update documentation.

* libguile/vm.c (vm_dispatch_hook):
* libguile/vm-engine.c:  Rework the hook machinery so that they can
  receive an arbitrary number of arguments.  The return and abort
  hooks will pass the values that they return to their continuations.
  (vm_engine): Adapt to ABORT_CONTINUATION_HOOK change.

* libguile/vm-i-system.c (return, return/values): Adapt to
  POP_CONTINUATION_HOOK change.

* module/system/vm/frame.scm (frame-return-values): Remove.  The
  pop-continuation-hook will pass the values directly.

* module/system/vm/trace.scm (print-return):
  (trace-calls-to-procedure):
  (trace-calls-in-procedure): Update to receive return values
  directly.

* module/system/vm/traps.scm (trap-in-procedure)
  (trap-in-dynamic-extent): Ignore return values.
  (trap-frame-finish, trap-calls-in-dynamic-extent)
  (trap-calls-to-procedure): Pass return values to the handlers.

11 years agoAllow vm_engine caller to pass arguments on the stack.
Andy Wingo [Thu, 23 May 2013 13:16:20 +0000 (15:16 +0200)]
Allow vm_engine caller to pass arguments on the stack.

* libguile/vm-engine.c (vm_engine): Allow the caller to pass arguments
  on the stack.

11 years agovm-engine: remove register assignments
Andy Wingo [Fri, 18 May 2012 10:21:33 +0000 (12:21 +0200)]
vm-engine: remove register assignments

* libguile/vm-engine.c: Remove the register assignments inherited from
  the 1990s.  GCC does seem to allocate reasonably on systems with
  enough registers (e.g. x86-64), and on system with too few (ia32) we
  disabled manual allocation.  Anyway this code was never tested, so
  it's better to leave the compiler to do its own thing, until proven
  otherwise.  Also in the RTL VM we don't need to allocate a register to
  the SP, because it isn't accessed as much.

11 years agoremove some configurability in vm-engine
Andy Wingo [Fri, 18 May 2012 10:21:08 +0000 (12:21 +0200)]
remove some configurability in vm-engine

* libguile/vm-engine.c: Remove the ability for the VM to check object
  access, free variable access, and the ip.  They were off by default.
  Since they will be different in the RTL VM, their presence is just
  making things confusing.

* libguile/vm.c: Remove corresponding error helpers.

11 years agominor vm-engine cleanups
Andy Wingo [Fri, 18 May 2012 09:57:51 +0000 (11:57 +0200)]
minor vm-engine cleanups

* libguile/vm-engine.c: Some very minor cleanups: indenting, use of
  VM_ASSERT, commenting.

11 years agoremove CONS macro in VM; use scm_cons instead
Andy Wingo [Thu, 17 May 2012 09:39:35 +0000 (11:39 +0200)]
remove CONS macro in VM; use scm_cons instead

* libguile/vm-engine.c (CONS): Remove.  Callers should use scm_cons
  instead, syncing registers beforehand.
  (POP_LIST): Adapt, only synchronizing once.
  (POP_LIST_MARK, POP_CONS_MARK): Remove unused macros.

* libguile/vm-i-scheme.c (cons):
* libguile/vm-i-system.c (push-rest, bind-rest): Adapt.

11 years agoinline vm-engine.h into vm-engine.c
Andy Wingo [Fri, 18 May 2012 09:52:12 +0000 (11:52 +0200)]
inline vm-engine.h into vm-engine.c

* libguile/vm-engine.h:
* libguile/vm-engine.c: Fold vm-engine.h into vm-engine.c.

* libguile/Makefile.am: Adapt.

11 years agoadd (find-mapped-elf-image) procedure to (system vm objcode) module
Andy Wingo [Sun, 28 Apr 2013 12:42:01 +0000 (14:42 +0200)]
add (find-mapped-elf-image) procedure to (system vm objcode) module

* libguile/objcodes.c (register_elf, scm_find_mapped_elf_image): New
  interfaces that keep a list of all ELF mappings.  Exported from the
  (system vm objcode) module.

* module/system/vm/objcode.scm: Export find-mapped-elf-image.

11 years agorefactor and simplify ELF loader in objcodes.c
Andy Wingo [Sun, 28 Apr 2013 12:23:20 +0000 (14:23 +0200)]
refactor and simplify ELF loader in objcodes.c

* libguile/objcodes.c (sniff_elf_alignment, alloc_aligned)
  (copy_and_align_elf_data): New helpers for portably re-aligning ELF
  data from read(2) or from a bytevector.
  (load_thunk_from_memory): Simplify!  Now there is only one procedure
  that loads ELF, and it does less: it simply receives the whole image
  in one array, hopefully from mmap.

  (scm_load_thunk_from_file): Use new map_file_contents helper, and go
  through load_thunk_from_memory.
  (scm_load_thunk_from_memory): Pass load_thunk_from_memory a piece of
  memory that it owns, and that is appropriately aligned.

11 years agoadd scm_{to,from}_{u,}intptr_t
Andy Wingo [Thu, 23 May 2013 12:18:47 +0000 (14:18 +0200)]
add scm_{to,from}_{u,}intptr_t

* libguile/numbers.h (scm_to_intptr_t, scm_from_intptr_t)
  (scm_to_uintptr_t, scm_from_uintptr_t): New defines.

* libguile/foreign.c: Remove definitions here; adapt callers to use new
  names with _t suffixes.

11 years agorefactor linker to lay out ELF files and memory in the same way
Andy Wingo [Sun, 28 Apr 2013 07:31:28 +0000 (09:31 +0200)]
refactor linker to lay out ELF files and memory in the same way

* module/system/vm/linker.scm (make-linker-object):
  (linker-object-section-symbol):
  (linker-object-symbols*): Create a symbol to the start of a linker
  object.  Hide it from the external linker-object-symbols* accessor.

  (segment-kind, count-segments): Sections without SHF_ALLOC don't get
  segments.
  (collate-objects-into-segments): Allow for #f segment types.  If two
  sections have the same type and flags, leave them in the same order.

  (align): Allow for 0 alignment.

  (add-elf-objects): New helper: puts the ELF data structures (header,
  segment table, and section table) in sections of their own.  This
  lends a nice clarity and conceptual unity to the linker.

  (relocate-section-header, allocate-segment): Lay out segments with
  congruent, contiguous addresses, so that we can just mmap the file and
  if debugging sections that are not in segments are present, they can
  be lazily paged in if needed by the kernel's VM system.

  (link-elf): Refactor to use the new interfaces.

* test-suite/tests/linker.test: Update to expect the additional sections
  for the header and section table.

11 years agoelf: add accessors for header members that might need relocation
Andy Wingo [Sun, 28 Apr 2013 05:51:42 +0000 (07:51 +0200)]
elf: add accessors for header members that might need relocation

* module/system/vm/elf.scm (elf-header-shoff-offset)
  (elf-section-header-addr-offset, elf-section-header-offset-offset):
  New accessors.

11 years agoELF refactor and consequent linker simplifications
Andy Wingo [Sun, 21 Apr 2013 14:06:36 +0000 (16:06 +0200)]
ELF refactor and consequent linker simplifications

* module/system/vm/elf.scm: Add commentary.
  (make-elf): Add a constructor similar to make-elf-segment and
  make-elf-section.
  (write-elf32-header, write-elf64-header, write-elf-header): Take an
  <elf> instead of all the fields separately.
  (<elf-segment>, <elf-section>): Add "index" property.  Adapt
  constructors accordingly.

* module/language/objcode/elf.scm (bytecode->elf): Arrange to set the
  section indexes when creating ELF sections.

* module/system/vm/linker.scm (fold-values): New helper.
  (alloc-segment, relocate-section-header): Arrange to set segment and
  section indexes.
  (find-shstrndx): New helper, replaces compute-sections-by-name.  Now
  that sections know their indexes, this is easier.
  (allocate-elf, write-elf): New helpers, factored out of link-elf.
  Easier now that sections have indexes.
  (link-elf): Simplify.  Check that the incoming objects have sensible
  numbers.

* test-suite/tests/linker.test: Update to set #:index on the linker
  objects.

11 years agosplit linker out of elf module
Andy Wingo [Wed, 17 Apr 2013 21:07:04 +0000 (23:07 +0200)]
split linker out of elf module

* module/Makefile.am:
* module/system/vm/linker.scm: New file, split out of (system vm elf).
  (make-string-table, string-table-intern): Export under their bare
  names, instead of make-elf-string-table and elf-string-table-intern.

* module/system/vm/elf.scm: Remove linking capabilities.
  (string-table-ref): Export.

* module/language/objcode/elf.scm (bytecode->elf): Adapt to use (system
  vm linker).

* test-suite/tests/linker.test: New test.

11 years agoweb: uri-encode hexadecimal percent-encoding is now uppercase
Aleix Conchillo Flaque [Thu, 2 May 2013 19:13:31 +0000 (12:13 -0700)]
web: uri-encode hexadecimal percent-encoding is now uppercase

* module/web/uri.scm (uri-encode): the hexadecimal percent-encoding %HH
  is now uppercased as suggested by RFC3986:

      "For consistency, URI producers and normalizers should use
       uppercase hexadecimal digits for all percent-encodings."

* test-suite/tests/web-uri.test ("encode"): update tests.

11 years agoManual: fix 'my-or' examples to use let-bound variable.
Mark H Weaver [Sun, 14 Apr 2013 17:36:20 +0000 (13:36 -0400)]
Manual: fix 'my-or' examples to use let-bound variable.

Fixes <http://bugs.gnu.org/14203> reported by Nikita Karetnikov.

* doc/ref/api-macros.texi (Defining Macros, Syntax Rules): Fix
  definition of 'my-or' example macro to use the let-bound variable.

11 years agotests: Use shell constructs that /bin/sh on Solaris 10 can understand.
Ludovic Courtès [Sun, 14 Apr 2013 13:46:17 +0000 (15:46 +0200)]
tests: Use shell constructs that /bin/sh on Solaris 10 can understand.

Partly fixes <http://bugs.gnu.org/14042>.
Reported by Marc Girod <marc.girod@gmail.com>

* test-suite/standalone/test-language: Use a shell construct that
  /bin/sh on Solaris 10 can understand.

11 years agoMerge remote-tracking branch 'origin/stable-2.0'
Mark H Weaver [Sun, 14 Apr 2013 06:48:33 +0000 (02:48 -0400)]
Merge remote-tracking branch 'origin/stable-2.0'

Conflicts:
GUILE-VERSION
libguile/array-map.c
libguile/fports.h
libguile/gc.h
libguile/inline.h
libguile/ports.c
libguile/ports.h
libguile/print.c
libguile/r6rs-ports.c
libguile/read.c
test-suite/tests/00-socket.test

11 years agoUsing 'pass-if-equal' in coding.test.
Mark H Weaver [Sun, 14 Apr 2013 06:29:25 +0000 (02:29 -0400)]
Using 'pass-if-equal' in coding.test.

* test-suite/tests/coding.test ("block comments", "line comments"):
  Use 'pass-if-equal'.

11 years agoAdjust BOM tests to reflect the fact that big endian is used by default.
Mark H Weaver [Sun, 14 Apr 2013 05:50:47 +0000 (01:50 -0400)]
Adjust BOM tests to reflect the fact that big endian is used by default.

* test-suite/tests/ports.test ("BOM not discarded unless at start of
  UTF-16 stream", "BOM not discarded unless at start of UTF-32 stream"):
  Adjust tests to reflect the fact that, in the absence of a BOM, big
  endian will be used by default for the "UTF-16" and "UTF-32"
  encodings.

11 years agoAdd 2012 and 2013 to copyright notice on numbers.test.
Mark H Weaver [Thu, 11 Apr 2013 00:07:22 +0000 (20:07 -0400)]
Add 2012 and 2013 to copyright notice on numbers.test.

* test-suite/tests/numbers.test: Add 2012 and 2013 to copyright notice.
  It was modified both of those years.

11 years agoDo not add $(EXEEXT) to guild or guile-tools.
Mark H Weaver [Wed, 10 Apr 2013 12:23:16 +0000 (08:23 -0400)]
Do not add $(EXEEXT) to guild or guile-tools.

* meta/Makefile.am (install-exec-hook): Do not add $(EXEEXT) to guild or
  guile-tools.

11 years agoMention `open-file' in NEWS.
Ludovic Courtès [Wed, 10 Apr 2013 05:52:36 +0000 (07:52 +0200)]
Mention `open-file' in NEWS.

11 years agodoc: Require libunistring 0.9.3 in `README'.
Ludovic Courtès [Wed, 10 Apr 2013 05:52:25 +0000 (07:52 +0200)]
doc: Require libunistring 0.9.3 in `README'.

* README: Require libunistring 0.9.3.  The <unitypes.h> header in 0.9.1
  lacks the _UC_ATTRIBUTE_CONST definition, leading to build failures.

11 years agobuild: Tell `gen-scmconfig' whether the system has `struct timespec'.
Ludovic Courtès [Tue, 9 Apr 2013 23:39:02 +0000 (01:39 +0200)]
build: Tell `gen-scmconfig' whether the system has `struct timespec'.

* configure.ac: Reinstate `struct timespec' check removed in commit
  7e7c6f6a937005b08fffd5aeccdf992459b07137, but define
  `HAVE_SYSTEM_STRUCT_TIMESPEC' instead of `HAVE_STRUCT_TIMESPEC'.
* libguile/gen-scmconfig.c (main): Change `HAVE_STRUCT_TIMESPEC' to
  `HAVE_SYSTEM_STRUCT_TIMESPEC'.

11 years agoBump version number for 2.0.9.
Ludovic Courtès [Tue, 9 Apr 2013 23:10:04 +0000 (01:10 +0200)]
Bump version number for 2.0.9.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

11 years agodoc: Update `release.org'.
Ludovic Courtès [Tue, 9 Apr 2013 23:09:28 +0000 (01:09 +0200)]
doc: Update `release.org'.

* doc/release.org: Recommend "distcheck".  Add `makeinfo' to the
  bootstrap tool list.

11 years agostime: Remove #ifdef HAVE_*_H for headers provided by Gnulib.
Ludovic Courtès [Tue, 9 Apr 2013 22:13:54 +0000 (00:13 +0200)]
stime: Remove #ifdef HAVE_*_H for headers provided by Gnulib.

* libguile/stime.c: Remove #ifdef HAVE_SYS_TIMES_H, HAVE_SYS_TYPES_H,
  and HAVE_STRING_H since those headers are always provided by Gnulib
  when the corresponding macro is undefined.  Fixes a regression on
  MinGW introduced by commit 40e2a31.

11 years agoMake `build-aux/gendocs.sh' executable.
Ludovic Courtès [Tue, 9 Apr 2013 22:10:23 +0000 (00:10 +0200)]
Make `build-aux/gendocs.sh' executable.

11 years agoBump version number for 2.0.8.
Ludovic Courtès [Tue, 9 Apr 2013 20:51:48 +0000 (22:51 +0200)]
Bump version number for 2.0.8.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
  functions `scm_c_bind_keyword_arguments' et al.
  (LIBGUILE_INTERFACE_AGE): Increment.

11 years agotests: Skip FFI tests involving `scm_is_pair' when `dynamic-func' fails.
Ludovic Courtès [Tue, 9 Apr 2013 20:37:06 +0000 (22:37 +0200)]
tests: Skip FFI tests involving `scm_is_pair' when `dynamic-func' fails.

* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
  finalizer", "equal? modulo finalizer (set-pointer-finalizer!)"]: Wrap
  `dynamic-func' in `false-if-exception' (static builds on NetBSD 5.1
  raise "Symbol not found" here.)

11 years agodoc: Cosmetic change for `release.org'.
Ludovic Courtès [Tue, 9 Apr 2013 19:48:58 +0000 (21:48 +0200)]
doc: Cosmetic change for `release.org'.

* doc/release.org: Add #+STARTUP.

11 years agoUpdate `THANKS'.
Ludovic Courtès [Tue, 9 Apr 2013 19:48:04 +0000 (21:48 +0200)]
Update `THANKS'.

11 years agoupdate NEWS
Andy Wingo [Tue, 9 Apr 2013 20:45:35 +0000 (22:45 +0200)]
update NEWS

* NEWS: Updates.

11 years agofix stime patch for HAVE_TIMES removal
Andy Wingo [Tue, 9 Apr 2013 20:12:28 +0000 (22:12 +0200)]
fix stime patch for HAVE_TIMES removal

* libguile/stime.c (scm_init_stime): Fix previous patch.  At this point
  in the source, we definitely have a run-time function, but don't
  necessarily have a real-time function.

11 years agosimplify configure checks for functionality provided by gnulib
Andy Wingo [Tue, 9 Apr 2013 19:58:30 +0000 (21:58 +0200)]
simplify configure checks for functionality provided by gnulib

* configure.ac: Remove checks for pipe, stftime, times, and select, as
  our Gnulib modules already ensure they are provided.

* libguile/stime.c: Rely on gnulib providing `times'.

11 years agoMinor 'THANKS' fix.
Mark H Weaver [Tue, 9 Apr 2013 19:24:18 +0000 (15:24 -0400)]
Minor 'THANKS' fix.

11 years agoFix alignment in 'THANKS'.
Mark H Weaver [Tue, 9 Apr 2013 19:23:20 +0000 (15:23 -0400)]
Fix alignment in 'THANKS'.

11 years agoUpdate bug report section of 'THANKS'.
Mark H Weaver [Tue, 9 Apr 2013 19:21:12 +0000 (15:21 -0400)]
Update bug report section of 'THANKS'.

11 years agoUpdate 'THANKS'.
Mark H Weaver [Tue, 9 Apr 2013 18:07:14 +0000 (14:07 -0400)]
Update 'THANKS'.

11 years agoManual: Don't promise to signal an error for an illegal 'letrec'.
Mark H Weaver [Tue, 9 Apr 2013 17:54:39 +0000 (13:54 -0400)]
Manual: Don't promise to signal an error for an illegal 'letrec'.

Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* doc/ref/api-binding.texi (Local Bindings): Remove the incorrect claim
  that improperly accessing a letrec-bound variable during evaluation of
  its initializers will necessarily cause an error to be signalled.

11 years agotests: Skip IPv6 socket tests when OS support is missing.
Ludovic Courtès [Tue, 9 Apr 2013 06:49:06 +0000 (08:49 +0200)]
tests: Skip IPv6 socket tests when OS support is missing.

Reported by Samuel Thibault <samuel.thibault@gnu.org>
and Peter Simons <simons@cryp.to>.

* test-suite/tests/00-socket.test ("AF_INET6/SOCK_STREAM"): Throw
  `unresolved' when `bind' throws EADDRNOTAVAIL.

11 years agoUpdate 'NEWS'.
Mark H Weaver [Mon, 8 Apr 2013 14:15:12 +0000 (10:15 -0400)]
Update 'NEWS'.

11 years agoUpdate 'NEWS'.
Mark H Weaver [Mon, 8 Apr 2013 12:58:00 +0000 (08:58 -0400)]
Update 'NEWS'.

11 years agoConsume a peeked EOF at the REPL.
Mark H Weaver [Mon, 8 Apr 2013 12:44:02 +0000 (08:44 -0400)]
Consume a peeked EOF at the REPL.

* module/system/repl/repl.scm (meta-reader): Consume peeked EOF.

11 years agoMiscellaneous 'sendfile' fixes and improved tests.
Mark H Weaver [Mon, 8 Apr 2013 04:36:00 +0000 (00:36 -0400)]
Miscellaneous 'sendfile' fixes and improved tests.

* libguile/filesys.c (scm_sendfile): In Linux-style sendfile(2) code, if
  EINTR or EAGAIN occurs, set result to 1 (not 0) so that we actually
  keep going.  In non-sendfile(2) code, deal gracefully with short reads
  due to EOF.

* test-suite/tests/filesys.test ("sendfile"): Use 'let*' to guarantee
  the needed order of operations: write (test-file) and then read it.
  Add code to check the written data (not just the returned length) in
  all tests, including the cases that hit EOF prematurely.

11 years agoUpdate 'NEWS'.
Mark H Weaver [Sun, 7 Apr 2013 21:47:44 +0000 (17:47 -0400)]
Update 'NEWS'.

11 years agoChange `sendfile' to loop until everything has been sent.
Ludovic Courtès [Sun, 7 Apr 2013 21:43:21 +0000 (23:43 +0200)]
Change `sendfile' to loop until everything has been sent.

* libguile/filesys.c (scm_sendfile)[HAVE_SYS_SENDFILE_H &&
  HAVE_SENDFILE]: Compare RESULT with C_COUNT.  Loop until C_COUNT bytes
  have been sent.
* doc/ref/posix.texi (File System): Update the description.  Explain the
  new semantics.
* test-suite/tests/filesys.test ("sendfile"): Rewrite using
  `pass-if-equal'.  Check the return value for all the tests.
  ["file with offset past the end", "file with offset near the end"]:
  New tests.

11 years agoRemove outdated and misplaced "Included Guile Modules" node from manual.
Mark H Weaver [Sun, 7 Apr 2013 19:45:38 +0000 (15:45 -0400)]
Remove outdated and misplaced "Included Guile Modules" node from manual.

* doc/ref/api-modules.texi (Included Guile Modules): Remove.
  (Using Guile Modules): Fix cross reference.

11 years agoClarify 'file-encoding' docs: heuristics may be improved later.
Mark H Weaver [Sun, 7 Apr 2013 16:07:33 +0000 (12:07 -0400)]
Clarify 'file-encoding' docs: heuristics may be improved later.

* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
  Mention UTF-8 as another common encoding used for Scheme source files,
  and that it is used by default.  Change the description to leave open
  the possibility of adding additional heuristics in the future.
  Mention that if the coding declaration is in a #!-style block comment,
  it must be the first such comment in the file.  Mention the
  '#:guess-encoding' keyword argument.

11 years agoAdd keyword arguments to file opening procedures.
Mark H Weaver [Sun, 7 Apr 2013 03:19:55 +0000 (23:19 -0400)]
Add keyword arguments to file opening procedures.

* libguile/fports.c (scm_open_file_with_encoding): New API function,
  containing the code previously found in 'scm_open_file', but modified
  to accept the new 'guess_encoding' and 'encoding' arguments.

  (scm_open_file): Now just a simple wrapper that calls
  'scm_open_file_with_encoding'.

  (scm_i_open_file): New implementation of 'open-file' that accepts
  keyword arguments '#:guess-encoding' and '#:encoding', and calls
  'scm_open_file_with_encoding'.

  (scm_init_fports_keywords): New initialization function that gets
  called after keywords are initialized.

* libguile/fports.h (scm_open_file_with_encoding,
  scm_init_fports_keywords): Add prototypes.

* libguile/init.c (scm_i_init_guile): Call 'scm_init_fports_keywords'.

* module/ice-9/boot-9.scm: Add enhanced versions of 'open-input-file',
  'open-output-file', 'call-with-input-file', 'call-with-output-file',
  'with-input-from-file', 'with-output-to-file', and
  'with-error-to-file', that accept keyword arguments '#:binary',
  '#:encoding', and (for input port constructors) '#:guess-encoding'.

* doc/ref/api-io.texi (File Ports): Update documentation.

* test-suite/tests/ports.test ("keyword arguments for file openers"):
  Add tests.

11 years agoAdd record type printer for srfi-41.
Chris K. Jester-Young [Sun, 7 Apr 2013 16:44:18 +0000 (12:44 -0400)]
Add record type printer for srfi-41.

* module/srfi/srfi-41.scm: Add record type printer for streams.
  (stream-promise-visit): New helper for visiting stream promises.

11 years agoAdd record type printer for srfi-45.
Chris K. Jester-Young [Sun, 7 Apr 2013 16:43:17 +0000 (12:43 -0400)]
Add record type printer for srfi-45.

* module/srfi/srfi-45.scm: Add record type printer for promises.
  (promise-visit): New helper for visiting lazy promises.

11 years agoImplement efficient 'scm_unget_bytes' and 'unget-bytevector'.
Mark H Weaver [Sat, 6 Apr 2013 05:42:45 +0000 (01:42 -0400)]
Implement efficient 'scm_unget_bytes' and 'unget-bytevector'.

* libguile/ports.c (scm_i_unget_bytes): New static function.
  (scm_unget_bytes): New API function.
  (scm_unget_byte): Rewrite to simply call 'scm_i_unget_bytes'.
  (scm_ungetc, scm_peek_char, looking_at_bytes): Use 'scm_i_unget_bytes'.

* libguile/ports.h: Add prototype for 'scm_unget_bytes'.

* libguile/fports.c (scm_setvbuf): Use 'scm_unget_bytes'.

* libguile/r6rs-ports.c (scm_unget_bytevector): New procedure.

* module/ice-9/binary-ports.scm (unget-bytevector): New export.

* doc/ref/api-io.texi (R6RS Binary Input): Add documentation.
  (R6RS I/O Ports): Update brief description of (ice-9 binary-ports) to
  reflect the new reality: it is no longer a subset of (rnrs io ports).

* test-suite/tests/ports.test ("unget-bytevector"): Add test.

11 years agoRemove byte-order mark check from 'scm_i_scan_for_encoding'.
Mark H Weaver [Fri, 5 Apr 2013 21:33:03 +0000 (17:33 -0400)]
Remove byte-order mark check from 'scm_i_scan_for_encoding'.

* libguile/read.c (scm_i_scan_for_encoding): Remove byte-order mark
  check.

11 years agoDo not scan for coding declarations in open-file.
Mark H Weaver [Wed, 30 Jan 2013 19:45:28 +0000 (14:45 -0500)]
Do not scan for coding declarations in open-file.

* libguile/fports.c (scm_open_file): Do not scan for coding
  declarations.  Replace 'use_encoding' local variable with
  'binary'.  Update documentation string.

* module/ice-9/psyntax.scm (include): Add the same file-encoding
  logic that's used in compile-file and scm_primitive_load.

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

* doc/ref/api-io.texi (File Ports): Update docs.

* test-suite/tests/ports.test: Change "open-file HONORS file coding
  declarations" test to "open-file IGNORES file coding declaration".

* test-suite/tests/coding.test (scan-coding): Use 'file-encoding' to
  scan for the encoding, since 'open-input-file' no longer does so.

11 years agodoc: Link exceptions and escape continuations.
Ludovic Courtès [Sun, 7 Apr 2013 09:51:26 +0000 (11:51 +0200)]
doc: Link exceptions and escape continuations.

* doc/ref/api-control.texi (Prompt Primitives): Mention exceptions.
  (Exception Terminology): Link to `call/ec'.

11 years agodoc: Warn against misuses of `file-name-separator-string'.
Ludovic Courtès [Sun, 7 Apr 2013 09:49:52 +0000 (11:49 +0200)]
doc: Warn against misuses of `file-name-separator-string'.

* doc/ref/posix.texi (File System): Warn against misuses of
  `file-name-separator-string'.

11 years agoDon't use scm_generalized_vector_get_handle() in array-map.c
Daniel Llorens [Sat, 6 Apr 2013 22:04:35 +0000 (00:04 +0200)]
Don't use scm_generalized_vector_get_handle() in array-map.c

* libguile/array-map.c: (rafill, racp, ramap, rafe): use
  scm_array_get_handle() instead of scm_generalized_get_vector_handle().

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
11 years agoFix the recommendations for conversion of C string constants.
Mark H Weaver [Sat, 6 Apr 2013 22:29:15 +0000 (18:29 -0400)]
Fix the recommendations for conversion of C string constants.

* doc/ref/api-data.texi (Conversion to/from C, Symbol Primitives,
  Keyword Procedures): Fix the recommendations for conversion of C
  string constants.  The encoding of the source code is irrelevant in
  modern compilers.  What is relevant is the execution character set.
  Both GCC and clang use UTF-8 by default, so recommend the
  'scm_from_utf8_*' functions when the argument is a C string constant.

  Also fix the broken texinfo markup for 'scm_from_*_symbol' that
  prevented them from being listed in the index.

11 years agoFix indentation in test-scm-c-bind-keyword-arguments.c.
Mark H Weaver [Sat, 6 Apr 2013 22:13:04 +0000 (18:13 -0400)]
Fix indentation in test-scm-c-bind-keyword-arguments.c.

* test-suite/standalone/test-scm-c-bind-keyword-arguments.c
  (test_invalid_keyword): Fix indentation.

11 years agoImplement 'scm_c_bind_keyword_arguments'.
Mark H Weaver [Sat, 6 Apr 2013 17:36:24 +0000 (13:36 -0400)]
Implement 'scm_c_bind_keyword_arguments'.

* libguile/keywords.c (scm_keyword_argument_error): New variable.
  (scm_c_bind_keyword_arguments): New API function.

* libguile/keywords.h (enum scm_keyword_arguments_flags): New enum.
  (scm_t_keyword_arguments_flags): New typedef.
  (scm_c_bind_keyword_arguments): New prototype.

* doc/ref/api-data.texi (Coding With Keywords, Keyword Procedures): Add
  documentation.

* test-suite/standalone/test-scm-c-bind-keyword-arguments.c: New file.

* test-suite/standalone/Makefile.am: Add
  test-scm-c-bind-keyword-arguments test.