summaryrefslogtreecommitdiff
path: root/libguile
AgeCommit message (Collapse)AuthorFilesLines
2014-01-14Merge branch 'stable-2.0'Mark H Weaver1-2/+6
2014-01-14print: In R7RS |...| symbols, print most graphic characters unescaped.Mark H Weaver1-2/+6
* libguile/print.c (print_r7rs_extended_symbol): Print any unicode graphic character other than '|' or '\' unescaped. Escape any spacing character other than ASCII space.
2014-01-14Merge branch 'stable-2.0'Mark H Weaver3-16/+107
Conflicts: libguile/print.c libguile/read.c test-suite/tests/print.test
2014-01-14print: Support R7RS |...| symbol notation.Mark H Weaver2-8/+67
* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option. (symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is enabled, then disallow '|' and '\' from bare symbols. (print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of 'display_string' and 'display_character' when printing ASCII literals. (print_r7rs_extended_symbol): New static function. (scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled, use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'. * libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro. (SCM_N_PRINT_OPTIONS): Increment. * doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols' print option. * test-suite/tests/print.test ("write"): Add tests.
2014-01-14read: Support R7RS |...| symbol notation.Mark H Weaver2-8/+37
* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro. (SCM_N_READ_OPTIONS): Increment. * libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'. (t_read_opts): Add field for 'r7rs_symbols_p'. (scm_read_string_like_syntax): New function based on earlier 'scm_read_string' that handles either string literals or R7RS quoted symbols (delimited by vertical bars), depending on the value of 'chr'. (scm_read_string): Reimplement based on 'scm_read_string_like_syntax'. (scm_read_r7rs_symbol): New static function. * doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS symbol syntax, mention the 'r7rs-symbols' read option, and give some examples. * doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols' read option. * test-suite/tests/reader.test ("reading"): Add test.
2014-01-14Merge branch 'stable-2.0'Mark H Weaver2-7/+72
Conflicts: libguile/chars.c libguile/read.c test-suite/tests/reader.test
2014-01-14read: use 'c_tolower' instead of 'tolower' in 'try_read_ci_chars'.Mark H Weaver1-1/+2
* libguile/read.c: Include <c-ctype.h>. (try_read_ci_chars): Use 'c_tolower' instead of 'tolower'.
2014-01-14Recognize 'escape' character name, per R7RS.Mark H Weaver1-3/+25
* libguile/chars.c (scm_r7rs_charnames, scm_r7rs_charnums): New static constants. (SCM_N_R7RS_CHARNAMES): New macro. (scm_i_charname, scm_i_charname_to_char): Adapt to new R7RS char names. * doc/ref/api-data.texi (Characters): Document #\escape. * test-suite/tests/reader.test ("reading"): Add test.
2014-01-14read: Accept "\|" in string literals.Mark H Weaver1-0/+1
* libguile/read.c (scm_read_string): Accept "\|" in string literals. * doc/ref/api-data.texi (String Syntax): Add "\|" to the list of supported backslash escapes. * test-suite/tests/reader.test ("reading"): Add test.
2014-01-14read: Support R7RS '#true' and '#false' syntax for booleans.Mark H Weaver1-3/+44
* libguile/read.c (try_read_ci_chars): New static function. (scm_read_boolean, scm_read_array): Use 'try_read_ci_chars'. * doc/ref/api-data.texi (Booleans): Update docs. * test-suite/tests/reader.test ("reading"): Add tests.
2014-01-14Merge branch 'stable-2.0'Mark H Weaver2-8/+11
Conflicts: libguile/hash.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm test-suite/tests/r6rs-ports.test
2014-01-13'port-position' works on CBIPs that do not support 'set-port-position!'.Ludovic Courtès1-7/+10
* libguile/r6rs-ports.c (cbp_seek)[WHENCE == SEEK_CUR]: Break out of the switch statement when OFFSET is zero. Pass 'scm_wrong_type_arg_msg' a phrase suitable for use after "expecting". * test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary input port supports `port-position', not `set-port-position!'"]: New test.
2014-01-12Fix hashing of empty vectors.Mark H Weaver1-1/+1
Fixes a bug introduced in cc1cd04f8111c306cf48b93e131d5c1765c808a3 "Fix hashing of vectors to run in bounded time." * libguile/hash.c (scm_hasher): Avoid division by zero. * test-suite/tests/hash.test ("hash"): Add tests.
2014-01-12Fix hashing of vectors to run in bounded time.Mark H Weaver1-26/+30
* libguile/hash.c (SCM_MIN): New macro. (scm_hasher): In vector case, do nothing if d is 0. Make sure to recurse with a reduced d. Move the loop out of the 'if'.
2014-01-09Merge branch 'stable-2.0'Mark H Weaver7-17/+43
Conflicts: module/system/vm/traps.scm test-suite/tests/peval.test
2014-01-08Fix 'string-copy!' to work properly with overlapping src/dest.Mark H Weaver1-3/+10
* libguile/srfi-13.c (scm_string_copy_x): Fix to work properly with overlapping src/dest. * test-suite/tests/srfi-13.test ("string-copy!"): Add tests.
2014-01-08Implement 'exact-integer?' and 'scm_is_exact_integer'.Mark H Weaver2-2/+23
* libguile/numbers.c (scm_exact_integer_p, scm_is_exact_integer): New procedures. (scm_integer_p): Improve docstring. * libguile/numbers.h (scm_exact_integer_p, scm_is_exact_integer): New prototypes. * doc/ref/api-data.texi (Integers): Add docs. * test-suite/tests/numbers.test ("exact-integer?"): Add tests.
2014-01-08scm_primitive_load: Simplify code using 'scm_open_file_with_encoding'.Mark H Weaver1-10/+5
* libguile/load.c (scm_primitive_load): Use 'scm_open_file_with_encoding'.
2014-01-08read: Avoid signed integer overflow in 'read_decimal_integer'.Mark H Weaver1-0/+3
* libguile/read.c (read_decimal_integer): Avoid overflow.
2014-01-08Increment SCM_N_READ_OPTIONS for 'curly-infix' option.Mark H Weaver1-1/+1
* libguile/private-options.h (SCM_N_READ_OPTIONS): Increment to 8. This should have been done when the 'curly-infix' was added.
2013-12-15Hide EINTR returns from 'accept'.Ludovic Courtès1-1/+1
* libguile/socket.c (scm_accept): Wrap 'accept' call in 'SCM_SYSCALL'.
2013-12-12Merge branch 'stable-2.0'Mark H Weaver1-1/+86
Conflicts: libguile/pairs.c libguile/vm.c test-suite/tests/control.test
2013-12-12Remove unused function scm_i_tag_name.Tom Tromey1-78/+0
* libguile/gc.c (scm_i_tag_name): Remove.
2013-12-12Add missing FUNC_NAME defines for pair accessors.Tom Tromey1-1/+92
* libguile/pairs.c (scm_car, scm_cdr, scm_caar, scm_cadr, scm_cdar, scm_cddr, scm_caaar, scm_caadr, scm_cadar, scm_caddr, scm_cdaar, scm_cdadr, scm_cddar, scm_cdddr, scm_caaaar, scm_caaadr, scm_caadar, scm_caaddr, scm_cadaar, scm_cadadr, scm_caddar, scm_cadddr, scm_cdaaar, scm_cdaadr, scm_cdadar, scm_cdaddr, scm_cddaar, scm_cddadr, scm_cdddar, scm_cddddr): Add missing FUNC_NAME defines.
2013-12-05vm: Gracefully handle stack overflows.Ludovic Courtès1-0/+15
Fixes <http://lists.gnu.org/archive/html/guile-user/2013-12/msg00017.html>. Reported by rvclayton@verizon.net (R. Clayton). * libguile/vm.c (reinstate_stack_reserve): New function. (vm_error_stack_overflow): Install it as an unwind handler. * test-suite/tests/control.test ("the-vm")["stack overflow reinstates stack reserve"]: New test.
2013-12-01Thread safe port properties.Mark H Weaver2-1/+18
* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x): Lock the port mutex while accessing the port alist. * libguile/read.c (set_port_read_option): Lock the port mutex while modifying port read options.
2013-11-30Fix more vm-engine commentsAndy Wingo1-8/+6
* libguile/vm-engine.c: Fix more comments.
2013-11-30Remove slot-ref and slot-set! opsAndy Wingo1-28/+3
* libguile/vm-engine.c: Remove slot-ref and slot-set! ops.
2013-11-30Fix vm-engine.c commentsAndy Wingo1-5/+6
* libguile/vm-engine.c: Fix some comments.
2013-11-28Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-7/+6
2013-11-28Critical sections in guardians do not need to block asyncsAndy Wingo1-7/+6
* libguile/guardians.c: Critical sections here cannot cause an async_tick, so they do not need to block asyncs.
2013-11-28Merge commit 'd364a8971828e38e8f9112b711066f4962bb400e'Andy Wingo2-40/+0
Conflicts: libguile/deprecated.h libguile/gc.c
2013-11-28Merge commit 'a38024baaa32d1a6d91fdc81388c88bbb926c3ae'Andy Wingo3-22/+32
Conflicts: libguile/ports.h
2013-11-28Merge commit '2437c7b2e8b4ab7786847ee1ce0b59e446a70fe2'Andy Wingo1-2/+16
Conflicts: libguile/guardians.c
2013-11-28Merge commit '8571dbde639e0ee9885bad49c9e180474bd23646'Andy Wingo3-0/+33
Conflicts: libguile/procprop.c
2013-11-28Merge commit '750ac8c592e792e627444f476877f282525b132e'Andy Wingo4-4/+6
Conflicts: .gitignore libguile/deprecated.c
2013-11-28Merge commit 'd360671c1cca335600079f1c5714572d1c2e676d'Andy Wingo1-1/+1
2013-11-28Deprecate gc-live-object-statsAndy Wingo4-39/+20
* libguile/gc.h: * libguile/gc.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_gc_live_object_stats): Deprecate; it hasn't worked in the whole 2.0 series.
2013-11-28Avoid needless GC on startup due to scm_gc_register_allocationAndy Wingo1-1/+1
* libguile/gc.c (bytes_until_gc): Initialize to DEFAULT_INITIAL_HEAP_SIZE, to avoid forced GC on the first mallocation.
2013-11-28Remove private-gc.hAndy Wingo9-60/+22
* libguile/simpos.c (scm_getenv_int): Move here, from gc.c. * libguile/private-gc.h: Remove, unused. * libguile/simpos.h: Move scm_getenv_int declaration here. * libguile/vm.c: * libguile/gc.c: Adapt scm_getenv_int users. * libguile/gc-malloc.c: * libguile/load.c: * libguile/script.c: Remove private-gc includes from non-users of scm_getenv_int. * libguile/Makefile.am: Adapt.
2013-11-28scm_i_tag_name internal to gc.cAndy Wingo2-3/+2
* libguile/gc.c (scm_i_tag_name): Make internal to gc.c. * libguile/private-gc.h: Remove from here.
2013-11-28More private-gc excisionsAndy Wingo2-18/+14
* libguile/private-gc.h (SCM_DOUBLECELL_ALIGNED_P): Remove; unused. * libguile/filesys.c (MAX, MIN): Move definitions here, from private-gc.h. (scm_sendfile, scm_readdir): Adapt uses of SCM_MAX and SCM_MIN to use MAX or MIN.
2013-11-28Remove unused enum policy_on_errorAndy Wingo1-3/+0
* libguile/private-gc.h (enum policy_on_error): Remove unused enum.
2013-11-28Tune initial heap sizeAndy Wingo3-15/+9
* libguile/fluids.c (new_fluid): Don't run an explicit GC for the first fluid. * libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE, scm_storage_prehistory): Enlarge from 32 kB to 512 or 1024 kB, depending on word size. Reduces startup time by 10 or 15% by avoiding excessive GC. * libguile/private-gc.h: Remove SCM_DEFAULT_INIT_HEAP_SIZE_2 definition here.
2013-11-28Remove another GC 6.8 hackAndy Wingo1-7/+0
* libguile/gc.c (scm_storage_prehistory): Remove hack for BDW-GC 6.8.
2013-11-27Remove nonfunctional gdb interfaceAndy Wingo6-471/+0
* libguile/gdb_interface.h: * libguile/gdbint.c: * libguile/gdbint.h: Remove. These were last modified significantly in 1997 and I think they are unused. * libguile/guile.c: Remove use. * libguile.h: Remove inclusion. * libguile/Makefile.am: Remove reference. * libguile/init.c: Remove use.
2013-11-27Remove the restore-continuation-hook.Andy Wingo3-19/+0
* libguile/vm.h: * libguile/vm.c: * libguile/vm-engine.c: * module/system/vm/traps.scm: * module/system/vm/vm.scm: Remove the unused and redundant restore-continuation-hook.
2013-11-27Declare r6rs-ports functionsAndy Wingo2-1/+4
* libguile/r6rs-ports.h: * libguile/r6rs-ports.c: Declare scm_unget_bytevector and scm_i_make_transcoded_port.
2013-11-27Fix uninitialized variable error in some peek-char error casesAndy Wingo1-1/+1
* libguile/ports.c (scm_peek_char): Don't require error cases to set *len. Fixes a bug caught by GCC whereby an EOF while reading a multibyte character with iconv would leave len uninitialized.
2013-11-27Declare scm_i_open_file to silence a warningAndy Wingo1-0/+2
* libguile/fports.c (scm_i_open_file): Declare.