summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-10Use lower-case windows.hMichael Gran1-1/+1
On some linux cross-builds, Windows.h is windows.h. On MinGW case is irrelevant. * libguile/posix-w32.h: modified
2021-03-09Write a proper vector-map and vector-for-each for (rnrs base)Linus2-9/+81
* module/rnrs/base.scm (vector-map vector-for-each): Rewrite to not be slow. * NEWS: Update.
2021-03-09Document syntax-sourcevAndy Wingo3-1/+11
* NEWS: Add doc link. * doc/ref/api-macros.texi (Syntax Transformer Helpers): Document syntax-sourcev. * module/system/syntax.scm: Re-export syntax-sourcev.
2021-03-09Document quote-syntaxAndy Wingo2-2/+25
* NEWS: Update. * doc/ref/api-macros.texi (Syntax Case): Update.
2021-03-09Update NEWSAndy Wingo1-0/+7
* NEWS: More words about mini-gmp.
2021-03-08Fix define error for mini-gmpMichael Gran1-1/+1
* libguile/gen-scmconfig.c [!SCM_I_GSC_ENABLE_MINI_GMP]: define SCM_ENABLE_MINI_GMP as zero, not undef
2021-03-08Update NEWS for --enable-mini-gmpAndy Wingo1-0/+45
* NEWS: Update.
2021-03-08Only install libgc as GMP allocator with mini-gmpAndy Wingo1-5/+19
* libguile/numbers.c (scm_install_gmp_memory_functions): Default to 1 only if mini-gmp is enabled.
2021-03-08Don't expose mini-gmp to usersAndy Wingo2-14/+26
* libguile.h: Don't import anything GMP-related. * libguile/numbers.h: Import GMP here instead. If we are using mini-GMP, only import it when building Guile. (scm_to_mpz, scm_from_mpz): Don't define when mini-gmp is enabled.
2021-03-07More informative error message if GMP not foundAndy Wingo1-1/+1
* configure.ac: Mention --enable-mini-gmp if GMP not found.
2021-03-07Fix reading #!!#Andy Wingo2-9/+26
* module/ice-9/read.scm (%read): Fix reading #!!#. * test-suite/tests/reader.test ("reading"): Add some test cases.
2021-03-05tweak unknown hash object error in readerMichael Gran1-1/+1
This makes it match the other species of unknown hash object error when reading number with radix. * module/ice-9/read.scm (read-sharp): modified
2021-03-05print token in error msg for unknown hash objectMichael Gran1-1/+1
* module/ice-9/read.scm (read-number-and-radix): modified
2021-03-05Handle <eof> in reader's character escape sequencesMichael Gran1-0/+6
* module/ice-9/read.scm (read-r6rs-hex-escape, read-fixed-hex-escape): modified
2021-03-05Fix reading "#;", "'", and similar premature-EOF situationsAndy Wingo2-25/+25
* module/ice-9/read.scm (%read): Adjust how subexpressions are read to error on EOF. Improve the error message. * test-suite/tests/reader.test ("#;"): Adapt expectation.
2021-03-05Fix up source properties section in manualAndy Wingo1-6/+6
* doc/ref/api-debug.texi (Source Properties): Fix wordo, and adapt text.
2021-03-05Fix reading of #true / #falseAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Fix bad argument order to unread-char.
2021-03-04Update reference for GUILE_EXTENSIONS_PATHAndy Wingo2-4/+12
* NEWS: Update. * doc/ref/guile-invoke.texi (Environment Variables): Add entry.
2021-03-04Update documentation to incorporate read-syntaxAndy Wingo4-42/+96
* NEWS: Update a bit. * doc/ref/api-debug.texi (Source Properties): Mention read-syntax. * doc/ref/api-evaluation.texi (Annotated Scheme Read): New section. * doc/ref/api-macros.texi (Syntax Case): Update for source vectors.
2021-03-04Syntax objects print with source locationsAndy Wingo1-2/+11
* module/system/syntax.scm (print-syntax): Print source locations.
2021-03-04Add docstring for array-shapeDaniel Llorens1-2/+12
2021-03-04Fix reading improper curly-infix expressionsAndy Wingo1-3/+3
* module/ice-9/read.scm (%read): A fix to last night's fix, to make srfi-105.test pass.
2021-03-03don't presume availability of gmp.pcMichael Gran8-32/+34
This suggests moving the conditional that determines if mini-gmp is used into scmconfig.h. * configure.ac: replace PKG_CHECK_MODULES for gmp with AC_LIB_HAVE_LINKFLAGS Remove ENABLE_MINI_GMP define. Also don't run mpz_inits test for --enable-mini-gmp. * libguile/gen-scmconfig.c (main) [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP with SCM_I_GSC_ENABLE_MINI_GMP * libguile/bytevectors.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP with SCM_ENABLE_MINI_GMP * libguile/init.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP with SCM_ENABLE_MINI_GMP * libguile/numbers.c: include scm.h [SCM_ENABLE_MINI_GMP]: provide mpz_inits and mpz_clears [ENABLE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP to ENABLE_MINI_GMP * libguile/numbers.h: include scm.h * libguile/random.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP with SCM_ENABLE_MINI_GMP * libguile/socket.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP with SCM_ENABLE_MINI_GMP
2021-03-03Fix reading #c32 vectorsAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Fix a wee typo.
2021-03-03Fix some srfi-105 parsing errorsAndy Wingo1-7/+8
* module/ice-9/read.scm (%read): Fix parsing errors.
2021-03-03Fix length of \U hex escape in new readerAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): \U escape is 6 digits long.
2021-03-03Remove read extension support from primitive-readAndy Wingo1-37/+5
* libguile/read.c (scm_read_sharp_extension): Remove. (scm_read_sharp): Adapt.
2021-03-03More read.c simplificationsAndy Wingo1-30/+28
* libguile/read.c: Use "return EXPR" instead of "return (EXPR)". Avoid passing around line and column info, as we don't use it any more.
2021-03-03primitive-read handles only default reader optionsAndy Wingo1-656/+122
* libguile/read.c: Remove support for all non-default reader options. Also remove support for source positions. The idea is that primitive-read should just be a stripped-down, easy-to-understand reader that is enough to bootstrap the C reader. Probably more refactoring will follow.
2021-03-03Scheme reader fully replaces C readerAndy Wingo2-4/+22
* libguile/read.h: * libguile/read.c (scm_primitive_read): New name for C reader. (scm_read): Call current value of "read" variable. (scm_init_read): Initialize "read" binding to "primitive-read". Replaced later in boot-9.
2021-03-03Fix bug in new array readerDaniel Llorens2-5/+37
* module/ice-9/read.scm (read-array): Return pair for dimension when len is given; single number is lbnd for list->typed-array. * test-suite/tests/arrays.test: More test cases for the reader.
2021-03-03Read-in-scheme replaces boot "read" definitionAndy Wingo11-46/+62
Instead of defining a separate module, given that "read" calls are quite all over the place, we're just going to replace the boot "read" binding with read.scm. This way, we'll be able to remove support for reader options in the boot reader, as it will only ever be used for a finite set of files. * NEWS: Update. * module/Makefile.am (ice-9/boot-9.go): Depend on read.scm. (SOURCES): * am/bootstrap.am (SOURCES): Don't build a ice-9/read.go, as we include it. * module/ice-9/boot-9.scm (read-syntax): Define here, as "include" now uses it. (read-hash-procedures, read-hash-procedure, read-hash-extend): New procedures. Will replace C variants. (read, read-syntax): Include read.scm to define these. * module/ice-9/psyntax-pp.scm (include): Regenerate. * module/ice-9/psyntax.scm (include): Use read-syntax, so we get better source information. * module/ice-9/read.scm (let*-values): New local definition, to avoid loading srfi-11. (%read): Use list->typed-array instead of u8-list->bytevector. * module/language/scheme/spec.scm: Remove (ice-9 read) import; read-syntax is there in the boot environment
2021-03-03Relax srfi-105 source expectationsAndy Wingo1-2/+8
* test-suite/tests/srfi-105.test ("curly-infix"): For { EXPR }, allow the source to be at the { rather than at EXPR.
2021-03-03Fix unterminated #!...!# error message in Scheme readerAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Tweak "unterminated block constant" error to be more compatible with C reader.
2021-03-03Fix reading neoteric exprs in Scheme readerAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Call the inner reader, not the outer reader.
2021-03-03Fix reader extensions in Scheme readerAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Fix invocation of hash procedure.
2021-03-03Invalid charset at EOF does not cause decoding errorAndy Wingo2-10/+3
* libguile/ports.c (peek_iconv_codepoint): If the input has no bytes, there's little point in raising a decoding error here. Therefore remove the needless iconv acquisition, harmonising with suspendable-ports. * test-suite/tests/ports.test ("port-encoding"): Update test to include some input so that the exception gets raised.
2021-03-03Remove textual-ports include from (ice-9 read)Andy Wingo1-2/+1
* module/ice-9/read.scm: We'll be loading this file early, so avoid extraneous deps.
2021-03-02improve autoconfigury for minigmpMichael Gran10-15/+23
* configure.ac: add SCM_I_GSC_ENABLE_MINI_GMP var and rename GUILE_MINI_GMP to ENABLE_MINI_GMP * libguile/bytevectors (GUILE_MINI_GMP): rename to ENABLE_MINI_GMP * libguile/gen-scmconfig.c: renamed GUILE_MINI_GMP to ENABLE_MINI_GMP. rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP * libguile/gen-scmconfig.h: add SCM_I_GSC_ENABLE_MINI_GMP * libguile/init.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/numbers.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/numbers.h: include scmconfig.h rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP * libguile/random.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/socket.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile.h [GUILE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP
2021-03-02Enable option to prefer mini-gmp over libgmpMichael Gran12-25/+4951
* configure.ac: rework gmp library detection. Add new flag. * libguile.h: modify gmp header inclusion * libguile/Makefile.am: add mini-gmp.[ch] files * libguile/bytevectors.c: add mini-gmp headers * libguile/gen-scmconfig.c: new #include variable GUILE_MINI_GMP * libguile/init.c: add mini-gmp header * libguile/mini-gmp.c: new file * libguile/mini-gmp.h: new file * libguile/numbers.c: add fallback for missing mpz_get_d_2exp * libguile/numbers.h: yse mini-gmp header * libguile/random.c: use mini-gmp header * libguile/socket.c: use mini-gmp header
2021-03-02Fix another typo in routine reading arraysDaniel Llorens2-2/+6
* module/ice-9/read.scm: As stated. * test-suite/tests/arrays.test: Test a fixed case.
2021-03-02Fix bug reading arrays with lengthsAndy Wingo1-1/+1
* module/ice-9/read.scm (%read): Fix typo.
2021-03-01Update NEWSAndy Wingo1-0/+62
* NEWS: Start updating for new release.
2021-02-28Fix Scheme read without source positionsAndy Wingo1-1/+2
* module/ice-9/read.scm (read): Fix annotate when positions are disabled.
2021-02-25Shunt syntax-sourcev to (system syntax internal)Andy Wingo1-1/+2
* module/ice-9/boot-9.scm: Add syntax-sourcev to hidden bindings.
2021-02-25read-syntax uses vector source representationAndy Wingo1-3/+1
* module/ice-9/read.scm (read-syntax): Switch to sourcev format.
2021-02-25Psyntax uses sourcev internallyAndy Wingo2-150/+220
* module/ice-9/psyntax.scm: Use the vector representation of source properties internally. We have to convert to alists when going to Tree-IL, but this will be in harmony with syntax objects once the reader switches to vectors too. * module/ice-9/psyntax-pp.scm: Regenerate.
2021-02-25Assembler writes vector source propertiesAndy Wingo1-2/+2
* module/system/vm/assembler.scm (intern-constant, link-data): Write the vector representation of source instead of the alist. Saves a lot of heap size, object file size, and init time when serializing syntax objects with source.
2021-02-25Add syntax-sourcevAndy Wingo2-3/+53
* libguile/syntax.c (sourcev_to_props, props_to_sourcev) (scm_syntax_source, scm_syntax_sourcev): Add alternate source representation for syntax objects.
2021-02-25Optimize run-time init and relocation procedureAndy Wingo1-57/+109
* module/system/vm/assembler.scm (<asm>, make-assembler) (intern-constant, emit-init-constants): Instead of loading a dependent value each time it's needed in the relocation procedure, eagerly patch values when they are created. Allows keeping values in registers, which decreases code size.