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

2215 commits

Author SHA1 Message Date
Andy Wingo
e98f64009d Remove port equal functions
* doc/ref/api-io.texi (Port Implementation): Remove mention of port
  equal functions.
* NEWS: Update.
* libguile/ports.c (scm_set_port_equalp): Remove.
* libguile/ports.h (scm_t_ptob_descriptor): Remove equalp function.
2016-04-04 16:30:56 +02:00
Andy Wingo
67b147fb7a Remove port free functions; just close instead
* libguile/ports.h (scm_t_port_type_flags): Replace
  SCM_PORT_TYPE_HAS_FLUSH with SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC.
  (scm_t_ptob_descriptor): Remove free function.
* libguile/ports.c (scm_set_port_needs_close_on_gc): New function.
  (scm_set_port_flush): Don't set flags.
  (scm_c_make_port_with_encoding, scm_close_port): Use the new flag to
  determine when to add a finalizer and also when to include the port in
  the weak set.
  (scm_set_port_free): Remove.
  (do_close, finalize_port): Close port instead of calling free
  function.
* libguile/r6rs-ports.c (initialize_transcoded_ports):
* libguile/vports.c (scm_make_sfptob):
* libguile/fports.c (scm_make_fptob): Mark these ports as needing close
  on GC.
* libguile/fports.c (fport_free): Remove.
* NEWS: Update.
* doc/ref/api-io.texi (Port Implementation): Update.
2016-04-04 16:30:56 +02:00
Andy Wingo
4460f1f152 Remove port mark functions
* doc/ref/api-io.texi (Port Implementation): Remove documentation.
* libguile/ports.c (scm_set_port_mark): Remove function.
* libguile/ports.h (scm_t_ptob_descriptor): Remove mark function.
* NEWS: Add entry.
2016-04-04 16:30:56 +02:00
Andy Wingo
59a18451b8 Use symbols instead of _IONBF values as args to setvbuf
* libguile/ports.c (scm_setvbuf): Use the symbols `none', `line', and
  `block' instead of the values `_IONBF', `_IOLBF', and `_IOFBF'.
* NEWS: Update.
* doc/ref/posix.texi (Ports and File Descriptors): Update setvbuf
documentation.
* module/ice-9/deprecated.scm (define-deprecated): New helper.
(_IONBF, _IOLBF, _IOFBF): Define deprecated values.
* benchmark-suite/benchmarks/read.bm ("read"):
* benchmark-suite/benchmarks/uniform-vector-read.bm
("uniform-vector-read!"):
* libguile/r6rs-ports.c (cbip_fill_input):
* module/system/base/types.scm (%ffi-memory-backend):
* module/web/client.scm (open-socket-for-uri):
* module/web/server/http.scm (http-read):
* test-suite/tests/ports.test ("pipe, fdopen, and line buffering"):
("setvbuf"):
* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports"): Update to use
non-deprecated interfaces.
2016-04-04 16:30:56 +02:00
Andy Wingo
a653271f98 Document new VM instructions
* doc/ref/vm.texi (Stack Layout): Add a note about unboxed values.
  (Instruction Set): Update for new instructions.
2016-02-01 21:21:38 +01:00
Andy Wingo
8998f1539f Update statprof documentation; deprecate `with-statprof'
* module/statprof.scm: Remove most of the commentary, as it was
  duplicated in the manual and was getting out of date.
  (stats): Remove self-secs-per-call and cum-secs-per-call fields as
  they can be computed from the other fields.
  (statprof-call-data->stats): Adapt.
  (statprof-stats-self-secs-per-call):
  (statprof-stats-cum-secs-per-call): New functions.
  (statprof-display/flat): Don't print the seconds-per-call fields, as
  we are no longer stopping the clock around call counters.  Anyway
  these times were quite misleading.
  (with-statprof): Deprecate.  It took its keyword arguments at the
  beginning; very complicated!  Better to use the `statprof' function.
  (`statprof' was introduced after `with-statprof' and then
  `with-statprof' was adapted to use it.)

* doc/ref/statprof.texi (Statprof): Port this documentation away from
  the automatically generated text and update it for the new interfaces
  like #:display-style.

* module/system/base/syntax.scm (record-case): Remove comment that
  referenced with-statprof.  Add comment indicating that record-case
  should be replaced.

* doc/ref/scheme-using.texi (Profile Commands): Update to mention
  keyword arguments and to link to the statprof documentation.
2016-02-01 15:12:36 +01:00
Andy Wingo
cd0b61a04e Frame <binding> objects capture frame, can ref value directly
* module/system/repl/debug.scm (print-locals): Adapt to
  frame-binding-ref change.

* module/system/vm/frame.scm (<binding>): Add `frame' field.
  (available-bindings): Capture the frame.
  (binding-ref, binding-set!): New functions, accessing a local variable
  value directly from a frame.
  (frame-binding-ref, frame-binding-set!): Remove.  As these are very
  low-level debugging interfaces introduced in 2.0, never documented,
  and quite tied to the VM, we feel comfortable making this change.
  (frame-call-representation): Adapt to available-bindings change.
  (frame-environment, frame-object-binding): Adapt to binding-ref
  interface change.

* doc/ref/vm.texi (Stack Layout): Mention that slots can be re-used.
  Update disassembly in example.

* doc/ref/api-debug.texi (Frames): Remove documentation for
  frame-local-ref, frame-local-set!, and frame-num-locals.  Replace with
  documentation for frame-bindings, binding accessors, and binding-ref /
  binding-set!.
2016-01-31 11:15:58 +01:00
Andy Wingo
58153e3a08 Remove frame-procedure
* libguile/frames.h:
* libguile/frames.c (scm_frame_procedure): Remove.
* test-suite/tests/eval.test ("stacks"): Adapt test.
* NEWS: Add news item.
* doc/ref/api-debug.texi (Frames): Document frame-procedure-name instead
  of frame-procedure.
2015-12-01 11:30:54 +01:00
Andy Wingo
3582787cb0 VM traps don't match on value of slot 0
* module/system/vm/traps.scm (frame-matcher): Always match on a
  procedure's code, instead of the value in slot 0.  Prevents confusion
  with closure-optimized procedures, re-use of slot 0, and untagged
  values in slot 0.
  (trap-at-procedure-call, trap-in-procedure)
  (trap-instructions-in-procedure, trap-at-procedure-ip-in-range)
  (trap-at-source-location, trap-in-dynamic-extent)
  (trap-calls-in-dynamic-extent, trap-instructions-in-dynamic-extent):
  Update to adapt to frame-matcher change and remove #:closure?
  argument, effectively changing the default behavior to #:closure? #t.

* doc/ref/api-debug.texi (Low-Level Traps): Update documentation.
2015-12-01 11:30:54 +01:00
Andy Wingo
adb2329863 Remove `procedure' repl command
* doc/ref/scheme-using.texi (Debug Commands):
* module/system/repl/command.scm (procedure): Remove REPL command.
  Since there is a closure binding and we have improved the ,registers
  output, this is no longer necessary and by removing it we remove
  another bogus use of frame-procedure.
2015-12-01 11:30:54 +01:00
Andy Wingo
e7660a607c VM support for raw slots
* libguile/loader.c (scm_find_slot_map_unlocked): Rename from
  scm_find_dead_slot_map_unlocked.

* libguile/vm.c (struct slot_map_cache_entry, struct slot_map_cache)
  (find_slot_map): Rename, changing "dead_slot" to "slot".
  (enum slot_desc): New type.
  (scm_i_vm_mark_stack): Interpret slot maps as having two bits per
  slot, allowing us to indicate that a slot is live but not a pointer.

* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
  emit-slot-map name change.

* module/system/vm/assembler.scm (<asm>): Rename dead-slot-maps field to
  slot-maps.
  (emit-slot-map): Rename from emit-dead-slot-map.
  (link-frame-maps): 2 bits per slot.

* module/language/cps/slot-allocation.scm (lookup-slot-map): Rename from
  lookup-dead-slot-map.
  (compute-var-representations): New function.
  (allocate-slots): Adapt to encode two-bit slot representations.
2015-10-28 16:40:53 +00:00
Andy Wingo
7aee3c74f5 return-values opcode resets the frame
* libguile/vm-engine.c (return-values): Change to also reset the frame,
  if nlocals is nonzero.

* doc/ref/vm.texi (Procedure Call and Return Instructions): Updated
  docs.

* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
  call emit-return-values with the right number of arguments.
2015-10-28 10:47:18 +00:00
Andy Wingo
95ac2204d9 Revert "Update Gnulib to v0.1-603-g1d16a7b"
This reverts commit 2d4da30fde.

This Gnulib update was causing failures related to timezones in
stime.c.  I tried to fix it by adopting the time_rz module from gnulib
but that then caused other failures.  We can try again later.
2015-10-25 10:55:14 +00:00
Andy Wingo
2d4da30fde Update Gnulib to v0.1-603-g1d16a7b 2015-10-22 13:34:00 +00:00
Andy Wingo
8832e8b68c Small subr-call refactor
* libguile/gsubr.c (scm_apply_subr): New internal helper.
* libguile/vm-engine.c (subr-call): Call out to scm_apply_subr.
* doc/ref/vm.texi (subr-call): Don't specify how the foreign pointer is
  obtained.
2015-10-22 12:13:37 +00:00
Andy Wingo
467e587d68 Update VM documentation for new stack layout
* doc/ref/vm.texi: Update for new stack layout.
* module/system/vm/disassembler.scm (code-annotation): Print the frame
  sizes after alloc-frame, reset-frame, etc to make reading the
  disassembly easier.
2015-10-22 11:02:18 +00:00
Andy Wingo
a0a8741608 Minor VM documentation updates
* doc/ref/vm.texi (Why a VM?, Variables and the VM): Minor updates.
2015-10-21 11:49:20 +02:00
Andy Wingo
73f6146bd8 Minor CPS documentation cleanups
* doc/ref/compiler.texi (Continuation-Passing Style): Minor cleanups.
2015-09-18 10:13:35 +02:00
Andy Wingo
d701e8a3d3 Update CPS language documentation
* doc/ref/compiler.texi (Continuation-Passing Style): Update to latest
  CPS language.
2015-09-17 20:14:35 +02:00
Andy Wingo
34ff3af9f0 Replace $letrec with $rec
* module/language/cps.scm ($rec): Replace $letrec with $rec, which is an
  expression, not a term.  This means that the names bound by the letrec
  appear twice: once in the $rec term, and once in the continuation.
  This is not very elegant, but the situation is better than it was
  before.  Adapt all callers.

* doc/ref/compiler.texi (CPS in Guile): Incomplete documentation
  updates.  I'll update these later when the IL settles down.
2015-04-01 10:10:10 +02:00
Andy Wingo
22c9e769f1 NEWS and doc updates
* doc/ref/vm.texi: Update for new instructions.
* doc/ref/web.texi: Update for URI-reference support.
* NEWS: Update.
2015-02-09 22:43:20 +01:00
Andy Wingo
d64146f210 Document support for URI references.
* doc/ref/web.texi (URIs): Update for URI reference changes.
2015-02-08 13:14:00 +01:00
Andy Wingo
6f248df1f6 Merge commit 'cdcba5b2f6'
Conflicts:
	module/statprof.scm
2015-01-22 14:37:18 +01:00
Andy Wingo
7c6ce75e2c Merge commit '7c433cbbce'
Conflicts:
	meta/Makefile.am
2015-01-22 13:32:59 +01:00
Andy Wingo
12dfe6568c Merge commit '5fac1a7ada'
Conflicts:
	configure.ac
	doc/ref/libguile-parallel.texi
2015-01-22 13:30:25 +01:00
Andy Wingo
a5b5cb422e Merge commit '8cf2a7ba74' 2015-01-22 13:24:30 +01:00
Andy Wingo
678995ff79 Merge commit '5af307de43'
Conflicts:
	test-suite/tests/reader.test
2015-01-22 12:50:18 +01:00
Andy Wingo
24d4f029bf Merge commit 'b1451ad859' 2015-01-22 12:46:11 +01:00
Ludovic Courtès
cdcba5b2f6 statprof: 'statprof' and 'with-statprof' return the code's return values.
* module/statprof.scm (statprof): Return the return values of THUNK.
  (with-statprof): Adjust docstring accordingly.
* test-suite/tests/statprof.test ("return values"): New test.
* doc/ref/statprof.texi (Statprof): Adjust accordingly.
2015-01-11 20:44:44 +01:00
Ludovic Courtès
680135b6a3 doc: Clarify the unit of the 'offset' argument of 'seek'.
Reported in <http://bugs.gnu.org/18520>
by David Kastrup <dak@gnu.org>.

* doc/ref/api-io.texi (Random Access): Clarify the unit of the 'offset'
  argument to 'seek'.
2014-12-03 19:07:28 +01:00
Ludovic Courtès
5fac1a7ada Add the 'guild' and 'guile' variables to 'guile-2.0.pc'.
* configure.ac: Remove meta/guile-2.0.pc and
  meta/guile-2.0-uninstalled.pc from 'AC_CONFIG_FILES'.
* meta/Makefile.am (substitute): New variable.
  (guile-2.0.pc, guile-2.0-uninstalled.pc): New targets.
  (guile-config, guild): Use $(substitute) instead of duplicated sed
  script.
  (CLEANFILES): Add the .pc files.
* meta/guile-2.0.pc.in (bindir, guild, guile): New variables.
* doc/ref/libguile-parallel.texi (Parallel Installations): Document the
  'guild' and 'guile' pkg-config variables.
2014-12-03 18:59:36 +01:00
Ludovic Courtès
7e466e0265 doc: Tell when 'GUILE_INSTALL_LOCALE' first appeared.
* doc/ref/guile-invoke.texi (Environment Variables): Add footnote about
  the Guile version where 'GUILE_INSTALL_LOCALE' appeared.
2014-12-02 21:25:56 +01:00
Chris Jester-Young
cffa9bd6a3 Implement SRFI 28: Basic Format Strings.
* module/srfi/srfi-28.scm: New module.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm.
* doc/ref/srfi-modules.texi (SRFI-28): New node.
2014-12-02 11:49:05 -05:00
Ludovic Courtès
d1447c717b doc: Clarify behavior of 'select' in the presence of signal interruptions.
Fixes <http://bugs.gnu.org/18988>.
Reported by Chris Vine <chris@cvine.freeserve.co.uk>.

* libguile/filesys.c (scm_select): Clarify handling of signal
  interruptions.
* doc/ref/posix.texi (Ports and File Descriptors): Adjust accordingly.
2014-11-20 21:32:44 +01:00
Mark H Weaver
5af307de43 read: Accept "\(" in string literals.
Suggested by David Kastrup <dak@gnu.org> in <http://bugs.gnu.org/13644>.

* libguile/read.c (scm_read_string_like_syntax): Accept "\(" as
  equivalent to "(".
* doc/ref/api-data.texi (String Syntax): Document it.
* test-suite/tests/reader.test ("reading"): Add test.
2014-10-01 21:00:23 -04:00
Mark H Weaver
b1451ad859 docs: Fix documented return type of 'scm_c_export'.
Fixes <http://bugs.gnu.org/17869>.
Reported and fixed by Alexei Matveev <alexei.matveev@gmail.com>.

* doc/ref/api-modules.texi (Accessing Modules from C): Change documented
  return type of 'scm_c_export' to 'void' to reflect reality.
* THANKS: Add Alexei Matveev to the fixes section.
2014-10-01 19:13:34 -04:00
Mark H Weaver
856d318a9f Merge branch 'stable-2.0'
Conflicts:
	benchmark-suite/benchmarks/ports.bm
	libguile/async.h
	libguile/bytevectors.c
	libguile/foreign.c
	libguile/gsubr.c
	libguile/srfi-1.c
	libguile/vm-engine.h
	libguile/vm-i-scheme.c
	module/Makefile.am
	module/language/tree-il/analyze.scm
	module/language/tree-il/peval.scm
	module/scripts/compile.scm
	module/scripts/disassemble.scm
	test-suite/tests/asm-to-bytecode.test
	test-suite/tests/peval.test
	test-suite/tests/rdelim.test
2014-09-30 03:50:47 -04:00
Andy Wingo
3157d45503 Add (ice-9 unicode) module
* libguile/unicode.c:
* libguile/unicode.h:
* test-suite/tests/unicode.test:
* module/ice-9/unicode.scm: New files.

* module/Makefile.am:
* libguile/Makefile.am:
* test-suite/Makefile.am:
* libguile/init.c: Wire new files into the build.

* doc/ref/api-data.texi: Add docs.
2014-09-29 21:54:14 -04:00
Mark H Weaver
ff4af3df23 doc: Improve description of vector-unfold and vector-unfold-right.
* doc/ref/srfi-modules.texi (SRFI-43 Constructors)[vector-unfold]:
  Improve description.
* module/srfi/srfi-43.scm (vector-unfold, vector-unfold-right):
  Improve docstrings.
2014-09-24 22:03:58 -04:00
Ludovic Courtès
447af515a3 Add 'EXIT_SUCCESS' and 'EXIT_FAILURE'.
Suggested by Frank Terbeck <ft@bewatermyfriend.org>.

* libguile/posix.c (scm_init_posix): Define 'EXIT_SUCCESS' and
  'EXIT_FAILURE'.
* doc/ref/posix.texi (Processes): Document them.
2014-09-22 22:51:39 +02:00
Mark H Weaver
0fce815b1b Document #:prefix option in use-module clauses.
* doc/ref/api-modules.texi (Using Guile Modules): Document #:prefix
  option.
2014-09-20 05:46:45 -04:00
Andy Wingo
c5ea75534c Add (ice-9 unicode) module
* libguile/unicode.c:
* libguile/unicode.h:
* test-suite/tests/unicode.test:
* module/ice-9/unicode.scm: New files.

* module/Makefile.am:
* libguile/Makefile.am:
* test-suite/Makefile.am:
* libguile/init.c: Wire new files into the build.

* doc/ref/api-data.texi: Add docs.
2014-09-12 17:00:59 +02:00
Ludovic Courtès
1e9249e0cd doc: "!#" does not need to appear on a line of its own.
* doc/ref/api-evaluation.texi (Block Comments): Remove "which must appear on a
  line of their own".  Reported by David Michael <fedora.dm0@gmail.com>.
2014-08-12 22:23:22 +02:00
David Kastrup
da6ecd4923 Clarify that object-properties cannot be reliably applied to numbers.
* doc/ref/api-utility.texi (Object Properties)[make-object-property]:
  Clarify that object-properties cannot be reliably applied to numbers.

Signed-off-by: David Kastrup <dak@gnu.org>
2014-08-10 22:55:25 -04:00
Andy Wingo
d40752513f Fix bit-count* bug
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
  2005 refactor (!) in which the second arg was erroneously taken from
  the first arg.

* test-suite/tests/bitvectors.test: Add test.

* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
2014-07-04 16:52:29 +02:00
Andy Wingo
d40b05386c Fix bit-count* bug
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
  2005 refactor (!) in which the second arg was erroneously taken from
  the first arg.

* test-suite/tests/bitvectors.test: Add test.

* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
2014-06-29 14:19:00 +02:00
Taylan Ulrich B
43191a31a5 R6RS library documentation fix
* doc/ref/api-modules.texi (R6RS Libraries): Move 'export' before
  'import' in the example library form, as required by R6RS.
2014-06-06 16:38:09 -04:00
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