1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

12591 commits

Author SHA1 Message Date
Ludovic Courtès
0ecd70a271 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'.
2010-03-31 00:42:01 +02:00
Ludovic Courtès
bd7131d3ad Add rudimentary ECMAScript tests.
* test-suite/Makefile.am (SCM_TESTS): Add `tests/ecmascript.test'.

* test-suite/tests/ecmascript.test: New file.
2010-03-31 00:42:01 +02:00
Ludovic Courtès
2115b8eb40 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.
2010-03-31 00:42:00 +02:00
Ludovic Courtès
1b10152215 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.
2010-03-31 00:41:59 +02:00
Andy Wingo
3ffd1ba96e 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.
2010-03-31 00:05:01 +02:00
Andy Wingo
d26383f427 Revert "fix equal? between an array and a non-array"
This reverts commit 9d031d4d57.
2010-03-30 23:51:40 +02:00
Andy Wingo
9d031d4d57 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.
2010-03-30 21:23:06 +02:00
Andy Wingo
6128f34c4b 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.
2010-03-30 10:53:05 +02:00
Andy Wingo
2533f10b40 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.
2010-03-30 10:31:27 +02:00
Andy Wingo
d38b431ace 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.
2010-03-30 10:31:27 +02:00
Andy Wingo
655aadf4b0 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.
2010-03-30 10:28:51 +02:00
Andy Wingo
0eedfa5cab 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.
2010-03-29 22:02:42 +02:00
Andy Wingo
4e974a1a6d remove out-of-date comment in scm_gc_malloc
* libguile/gc-malloc.c (scm_gc_malloc): Remove out-of-date comment.
2010-03-29 21:51:07 +02:00
Andy Wingo
4f08d0b50f (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.
2010-03-29 18:12:37 +02:00
Andy Wingo
a5e95abe9b 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.
2010-03-29 18:01:34 +02:00
Mark H Weaver
f60c2c4e10 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
2010-03-28 14:34:19 +02:00
Andy Wingo
98dcf051e0 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.
2010-03-28 14:31:57 +02:00
Andy Wingo
83a7b43bf2 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.
2010-03-26 13:22:10 +01:00
Andy Wingo
1f51e2757c 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.
2010-03-25 14:19:25 +01:00
Andy Wingo
3785c5b276 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.
2010-03-25 14:15:16 +01:00
Andy Wingo
dca9a4d685 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*.
2010-03-23 00:18:48 +01:00
Andy Wingo
1ea8aa7d8e 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.
2010-03-22 22:13:35 +01:00
Ludovic Courtès
df0f529585 Make `include' tail-recursive.
* module/ice-9/psyntax.scm (include)[read-file]: Make tail-recursive.

* module/ice-9/psyntax-pp.scm: Regenerate.
2010-03-20 17:03:54 +01:00
Ludovic Courtès
165a8643ae 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.
2010-03-20 17:00:38 +01:00
Ludovic Courtès
a2c6904911 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'.
2010-03-20 16:45:14 +01:00
Andy Wingo
7f10a113c5 fix srfi-31 check after macroexpand rename
* test-suite/tests/srfi-31.test: ("rec special form"): Fix check.
2010-03-19 17:05:46 +01:00
Andy Wingo
8a73a6d294 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.
2010-03-19 15:22:27 +01:00
Andy Wingo
6ffd4131ff finish macro docs
* doc/ref/api-macros.texi: Finish macro docs.
2010-03-19 13:16:57 +01:00
Andy Wingo
1fc8dcc7ac document syntax-case
* doc/ref/api-macros.texi: Document syntax-case, and tweak defmacro
  docs.

* doc/ref/api-debug.texi: Move cons-source here.
2010-03-19 12:30:38 +01:00
Andy Wingo
a6e60a9571 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.
2010-03-19 12:30:38 +01:00
Ludovic Courtès
fbda9ef1b2 Bump version number for 1.9.9.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
2010-03-18 23:48:49 +01:00
Ludovic Courtès
d6ed9b92c5 Update `NEWS'. 2010-03-18 23:48:12 +01:00
Andy Wingo
e4955559c6 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.
2010-03-18 23:39:44 +01:00
Ludovic Courtès
ef7e4ba373 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.
2010-03-18 20:41:03 +01:00
Ludovic Courtès
f4c79b3c08 Update Gnulib; use the `func' module.
Update Gnulib to v0.0-3575-g128e4b8.

* m4/gnulib-cache.m4: Add `func'.
2010-03-18 20:41:01 +01:00
Ludovic Courtès
54eb59cf49 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.
2010-03-18 00:28:14 +01:00
Ludovic Courtès
5595bd7641 Remove obsolete test directory.
* test-suite/tests/c-api: Remove.
2010-03-17 00:54:01 +01:00
Ludovic Courtès
d12f974b43 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'.
2010-03-17 00:54:01 +01:00
Ludovic Courtès
dd1464bf38 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.
2010-03-17 00:54:01 +01:00
Ludovic Courtès
3023e7b0c9 Fix doc string of `dynamic-pointer'.
* libguile/dynl.c (scm_dynamic_pointer): Fix doc string.  Reformat body.
2010-03-17 00:54:00 +01:00
Ludovic Courtès
087aa6aa31 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.
2010-03-17 00:54:00 +01:00
Andy Wingo
b0abbaa74a update NEWS for 1.9.9
* NEWS: Update.
2010-03-16 23:58:34 +01:00
Andy Wingo
71fada0b6d cull 1.9.8 NEWS items
* NEWS: Remove 1.9.8 items; they have been folded in already.
2010-03-16 22:56:37 +01:00
Andy Wingo
17ed90df48 add a section to the manual on prompts
* doc/ref/api-control.texi (Prompts): Add a section on prompts.
2010-03-16 22:47:35 +01:00
Andy Wingo
718815d761 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.
2010-03-16 21:44:34 +01:00
Andy Wingo
44602b0868 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.
2010-03-16 21:20:34 +01:00
Andy Wingo
89607fab50 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.
2010-03-16 21:20:29 +01:00
Andy Wingo
462bcfd038 Bump GUILE_EFFECTIVE_VERSION to 2.0
* GUILE-VERSION (GUILE_EFFECTIVE_VERSION): Bump to 2.0.
2010-03-16 20:27:47 +01:00
Andy Wingo
dbf499823f 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.
2010-03-16 20:27:10 +01:00
Andy Wingo
f7cea64566 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.
2010-03-16 15:55:24 +01:00