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

15770 commits

Author SHA1 Message Date
Ludovic Courtès
449be2a5e5 build: Adjust autogen.sh to 'libtoolize' name on Darwin.
Reported by Daniel Llorens.

* autogen.sh: Use 'glibtoolize' on Darwin.
2014-10-06 15:23:10 +02: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
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
7a71a45cfd peval: Handle optional argument inits that refer to previous arguments.
Fixes <http://bugs.gnu.org/17634>.
Reported by Josep Portella Florit <jpf@primfilat.com>.

* module/language/tree-il/peval.scm (inlined-application): When inlining
  an application whose operator is a lambda expression with optional
  arguments that rely on default initializers, expand into a series of
  nested let expressions, to ensure that previous arguments are in scope
  when the default initializers are evaluated.

* test-suite/tests/peval.test ("partial evaluation"): Add tests.
2014-09-28 23:51:20 -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
David Michael
3a3316e200 guile-readline: Use the current directory if HOME is unset.
* guile-readline/ice-9/readline.scm (history-file): When the HOME
  environment variable is unset, use the current directory instead.
2014-09-21 23:21:29 -04:00
Ludovic Courtès
76a8db27c6 build: Use 'libtoolize' in autogen.sh.
Fixes <http://bugs.gnu.org/18470>.
Reported by Rob Browning <rlb@defaultvalue.org>.

* autogen.sh: Invoke 'libtoolize' instead of 'libtool'.
2014-09-20 14:36:35 +02:00
David Kastrup
8442211ef0 Fix SCM_SMOB_OBJECT{_,_0_,_1_,_2_,_3_}LOC.
Fixes <http://bugs.gnu.org/18495>.

* libguile/smob.h (SCM_SMOB_OBJECT_LOC, SCM_SMOB_OBJECT_0_LOC)
  (SCM_SMOB_OBJECT_1_LOC, SCM_SMOB_OBJECT_2_LOC)
  (SCM_SMOB_OBJECT_3_LOC): These elementary API macros have been broken
  by commit 56164dc47f in 2009.

Signed-off-by: David Kastrup <dak@gnu.org>
2014-09-20 06:36:42 -04:00
Mark H Weaver
f2742bdd68 guild disassemble: Use #:prefix instead of #:renamer.
* module/scripts/disassemble.scm: Use #:prefix instead of #:renamer
  in #:use-module clause.
2014-09-20 05:47:05 -04: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
Mark H Weaver
8f230e3341 SRFI-43: vector-concatenate: Fix error message.
* module/srfi/srfi-43.scm (vector-concatenate): Fix the 'who' of an
  error message.
2014-09-20 05:44:15 -04:00
Mark H Weaver
97c520fd3f VM: Use register "a3" for IP_REG on m68k.
Subset of a patch by Andreas Schwab <schwab@linux-m68k.org>.
Reported by Rob Browning <rlb@defaultvalue.org>.

* libguile/vm-engine.h (IP_REG)[__mc68000__]: Use register "a3".
2014-09-20 05:43:27 -04:00
Mark H Weaver
bed025bd25 VM: Allow the C compiler to choose FP_REG on ARM.
Reported by Rob Browning <rlb@defaultvalue.org>.

* libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register
  choice ("r7") for FP_REG, which was reported to cause compilation
  failures on ARM.
2014-09-20 05:40:24 -04:00
Mark H Weaver
156119b022 Do not assume that 64-bit integers will be 64-bit aligned.
* libguile/foreign.c (raw_bytecode, objcode_cells):
* libguile/gsubr.c (raw_bytecode, objcode_cells): Use SCM_ALIGNED to
  ensure 64-bit alignment.
2014-09-20 05:38:05 -04:00
Mark H Weaver
a85c78ea13 VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL outputs.
Reported by Rob Browning <rlb@defaultvalue.org>.

* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
  to the SMULL output registers.
2014-09-20 05:30:41 -04:00
Ludovic Courtès
b38c19a5a5 tests: Link test against Gnulib.
Reported by Eli Zaretskii <eliz@gnu.org>.

* test-suite/standalone/Makefile.am (test_scm_take_locale_symbol_LDADD):
  Add libgnu.la, for the 'strdup' replacement.
2014-09-17 13:43:55 +02:00
Ludovic Courtès
9233c05585 Thank Franck. 2014-08-26 23:41:33 +02:00
Ludovic Courtès
8ac39b38d1 Handle ~p in 'format' warnings.
Fixes <http://bugs.gnu.org/18299>.
Reported by Frank Terbeck <ft@bewatermyfriend.org>.

* module/language/tree-il/analyze.scm (format-string-argument-count):
  Add case for ~p.
* test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too
  few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few
  arguments"): New tests.
2014-08-26 23:41:33 +02:00
Eli Zaretskii
c6a7930b38 On MS-Windows, don't return file names with backslashes from search-path.
* libguile/load.c (search_path): On MS-Windows, convert all
  backslashes to forward slashes if the file was found on PATH.
2014-08-15 09:47:52 +03:00
Mark H Weaver
cfefef6bd9 Copy the result from 'nl_langinfo' before it can be overwritten.
Based on a patch by Eli Zaretskii <eliz@gnu.org>.

* libguile/i18n.c (copy_string_or_null): New static function.
  (scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from
  'nl_langinfo' and 'nl_langinfo_l' before the next call and before
  releasing the locale mutex.
2014-08-13 22:47:32 -04:00
Eli Zaretskii
7c848fe572 Make temporary file in coding.test work on MS-Windows.
* test-suite/tests/coding.test (with-temp-file): Instead of
  hard-coding "/tmp" as the temporary directory, use $TMPDIR or
  $TEMP from the environment, and fall back on "/tmp" if none of
  those 2 is defined.
2014-08-13 18:41:15 +03: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
Ian Price
b072b8e692 Provide curried version of define*-public.
* module/ice-9/curried-definitions.scm (define*-public): New macro.
2014-07-31 16:05:58 +01:00
Ian Price
8857e271d8 Prevent add-to-load-path from adding duplicate entries
* module/ice-9/boot-9.scm (add-to-load-path): Remove argument from
  %load-path (if it exists) before pushing. This also means that the
  `elt' will always be at the front of %load-path.
2014-07-30 19:22:04 +01:00
Ludovic Courtès
ffd3e55cfd Recognize more ARM targets.
Suggested by Dale P. Smith.

* module/system/base/target.scm (cpu-endianness): Add cases for
  "arm.*eb", "^aarch64.*be", and "aarch64".  Change "arm" case to
  "arm.*".
  (triplet-pointer-size): Allow underscore as in 'aarch64_be'.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu",
  "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
2014-07-04 17:26:41 +02: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
Ludovic Courtès
f184e887a6 build: Support pthread builds without 'pthread_cancel' support (Android).
Reported by Sylvain Beucler <beuc@beuc.net>.

* configure.ac: Check for 'pthread_cancel'.
* libguile/threads.c (scm_cancel_thread): Conditionalize on
  !SCM_USE_PTHREAD_THREADS || defined HAVE_PTHREAD_CANCEL.
* test-suite/tests/threads.test (require-cancel-thread): New procedure.
  ("timed joining fails if timeout exceeded", "join-thread returns
  timeoutval on timeout", "cancel succeeds", "handler result passed to
  join", "can cancel self"): Use it.
2014-07-04 15:52:53 +02:00
Ludovic Courtès
8c75d3ae01 build: Use 'LT_LIB_M' to determine whether -lm is needed.
* configure.ac: Use 'LT_LIB_M' instead of 'AC_CHECK_LIB(m, cos)'.
  Suggested by Sylvain Beucler <beuc@beuc.net>.
2014-07-04 15:37:38 +02:00
Ludovic Courtès
df8c52e93d Recognize arm-* target triplets.
Reported by Sylvain Beucler <beuc@beuc.net>.

* module/system/base/target.scm (cpu-endianness): Add case where CPU is
  "arm".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]:
  New test.
2014-07-04 15:35:55 +02:00
Eli Zaretskii
c53b5d891f Remove trailing whitespace from ports.test. 2014-07-03 21:05:49 +03:00
Eli Zaretskii
8c6b62e7d5 Untabify some test files.
* test-suite/tests/ports.test: Untabify.
* test-suite/tests/posix.test: Untabify.
* test-suite/tests/r6rs-files.test: Untabify.
2014-07-03 21:02:23 +03:00
Eli Zaretskii
9235f805fa Fix problems with Windows file names that use backslashes.
* libguile/load.c (scm_i_mirror_backslashes): New function.
  (scm_init_load_path): Call it to produce MS-Windows file names
  with forward slashes.
  (FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms.

* libguile/load.h (scm_i_mirror_backslashes): Add prototype.

* libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes
  on argv[0].

* libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes
  on the directory name returned by getcwd.

* test-suite/tests/ports.test ("file name separators"): New test.
2014-07-03 20:58:19 +03:00
Eli Zaretskii
9dc3fc4dd4 Fix calculation of CPU set size for getaffinity.
* libguile/posix.c (cpu_set_to_bitvector): Use CPU_SETSIZE, not
  sizeof, to compute the size of the CPU set.
2014-07-03 19:30:02 +03:00
Eli Zaretskii
5102fc3790 Provide a more reasonable default value for stack limit on MS-Windows.
* libguile/debug.c (init_stack_limit) [__MINGW32__]: Use
  VirtualQuery to compute the stack limit on MS-Windows.
2014-07-03 19:26:21 +03:00
Eli Zaretskii
317f6a2370 Unconditionally build and test the ice-9/popen module.
* module/Makefile.am (ICE_9_SOURCES): Add ice-9/popen.scm.
  (ICE_9_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
  of ice-9/popen.scm.
  (SCRIPTS_SOURCES): Add scripts/autofrisk.scm and
  scripts/scan-api.scm unconditionally.
  (SCRIPTS_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
  of scripts/autofrisk.scm and scripts/scan-api.scm.

* configure.ac: Remove the BUILD_ICE_9_POPEN condition.

* test-suite/tests/popen.test (if-supported): Don't test for 'fork
 feature being supported.
2014-07-03 19:20:00 +03:00
Eli Zaretskii
bc945fadd2 More fixes for deleting files whose ports are not closed.
* test-suite/tests/r6rs-files.test: Close the port after
	using it.

	* test-suite/tests/posix.test ("mkstemp!"): Close the port after
	using it.
2014-07-02 21:21:52 +03:00
Eli Zaretskii
4698a11cbd Make 'system*' available on MS-Windows.
* libguile/simpos.c (scm_system_star) [!HAVE_FORK]: An
	implementation of 'system*' for MS-Windows, which doesn't have
	'fork', but can use 'spawnvp' in this case.
2014-07-02 18:38:28 +03:00
Eli Zaretskii
0d77e062dc Fix deletion of ports.test test file on MS-Windows.
* test-suite/tests/ports.test ("fdes->port", "seek")
	("truncate-file"): Close every file and port we open, to avoid
	failure to delete the test file on MS-Windows when the test is
	completed.
2014-07-02 18:28:06 +03:00
Eli Zaretskii
c7161ee334 Fix compilation of scm_nl_langinfo when some nl_langinfo items are missing.
* i18n.c (scm_nl_langinfo): Don't assume that both INT_* and
  the corresponding non-INT_* items are always either all defined
  or all undefined.
2014-06-22 19:11:30 +03:00
Ludovic Courtès
f089330846 tests: Improve lack-of-/dev/null detection.
Suggested by Eli Zaretskii <eliz@gnu.org>.

* test-suite/test-suite/lib.scm (%null-device): Test for Windows based
  by checking for a drive letter in the current directory name.
2014-06-12 23:19:37 +02:00
Ludovic Courtès
700f6cd86b i18n: Adjust tests for Windows.
* test-suite/tests/i18n.test (mingw?): New variable.
  (%french-locale-name, %french-utf8-locale-name,
  %turkish-utf8-locale-name, %german-utf8-locale-name,
  %greek-utf8-locale-name): Add name of corresponding Windows codepage,
  when MINGW? is true.
  (under-turkish-utf8-locale-or-unresolved): Add exception for
  "mingw32".

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2014-06-11 15:03:31 +02:00
Ludovic Courtès
c84f25bcce i18n: Ignore LC_MESSAGES on MinGW.
* libguile/locale-categories.h (MESSAGES): Add condition on
  !(defined(LC_MAX) && LC_MESSAGES > LC_MAX).
* test-suite/tests/i18n.test ("locale objects")["make-locale (2 args,
  list)", "make-locale (3 args)", "locale?"]: Use LC_NUMERIC or LC_TIME
  instead of LC_MESSAGES.

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2014-06-11 14:54:21 +02:00
Ludovic Courtès
82b8cfa40c tests: Use NUL instead of /dev/null on MinGW.
Reported by Eli Zaretskii <eliz@gnu.org>.

* test-suite/test-suite/lib.scm (%null-device): New variable.
* test-suite/tests/c-api.test (egrep): Use %NULL-DEVICE instead of
  /dev/null.
* test-suite/tests/popen.test ("open-input-pipe")["no duplicate"]:
  Likewise.
2014-06-11 14:36:55 +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
Mark H Weaver
fc8a90043b Optimize scm_ilength and 'length+'.
* libguile/list.c (scm_ilength): Test for SCM_NULL_OR_NIL_P only after
  testing scm_is_pair.  Conform to GNU coding standards.

* libguile/srfi-1.c (scm_srfi1_length_plus): Ditto.
2014-06-04 20:42:21 -04:00
Mark H Weaver
4afca1a066 test-guild-compile: Increase sleep time before sending SIGINT.
* test-suite/standalone/test-guild-compile: Increase sleep time
  before sending SIGINT, for slow machines.
2014-06-04 20:40:23 -04:00