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

2229 commits

Author SHA1 Message Date
Dmitry Bogatov
d86a063158 Fix typo in `transform-string' doc.
* doc/ref/texinfo.texi: Fix single typo.

Signed-off-by: Dmitry Bogatov <KAction@gnu.org>
2014-06-04 20:59:36 -04:00
Andy Wingo
de0233af17 Fix inner and outer stack cuts to match on procedure code
* doc/ref/api-debug.texi (Stack Capture): Update make-stack docs.

* libguile/programs.h:
* libguile/programs.c (scm_program_address_range): New internal
  procedure.

* libguile/stacks.c (narrow_stack): Interpret a pair of integers as an
  address range.  If a cut is a procedure, attempt to resolve it to an
  address range.
  (scm_make_stack): Update docstring.

* module/system/vm/program.scm (program-address-range): New exported
  procedure.

* module/statprof.scm (statprof, gcprof): Use program-address-range to
  get the outer-cut, for efficiency.
2014-05-01 14:26:20 +02:00
Andy Wingo
d7a67c3e91 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	.gitignore
	doc/example-smob/Makefile
	doc/ref/api-smobs.texi
	doc/ref/libguile-concepts.texi
	doc/ref/libguile-smobs.texi
	libguile.h
	libguile/finalizers.c
	libguile/finalizers.h
	libguile/goops.c
	module/language/tree-il/compile-glil.scm
	module/oop/goops.scm
2014-04-28 18:51:21 +02:00
Andy Wingo
4338f2f91e Prefer foreign objects over smobs in manual
* doc/ref/api-memory.texi (Memory Blocks): Recommend against
  scm_gc_free.  Refer to foreign objects instead of smobs.  Remove
  discussion of scm_must_malloc et al.

* doc/ref/guile.texi (API Reference): Rename SMOB menu item.

* doc/ref/libguile-snarf.texi (Function Snarfing): Update example to not
  refer to smobs.
* doc/ref/tools.texi (How guile-snarf works): Likewise.
2014-04-28 18:00:05 +02:00
Andy Wingo
d9a4a1cde1 Remove SMOB tutorial; update manual.
* doc/ref/libguile-smobs.texi: Remove; this tutorial is superseded by
  libguile-foreign-objects.

* doc/ref/libguile-foreign-objects.texi: Proofreading.

* doc/ref/libguile-program.texi: Update Dia examples to refer to foreign
  objects.

* doc/ref/libguile-concepts.texi (Garbage Collection): Update to
  accurately describe the BDW-GC, and to avoid reference to mark
  functions.

* doc/ref/guile.texi: Remove libguile-smobs, and reword API menu.

* doc/ref/api-utility.texi (Equality): Mention GOOPS instead of SMOBs.

* doc/ref/api-smobs.texi (Smobs): Describe as a legacy interface.
  Exhort readers against the writing of mark functions.

* doc/ref/api-foreign-objects.texi (Foreign Objects): Proofreading.

* doc/ref/api-control.texi (Catch): Fix ref to point to foreign
  objects.

* doc/ref/Makefile.am: Remove libguile-smobs.texi.
2014-04-28 17:45:07 +02:00
Andy Wingo
6e4630e01a Add foreign object documentation
* doc/ref/api-foreign-objects.texi:
* doc/ref/libguile-foreign-objects.texi: New files.

* doc/ref/guile.texi:
* doc/ref/Makefile.am: Link new files into docs.
2014-04-28 16:27:09 +02:00
Andy Wingo
fa1a30726d Add interface to disable automatic finalization
* libguile/finalizers.h:
* libguile/finalizers.c (run_finalizers_async_thunk): Call the new
  scm_run_finalizers helper.
  (scm_set_automatic_finalization_enabled, scm_run_finalizers): New
  functions.
  (scm_init_finalizers): Only set a finalizer notifier if automatic
  finalization is enabled.

* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
  of concurrency.

* doc/ref/api-smobs.texi (Smobs): Document new functions.
2014-04-26 14:46:45 +02:00
Mark H Weaver
475772ea57 Merge branch 'stable-2.0'
Conflicts:
	GUILE-VERSION
	NEWS
	guile-readline/ice-9/readline.scm
	libguile/async.c
	libguile/backtrace.c
	libguile/deprecated.h
	libguile/gc-malloc.c
	libguile/gdbint.c
	libguile/init.c
	libguile/ioext.c
	libguile/mallocs.c
	libguile/print.c
	libguile/rw.c
	libguile/scmsigs.c
	libguile/script.c
	libguile/simpos.c
	libguile/snarf.h
	libguile/strports.c
	libguile/threads.c
	libguile/vm-i-scheme.c
	libguile/vm-i-system.c
	module/srfi/srfi-18.scm
	test-suite/Makefile.am
	test-suite/standalone/test-num2integral.c
2014-04-25 02:06:01 -04:00
Andy Wingo
d6651f6903 Add interface to disable automatic finalization
* libguile/finalizers.h:
* libguile/finalizers.c (run_finalizers_async_thunk)
  (finalization_thread_proc): Call the new scm_run_finalizers helper.
  (scm_i_finalizer_pre_fork): Only spawn the thread if automatic
  finalization is enabled.
  (scm_set_automatic_finalization_enabled, scm_run_finalizers): New
  functions.
  (scm_init_finalizers, scm_init_finalizer_thread): Only set a finalizer
  notifier if automatic finalization is enabled.

* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
  of concurrency.

* doc/ref/api-smobs.texi (Smobs): Document new functions.
2014-04-17 15:29:13 +02:00
Mark H Weaver
580ef7fcf4 Documentation tweaks for the 'r7rs-symbols' read/print options.
* doc/ref/api-data.texi (Symbol Read Syntax): Mention the 'r7rs-symbols'
  print option, and provide example code to enable both the read and
  print options.  Add 'r7rs-symbols' to the concept index.
2014-03-17 02:40:23 -04:00
Andy Wingo
c2379a5b45 Doc and NEWS updates
* NEWS: Update section on dynamic stacks.  Add link for intptr
  interfaces.
* doc/ref/api-data.texi (Integers): Add intptr interfaces.
2014-03-16 16:28:28 +01:00
Andy Wingo
9d3aa47b61 Debug options doc fix.
* doc/ref/api-debug.texi (Debug Options): Fix.
2014-03-16 15:50:27 +01:00
Andy Wingo
22806c244a Document stack-overflow handlers, limits, and unwind-only exceptions
* module/system/repl/error-handling.scm (call-with-error-handling): Add
  #:report-keys kwarg, so that unwind-only exceptions (stack-overflow in
  particular) get reported.

* doc/ref/api-debug.texi (Pre-Unwind Debugging): Add documentation for
  #:report-keys kwarg of call-with-error-handling.
  (Stack Overflow): New subsubsection.
  (Debug Options): Remove discussion of stack overflow.
2014-03-16 15:32:39 +01:00
Mark H Weaver
2b509a2e37 SRFI-43 documentation tweaks
* doc/ref/api-compound.texi (Vectors): Add cross-reference to SRFI-43.
* doc/ref/srfi-modules.texi (SRFI-43 Selectors): Simplify description of
  'vector-ref'.
2014-03-14 15:07:10 -04:00
Andy Wingo
966d4bdd70 Fix setitimer documentation. Allow microseconds >= 1e6.
* doc/ref/posix.texi (Signals): Fix the documentation for setitimer; it
  was wrong.

* libguile/scmsigs.c (pack_tv): New helper.  Allow usecs >= 1e6.
  (unpack_tv): New helper.
  (scm_setitimer): Use the new helpers.

* test-suite/tests/signals.test: Add setitimer tests.
2014-02-28 10:31:12 +01:00
Mark H Weaver
caa3d99be9 Fix typo in manual.
* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
  (rnrs bytevector) --> (rnrs bytevectors).
2014-02-27 22:26:05 -05:00
Ludovic Courtès
359f46a41c Add GDB extension to support Guile.
* libguile/libguile-2.0-gdb.scm: New file.
* libguile/Makefile.am (install-data-local): New target.  Based on code
  from GNU libstdc++.
  (EXTRA_DIST): Add 'libguile-2.0-gdb.scm'.
* doc/ref/api-debug.texi (GDB Support): New section.
2014-02-18 23:04:33 +01:00
David Thompson
b0a3149955 Add cooperative REPL server module.
Modified-by: Mark H Weaver <mhw@netris.org>

* module/system/repl/coop-server.scm: New module.

* module/system/repl/repl.scm (start-repl): Extract body to start-repl*.
  (start-repl*): New procedure.
  (run-repl): Extract body to run-repl*.
  (run-repl*): New procedure.

* module/system/repl/server.scm (run-server): Extract body to
  run-server*.
  (run-server*): New procedure.

* doc/ref/api-evaluation.texi (Cooperative REPL Servers): New node.

* module/Makefile.am (SYSTEM_SOURCES): Add system/repl/coop-server.scm.
2014-02-12 11:26:22 -05:00
Mark H Weaver
5ecc58113a REPL Server: Fix 'stop-server-and-clients!'.
* module/system/repl/server.scm: Import (ice-9 match) and (srfi srfi-1).
  (*open-sockets*): Add comment.  This is now a list of pairs with a
  'force-close' procedure in the cdr.
  (close-socket!): Add comment noting that it is unsafe to call this
  from another thread.
  (add-open-socket!): Add 'force-close' argument, and put it in the cdr
  of the '*open-sockets*' entry.
  (stop-server-and-clients!): Use 'match'.  Remove the first element
  from *open-sockets* immediately.  Call the 'force-close' procedure
  instead of 'close-socket!'.
  (errs-to-retry): New variable.
  (run-server): Add a pipe, used in the 'force-close' procedure to
  cleanly shut down the server.  Put the server socket into non-blocking
  mode.  Use 'select' to monitor both the server socket and the pipe.
  Don't call 'add-open-socket!' on the client-socket.  Close the pipe
  and the server socket cleanly when we're asked to shut down.
  (serve-client): Call 'add-open-socket!' with a 'force-close' procedure
  that cancels the thread.  Set the thread cleanup handler to call
  'close-socket!', instead of calling it in the main body.

* doc/ref/api-evaluation.texi (REPL Servers): Add a caveat to the manual
  entry for 'stop-servers-and-clients!'.
2014-02-12 11:21:46 -05:00
Andy Wingo
8051cf2304 Merge commit 'fb7dd00169'
This commit also renames uniform-vector-element-type-code to
array-type-code.

Conflicts:
	libguile/uniform.c
	libguile/uniform.h
	test-suite/tests/arrays.test
2014-02-08 15:31:37 +01:00
Andy Wingo
c8b7b0dad3 Merge commit 'b9b88351ea'
Conflicts:
	libguile/deprecated.h
	test-suite/tests/00-socket.test
2014-02-08 14:55:16 +01:00
Andy Wingo
04023cceb7 Merge commit 'b86069c130'
Conflicts:
	libguile/hashtab.c
2014-02-08 14:46:31 +01:00
Andy Wingo
d4a5776ac5 Merge commit '54cded99dc' 2014-02-08 14:44:23 +01:00
Andy Wingo
fb7dd00169 Deprecate general "uniform-vector" interface
* libguile/uniform.h:
* libguile/uniform.c (scm_is_uniform_vector, scm_uniform_vector_p)
  (scm_c_uniform_vector_length, scm_uniform_vector_length)
  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
  (scm_c_uniform_vector_ref, scm_uniform_vector_ref):
  (scm_c_uniform_vector_set_x, scm_uniform_vector_set_x):
  (scm_uniform_vector_to_list)
  (scm_uniform_vector_elements, scm_uniform_vector_writable_elements):
  Deprecate.  This interface lacked both generality and specificity.
  The general replacement is array-length, array-ref, and friends on the
  scheme side, or the array handle interface on the C side.  On the
  specific side of things, there are the specific bytevector, srfi-4,
  and bitvector interfaces.

* test-suite/tests/arrays.test:
* test-suite/tests/bitvectors.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-4.test: Update to use array interfaces.

* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
* doc/ref/srfi-modules.texi (SRFI-4): Update.
2014-02-08 14:28:07 +01:00
Andy Wingo
b9b88351ea Deprecate htons, htonl, ntohs, ntohl
* libguile/sockets.h:
* libguile/sockets.c:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_htons, scm_htonl, scm_ntohs, scm_ntohl):
  Deprecate.  Bytevectors adequately subsume their functionality.

* doc/ref/posix.texi:
* test-suite/tests/00-socket.test: Update.
2014-02-08 14:28:07 +01:00
Mark H Weaver
b86069c130 Make size argument optional to 'make-doubly-weak-hash-table'; fix docs.
* libguile/hashtab.c (scm_make_doubly_weak_hash_table): Make 'size'
  argument optional, like the weak hash table constructors.

* doc/ref/api-memory.texi (Weak hash tables): Document that 'size'
  argument is optional for the weak hash table constructors.
2014-02-07 16:38:58 -05:00
Mark H Weaver
54cded99dc Fix 'weak-vector?' doc: Weak hash tables are not weak vectors.
* doc/ref/api-memory.texi (Weak vectors): In 'weak-vector?' entry, don't
  claim that weak hash tables are weak vectors.  Remove statement that
  weak vectors are mainly useful for implementing weak hash tables.
2014-02-07 16:26:38 -05:00
Andy Wingo
cc620af7ca Merge commit '1e3fd6a0c8'
Conflicts:
	doc/ref/api-memory.texi
	libguile/weaks.c
	libguile/weaks.h
	module/ice-9/weak-vector.scm
2014-02-07 15:27:28 +01:00
Andy Wingo
7affd3141b Merge commit '40a723a922' 2014-02-07 15:26:18 +01:00
Andy Wingo
b00c9b2214 Merge commit '866af5da3d'
Removes the special arity handler, and instead relies on the procedure
returning the correct number of values.
2014-02-07 15:24:43 +01:00
Andy Wingo
cd36c69619 Merge commit '34e8987734'
Conflicts:
	module/Makefile.am
2014-02-07 15:13:22 +01:00
Andy Wingo
ae7f13be4b Merge commit 'ca5e0414e9'
Conflicts:
	module/language/tree-il/primitives.scm
2014-02-07 15:05:55 +01:00
Andy Wingo
a1aae2c3a0 Merge commit 'f6ddf827f8'
Conflicts:
	module/ice-9/boot-9.scm
	module/oop/goops.scm
2014-02-07 14:51:42 +01:00
Andy Wingo
7d484bfa15 Merge commit 'a5cbbaa66a' 2014-02-07 14:43:23 +01:00
Andy Wingo
e4eb0e39b4 Merge commit '8ca97482b0'
Conflicts:
	libguile/r6rs-ports.c
2014-02-07 14:42:40 +01:00
Andy Wingo
e140d85d53 Merge commit '122f24cc8a'
Conflicts:
	libguile/fports.c
	libguile/ports.c
2014-02-07 14:39:01 +01:00
Andy Wingo
1e3fd6a0c8 Add weak-vector-length, weak-vector-ref, weak-vector-set!
* libguile/weaks.c (scm_is_weak_vector, scm_c_weak_vector_length):
  (scm_c_weak_vector_ref, scm_c_weak_vector_set_x): New interfaces for
  dealing with weak vectors from C.
  (scm_weak_vector_length, scm_weak_vector_ref, scm_weak_vector_set_x):
  New Scheme interfaces to weak vectors; to be used instead of
  vector-length, vector-ref, etc.

* module/ice-9/weak-vector.scm: Export the new interfaces.

* doc/ref/api-memory.texi (Weak vectors): Document them.
2014-02-07 12:25:05 +01:00
Mark H Weaver
40a723a922 Remove outdated documentation of LTDL_LIBRARY_PATH.
* doc/ref/guile-invoke.texi (Environment Variables): Remove
  documentation of 'LTDL_LIBRARY_PATH'.
2014-02-05 23:40:25 -05:00
Mark H Weaver
8acd457958 Document 'equal?' in list of R6RS incompatibilities.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that 'equal?'
  may not terminate when applied to cyclic datums.
2014-02-05 23:25:32 -05:00
Andy Wingo
b3ae2b5068 Add VM and compiler support for calls to known procedures
* module/language/cps.scm ($callk): New expression type, for calls to
  known labels.  Part of "low CPS".
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm: Adapt call sites.

* libguile/vm-engine.c (call-label, tail-call-label): New instructions.
  Renumber the rest; this is an ABI change.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

* doc/ref/compiler.texi (CPS in Guile): Document $callk.
2014-02-02 23:19:22 +01:00
Mark H Weaver
48eb902119 Implement R7RS 'define-values'.
* module/ice-9/boot-9.scm (%define-values-arity-error): New procedure.
  (define-values): New macro.

* doc/ref/api-binding.texi (Binding Multiple Values): Add docs.

* test-suite/tests/syntax.test: Add tests.
2014-02-02 03:28:23 -05:00
Mark H Weaver
34e8987734 Implement SRFI-64 - A Scheme API for test suites.
* module/srfi/srfi-64.scm: New file.
* module/srfi/srfi-64/testing.scm: New file.
* module/Makefile.am: Add rule for srfi-64.go dependency on
  srfi-64/testing.scm.
  (SRFI_SOURCES): Add srfi/srfi-64.scm.
  (NOCOMP_SOURCES): Add srfi/srfi-64/testing.scm.
* doc/ref/srfi-modules.texi (SRFI-64): New node.
* test-suite/tests/srfi-64.test: New file.
* test-suite/tests/srfi-64-test.scm: New file.
* test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-64.test.
  (EXTRA_DIST): Add tests/srfi-64-test.scm.
2014-02-01 01:19:55 -05:00
Mark H Weaver
9060dc29d5 Implement SRFI-43 Vector Library.
* module/srfi/srfi-43.scm: New file.
* module/Makefile.am (SRFI_SOURCES): Add module/srfi/srfi-43.scm.
* test-suite/tests/srfi-43.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-43.test.
* doc/ref/srfi-modules.texi (SRFI-43, SRFI-43 Constructors)
  (SRFI-43 Predicates, SRFI-43 Selectors, SRFI-43 Iteration)
  (SRFI-43 Searching, SRFI-43 Mutators, SRFI-43 Conversion): New nodes.
2014-02-01 01:19:49 -05:00
Andy Wingo
03dfed840b Document top-level pseudo-hygiene
* doc/ref/api-macros.texi (Hygiene and the Top-Level): Add a section
  documenting our pseudo-hygienic top-level names.
2014-01-26 15:08:35 +01:00
Mark H Weaver
3e2e49650c Implement SRFI-111 Boxes.
* module/srfi/srfi-111.scm: New file.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-111.scm.
* test-suite/tests/srfi-111.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-111.test.
* doc/ref/srfi-modules.texi (SRFI-111): New node.
2014-01-24 10:50:51 -05:00
Mark H Weaver
fc1cb3fad4 Improve docs for 'eval-when'.
* doc/ref/api-macros.texi (Eval When): Explain in detail what each
  condition means, including 'expand' which was previously undocumented.
  Change the example to use (expand load eval) and recommend that set of
  conditions, instead of (compile load eval) which was previously
  recommended and shown in the example.
2014-01-23 03:49:21 -05:00
Mark H Weaver
a5cbbaa66a Fix nested block comment example in manual.
Reported by Chris K. Jester-Young <cky944@gmail.com>.

* doc/ref/api-evaluation.texi (Block Comments): Fix example.
2014-01-21 16:21:36 -05:00
Mark H Weaver
ba578eb044 Merge branch 'stable-2.0'
Conflicts:
	libguile/read.c
	test-suite/tests/web-response.test
2014-01-21 03:57:04 -05:00
Ludovic Courtès
8ca97482b0 Custom binary input ports support 'setvbuf'.
* libguile/r6rs-ports.c (CBIP_BUFFER_SIZE): Adjust comment.  Set to 8KiB.
  (SCM_SET_CBIP_BYTEVECTOR): New macro.
  (cbip_setvbuf): New function.
  (make_cbip): Set PORT's 'setvbuf' internal field.
  (cbip_fill_input): Check whether PORT is buffered.  When unbuffered,
  check whether BV can hold C_REQUESTED bytes, and allocate a new
  bytevector if not; copy the data back from BV to c_port->read_pos.
  Remove 'again' label, and don't loop there.
* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
  input port unbuffered & 'port-position'", "custom binary input port
  unbuffered & 'read!' calls", "custom binary input port, unbuffered
  then buffered", "custom binary input port, buffered then unbuffered"]:
  New tests.
* doc/ref/api-io.texi (R6RS Binary Input): Document the buffering of
  custom binary input ports, and link to 'setvbuf'.
2014-01-18 22:52:07 +01:00
Ludovic Courtès
122f24cc8a Prepare 'setvbuf' to support for non-file ports.
* libguile/ports-internal.h (struct scm_port_internal): Add
  setvbuf' field.  Change 'pending_eof' to a 1-bit unsigned char.
* libguile/ports.c (scm_new_port_table_entry): Clear 'pti->setvbuf'.
* libguile/fports.c (scm_setvbuf): Accept any open port, and error out
  when PORT's setvbuf' field is NULL.  Remove explicit 'scm_gc_free' calls.
  (scm_i_fdes_to_port): Set PORT's 'setvbuf' field.
* test-suite/tests/ports.test ("setvbuf")["closed port", "string port"]:
  New tests.
* doc/ref/posix.texi (Ports and File Descriptors): Suggest that
  'setvbuf' works for different port types.
2014-01-18 22:52:07 +01:00