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

3600 commits

Author SHA1 Message Date
Michael Gran
cd2d5a2500 Let suspendable ports' read-line handle alternate line endings
Handle CRLF, NEL, LS and PS to match the new C implementation.

* module/ice-9/suspendable-ports.scm (%read-line): handle alternate line endings
  (read-line): use new %read-line
2018-04-25 20:36:43 -07:00
Michael Gran
6d325a7a27 simplify reading http headers using updated %read-line
%read-line can handle CRLF now.

* module/web/http.scm (read-header-line): modified
2018-04-17 17:36:55 -07:00
Michael Gran
1405b76dbc ice-9 ftw: handle non-working inodes
* module/ice-9/ftw.scm (visited?-proc): accept filename for string hash
  (file-system-fold): use string hash if ino = 0
  (ftw): use new visited?-proc
* test-suite/tests/ftw.test (visited?-proc valid inodes): add filenames to visited?-proc calls
  (visited?-proc broken inodes): new tests
  (%top-srcdir): canonicalize-path
2018-04-16 20:57:12 -07:00
Michael Gran
5cad80262a ice-9 ftw: handle missing getuid and getgid
* module/ice-9/ftw.scm (getuid-or-false, getgid-or-false): new macros
  (stat-dir-readable?-proc): don't overwrite arguments
  (ftw, nftw): use new macros
* test-suite/tests/ftw.test (test-EACCES): don't presume getuid exists
2018-04-16 20:38:38 -07:00
Michael Gran
851c05a584 remove a re-definition of when/unless
They are now in core library.

* module/scripts/snarf-check-and-output-texi.scm (when, unless): removed
2018-04-16 19:19:24 -07:00
Mark H Weaver
b56e084c77
Fix eta-conversion edge cases in peval.
Fixes <https://bugs.gnu.org/29520>.
Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

* module/language/tree-il/peval.scm (peval)[lift-applied-lambda]: Before
performing eta-conversion, check that the variable(s) passed to the
inner 'apply' are not referenced from the inner lambda, and that the
number of required arguments would not be reduced by the conversion.
2018-03-15 23:22:26 -04:00
Shea Levy
08bb462836
Recognize RISC-V compilation targets.
* module/system/base/target.scm (cpu-endianness): Add case for "riscv" variants.

Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Mark H Weaver <mhw@netris.org>
2018-03-15 23:15:44 -04:00
Ludovic Courtès
3986053959 srfi-18: 'thread-sleep!' timeout-as-a-number is relative.
This is a followup to <https://bugs.gnu.org/29704>.

* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
keep it as-is.
* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
the timeout.
("thread sleeps fractions of a second"): Pass 0.5 as the timeout.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
2c7b350f93 srfi-18: When timeout is a number, it's a relative number of seconds.
Fixes <https://bugs.gnu.org/29704>.
Reported by David Beswick <dlbeswick@gmail.com>.

* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
(mutex-lock!): Use it in 'thread:lock-mutex' call.
(mutex-unlock!): Use it.
* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
("mutex-lock! returns true when lock obtained within timeout")
("recursive lock waits")
("mutex unlock is false when condition times out"): Adjust cases where
the 'timeout' parameter is a number so that it's a relative number.
2018-02-16 15:29:35 +01:00
Ludovic Courtès
a1793bc904 Revert "Honor '%fresh-auto-compile'."
This reverts commit 83d4c4d622,
which came from a misunderstanding.
2018-01-15 23:17:24 +01:00
Ludovic Courtès
988aa29238 compile: Load language modules upfront.
Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
--from=elisp ... language/elisp/boot.el" would fail with an exception
from 'load-thunk-from-memory' while trying to load (language elisp spec)
from the guile-being-compiled instead of using that of the
guile-for-build.

The problem did not manifest with --from=scheme because (language scheme
spec) happened to be already loaded before we had changed %load-path.

* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.
2017-12-22 17:00:33 +01:00
Andy Wingo
19c0e30243 Avoid generating arity-adapting zero-value conts where possible
* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
  generating arity-adapting continuations for nullary continuations.
2017-12-01 11:01:39 +01:00
Andy Wingo
83042571c1 Avoid generating arity-adapting continuations if not needed
* module/language/tree-il/compile-cps.scm (adapt-arity): Allow k to be
  $kargs for the 1-valued case.
  (convert): For single-valued continuations where the definition is
  clearly single-valued, avoid making a needless $kreceive and extra
  "rest" binding that will just be filled with () and have to be
  eliminated later.
2017-11-30 18:32:35 +01:00
Andy Wingo
3e6857a535 -O1 disables call precoloring
* module/language/cps/compile-bytecode.scm (compile-function)
  (emit-bytecode):
* module/language/cps/slot-allocation.scm (allocate-slots):
* module/language/cps/optimize.scm (cps-default-optimization-options):
  Allow the "lazy vars" optimization, a form of slot precoloring, to be
  disabled.  It will be disabled at -O0 or -O1, to speed compilation
  times.
2017-11-30 17:02:27 +01:00
Andy Wingo
bb77c0f537 Improve CSE complexity
* module/language/cps/cse.scm (compute-available-expressions):
  (compute-equivalent-subexpressions): Improve algorithmic complexity of
  CSE by pre-computing the labels whose reads are clobbered by a label's
  writes.
2017-11-30 13:10:03 +01:00
Andy Wingo
8e7f857b02 Add compute-clobber-map to effect analysis
* module/language/cps/effects-analysis.scm (compute-clobber-map): New
  public function.
2017-11-30 13:09:53 +01:00
Andy Wingo
d4883307ca Minor CSE run-time optimization
* module/language/cps/cse.scm (compute-equivalent-subexpressions): Minor
  optimization to reduce the size of equivalent expression keys, and to
  avoid some work if an expression has no key.
2017-11-30 13:08:32 +01:00
Andy Wingo
8e2314c46d Simplify live variable computation for graphs without loops
* module/language/cps/slot-allocation.scm
  (compute-reverse-control-flow-order): For graphs without back-edges,
  use a simplified computation of reverse control flow order.
2017-11-29 20:23:10 +01:00
Andy Wingo
76d4608d7a Add nullary intmap and intset folders
* module/language/cps/intmap.scm (intmap-fold, intmap-fold-right):
* module/language/cps/intset.scm (intset-fold, intset-fold-right): Add
  nullary folders.
2017-11-29 20:23:10 +01:00
Andy Wingo
5f59e2812d Fix logand type inference
* module/language/cps/types.scm (logand): We were computing the wrong
  ranges when either argument was negative; a terrible bug!
  (logsub): Also fix range when A is negative and B is non-negative.
  (ulogand): Tighten up range.
2017-11-29 20:23:10 +01:00
Matt Wette
bb5d316b16 foreign: Add 'uintptr_t' and 'intptr_t'.
* libguile/foreign.c (scm_uintptr_t, scm_intptr_t): New variables.
(scm_init_foreign): Define them.
* module/system/foreign.scm: Export 'intptr_t' and 'uintptr_t'.
* doc/ref/api-foreign.texi (Foreign Types): Document them.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-11-22 16:33:57 +01:00
Maxim Cournoyer
3e7c80a62f scripts: help: Fix reference to the "Using Guile Tools" node.
Fixes <https://bugs.gnu.org/28835>.

* module/scripts/help.scm (list-commands): Fix reference to the "Using
Guile Tools" node.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-11-22 16:21:59 +01:00
Ludovic Courtès
83d4c4d622 Honor '%fresh-auto-compile'.
Fixes <https://bugs.gnu.org/29226>.

* libguile/load.c (scm_primitive_load_path): Set 'compiled_thunk' to
SCM_BOOL_F when *scm_loc_fresh_auto_compile is true.
* module/ice-9/boot-9.scm (load-in-vicinity)[load-absolute]: Call
'pre-compiled' only when %FRESH-AUTO-COMPILE is false.
2017-11-22 16:04:24 +01:00
Ludovic Courtès
6ad28ae3bc http: Fix typo in proxy handling in 'write-request-line'.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00190.html>.

* module/web/http.scm (write-request-line): Fix more typos introduced in
96b994b6f8.
2017-11-11 15:14:54 +01:00
Ludovic Courtès
7d0d9e2c25 http: Fix typo in proxy handling in 'write-request-line'.
Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>
at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>.

* module/web/http.scm (write-request-line): Move 'string-index' first in
'cond' clause.  Fixes a regression introduced in
96b994b6f8.
2017-11-10 22:54:49 +01:00
Ludovic Courtès
b322ac67d3 Print exception location only once.
Fixes a regression introduced in commit
39090e677e.

* module/ice-9/boot-9.scm (exception-printers)[print-exception]: Remove
extraneous 'print-location' call.
2017-11-09 21:56:39 +01:00
Ludovic Courtès
81d2e35266 Allow GDB support to be used with GDB-linked-against-Guile-2.0.
* libguile/Makefile.am (INSTANTIATE): New variable.
(install-data-hook): Use it.
* libguile/libguile-2.2-gdb.scm: Autoload (system vm debug).
Augment %load-path and %load-compiled-path, and reload (system base
types).
* module/system/base/types.scm: Remove #:hide to be 2.0-compatible.
Use (system syntax internal) conditionally when on 2.2.
2017-11-05 18:21:35 +01:00
Daniel Llorens
e0bcda4ad9 Fix bitvectors and non-zero lower bound arrays in truncated-print
* 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-31 13:23:44 +01:00
Daniel Llorens
3bfd4aaa6e Fix sort, sort! for arrays with nonzero lower bound
* 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-31 13:23:17 +01:00
Ludovic Courtès
bf060d2aff 'frame-matcher' doesn't crash when the last IP is unknown.
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-10-25 10:48:50 -07:00
Andy Wingo
a74d4ee4f6 Add struct-ref/unboxed, struct-set!/unboxed
* 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-25 21:54:36 +02:00
Andy Wingo
f23415589a GOOPS slot access protected via slot accessors, not struct perms
* 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-23 14:24:34 +02:00
Andy Wingo
fe4a34d20d Deprecate make-struct
* 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-22 10:32:33 +02:00
Andy Wingo
dd11b82162 Use make-struct/no-tail instead of make-struct
* 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-20 22:07:18 +02:00
Andy Wingo
da9da0eca4 psyntax generates calls to make-struct/no-tail
* module/ice-9/psyntax.scm (define-expansion-constructors): Expand to
  make-struct/no-tail.
* module/ice-9/psyntax-pp.scm: Regenerate.
2017-09-20 21:55:21 +02:00
Andy Wingo
7095a536f3 web: add support for URI-reference
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-21 13:42:29 +02:00
Andy Wingo
0c102b56e9 Fix reading of HTTPS responses that are smaller than port buffer
* 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-28 13:38:41 +02:00
Ludovic Courtès
886ac3e2ab SRFI-19: Swap seconds and nanoseconds in 'current-time-monotonic'.
* module/srfi/srfi-19.scm (current-time-monotonic): Swap the 2nd and 3rd
arguments.  Fixes a regression introduced in
commit b11e2922c3.
2017-04-22 01:01:32 +02:00
Thomas Danckaert
02cf38514d SRFI-37: Account for zero-length arguments.
* 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-20 10:58:54 +02:00
Freja Nordsiek
a7428a3172 Fixed bug: statprof flat display wasn't writing summary lines to port
* module/statprof.scm (statprof-display/flat): fixed bug where summary lines
  were written to (current-output-port) instead of the provided port.
2017-04-19 16:25:00 +02:00
Andy Wingo
4b39c1a9e5 Fix date->string ~f operator to not emit leading zeros
* module/srfi/srfi-19.scm (directives): Format ~f without leading
  zeroes.  Fixes https://bugs.gnu.org/26260.
* test-suite/tests/srfi-19.test ("SRFI date/time library"): Add test.
2017-04-19 15:42:03 +02:00
Andrew Moss
1978085b22 Fixed bug: ~N mishandles small nanoseconds value
Fixes <http://bugs.gnu.org/26261>.
Reported by Zefram <zefram@fysh.org>.

* module/srfi/srfi-19.scm ("define directives"): N padding increased from 7 to 9

* test-suite/tests/srfi-19.test ("date->string"): New test.
2017-04-19 15:13:09 +02:00
Andy Wingo
b11e2922c3 SRFI-19 current-time-monotonic returns time of right type
* module/srfi/srfi-19.scm (current-time-monotonic): Actually return a
  time with the correct type.  Fixes #26329.
2017-04-19 15:08:46 +02:00
Andy Wingo
e0502f3c77 Bump objcode version in a compatible way
* libguile/_scm.h (SCM_OBJCODE_MINIMUM_MINOR_VERSION): New definition,
  indicating the oldest objcode version that we support.
  (SCM_OBJCODE_MINOR_VERSION): Bump.
* libguile/loader.c (process_dynamic_segment): Support a range of
  versions.
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
2017-04-18 21:37:36 +02:00
Andy Wingo
7c71be0c7e Add sandboxed evaluation facility
* module/ice-9/sandbox.scm: New file.
* module/Makefile.am (SOURCES): Add new file.
* doc/ref/api-evaluation.texi (Sandboxed Evaluation): New section.
* NEWS: Update.
* test-suite/tests/sandbox.test: New file.
* test-suite/Makefile.am: Add new file.
2017-04-18 21:27:45 +02:00
Andy Wingo
7ed54fd36d All literal constants are read-only
* libguile/array-handle.c (initialize_vector_handle): Add mutable_p
  argument.  Unless the vector handle is mutable, null out its
  writable_elements member.
  (scm_array_get_handle): Adapt to determine mutability of the various
  arrays.
  (scm_array_handle_elements, scm_array_handle_writable_elements):
  Reverse the sense: instead of implementing read-only in terms of
  read-write, go the other way around, adding an assertion in the
  read-write case that the array handle is mutable.
* libguile/array-map.c (racp): Assert that the destination is mutable.
* libguile/bitvectors.c (SCM_F_BITVECTOR_IMMUTABLE, IS_BITVECTOR):
  (IS_MUTABLE_BITVECTOR): Add a flag to indicate immutability.
  (scm_i_bitvector_bits): Fix indentation.
  (scm_i_is_mutable_bitvector): New helper.
  (scm_array_handle_bit_elements)
  ((scm_array_handle_bit_writable_elements): Build writable_elements in
  terms of elements.
  (scm_bitvector_elements, scm_bitvector_writable_elements): Likewise.
  (scm_c_bitvector_set_x): Require a mutable bitvector for the
  fast-path.
  (scm_bitvector_to_list, scm_bit_count): Use read-only elements()
  function.
* libguile/bitvectors.h (scm_i_is_mutable_bitvector): New decl.
* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE):
  (INTEGER_GETTER_PROLOGUE, INTEGER_SETTER_PROLOGUE):
  (INTEGER_REF, INTEGER_NATIVE_REF, INTEGER_SET, INTEGER_NATIVE_SET):
  (GENERIC_INTEGER_ACCESSOR_PROLOGUE):
  (GENERIC_INTEGER_GETTER_PROLOGUE, GENERIC_INTEGER_SETTER_PROLOGUE):
  (LARGE_INTEGER_NATIVE_REF, LARGE_INTEGER_NATIVE_SET):
  (IEEE754_GETTER_PROLOGUE, IEEE754_SETTER_PROLOGUE):
  (IEEE754_REF, IEEE754_NATIVE_REF, IEEE754_SET, IEEE754_NATIVE_SET):
  Setters require a mutable bytevector.
  (SCM_BYTEVECTOR_SET_FLAG): New helper.
  (SCM_BYTEVECTOR_SET_CONTIGUOUS_P, SCM_BYTEVECTOR_SET_ELEMENT_TYPE):
  Remove helpers.
  (SCM_VALIDATE_MUTABLE_BYTEVECTOR): New helper.
  (make_bytevector, make_bytevector_from_buffer): Use
  SCM_SET_BYTEVECTOR_FLAGS.
  (scm_c_bytevector_set_x, scm_bytevector_fill_x)
  (scm_bytevector_copy_x): Require a mutable bytevector.
* libguile/bytevectors.h (SCM_F_BYTEVECTOR_CONTIGUOUS)
  (SCM_F_BYTEVECTOR_IMMUTABLE, SCM_MUTABLE_BYTEVECTOR_P): New
  definitions.
* libguile/bytevectors.h (SCM_BYTEVECTOR_CONTIGUOUS_P): Just access one
  bit.
* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Implement
  writable_elements() in terms of elements().
* libguile/strings.c (scm_i_string_is_mutable): New helper.
* libguile/uniform.c (scm_array_handle_uniform_elements):
  (scm_array_handle_uniform_writable_elements): Implement
  writable_elements in terms of elements.
* libguile/vectors.c (SCM_VALIDATE_MUTABLE_VECTOR): New helper.
  (scm_vector_elements, scm_vector_writable_elements): Implement
  writable_elements in terms of elements.
  (scm_c_vector_set_x): Require a mutable vector.
* libguile/vectors.h (SCM_F_VECTOR_IMMUTABLE, SCM_I_IS_MUTABLE_VECTOR):
  New definitions.
* libguile/vm-engine.c (VM_VALIDATE_MUTABLE_BYTEVECTOR):
  (VM_VALIDATE_MUTABLE_VECTOR, vector-set!, vector-set!/immediate)
  (BV_BOUNDED_SET, BV_SET): Require mutable bytevector/vector.
* libguile/vm.c (vm_error_not_a_mutable_bytevector):
  (vm_error_not_a_mutable_vector): New definitions.
* module/system/vm/assembler.scm (link-data): Mark residualized vectors,
  bytevectors, and bitvectors as being read-only.
2017-04-18 21:27:45 +02:00
Ludovic Courtès
d7778b3d6a types: Hide one of the 'bytevector->string' procedures.
* module/system/base/types.scm: Hide 'bytevector->string' from (rnrs io
ports).
2017-04-14 23:26:41 +02:00
Andy Wingo
ce934bcd43 Add allow-legacy-syntax-objects? parameter
* module/ice-9/psyntax.scm (syntax?): Only recognize legacy syntax
  objects if the new allow-legacy-syntax-objects? parameter is true.
* module/ice-9/boot-9.scm (allow-legacy-syntax-objects?): New
  parameter.
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document the
  horrible situation with legacy syntax objects.
* NEWS: Add entry.
2017-03-28 21:27:11 +02:00
Andy Wingo
a42bfae65f Psyntax generates new syntax objects
* module/ice-9/psyntax.scm (make-syntax-object): Change to make
  new-style syntax objects.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/compile-psyntax.scm (squeeze-syntax-object): Change to be
  functional.
  (squeeze-constant): Likewise.
  (squeeze-tree-il): Likewise.
  (translate-literal-syntax-objects): New pass.  The compiler can embed
  literal syntax objects into compiled objects, but syntax can no longer
  be read/written; otherwise users could forge syntax objects.  So for
  the bootstrap phase, rewrite literal constants to calls to
  make-syntax.
2017-03-28 19:23:13 +02:00
Andy Wingo
eb84c2f2da Beginnings of psyntax switch to new syntax objects
* module/ice-9/psyntax.scm: Baby steps towards support of a new
  representation of syntax objects.
* module/ice-9/psyntax-pp.scm: Regenerate.
2017-03-28 19:23:13 +02:00