summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-10-27Support general arrays in random:hollow-sphere!wip-llodaDaniel Llorens2-78/+132
* libguile/random.c (vector_scale_x, vector_sum_squares): Handle general rank-1 #t or 'f64 arrays. * test-suite/tests/random.test: Add tests for random:hollow-sphere!.
2017-10-27Remove scm_generalized_vector_get_handleDaniel Llorens6-30/+27
This was deprecated in 2.0.9 (118ff892be199f0af359d1b027645d4783a364ec). * libguile/bitvectors.c (scm_bitvector_writable_elements): Replace scm_generalized_vector_get_handle. Remove unnecessary #includes. * libguile/vectors.c (scm_vector_writable_elements): Replace scm_generalized_vector_get_handle. Remove unnecessary #includes. * libguile/random.c (scm_random_normal_vector_x): Replace scm_generalized_vector_get_handle. * libguile/generalized-vectors.h, libguile/generalized-vectors.c (scm_generalized_vector_get_handle): Remove. Remove unnecessary #includes. * NEWS: Add removal notice.
2017-10-27Fix bitvectors and non-zero lower bound arrays in truncated-printDaniel Llorens5-56/+169
* module/ice-9/arrays.scm (array-print-prefix): New private function. * libguile/arrays.c (scm_i_print_array): Reuse (array-print-prefix) from (ice-9 arrays). Make sure to release the array handle. * module/ice-9/pretty-print.scm (truncated-print): Support bitvectors. Don't try to guess the array prefix but call array-print-prefix from (ice-9 arrays) instead. Fix call to print-sequence to support non-zero lower bound arrays. * test-suite/tests/arrays.test: Test that arrays print properly. * test-suite/tests/print.test: Test truncated-print with bitvectors, non-zero lower bound arrays.
2017-10-27Support non-zero lower bounds in array-slice-for-eachDaniel Llorens2-13/+17
* libguile/array-handle.c (scm_array_handle_writable_elements): Fix error message. * libguile/array-map.c (scm_array_slice_for_each): Support non-zero lower bounds. Fix error messages. * test-suite/tests/array-map.test: Test scm_array_slice_for_each with non-zero lower bound argument.
2017-10-27Fix sort, sort! for arrays with nonzero lower boundDaniel Llorens6-140/+208
* module/ice-9/arrays.scm (array-copy): New function, export. * module/Makefile.am: Install (ice-9 arrays). * doc/ref/api-data.texi: Add documentation for (ice-9 arrays). * libguile/quicksort.i.c: Use signed bounds throughout. * libguile/sort.c (scm_restricted_vector_sort_x): Fix error calls. Fix calls to quicksort. * test-suite/tests/sort.test: Actually test that the sorted results match the original data. Test cases for non-zero base index arrays for sort, sort!, and stable-sort!.
2017-10-27Remove documentation on uniform-vector-read!, uniform-vector-writeDaniel Llorens2-33/+7
* NEWS: Add specific removal notice. * doc/ref/api-data.texi: Remove documentation on uniform-vector-read!, uniform-vector-write.
2017-10-27Replace uniform-vector-read benchmark with bytevector-io benchmarkDaniel Llorens2-16/+15
* benchmark-suite/benchmarks/uniform-vector-read.bm: Remove; uniform-vector-read! and uniform-vector-write were deprecated in 2.0 and are have been removed in 2.1. * benchmark-suite/benchmarks/bytevector-io.bm: New benchmark. * benchmark-suite/Makefile.am: Run the new benchmark.
2017-10-27Allow scm_XXX_writable_elements on empty vectors, even if immutableDaniel Llorens4-12/+30
* libguile/array-handle.c (initialize_vector_handle): Set both element pointers to NULL if the vector is empty. * libguile/array-map.c (racp): Ignore immutability if destination is empty. * test-suite/tests/sort.test: Check empty/mutable/immutable vectors with sort!. * test-suite/tests/array-map.test: Check array-copy! with empty/immutable destination.
2017-10-25Allow garbage collection of revealed file ports.Ludovic Courtès4-51/+69
Reported at <https://bugs.gnu.org/28784>. Discussed at <https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00003.html>. * libguile/fports.c (revealed_ports, revealed_lock): Remove. (scm_revealed_count): Just return 'SCM_REVEALED (port)'. (scm_set_port_revealed_x, scm_adjust_port_revealed_x): Remove REVEALED_PORTS manipulation. (fport_close): Do nothing when SCM_REVEALED (port) > 0. * libguile/fports.h (scm_t_fport): Adjust comment; make 'revealed' unsigned. * libguile/ports.c (do_close): Call 'close_port' instead of 'scm_close_port'. (scm_close_port): Rename to... (close_port): ... this. Add 'explicit' parameter. Clear 'revealed' field when PORT is a file port and EXPLICIT is true. (scm_close_port): Call 'close_port'. * test-suite/tests/ports.test ("close-port & revealed port") ("revealed port fdes not closed"): New tests.
2017-10-25'frame-matcher' doesn't crash when the last IP is unknown.Ludovic Courtès1-2/+3
This fixes a bug when using ",break": system/vm/traps.scm:127:31: system/vm/traps.scm:127:31: In procedure <: Wrong type: #f * module/system/vm/traps.scm (frame-matcher): Check whether END is true.
2017-09-25Add struct-ref/unboxed, struct-set!/unboxedAndy Wingo5-49/+200
* NEWS: Add news entry. * doc/ref/api-data.texi (Vtables, Structure Basics): Update documentation. * libguile/struct.c (scm_i_struct_equalp): Avoid using struct-ref on unboxed fields. (scm_struct_ref, scm_struct_set_x_unboxed): Issue deprecation warning when accessing unboxed fields. (scm_struct_ref_unboxed, scm_struct_set_x_unboxed): New functions. * libguile/struct.h (scm_struct_ref_unboxed, scm_struct_set_x_unboxed): New functions. * module/oop/goops.scm (class-add-flags!, class-clear-flags!): (class-has-flags?, <class>, %allocate-instance, <slot>): (compute-get-n-set, unboxed-get, unboxed-set, unboxed-slot?): (allocate-slots, %prep-layout!, make-standard-class, initialize): Adapt to access unboxed nfields and flags fields via the new accessors.
2017-09-23GOOPS slot access protected via slot accessors, not struct permsAndy Wingo1-6/+27
* module/oop/goops.scm (opaque-slot?, read-only-slot?): New helpers. (allocate-slots): Protect opaque and read-only slots by wrapping the slot accessors instead of relying on struct permissions. (%compute-layout): Remove opaque-slot case.
2017-09-23Deprecate opaque struct fieldsAndy Wingo3-15/+27
* NEWS: Add entry. * doc/ref/api-data.texi (Vtables, Structure Basics): Remove mention of opaque field protection. * libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail): Remove discussion of opaque fields. (set_vtable_layout_flags): Issue a deprecation warning when opaque fields are used.
2017-09-22Remove needless static variables from goops.cAndy Wingo1-23/+2
* libguile/goops.c: Remove many static SCM variables that were not used on the C level, like class_protected for <protected-slot> and so on.
2017-09-22Fix up make-struct-layout and make-struct/no-tail docstringsAndy Wingo1-10/+7
* libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail): Fix up docstrings for self and tail deprecation.
2017-09-22Deprecate struct "self" slotsAndy Wingo5-15/+38
* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use a normal slot instead of a self slot. * libguile/print.c (make_print_state): Initialize "handle" slot manually. * libguile/struct.c (issue_deprecation_warning_for_self_slots): New helper, called when making vtables to issue deprecation warnings for "self" slots. Avoids warning for the "self" slot that's part of the fixed vtable slots. (scm_i_struct_inherit_vtable_magic): Call issue_deprecation_warning_for_self_slots. * doc/ref/api-data.texi (Vtables, Structure Basics): Remove references to self slots. * NEWS: Add entry.
2017-09-22Remove unused code in struct.cAndy Wingo1-34/+0
* libguile/struct.c (scm_make_struct_layout, scm_struct-ref) (scm_struct_set_x): Remove commented-out support for signed and double raw fields.
2017-09-22Deprecate make-structAndy Wingo11-81/+139
* libguile/struct.c: Replace uses of scm_make_struct with scm_make_struct_no_tail or scm_c_make_struct. (scm_make_struct_no_tail): Move this function to C instead of Scheme to be able to deprecate scm_make_struct. * libguile/struct.h (scm_make_struct_no_tail): New public declaration. * libguile/deprecated.h: * libguile/deprecated.c (scm_make_struct): Deprecate. * libguile/print.c: * libguile/procs.c: * libguile/stacks.c: Replace uses of scm_make_struct with scm_make_struct_no_tail. * test-suite/tests/coverage.test: * test-suite/tests/structs.test: Use make-struct/no-tail instead of make-struct. * NEWS: Add entry.
2017-09-20Remove references to tail arrays in the documentationAndy Wingo1-69/+18
* doc/ref/api-data.texi (Vtables, Structure Basics): Update to remove references to tail arrays, in preparation for deprecation.
2017-09-20Use make-struct/no-tail instead of make-structAndy Wingo8-80/+78
* module/ice-9/boot-9.scm: * module/language/cps/effects-analysis.scm: * module/language/elisp/falias.scm: * module/language/tree-il.scm: * module/language/tree-il/primitives.scm: * module/rnrs/records/procedural.scm: * module/srfi/srfi-35.scm: * module/system/base/syntax.scm: Change uses of make-struct to make-struct/no-tail.
2017-09-20psyntax generates calls to make-struct/no-tailAndy Wingo2-83/+97
* module/ice-9/psyntax.scm (define-expansion-constructors): Expand to make-struct/no-tail. * module/ice-9/psyntax-pp.scm: Regenerate.
2017-07-31put-bytevector, unget-bytevector: Allow start == bytevector length.Mark H Weaver1-2/+2
* libguile/r6rs-ports.c (scm_put_bytevector, scm_unget_bytevector): When three arguments (port bv start) are provided, allow start to be equal to the length of the bytevector, resulting in a zero-length write.
2017-06-15Correctly relativize file names in the presence of common prefixes.Ludovic Courtès2-2/+34
* libguile/filesys.c (scm_i_relativize_path): When DIR is a prefix of SCANON, make sure DIR ends with a separator or SCANON starts with a separator. * test-suite/tests/ports.test (%temporary-directory): New variable. ("%file-port-name-canonicalization")["relative canonicalization with common prefixes"]: New test.
2017-06-11doc: Document 'short' and 'unsigned-short' foreign types.Mark H Weaver1-0/+2
This is a followup to commit 42f7c01e0a1d1c139ec8b835429a80ab15ac4007. Reported by Adriano Peluso <catonano@gmail.com>. * doc/ref/api-foreign.texi (Foreign Types): Add missing entries for 'short' and 'unsigned-short'.
2017-05-31Update guile.m4 to check for 2.2 by defaultAndy Wingo1-3/+3
* meta/guile.m4 (GUILE_PKG): Update default Guile versions to 2.2.
2017-05-31guile.m4 fix for 3.0 prereleasesAndy Wingo1-0/+3
* meta/guile.m4 (GUILE_PROGS): Allow prereleases of Guile with a new major version.
2017-05-22Minor updates of README.Andy Wingo1-5/+1
* README: Minor updates.
2017-05-22Remove legacy NEWS.guile-vm.Andy Wingo1-57/+0
* NEWS.guile-vm: Remove.
2017-05-22Minor updates to HACKING.Andy Wingo1-107/+13
* HACKING: Minor updates.
2017-05-22Remove outdated ANNOUNCE.Andy Wingo1-60/+0
* ANNOUNCE: Remove outdated file.
2017-05-22Remove outdated README.guile-vm.Andy Wingo1-117/+0
* README.guile-vm: Remove.
2017-05-21web: add support for URI-referenceAndy Wingo9-146/+338
Based on a patch by Daniel Hartwig <mandyke@gmail.com>. * NEWS: Update. * doc/ref/web.texi (URIs): Fragments are properly part of a URI, so remove the incorrect note. Add documentation on URI subtypes. * module/web/uri.scm (uri-reference?): New base type predicate. (uri?, relative-ref?): Specific predicates. (validate-uri-reference): Strict validation. (validate-uri, validate-relative-ref): Specific validators. (build-uri-reference, build-relative-ref): New constructors. (string->uri-reference): Rename from string->uri. (string->uri, string->relative-ref): Specific constructors. (uri->string): Add #:include-fragment? keyword argument. * module/web/http.scm (parse-request-uri): Use `build-uri-reference', and result is a URI-reference, not URI, object. No longer infer an absent `uri-scheme' is `http'. (write-uri): Just use `uri->string'. (declare-uri-header!): Remove unused function. (declare-uri-reference-header!): Update. Rename from `declare-relative-uri-header!'. * test-suite/tests/web-uri.test ("build-uri-reference"): ("string->uri-reference"): Add. ("uri->string"): Also tests for relative-refs. * test-suite/tests/web-http.test ("read-request-line"): ("write-request-line"): Update for no scheme in some URIs. ("entity headers", "request headers"): Content-location, Referer, and Location should also parse relative-URIs. * test-suite/tests/web-request.test ("example-1"): Expect URI-reference with no scheme.
2017-05-17readline: Avoid interpreting control characters in pastes.Andy Wingo4-2/+27
* NEWS: Update. * doc/ref/repl-modules.texi (Readline Options): Update for bracketed-paste. * guile-readline/readline.h (SCM_READLINE_BRACKETED_PASTE): Add bracketed-paste option. * guile-readline/readline.c (scm_readline_opts): Add bracketed-paste. (scm_init_readline): Wire up the logic.
2017-05-16On Hurd, skip tests that require working setrlimits for memoryManolis Ragkousis2-0/+12
On Hurd, setrlimits are not yet implemented. See <https://lists.gnu.org/archive/html/bug-hurd/2017-05/msg00013.html>. * test-suite/standalone/test-out-of-memory: skip for Hurd. * test-suite/standalone/test-stack-overflow: skip for Hurd.
2017-04-28Fix reading of HTTPS responses that are smaller than port bufferAndy Wingo1-2/+12
* module/web/client.scm (tls-wrap): Use get-bytevector-some instead of get-bytevector-n, to prevent Guile from attempting to read more bytes than are available. Normally trying to read data on a shut-down socket is fine, but but gnutls issues an error if you attempt to read data from a shut-down socket, and that appears to be a security property. Fixes HTTPS requests whose responses are smaller than the port buffer.
2017-04-25Correct note about Gregorian reform in SRFI-19Zefram1-11/+10
* doc/ref/srfi-modules.texi (SRFI-19): SRFI-19 specifies proleptic use of the Gregorian calendar, so it was incorrect of the documentation to describe the code as erroneous in doing so. Rewrite the caution more neutrally, and move it to the section about the "date" structure, where it seems most relevant.
2017-04-22SRFI-19: Swap seconds and nanoseconds in 'current-time-monotonic'.Ludovic Courtès1-2/+2
* module/srfi/srfi-19.scm (current-time-monotonic): Swap the 2nd and 3rd arguments. Fixes a regression introduced in commit b11e2922c36c4105797c269c7e616535b702698a.
2017-04-21Bump version to 2.2.2.v2.2.2Andy Wingo1-3/+3
* GUILE-VERSION: Bump to 2.2.2.
2017-04-21Update NEWS some moreAndy Wingo1-0/+5
* NEWS: More updates.
2017-04-21Update NEWS.Andy Wingo1-0/+18
* NEWS: Update.
2017-04-21Syntax objects are comparable with equal?Andy Wingo3-0/+53
* libguile/eq.c (scm_equal_p, scm_raw_ihash): Add cases for syntax objects, which should be comparable with equal?. * test-suite/tests/syntax.test ("syntax objects"): Add tests.
2017-04-20SRFI-37: Account for zero-length arguments.Thomas Danckaert1-1/+2
* module/srfi/srfi-37.scm (args-fold): When checking if an argument is an option (starts with #\-), first check if the length is non-zero.
2017-04-20Restore libgc 7.2 compatibilityAndy Wingo2-1/+9
* configure.ac: Check for GC_is_heap_ptr, added after libgc 7.2. * libguile/pairs.h (GC_is_heap_ptr): Define a shim for GC_is_heap_ptr, inside BUILDING_LIBGUILE so as not to expose it to users.
2017-04-19GNU Guile 2.2.1.v2.2.1Andy Wingo1-3/+3
* GUILE-VERSION (GUILE_MICRO_VERSION, LIBGUILE_INTERFACE_CURRENT): (LIBGUILE_INTERFACE_AGE): Increment version.
2017-04-19Update release docsAndy Wingo1-17/+16
* doc/release.org: Update for 2.2.
2017-04-19Update NEWSAndy Wingo1-1/+19
* NEWS: Update.
2017-04-19guile-snarf: skip -g* arguments to avoid build failureSergei Trofimovich1-2/+14
* libguile/guile-snarf.in: skip -g* arguments to avoid failure on -ggdb3. Bug: https://bugs.gentoo.org/608190 Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-04-19api-procedures.texi: typo: 'an' -> 'on'Sergei Trofimovich1-1/+1
* doc/ref/api-procedures.texi: Fix typo. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-04-19Documentation typo tweakSergei Trofimovich1-1/+1
* doc/ref/api-data.texi: Tweak 'u+0007' to 'U+0007' (as in the rest of the table). Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-04-19Fix spurious warnings in net_db.cAndy Wingo1-2/+2
* libguile/guile-func-name-check (/^SCM_DEFINE /): Fix pattern to not produce spurious warnings. Thanks to Dale Smith for the suggestion. Fixes https://bugs.gnu.org/26123.