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

1731 commits

Author SHA1 Message Date
Andy Wingo
a6bd32406d add fluid->parameter
* module/ice-9/boot-9.scm (make-parameter): Add a docstring.
  (fluid->parameter): New interface.  Use it when turning port fluids
  into parameters.

* doc/ref/api-scheduling.texi (Parameters): Deffn instead of defun for
  make-parameter documentation.  Add docs for fluid->parameter.
2013-01-22 15:17:50 +01:00
Andy Wingo
5a35d42aa5 add read-string and read-string! to (ice-9 rdelim)
* module/ice-9/rdelim.scm (read-string!, read-string): New functions.
* test-suite/tests/rdelim.test: Add tests.
* doc/ref/api-io.texi: Add docs.

* module/ice-9/iconv.scm:
* module/rnrs/io/ports.scm:
* module/web/uri.scm: Use the new functions.
2013-01-22 15:15:43 +01:00
Andy Wingo
84f5a82517 `include' relative paths relative to including file
* module/ice-9/psyntax.scm (include): Like `load', interpret relative
  paths as being relative to the file that does the `include'.

* doc/ref/api-evaluation.texi: Update docs.
2013-01-22 12:06:59 +01:00
Andy Wingo
f0b6d8c71d libguile examples use scm_c_vector functions instead of SCM_SIMPLE_VECTOR_*
* doc/ref/libguile-concepts.texi (Multi-Threading): Use functions in the
  example instead of macros.  Performance is really not a concern with
  this interface, especially now that scm_car and scm_cdr are inline
  functions.
2013-01-22 12:05:32 +01:00
Andy Wingo
5b70b4e284 documentation recommends scm_new_smob instead of SCM_NEWSMOB
* doc/ref/api-smobs.texi (Smobs): Document scm_new_smob and
  scm_new_double_smob instead of the SCM_NEWSMOB / SCM_RETURN_NEWSMOB
  family of macros.

* doc/ref/libguile-smobs.texi (Creating Smob Instances): Use
  scm_new_smob.
2013-01-22 12:05:32 +01:00
Andy Wingo
f6fd2c03a5 fix try-module-autoload, which did not detect failure to find the file
* libguile/load.c (scm_primitive_load_path): If the second argument is a
  procedure, call it like a thunk.

* doc/ref/api-evaluation.texi (Load Paths): Update docs.

* module/ice-9/boot-9.scm (resolve-interface): Use `unless'.
  (try-module-autoload): Use the new primitive-load-path to detect
  failure to find an appropriate file.  Fixes a bug reported by Diogo
  F. S. Ramos.  Thanks to Noah Lavine for tracking it down.
2013-01-21 11:21:52 +01:00
Andy Wingo
a796d0a954 warn on multithreaded fork
* libguile/posix.c (scm_fork): Issue a warning on a multithreaded fork.
* doc/ref/posix.texi (Processes): Add note about multithreaded fork.

* test-suite/tests/00-socket.test: Moved here, from socket.test, so as
  to run before any threads are created.
* test-suite/Makefile.am: Adapt.
2013-01-17 12:38:56 +01:00
Andy Wingo
22cdf986db warning instead of error on multithreaded fork
* libguile/posix.c (scm_fork): Issue a warning instead of an error on a
  multithreaded fork.
* doc/ref/posix.texi (Processes): Add note about multithreaded fork.
2013-01-17 12:25:52 +01:00
Andy Wingo
36c210d14e trace: limit length of "| | | "... prefix
* module/system/vm/trace.scm (build-prefix): New helper.
  (print-application, print-return): Use the helper.
  (trace-calls-to-procedure, trace-calls-in-procedure):
  (trace-instructions-in-procedure, call-with-trace): Add #:max-indent
  argument, defaulting to the terminal width less 40 characters.

* doc/ref/scheme-using.texi: Update `trace' docs.

Based on a patch by Nala Ginrut.
2013-01-16 18:11:47 +01:00
Noah Lavine
fee87b821f PEG Renames
* module/ice-9/peg.scm: rename 'peg-sexp-compile' to
 'compile-peg-pattern'
* module/ice-9/peg/codegen.scm: same
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:50 +01:00
Noah Lavine
3ebd578616 PEG Renames
* module/ice-9/peg.scm: rename 'define-grammar' to
 'define-peg-string-patterns'
* module/ice-9/peg/string-peg.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.bench: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:49 +01:00
Noah Lavine
40ebbd64c4 PEG Renames
* module/ice-9/peg.scm: rename 'define-nonterm' to 'define-peg-pattern'
* module/ice-9/peg/using-parsers.scm: same
* module/ice-9/peg/string-peg.scm: same
* test-suite/tests/peg.test: same
* doc/ref/api-peg.texi: same
2013-01-16 10:11:49 +01:00
Noah Lavine
8022f5023e PEG Renames
* module/ice-9/peg.scm: rename 'peg-parse' to 'match-pattern'
* module/ice-9/peg/string-peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* doc/ref/api-peg.texi: same
* test-suite/tests/peg.test: same
* test-suite/tests/peg.bench: same
2013-01-16 10:11:49 +01:00
Noah Lavine
d7e2f5e3c2 PEG Renames
* doc/ref/api-peg.texi: rename 'peg-match' to 'search-for-pattern'
* module/ice-9/peg.scm: same
* module/ice-9/peg/using-parsers.scm: same
* test-suite/tests/peg.test: same
2013-01-16 10:11:48 +01:00
Noah Lavine
ecaa261a20 Document PEGs at Runtime
doc/ref/api-peg.texi: suggest a cleaner method of generating PEG parsers
  at runtime.
2013-01-16 10:11:48 +01:00
Noah Lavine
e0d140251a Update PEG Documentation
Change the PEG documentation to use the new style of s-expression PEGs.
2013-01-16 10:11:47 +01:00
Noah Lavine
72287411e9 Add 'not-followed-by' PEG
The PEG s-expression syntax now uses '(not-followed-by ...)' instead of
'(body ! ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
66ba3de0a6 Add 'followed-by' PEG
The PEG s-expression syntax now uses '(followed-by ...)' instead of
'(body & ... 1)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
8e97edd5d3 Add '?' PEG
The PEG s-expression syntax now uses '(? ...)' instead of '(body lit ... ?)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
3d19969d74 Add '+' PEG
The PEG s-expression syntax now uses '(+ ...)' instead of '(body lit ... +)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
f310a111de Add '*' PEG
The s-expression representation of PEG grammars now uses a '(* ...)' form
instead of '(body lit ... *)'.
2013-01-16 10:11:46 +01:00
Noah Lavine
94e8517c16 Extensible PEG Syntax
* module/ice-9/peg/codegen.scm: Make the PEG syntax extensible, and
    move most of the current code generators to the new interface
* doc/ref/api-peg.texi: Document PEG extensions in the PEG Internals
    section of the manual
2013-01-16 10:11:44 +01:00
Noah Lavine
97c846947d Document PEG Internals
* doc/ref/api-peg.texi: add a manual section about the PEG internals.
2013-01-16 10:11:44 +01:00
Andy Wingo
718bc349af reformat and reflow api-peg.texi
* doc/ref/api-peg.texi: Reformat and reflow.
2013-01-16 10:11:42 +01:00
Andy Wingo
eee0877c3e add PEG parser generator
* module/ice-9/peg.scm: New file.
* module/Makefile.am: Add to build.

* doc/ref/Makefile.am:
* doc/ref/api-peg.texi:
* doc/ref/guile.texi: Add documentation for PEG parser.

* test-suite/Makefile.am:
* test-suite/tests/peg.bench:
* test-suite/tests/peg.test: Add tests, and a benchmark.
2013-01-16 10:11:15 +01:00
Andy Wingo
58c4a39d98 an end to the generated-documentation experiment
* doc/ref/statprof.texi:
* doc/ref/sxml.texi:
* doc/ref/texinfo.texi: New files, containing the documentation that was
  previously generated from source and rendered into
  standard-library.texi.  The documentation is still horrible, but at
  least now it is user-editable.
2013-01-16 10:03:44 +01:00
Greg Benison
5156f4d745 doc/ref/hierarchy.png: conform to hierarchy.txt and manual
hierarchy.png (and .pdf, .eps) were changed to add one node
to the graph, getting them in sync with hierarchy.txt
(and the GOOPS section of the manual).

Also added hierarchy.dot, a file to generate said figure
using graphviz.
2013-01-15 19:17:55 +01:00
Andy Wingo
08467a7e61 add scm_from_port_string and friends
* doc/ref/api-data.texi (Conversion to/from C):
* libguile/strings.h:
* libguile/strings.c (scm_from_port_string, scm_from_port_stringn):
  (scm_to_port_string, scm_to_port_stringn): New functions.

* guile-readline/readline.c (internal_readline):
* libguile/strports.c (scm_strport_to_string):
* libguile/read.c (scm_read_number, scm_read_mixed_case_symbol):
  (scm_read_number_and_radix, scm_read_character): Use the new
  functions.
2013-01-15 16:32:17 +01:00
Andy Wingo
b4fa6cc909 Merge remote-tracking branch 'origin/stable-2.0'
There is a failing test due to a scm_from_utf8_stringn bug brought out
by the iconv test that will be fixed in the next commit.

Conflicts:
	libguile/deprecated.h
	module/ice-9/deprecated.scm
2013-01-15 10:45:39 +01:00
Andy Wingo
581f410fbd case-lambda* clauses fail to match if too many positionals
* doc/ref/api-procedures.texi (Case-lambda): Expand case-lambda*
  documentation.

* module/ice-9/eval.scm (primitive-eval):
* libguile/eval.c (prepare_boot_closure_env_for_apply): Dispatch to the
  next case-lambda clause if there are too many positionals.

* doc/ref/vm.texi (Function Prologue Instructions):
* libguile/vm-i-system.c (bind-optionals/shuffle-or-br): New
  instruction, like bind-optionals/shuffle but can dispatch to the next
  clause if there are too many positionals.

* module/language/assembly/disassemble.scm (code-annotation):
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
  case for bind-optionals/shuffle-or-br.
* module/language/glil/compile-assembly.scm (glil->assembly): If there
  is an alternate, use bind-optionals/shuffle-or-br instead of
  bind-optionals/shuffle.

* test-suite/tests/optargs.test ("case-lambda*"): Add tests.
2013-01-14 11:38:09 +01:00
Andy Wingo
5ed4ea90a9 Change iconv procedures to take optional instead of keyword arg
* module/ice-9/iconv.scm (call-with-encoded-output-string):
  (string->bytevector, bytevector->string): Take an optional instead of
  a keyword argument.

* doc/ref/api-data.texi (Representing Strings as Bytes): Adapt docs to
  change, and fix a number of errors.  Thanks to Ludovic Courtès for the
  pointers.

* test-suite/tests/iconv.test ("wide non-ascii string"): Add a test for
  the 'substitute path.
2013-01-11 21:15:28 +01:00
Andy Wingo
990b11c53f Add http-post, http-put, et cetera
* module/web/client.scm (ensure-uri): New helper.
  (open-socket-for-uri): Accept a URI as a string or as a URI object.
  (extend-request, sanitize-request): New helpers, like the
  corresponding functions in (web server).
  (decode-response-body): Add a reference to the HTTP/1.1 spec, and
  use (ice-9 iconv).
  (request): New helper, factoring all aspects of sending an HTTP
  request and getting a response.
  (http-get): Redefine in terms of http-get.  Deprecate the
  #:extra-headers argument in favor of #:headers.  Allow a body.  Add a
  #:streaming? argument, subsuming the functionality of http-get*.
  (http-get*): Deprecate.
  (http-head, http-post, http-put, http-delete, http-trace)
  (http-options): Define interfaces for all HTTP verbs.

* test-suite/tests/web-client.test: Add tests.

* doc/ref/web.texi: Update documentation.

Thanks to Gregory Benison for the initial patch.
2013-01-11 15:40:00 +01:00
Andy Wingo
f05bb8494c add bytevector->string and string->bytevector in new (ice-9 iconv) module
* module/Makefile.am:
* module/ice-9/iconv.scm: New module implementing procedures to encode
  and decode representations of strings as bytes.

* test-suite/Makefile.am:
* test-suite/tests/iconv.test: Add tests.

* doc/ref/api-data.texi: Add docs.
2013-01-11 15:15:37 +01:00
Mark H Weaver
e0c211bb2e Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/posix.c
	module/ice-9/eval.scm
	test-suite/tests/cse.test
2013-01-07 17:23:26 -05:00
Andy Wingo
4dbac5e08b Fix partial commit of documentation update
* doc/ref/api-procedures.texi (Compiled Procedures): Fix
  partially-committed doc update.
2013-01-07 23:19:10 +01:00
Andy Wingo
9f17d967c9 More procedure-arguments-alist documentation and a bugfix
* doc/ref/api-procedures.texi (Compiled Procedures): Expand
  program-arguments-alist and program-lambda-list documentation.

* module/system/vm/program.scm (arity->arguments-alist): Fix the rest
  arg if there are also keyword args, a bug found while documenting!

* test-suite/tests/session.test ("procedure-arguments"): Update.
2013-01-07 22:02:26 +01:00
Cedric Cellier
6fca8730f7 document program-arguments-alist and program-lambda-list 2013-01-07 20:37:07 +01:00
Daniel Hartwig
afdf5467e5 repl: add repl-option for customized print
Closes <http://bugs.gnu.org/13077>.

* module/system/repl/common.scm (repl-default-options)
  (repl-print): Add option to use customized print procedure.
* doc/ref/scheme-using.texi (REPL Commands): Update.
2012-12-10 23:41:06 +01:00
Daniel Hartwig
e6a730b22a doc: remove more references to hash-tables-as-vectors
* doc/ref/api-compound.texi (Hash Tables): Update.
2012-11-30 21:23:05 +01:00
Ludovic Courtès
a638be152c doc: Document nested futures.
* doc/ref/api-scheduling.texi (Futures): Mention nested futures.
  Explain what happens upon `touch'.
2012-11-29 22:44:12 +01:00
Ludovic Courtès
8eccf6cdbd doc: Remove example use of vectors as hash tables.
Fixes <http://bugs.gnu.org/13022>.
Reported by Daniel Hartwig <mandyke@gmail.com>.

* doc/ref/api-compound.texi (Hash Table Examples): Remove example use of
  vectors as hash tables.
2012-11-29 22:44:12 +01:00
Mark H Weaver
bd31bce6ac Add parse-path-with-ellipsis, and use it for GUILE_LOAD_PATH et al.
* libguile/load.c (scm_ellipsis): New Variable.
  (scm_parse_path_with_ellipsis): New procedure.
  (scm_init_load): Initialize 'scm_ellipsis'.
  (scm_init_load_path): Use 'scm_parse_path_with_ellipsis' to
  handle GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH.

* libguile/load.h (scm_parse_path_with_ellipsis): Add prototype.

* doc/ref/guile-invoke.texi (Environment Variables):
  doc/ref/api-evaluation.texi (Load Paths): Add documentation.
  Correct description of default load path to reflect reality.
  Remove 'GUILE_LOAD_PATH' from the concept index; it is already
  in the variable index.  Add cross references between these two
  sections of the manual.
2012-11-28 21:58:05 -05:00
Ludovic Courtès
91e693a8e8 web: Add `http-get*'.
* module/web/client.scm (http-get*): New procedure.
* doc/ref/web.texi (Web Client): Document it.
2012-11-28 22:50:26 +01:00
Ludovic Courtès
75d6c59fc2 web: Add `response-body-port'.
* module/web/response.scm (make-delimited-input-port,
  response-body-port): New procedures.
  (read-response-body): Use `response-body-port'.

* test-suite/tests/web-response.test ("example-1")["response-body-port"]:
  New test.
  ("example-2")["response-body-port"]: New test.
2012-11-28 22:41:25 +01:00
Ludovic Courtès
ee2d874119 web: Export `text-content-type?'.
* module/web/client.scm (text-type?): Remove.
  (decode-response-body): Use `text-content-type?'.
* module/web/response.scm (text-content-type?): New procedure.
* doc/ref/web.texi (Responses): Document it.
2012-11-28 22:12:59 +01:00
Ian Price
085552d83d Fix docs for `hashtable-copy'
* doc/ref/r6rs.texi (rnrs hashtables): a true mutable argument means a
  mutable copy.
2012-11-26 01:24:51 +00:00
Daniel Hartwig
890647559d (web uri): document that uri-port is an integer
* doc/ref/web.texi (URIs):
* module/web/uri.scm (build-uri): Document that uri-port is an integer.
2012-11-24 15:54:07 +01:00
Daniel Hartwig
06883ae000 syncronize web module docstrings with manual
* doc/ref/web.texi: Fix spacing.  Update with a few missing function
  descriptions.

* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/server.scm:
* module/web/uri.scm: Update docstrings from manual (reworked by Ludovic
  Courtès).
2012-11-24 15:40:14 +01:00
Ludovic Courtès
679a35567d doc: Mention the duplicate-case-datum' and bad-case-datum' warnings.
* doc/ref/api-evaluation.texi (Compilation): List the
  `duplicate-case-datum' and `bad-case-datum' warnings.
2012-11-23 23:41:32 +01:00
Ludovic Courtès
44cd55752a doc: Strengthen the case for pattern matching.
* doc/ref/api-compound.texi (Pairs): Warn against `cadr' & co., and add
  a link to "Pattern Matching".
* doc/ref/match.texi (Pattern Matching): Add example with nested lists.
  Add paragraph comparing `match' expressions and hand-written code.
2012-11-17 16:14:02 +01:00