bpt/guile.git
14 years agomore nil docs
Andy Wingo [Fri, 16 Apr 2010 07:38:29 +0000 (09:38 +0200)]
more nil docs

* doc/ref/api-languages.texi (Nil): Be a bit more thorough, and
  positive.

14 years agoadd docs on `nil'
Andy Wingo [Thu, 15 Apr 2010 22:00:39 +0000 (00:00 +0200)]
add docs on `nil'

* doc/ref/api-languages.texi (Nil): Write about `nil'.

14 years agofix bugs in ice-9 i18n demo (invalid input)
Andy Wingo [Thu, 15 Apr 2010 21:24:26 +0000 (23:24 +0200)]
fix bugs in ice-9 i18n demo (invalid input)

* doc/ref/api-i18n.texi (Accessing Locale Information): Crucial
  bugfixes.

14 years agofixes to api-i18n.texi
Andy Wingo [Thu, 15 Apr 2010 21:10:25 +0000 (23:10 +0200)]
fixes to api-i18n.texi

* doc/ref/api-i18n.texi (Character Case Mapping): Remove note about lack
  of support for multibute characters.

14 years agoflesh out docs on multiple languages a bit more
Andy Wingo [Thu, 15 Apr 2010 21:09:29 +0000 (23:09 +0200)]
flesh out docs on multiple languages a bit more

* doc/ref/api-languages.texi: Move here from api-translation. Still
  stubbed in parts, but it's getting better.
* doc/ref/Makefile.am: Adapt to api-languages.texi name change.
* doc/ref/guile.texi: Likewise.

14 years agoBump version number for 1.9.10.
Ludovic Courtès [Thu, 15 Apr 2010 20:21:40 +0000 (22:21 +0200)]
Bump version number for 1.9.10.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

14 years agoelisp.test cleanups
Andy Wingo [Fri, 9 Apr 2010 20:33:46 +0000 (22:33 +0200)]
elisp.test cleanups

* test-suite/tests/elisp.test: Use quote and #nil instead of quasiquote
  and ,#nil.

14 years agore-enable elisp test
Andy Wingo [Fri, 9 Apr 2010 12:43:49 +0000 (14:43 +0200)]
re-enable elisp test

* test-suite/tests/elisp.test: Rework for #nil, to actually be enabled,
  to always run, and to use the new compiler. Comment out some failing tests, to
  be dealt with in the future.

14 years agochange remaining %nil -> #nil
Andy Wingo [Fri, 9 Apr 2010 12:44:28 +0000 (14:44 +0200)]
change remaining %nil -> #nil

* doc/ref/vm.texi:
* libguile/boolean.h:
* libguile/pairs.h:
* module/language/elisp/README:
* test-suite/tests/elisp-compiler.test:
* test-suite/tests/load.test: Change remaining mentions of %nil to #nil.

14 years agoelisp fixes for nil, and, or
Andy Wingo [Fri, 9 Apr 2010 19:04:52 +0000 (21:04 +0200)]
elisp fixes for nil, and, or

* module/language/elisp/runtime/macro-slot.scm (or, and): Fix one-arg
  case to return the arg as-is.

* module/language/elisp/runtime.scm (nil-value): Fix to be #nil.

14 years agoremove libguile/lang.h, deprecate %nil (in favor of #nil)
Andy Wingo [Fri, 9 Apr 2010 12:26:31 +0000 (14:26 +0200)]
remove libguile/lang.h, deprecate %nil (in favor of #nil)

* libguile/Makefile.am:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h: Remove lang.c and lang.h.

* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.

* module/ice-9/deprecated.scm (%nil): %nil definition moved here.

* libguile/alist.c:
* libguile/async.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/list.c:
* libguile/load.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/promises.c:
* libguile/sort.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weaks.c:
* srfi/srfi-1.c: <libguile/lang.h> references removed.

14 years ago%nil -> #nil
Andy Wingo [Fri, 9 Apr 2010 12:17:04 +0000 (14:17 +0200)]
%nil -> #nil

* module/language/assembly.scm (object->assembly, assembly->object):
* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/language/glil/decompile-assembly.scm (decompile-load-program):
  Change instances of %nil to #nil.

14 years agoadd read syntax for #nil
Andy Wingo [Fri, 9 Apr 2010 12:15:16 +0000 (14:15 +0200)]
add read syntax for #nil

* libguile/evalext.c (scm_self_evaluating_p): #nil is self-evaluating.

* libguile/read.c (scm_read_nil, scm_read_sharp): Add read syntax for
  #nil.

14 years agolisp nil always enabled
Andy Wingo [Fri, 9 Apr 2010 12:03:02 +0000 (14:03 +0200)]
lisp nil always enabled

* configure.ac: Remove --disable-elisp option. Lisp nil is always
  enabled.

* libguile/boolean.h:
* libguile/gen-scmconfig.c:
* libguile/gen-scmconfig.h.in:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h:
* libguile/pairs.h:
* libguile/private-options.h:
* libguile/read.c: Remove conditionals for disabling elisp.

14 years agoadd debugging input and output ports
Andy Wingo [Fri, 9 Apr 2010 11:41:31 +0000 (13:41 +0200)]
add debugging input and output ports

* module/system/vm/debug.scm (*debug-input-port*):
  (*debug-output-port*): New public fluids.
  (run-debugger): Add some kwargs for input and output ports, defaulting
  to the debug input and output ports.
  (debug-pre-unwind-handler): Print to debug output port.
  (debug): Untabify.

14 years agorepl-reader only prompts if no input is available
Andy Wingo [Fri, 9 Apr 2010 11:33:20 +0000 (13:33 +0200)]
repl-reader only prompts if no input is available

* module/ice-9/boot-9.scm (repl-reader): For the default (non-readline)
  repl reader, only display the prompt if input isn't already available.
  Fixes spurious prompts in the debugger.

14 years agoRaise an error when attempting to modify the value of `%null-pointer'.
Ludovic Courtès [Thu, 8 Apr 2010 22:30:10 +0000 (00:30 +0200)]
Raise an error when attempting to modify the value of `%null-pointer'.

* libguile/foreign.c (sym_null_pointer_error): New variable.
  (null_pointer_error): New function.
  (scm_foreign_set_x): Raise an error if attempting to modify
  NULL_POINTER.
  (scm_foreign_to_bytevector): Use `null_pointer_error ()' instead of
  `scm_misc_error ()'.

* test-suite/tests/foreign.test: New file.

* test-suite/Makefile.am (SCM_TESTS): Add tests/foreign.test.

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

14 years agoAllocate foreign pointer objects in GC-scanned memory.
Ludovic Courtès [Thu, 8 Apr 2010 22:14:34 +0000 (00:14 +0200)]
Allocate foreign pointer objects in GC-scanned memory.

* libguile/foreign.c (scm_take_foreign_pointer): Allocate RET in
  GC-scanned memory.  This fixes a bug where the object pointed to by
  SCM_CIF in the pair returned by `cif_to_procedure ()' would be
  reclaimed (as a consequence of commit
  087aa6aa312a8d0af51fa9b2f7bfc1332ad97338).

14 years agoAvoid obsolescent C declarator with empty parentheses.
Ludovic Courtès [Thu, 8 Apr 2010 22:01:38 +0000 (00:01 +0200)]
Avoid obsolescent C declarator with empty parentheses.

* libguile/foreign.c (scm_i_foreign_call): Don't declare FUNC with a
  declarator with empty parentheses (bug #23681).

14 years agoFix `module-reverse-lookup'.
Ludovic Courtès [Thu, 8 Apr 2010 17:17:25 +0000 (19:17 +0200)]
Fix `module-reverse-lookup'.

* libguile/modules.c (scm_module_reverse_lookup): Type-check VARIABLE.
  Don't traverse the `uses' list when MODULE is #f.

* test-suite/tests/modules.test ("foundations")["module-reverse-lookup
  [pre-module-obarray]", "module-reverse-lookup [wrong-type-arg]"]: New
  tests.

14 years agoRemove `fold' from (sxml fold).
Ludovic Courtès [Thu, 8 Apr 2010 21:55:41 +0000 (23:55 +0200)]
Remove `fold' from (sxml fold).

* module/sxml/fold.scm: Use (srfi srfi-1).
  (fold): Remove.
  (fold-values): Update docstring accordingly.

* test-suite/tests/sxml.fold.test: Use (srfi srfi-1).

14 years agofix curried definitions for value defines
Andy Wingo [Thu, 8 Apr 2010 19:01:52 +0000 (21:01 +0200)]
fix curried definitions for value defines

* module/ice-9/curried-definitions.scm: Allow definitions of values with
  define and define*.
* test-suite/tests/curried-definitions.test: Add tests.

14 years agosync regs before calling scm_class_of
Andy Wingo [Thu, 8 Apr 2010 08:56:14 +0000 (10:56 +0200)]
sync regs before calling scm_class_of

* libguile/vm-i-scheme.c (class-of): Sync registers before calling
  scm_class_of.

14 years agoadd (ice-9 curried definitions)
Andy Wingo [Wed, 7 Apr 2010 22:36:53 +0000 (00:36 +0200)]
add (ice-9 curried definitions)

* module/Makefile.am:
* module/ice-9/curried-definitions.scm: New module, implementing
  SICM-style currying.

* test-suite/Makefile.am:
* test-suite/tests/curried-definitions.test: A test.

14 years agofix bug when importing bindings that were already imported and used
Andy Wingo [Wed, 7 Apr 2010 22:29:52 +0000 (00:29 +0200)]
fix bug when importing bindings that were already imported and used

* module/ice-9/boot-9.scm (module-use!, module-use-interfaces!): When
  adding the module or interface to the use list, clear the cached
  imports obarray.

  The test case is coming next.

14 years agoupdate licenses on tests imported from guile-lib
Andy Wingo [Wed, 7 Apr 2010 19:37:50 +0000 (21:37 +0200)]
update licenses on tests imported from guile-lib

* test-suite/tests/sxml.fold.test:
* test-suite/tests/sxml.ssax.test:
* test-suite/tests/sxml.transform.test:
* test-suite/tests/sxml.xpath.test:
* test-suite/tests/texinfo.docbook.test:
* test-suite/tests/texinfo.serialize.test:
* test-suite/tests/texinfo.string-utils.test:
* test-suite/tests/texinfo.test: Update licenses to GPL or LGPL 3+, and
  update copyright holders to be FSF (where that is the case). Copyright
  holders who are not FSF have their code in GPL/LGPL-compatible
  licesnse.

14 years agoadd docs and tests for array->list
Andy Wingo [Wed, 7 Apr 2010 19:04:37 +0000 (21:04 +0200)]
add docs and tests for array->list

* libguile/generalized-arrays.c (scm_array_to_list): Add docs.
* test-suite/tests/arrays.test ("array->list"): Add tests.

14 years agoupdate NEWS for 1.9.10
Andy Wingo [Tue, 6 Apr 2010 22:26:48 +0000 (00:26 +0200)]
update NEWS for 1.9.10

* NEWS: Update for new 1.9.10 entries.

14 years agovery important fix to (system repl command)
Andy Wingo [Tue, 6 Apr 2010 22:09:53 +0000 (00:09 +0200)]
very important fix to (system repl command)

* module/system/repl/command.scm (language): s/Have fun/Happy hacking/.
  Heh.

14 years agodeprecated sc-expand in deprecated (ice-9 syncase)
Andy Wingo [Tue, 6 Apr 2010 22:05:34 +0000 (00:05 +0200)]
deprecated sc-expand in deprecated (ice-9 syncase)

* module/ice-9/syncase.scm: Export sc-expand as macroexpand.

14 years agoUpdate NEWS to reflect the current state
Andy Wingo [Tue, 6 Apr 2010 22:01:35 +0000 (00:01 +0200)]
Update NEWS to reflect the current state

* NEWS: Update a number of old entries.

14 years agoremove transient 1.9.9 entries from the NEWS
Andy Wingo [Tue, 6 Apr 2010 21:58:51 +0000 (23:58 +0200)]
remove transient 1.9.9 entries from the NEWS

* NEWS: Cull 1.9.9 entries.

14 years agofinish ffi docs
Andy Wingo [Tue, 6 Apr 2010 21:17:10 +0000 (23:17 +0200)]
finish ffi docs

* libguile/foreign.c: Some doc tweaks.
* doc/ref/api-foreign.texi: Finish FFI docs.

14 years agomore ffi docs
Andy Wingo [Mon, 5 Apr 2010 22:45:35 +0000 (00:45 +0200)]
more ffi docs

* libguile/foreign.c (scm_make_foreign_function): Doc a little.
* doc/ref/api-foreign.texi (Foreign Function Interface): Document some
  more.

14 years agocopyright dates
Michael Gran [Sat, 3 Apr 2010 13:46:23 +0000 (06:46 -0700)]
copyright dates

* libguile/unidata_to_charset.pl: change copyright date
* test-suite/tests/srfi-14.test: change copyright date

14 years agoRemove obsolete docs for multi-byte text
Michael Gran [Sat, 3 Apr 2010 05:25:30 +0000 (22:25 -0700)]
Remove obsolete docs for multi-byte text

These describe the initial, unimplemented plan for Unicode
support.  These have been overcome by events.

* doc/mbapi.texi: removed
* doc/mltext.texi: removed

14 years agoUpdate standard character sets to Unicode 5.2
Michael Gran [Sat, 3 Apr 2010 04:12:55 +0000 (21:12 -0700)]
Update standard character sets to Unicode 5.2

* srfi-14.i.c: all character ranges updated to Unicode 5.2

14 years agoUnicode data parsing script incorrect for char-set:ascii
Michael Gran [Sat, 3 Apr 2010 04:08:42 +0000 (21:08 -0700)]
Unicode data parsing script incorrect for char-set:ascii

char-set:ascii is the only char-set consisting of a single contiguous
range, and there was an off-by-one error for that case.

* libguile/unidata_to_charset.pl (compute): fix off-by-one

14 years agodeprecate dynamic-args-call, and update docs some more
Andy Wingo [Thu, 1 Apr 2010 22:34:49 +0000 (00:34 +0200)]
deprecate dynamic-args-call, and update docs some more

* libguile/deprecated.h (scm_dynamic_args_call): Deprecate.
* libguile/deprecated.c:
* libguile/dynl.h:
* libguile/dynl.c:

* doc/ref/api-foreign.texi: More doc updates.

14 years agoadd api-foreign.texi
Andy Wingo [Thu, 1 Apr 2010 22:23:24 +0000 (00:23 +0200)]
add api-foreign.texi

* doc/ref/api-foreign.texi: New file.
* doc/ref/api-modules.texi: Reorganize bits about dynamic linking into
  api-foreign.

* doc/ref/guile.texi:
* doc/ref/Makefile.am: Adapt to api-foreign.texi.

14 years agofix vector-ref and vector-set opcodes for weak vectors
Andy Wingo [Thu, 1 Apr 2010 07:05:59 +0000 (09:05 +0200)]
fix vector-ref and vector-set opcodes for weak vectors

* libguile/vectors.h (SCM_I_IS_NONWEAK_VECTOR): New internal predicate.
* libguile/vm-i-scheme.c (vector-ref, vector-set): Only inline access to
  nonweak vectors.

14 years agomore fixes to equal? for arrays
Andy Wingo [Wed, 31 Mar 2010 22:18:44 +0000 (00:18 +0200)]
more fixes to equal? for arrays

* libguile/array-map.c (array_compare, scm_array_equal_p): Rewrite as
  something that operates on the generic array handle infrastructure.
  Based on array->list.
  (scm_i_array_equal_p): Change the docs, as array-equal? is now the same
  as equal?, except that it typechecks its args.

* doc/ref/api-compound.texi (Array Procedures): Update array-equal?
  docs.

* libguile/deprecated.h:
* libguile/deprecated.c (scm_raequal): Deprecate.

* libguile/bytevectors.c (scm_bytevector_eq_p): Bugfix: bytevectors are
  bytevector=? only if their element type is the same.

* libguile/eq.c (scm_equal_p): Only dispatch to scm_array_equal_p if
  both args are arrays (generically).

* test-suite/tests/arrays.test ("equal?"): Add some more tests.

14 years agofix array bugs in ecmascript
Andy Wingo [Wed, 31 Mar 2010 20:31:11 +0000 (22:31 +0200)]
fix array bugs in ecmascript

* module/language/ecmascript/array.scm (pput, *array-prototype*): Fix
  bugs in ecmascript array runtime.

14 years agofix bug in ash opcode
Andy Wingo [Wed, 31 Mar 2010 20:29:29 +0000 (22:29 +0200)]
fix bug in ash opcode

* libguile/vm-i-scheme.c (ash): Fix embarrassing bug in (ash 1 32).
* test-suite/tests/bit-operations.test ("bitshifts on word boundaries"):
  Add tests.

14 years agorename unif.test to arrays.test
Andy Wingo [Wed, 31 Mar 2010 19:16:54 +0000 (21:16 +0200)]
rename unif.test to arrays.test

* test-suite/tests/arrays.test: Move all unif.test here. Unif.test was
  mostly testing arrays anyway. Incorporate the existing arrays.test.

* test-suite/tests/unif.test: Deleted.
* test-suite/Makefile.am: Update.

14 years agoMove another GOOPS-less test at the beginning.
Ludovic Courtès [Wed, 31 Mar 2010 12:54:43 +0000 (14:54 +0200)]
Move another GOOPS-less test at the beginning.

* test-suite/tests/eval.test ("promises")["extended promise
  behaviour"]("implicit forcing is not supported"): Move...
* test-suite/tests/00-initial-env.test ("goopsless"): ... here.

14 years agoAdd separate test file for GOOPS-less tests.
Ludovic Courtès [Wed, 31 Mar 2010 09:38:02 +0000 (11:38 +0200)]
Add separate test file for GOOPS-less tests.

* test-suite/tests/00-initial-env.test: New file.

* test-suite/Makefile.am (SCM_TESTS): Add `tests/00-initial-env.test'.

* test-suite/tests/numbers.test ("+")["wrong type argument"]: Move to
  `00-initial-env.test'.

14 years agoAdapt ECMAScript parser and lexer to `(system base lalr)'.
Ludovic Courtès [Fri, 19 Mar 2010 23:08:36 +0000 (00:08 +0100)]
Adapt ECMAScript parser and lexer to `(system base lalr)'.

* module/language/ecmascript/tokenize.scm: Use `make-lexical-token' and
  related procedures instead of pairs as tokens passed to the parser.
  Pass source location information in the form of `source-location'
  objects.

* module/language/ecmascript/parse.scm (read-ecmascript,
  read-ecmascript/1): Instantiate a new parser at each call.
  (parse-ecmascript): Rename to...
  (make-parser): ... this.  Change `->' to `:' in the grammar syntax.

* module/language/ecmascript/parse-lalr.scm: Remove.

* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Remove
  `language/ecmascript/parse-lalr.scm'.

14 years agoAdd rudimentary ECMAScript tests.
Ludovic Courtès [Tue, 30 Mar 2010 22:09:40 +0000 (00:09 +0200)]
Add rudimentary ECMAScript tests.

* test-suite/Makefile.am (SCM_TESTS): Add `tests/ecmascript.test'.

* test-suite/tests/ecmascript.test: New file.

14 years agoMention `(system base lalr)' in the manual.
Ludovic Courtès [Mon, 29 Mar 2010 23:11:09 +0000 (01:11 +0200)]
Mention `(system base lalr)' in the manual.

* doc/ref/Makefile.am (guile_TEXINFOS): Add `api-lalr.texi'.

* doc/ref/api-lalr.texi: New file.

* doc/ref/guile.texi (API Reference): Include it.

14 years agoAdd Boucher's `lalr-scm' as the `(system base lalr)' module.
Ludovic Courtès [Tue, 30 Mar 2010 22:41:28 +0000 (00:41 +0200)]
Add Boucher's `lalr-scm' as the `(system base lalr)' module.

Taken from r51 of <http://lalr-scm.googlecode.com/svn/trunk>.

* module/Makefile.am (SYSTEM_BASE_SOURCES): Add `system/base/lalr.scm'.
  (NOCOMP_SOURCES): Add `system/base/lalr.upstream.scm'.

* module/system/base/lalr.scm, module/system/base/lalr.upstream.scm: New
  files.

* test-suite/Makefile.am (LALR_TESTS, LALR_EXTRA, TESTS,
  TESTS_ENVIRONMENT): New variables.
  (EXTRA_DIST): Add $(LALR_EXTRA).

* test-suite/lalr/common-test.scm,
  test-suite/lalr/glr-test.scm,
  test-suite/lalr/test-glr-associativity.scm,
  test-suite/lalr/test-glr-basics-01.scm,
  test-suite/lalr/test-glr-basics-02.scm,
  test-suite/lalr/test-glr-basics-03.scm,
  test-suite/lalr/test-glr-basics-04.scm,
  test-suite/lalr/test-glr-basics-05.scm,
  test-suite/lalr/test-glr-script-expression.scm,
  test-suite/lalr/test-glr-single-expressions.scm,
  test-suite/lalr/test-lr-associativity-01.scm,
  test-suite/lalr/test-lr-associativity-02.scm,
  test-suite/lalr/test-lr-associativity-03.scm,
  test-suite/lalr/test-lr-associativity-04.scm,
  test-suite/lalr/test-lr-basics-01.scm,
  test-suite/lalr/test-lr-basics-02.scm,
  test-suite/lalr/test-lr-basics-03.scm,
  test-suite/lalr/test-lr-basics-04.scm,
  test-suite/lalr/test-lr-basics-05.scm,
  test-suite/lalr/test-lr-error-recovery-01.scm,
  test-suite/lalr/test-lr-error-recovery-02.scm,
  test-suite/lalr/test-lr-no-clause.scm,
  test-suite/lalr/test-lr-script-expression.scm,
  test-suite/lalr/test-lr-single-expressions.scm: New files.

14 years agofix equal? between an array and a non-array
Andy Wingo [Tue, 30 Mar 2010 22:05:01 +0000 (00:05 +0200)]
fix equal? between an array and a non-array

OK let's try again. While the thanks go to Daniel Llorens del Río for
the tip, the blame continues going to me :)

* test-suite/Makefile.am:
* test-suite/tests/arrays.test: Add a test.

* libguile/array-map.c (raeql): Handle a few 0-dimensional cases. If the
  shapes of the arrays don't match, just return #f instead of raising
  an error.

14 years agoRevert "fix equal? between an array and a non-array"
Andy Wingo [Tue, 30 Mar 2010 21:51:40 +0000 (23:51 +0200)]
Revert "fix equal? between an array and a non-array"

This reverts commit 9d031d4d575ac8f343a5d984cb02cd374577c5a9.

14 years agofix equal? between an array and a non-array
Andy Wingo [Tue, 30 Mar 2010 19:23:06 +0000 (21:23 +0200)]
fix equal? between an array and a non-array

* libguile/eq.c (scm_equal_p): Only call scm_array_equal_p if both
  arguments are generalized arrays; otherwise they are not equal. Thanks
  to Daniel Llorens del Río for the tip.

* test-suite/Makefile.am:
* test-suite/tests/arrays.test: Add a test.

14 years agocorrectly handle --no-autocompile (fixed broken previous patch)
Andy Wingo [Tue, 30 Mar 2010 08:53:05 +0000 (10:53 +0200)]
correctly handle --no-autocompile (fixed broken previous patch)

* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
  to false.

* libguile/init.c (scm_i_init_guile):
* libguile/load.h:
* libguile/load.c (scm_init_load_should_autocompile): At the end of
  init, check GUILE_AUTO_COMPILE.

* libguile/script.c (scm_compile_shell_switches): Instead of making
  --autocompile / --no-autocompile render into the s-expression, just
  handle them immediately, so that --no-autocompile takes effect for the
  expander.

14 years agonil is null, whee
Andy Wingo [Tue, 23 Mar 2010 19:29:22 +0000 (20:29 +0100)]
nil is null, whee

* libguile/pairs.h (scm_is_null): Nil is also null.

* libguile/vm-i-scheme.c (not, not-not, null?, not-null?):
* libguile/vm-i-system.c (br-if-null, br-if-not-null): Remove some more
  nil special cases.

14 years agonil is false, whee
Andy Wingo [Tue, 23 Mar 2010 19:23:19 +0000 (20:23 +0100)]
nil is false, whee

* libguile/boolean.h (scm_is_false): Recognize nil as false, by default.
  (scm_is_bool): Recognize nil as a boolean.

* libguile/boolean.c (scm_not, scm_boolean, scm_to_bool, scm_is_bool):
  Adapt to treat nil as false.

* libguile/vm-i-system.c (br-if, br-if-not): Just use scm_is_false
  instead of specifically mentioning nil.

14 years agogoing through scm_shell not necessary to get autocompilation
Andy Wingo [Tue, 30 Mar 2010 08:28:51 +0000 (10:28 +0200)]
going through scm_shell not necessary to get autocompilation

* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
  from the environment variable here, so that apps that don't go through
  scm_shell get autocompilation.

* libguile/script.c (scm_compile_shell_switches): Explicitly enable or
  disable autocompilation here, if told to do so.

14 years agofix bug in scm_must_free
Andy Wingo [Mon, 29 Mar 2010 20:02:42 +0000 (22:02 +0200)]
fix bug in scm_must_free

* libguile/gc-malloc.c: Update a comment.
  (scm_must_free): Must be able to free memory allocated with
  scm_must_malloc, and thus must be GC_FREE, not free.

14 years agoremove out-of-date comment in scm_gc_malloc
Andy Wingo [Mon, 29 Mar 2010 19:51:07 +0000 (21:51 +0200)]
remove out-of-date comment in scm_gc_malloc

* libguile/gc-malloc.c (scm_gc_malloc): Remove out-of-date comment.

14 years ago(texinfo reflection) parses out macro metadata
Andy Wingo [Mon, 29 Mar 2010 16:06:54 +0000 (18:06 +0200)]
(texinfo reflection) parses out macro metadata

* module/texinfo/reflection.scm (macro-arguments):
  (macro-additional-stexi, object-stexi-documentation): Parse out the
  metadata in macros, if it is available, so we can show defmacros'
  arguments, syntax-rules' patterns, etc.

14 years agometadata for syntax-rules, identifier-syntax, and define-macro macros
Andy Wingo [Mon, 29 Mar 2010 16:01:34 +0000 (18:01 +0200)]
metadata for syntax-rules, identifier-syntax, and define-macro macros

* module/ice-9/psyntax.scm (syntax-rules, identifier-syntax):
* module/ice-9/boot-9.scm (define-macro): Embed metadata into the macro
  transformer for use by documentation tools and the like.

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

14 years agoRenumber IFLAGSs so the first 8 are reserved for lisp booleans.
Mark H Weaver [Sat, 27 Mar 2010 21:35:46 +0000 (17:35 -0400)]
Renumber IFLAGSs so the first 8 are reserved for lisp booleans.

This enables more efficient implementations of several operations,
e.g. scm_is_lisp_bool, canonicalize_boolean, fast_boolean_not,
converting SCM booleans to C booleans, etc.

* libguile/tags.h: Renumber IFLAGs.

* libguile/print.c: Renumber iflagnames to match.

* libguile/boolean.c:
* libguile/boolean.h:
  SCM_XXX_ANOTHER_BOOLEAN_DONT_USE --> SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0

14 years agoFix inlining of lambda-apply-lambda.
Andy Wingo [Sun, 28 Mar 2010 12:31:57 +0000 (14:31 +0200)]
Fix inlining of lambda-apply-lambda.

* module/language/tree-il/inline.scm (inline!): Only inline (lambda args
  (apply (lambda ...) args)) if the outer lambda has rest args. Thanks
  to Mark Weaver for the note.

14 years agoremove spurious declarations in c-tokenize.lex
Andy Wingo [Fri, 26 Mar 2010 12:20:00 +0000 (13:20 +0100)]
remove spurious declarations in c-tokenize.lex

* libguile/c-tokenize.lex: Remove spurious declarations of flex-internal
  functions, as their prototypes are changing in upstream flex.

14 years agovectors of pairs in docstring position are metadata
Andy Wingo [Thu, 25 Mar 2010 13:19:25 +0000 (14:19 +0100)]
vectors of pairs in docstring position are metadata

* module/ice-9/psyntax.scm (chi-lambda-case, lambda): If we find a
  vector of pairs in the docstring position, interpret those pairs as
  additional metadata.

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

14 years agopsyntax supports multiple docstrings, merging lambda-case metadata
Andy Wingo [Thu, 25 Mar 2010 13:02:43 +0000 (14:02 +0100)]
psyntax supports multiple docstrings, merging lambda-case metadata

* module/ice-9/psyntax.scm (build-simple-lambda, build-case-lambda):
  Don't take a docstring, take a metadata alist. Don't bother annotating
  interpreted expressions with docstrings.
  (chi-simple-lambda): Take already-parsed metadata.
  (lambda): Parse out multiple docstrings as separate "documentation"
  entries in the "meta".
  (chi-lambda-case): Merge multiple "meta" entries among the various
  cases.
  (lambda*, case-lambda, case-lambda*): Receive "meta" clauses, not
  docstrings.

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

14 years agomake guile's welcome more gnu-conventional; also warranty and copying info
Andy Wingo [Mon, 22 Mar 2010 23:18:48 +0000 (00:18 +0100)]
make guile's welcome more gnu-conventional; also warranty and copying info

* module/system/repl/command.scm: Add support for ,show with topics
  "warranty", "copying", and "version".
  (language): Don't re-print the welcome; print sometime more terse.
* module/system/repl/common.scm (*version*, *warranty*, *copying*): New
  public globals.
  (repl-welcome): Display *version*.

14 years agoUpdate manual examples of how to link with Guile
Andy Wingo [Fri, 19 Mar 2010 16:48:08 +0000 (17:48 +0100)]
Update manual examples of how to link with Guile

* doc/ref/intro.texi (Linking Guile into Programs):
* doc/ref/libguile-linking.texi (A Sample Guile Main Program): Update
  examples of how to link with guile.

14 years agoMake `include' tail-recursive.
Ludovic Courtès [Fri, 19 Mar 2010 14:42:20 +0000 (15:42 +0100)]
Make `include' tail-recursive.

* module/ice-9/psyntax.scm (include)[read-file]: Make tail-recursive.

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

14 years agoCosmetic changes in `foreign.c'.
Ludovic Courtès [Sat, 20 Mar 2010 16:00:38 +0000 (17:00 +0100)]
Cosmetic changes in `foreign.c'.

* libguile/foreign.c (unpack, pack): Add `const' qualifier for `type'.
  Comment.  Indent.
  (scm_i_foreign_call): Add `const' qualifier for `argv'.  Punctuate
  comments.  Clarify argument unpacking loop.

14 years agoFix argument passing to foreign functions.
Ludovic Courtès [Sat, 20 Mar 2010 15:45:14 +0000 (16:45 +0100)]
Fix argument passing to foreign functions.

* libguile/foreign.c (scm_i_foreign_call): When allocating room for
  DATA, use the sum of all the argument sizes, not `cif->bytes'.

14 years agofix srfi-31 check after macroexpand rename
Andy Wingo [Fri, 19 Mar 2010 16:05:46 +0000 (17:05 +0100)]
fix srfi-31 check after macroexpand rename

* test-suite/tests/srfi-31.test: ("rec special form"): Fix check.

14 years agorename sc-expand to macroexpand
Andy Wingo [Fri, 19 Mar 2010 14:22:27 +0000 (15:22 +0100)]
rename sc-expand to macroexpand

* module/ice-9/boot-9.scm (macroexpand): Rename from sc-expand.
  (%pre-modules-transformer): Adapt to name change.
* module/ice-9/compile-psyntax.scm: Adapt to name change.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/psyntax.scm: Rename sc-expand to macroexpand.
* module/language/scheme/compile-tree-il.scm (compile-tree-il): Adapt to
  name change.

14 years agofinish macro docs
Andy Wingo [Fri, 19 Mar 2010 12:16:57 +0000 (13:16 +0100)]
finish macro docs

* doc/ref/api-macros.texi: Finish macro docs.

14 years agodocument syntax-case
Andy Wingo [Fri, 19 Mar 2010 11:30:31 +0000 (12:30 +0100)]
document syntax-case

* doc/ref/api-macros.texi: Document syntax-case, and tweak defmacro
  docs.

* doc/ref/api-debug.texi: Move cons-source here.

14 years agoadd GUILE-VERSION to CONFIG_STATUS_DEPENDENCIES
Andy Wingo [Fri, 19 Mar 2010 11:01:55 +0000 (12:01 +0100)]
add GUILE-VERSION to CONFIG_STATUS_DEPENDENCIES

* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add GUILE-VERSION, so that a
  change in GUILE-VERSION causes a reconfigure.

14 years agoBump version number for 1.9.9.
Ludovic Courtès [Thu, 18 Mar 2010 22:48:49 +0000 (23:48 +0100)]
Bump version number for 1.9.9.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

14 years agoUpdate `NEWS'.
Ludovic Courtès [Thu, 18 Mar 2010 22:48:12 +0000 (23:48 +0100)]
Update `NEWS'.

14 years agoA start at syntax-rules docs
Andy Wingo [Thu, 18 Mar 2010 22:39:33 +0000 (23:39 +0100)]
A start at syntax-rules docs

* doc/ref/api-macros.texi: New file, documenting macros. Removed some
  old cruft, and started documenting hygienic macros.

* doc/ref/api-procedures.texi: Moved macro things out of here.

* doc/ref/guile.texi: Separate macros from procedures.

* doc/ref/api-data.texi: Update some xrefs.

* doc/ref/Makefile.am: Add api-macros.texi.

14 years agoImprove encoding error reporting.
Ludovic Courtès [Thu, 18 Mar 2010 19:23:12 +0000 (20:23 +0100)]
Improve encoding error reporting.

* libguile/strings.c (scm_encoding_error): Change arguments to convey
  more information.  Raise the error with `scm_throw ()', passing all
  the information to the handler.
  (scm_from_stringn, scm_to_stringn): Update accordingly.

* test-suite/tests/ports.test ("string ports")["wrong encoding"]: Check
  the arguments passed to the `throw' handler.

* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
  Output")["put-bytevector with wrong-encoding string port"]: Likewise.

14 years agoUpdate Gnulib; use the `func' module.
Ludovic Courtès [Thu, 18 Mar 2010 19:34:01 +0000 (20:34 +0100)]
Update Gnulib; use the `func' module.

Update Gnulib to v0.0-3575-g128e4b8.

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

14 years agoAdd `%null-pointer' to `(system foreign)'.
Ludovic Courtès [Wed, 17 Mar 2010 23:27:38 +0000 (00:27 +0100)]
Add `%null-pointer' to `(system foreign)'.

* libguile/foreign.c (sym_null, null_pointer): New variables.
  (scm_foreign_to_bytevector): Raise an error when PTR is NULL.
  (scm_init_foreign): Define SYM_NULL.

* module/system/foreign.scm (%null-pointer): New exported binding.

14 years agoRemove obsolete test directory.
Ludovic Courtès [Tue, 16 Mar 2010 23:52:52 +0000 (00:52 +0100)]
Remove obsolete test directory.

* test-suite/tests/c-api: Remove.

14 years agoChange `dynamic-link' to return a global handle when the argument is omitted.
Ludovic Courtès [Tue, 16 Mar 2010 23:51:22 +0000 (00:51 +0100)]
Change `dynamic-link' to return a global handle when the argument is omitted.

* libguile/dynl.c (sysdep_dynl_link): Handle FNAME == NULL.
  (scm_dynamic_link): Make argument optional.  Adjust body accordingly.

* test-suite/standalone/test-ffi (global, strerror, strlen): New
  bindings.
  Add test for these bindings.

* doc/ref/api-modules.texi (Low level dynamic linking): Update
  description of `dynamic-link'.

14 years agoProvide `int', `long', `size_t', etc. in `(system foreign)'.
Ludovic Courtès [Tue, 16 Mar 2010 23:45:57 +0000 (00:45 +0100)]
Provide `int', `long', `size_t', etc. in `(system foreign)'.

* libguile/foreign.c (sym_int, sym_long, sym_unsigned_int,
  sym_unsigned_long, sym_size_t): New variables.
  (scm_init_foreign): Define them at the Scheme level.

* module/system/foreign.scm (int, unsigned-int, long,
  unsigned-long, size_t): New exported bindings.

14 years agoFix doc string of `dynamic-pointer'.
Ludovic Courtès [Tue, 16 Mar 2010 23:06:13 +0000 (00:06 +0100)]
Fix doc string of `dynamic-pointer'.

* libguile/dynl.c (scm_dynamic_pointer): Fix doc string.  Reformat body.

14 years agoUse GC-managed pointerless memory in the FFI.
Ludovic Courtès [Tue, 16 Mar 2010 22:51:21 +0000 (23:51 +0100)]
Use GC-managed pointerless memory in the FFI.

* libguile/foreign.c (scm_make_foreign_function): Use
  `scm_gc_malloc_pointerless ()' when allocating memory for CIF.
  (pack): Likewise for the `FFI_TYPE_STRUCT' case.

14 years agoupdate NEWS for 1.9.9
Andy Wingo [Tue, 16 Mar 2010 22:58:34 +0000 (23:58 +0100)]
update NEWS for 1.9.9

* NEWS: Update.

14 years agocull 1.9.8 NEWS items
Andy Wingo [Tue, 16 Mar 2010 21:56:37 +0000 (22:56 +0100)]
cull 1.9.8 NEWS items

* NEWS: Remove 1.9.8 items; they have been folded in already.

14 years agoadd a section to the manual on prompts
Andy Wingo [Tue, 16 Mar 2010 21:47:35 +0000 (22:47 +0100)]
add a section to the manual on prompts

* doc/ref/api-control.texi (Prompts): Add a section on prompts.

14 years agoparallel installability for libguile*.h
Andy Wingo [Tue, 16 Mar 2010 20:37:12 +0000 (21:37 +0100)]
parallel installability for libguile*.h

* Makefile.am:
* libguile/Makefile.am (modincludedir): Install into
  $pkgincludedir/$GUILE_EFFECTIVE_VERSION. This allows multiple Guile
  development packages to be installed at once.

* guile-readline/Makefile.am (modincludedir):
* srfi/Makefile.am (srfiincludedir): Likewise.

* meta/guile-2.0.pc.in (Cflags): Add the appropriate -I line so that
  user code picks up the new location transparently.

14 years agorename libguile to libguile-@EFFECTIVE_VERSION@, currently libguile-2.0
Andy Wingo [Tue, 16 Mar 2010 20:18:12 +0000 (21:18 +0100)]
rename libguile to libguile-@EFFECTIVE_VERSION@, currently libguile-2.0

* libguile/Makefile.am (lib_LTLIBRARIES): Instead of just "libguile.la",
  make "libguile-@EFFECTIVE_VERSION@.la". This allows multiple versions
  of Guile to be installed at once. See
  http://www106.pair.com/rhp/parallel.html for a rationale.

  (libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS): Fixup automake vars
  to include the effective version.
  (guile_LDADD): Fix up the spelling of libguile.

* libguile/bytevectors.c (scm_bootstrap_bytevectors):
* libguile/foreign.c (scm_register_foreign):
* libguile/i18n.c (scm_bootstrap_i18n):
* libguile/instructions.c (scm_bootstrap_instructions):
* libguile/objcodes.c (scm_bootstrap_objcodes):
* libguile/programs.c (scm_bootstrap_programs):
* libguile/vm.c (scm_bootstrap_vm): Register extensions using e.g.
  "libguile-2.0" as the libname -- i.e., including the effective version
  in the libname.

* module/ice-9/i18n.scm:
* module/rnrs/bytevector.scm:
* module/rnrs/io/ports.scm:
* module/system/foreign.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm: When doing a load-extension for something in
  Guile, use the effective version also.

* meta/guile-2.0-uninstalled.pc.in (Libs):
* meta/guile-2.0.pc.in (Libs): Use -lguile-@EFFECTIVE_VERSION@. This
  change should mean that code built against Guile should not be
  affected by the libguile rename.

* guile-readline/Makefile.am (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD):
* srfi/Makefile.am
  (libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_4_v_@LIBGUILE_SRFI_SRFI_4_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_13_14_v_@LIBGUILE_SRFI_SRFI_13_14_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_LIBADD):
* test-suite/standalone/Makefile.am (test_num2integral_LDADD):
  (test_round_LDADD):
  (libtest_asmobs_la_LIBADD):
  (libtest_ffi_la_LIBADD):
  (test_list_LDADD):
  (test_unwind_LDADD):
  (test_conversion_LDADD):
  (test_loose_ends_LDADD):
  (test_scm_c_read_LDADD):
  (test_scm_take_locale_symbol_LDADD):
  (test_scm_take_u8vector_LDADD):
  (libtest_extensions_la_LIBADD):
  (test_with_guile_module_LDADD):
  (test_scm_with_guile_LDADD): Fix up the spelling of libguile.la.

14 years agoversion.h has SCM_EFFECTIVE_VERSION; effective-version uses that
Andy Wingo [Tue, 16 Mar 2010 19:58:24 +0000 (20:58 +0100)]
version.h has SCM_EFFECTIVE_VERSION; effective-version uses that

* libguile/version.c (scm_effective_version): Use SCM_EFFECTIVE_VERSION.
* libguile/version.h.in (SCM_EFFECTIVE_VERSION): Define from
  GUILE_EFFECTIVE_VERSION.

* libguile/Makefile.am (version.h): Subst in GUILE_EFFECTIVE_VERSION.

* test-suite/tests/version.test ("version reporting works"): The
  effective version is not necessarily MAJOR.MINOR. Remove check.

14 years agoBump GUILE_EFFECTIVE_VERSION to 2.0
Andy Wingo [Tue, 16 Mar 2010 19:27:47 +0000 (20:27 +0100)]
Bump GUILE_EFFECTIVE_VERSION to 2.0

* GUILE-VERSION (GUILE_EFFECTIVE_VERSION): Bump to 2.0.

14 years agodecouple GUILE_VERSION from GUILE_EFFECTIVE_VERSION.
Andy Wingo [Tue, 16 Mar 2010 19:27:10 +0000 (20:27 +0100)]
decouple GUILE_VERSION from GUILE_EFFECTIVE_VERSION.

* GUILE-VERSION (GUILE_VERSION): Decouple from GUILE_EFFECTIVE_VERSION.
  This allows us to bumpt the effective version to 2.0 before reaching 2.0.

14 years agomore vm gc fixen
Andy Wingo [Tue, 16 Mar 2010 14:55:24 +0000 (15:55 +0100)]
more vm gc fixen

* libguile/vm-i-system.c (continuation_call): Sync before calling a
  continuation. Shouldn't much matter, but it seems like a good idea.
  (wind-fluids): More importantly, sync before allocating a with-fluids
  object.

14 years agoconfigure: Abort when GMP is not found.
Ludovic Courtès [Mon, 15 Mar 2010 16:54:45 +0000 (17:54 +0100)]
configure: Abort when GMP is not found.

* configure.ac: Fix erroneous `AC_LIB_HAVE_LINKFLAGS' invocation.  Above
  when $HAVE_LIBGMP is not "yes".

14 years agoMake sure the whole VM stack is always scanned by the GC.
Ludovic Courtès [Mon, 15 Mar 2010 14:39:43 +0000 (15:39 +0100)]
Make sure the whole VM stack is always scanned by the GC.

Thanks to Andy for noticing this.

* libguile/vm-engine.h (SYNC_REGISTER, CACHE_REGISTER): Add comment.

* libguile/vm-i-scheme.c (make_struct): Call `SYNC_REGISTER ()' in all
  cases since the GC is going to run.
  (struct_ref, struct_set): Call `SYNC_REGISTER ()' on the slow path.
  (BV_REF_WITH_ENDIANNESS, BV_FIXABLE_INT_REF, BV_INT_REF): Likewise.
  (BV_FLOAT_REF): Always `SYNC_REGISTER ()'.

14 years agodoc: Update "Multi-Threading" node.
Ludovic Courtès [Sun, 14 Mar 2010 22:37:00 +0000 (23:37 +0100)]
doc: Update "Multi-Threading" node.

* doc/ref/libguile-concepts.texi (Multi-Threading): Remove bits about
  the requirement not to block in guile mode.