1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-05 15:10:27 +02:00
Commit graph

9450 commits

Author SHA1 Message Date
Rob Browning
d26af5b23e *** empty log message *** 2003-11-19 21:39:26 +00:00
Rob Browning
060ffedfe1 (check_SCRIPTS): add test-system-cmds.
(TESTS): add test-system-cmds.
2003-11-19 21:39:16 +00:00
Rob Browning
b10b93de99 * standalone/test-system-cmds: new test. 2003-11-19 21:39:07 +00:00
Marius Vollmer
f24809dc2b *** empty log message *** 2003-11-19 18:24:36 +00:00
Marius Vollmer
e23fec5561 Include exact rationals. 2003-11-19 18:13:21 +00:00
Marius Vollmer
01b30204b5 (What is Guile?): Add @acronym for POSIX, R5RS, GUI,
and HTTP.  Conclude linking libguile.
2003-11-19 18:12:11 +00:00
Marius Vollmer
c1f1071afc Changed to reflect the fact that rationalize only returns an exact
result for exact arguments.  Fixed bugs in tests that were not caught
previously since all fraction were treated as equal regardless of
value.
2003-11-19 05:15:51 +00:00
Marius Vollmer
fb16d26e23 *** empty log message *** 2003-11-19 05:13:53 +00:00
Marius Vollmer
c60e130c97 * numbers.c (scm_make_ratio): Rewritten to have a simpler
structure.  Previously, not all cases with a negative denominator
were covered.
2003-11-19 05:12:08 +00:00
Marius Vollmer
0b0c8e3b4c * numbers.c (scm_make_ratio): Don't declare divisible_p after
statements.
2003-11-19 04:30:40 +00:00
Marius Vollmer
4bca30d83a *** empty log message *** 2003-11-19 03:51:21 +00:00
Marius Vollmer
02164269a7 * numbers.c (scm_i_fraction_equalp): Do not treat the return value
of scm_equal_p as a C boolean, use SCM_FALSEP.  Previously, all
fractions were equal to each other regardless of value.  Ooops.

* numbers.c (scm_rationalize): Return an inexact result when given
inexact arguments.
2003-11-19 03:50:26 +00:00
Marius Vollmer
eb927cb95c * numbers.c (scm_exact_p, scm_inexact_p): Throw error for non-numbers. 2003-11-19 02:38:37 +00:00
Marius Vollmer
d8592269ab (mem2decimal_from_point): use scm_divide instead of scm_divide2real
when forming the fractional part.  This allows "#e1.2" to yield 6/5.
2003-11-19 02:19:03 +00:00
Neil Jerram
0f8b558cbc Work in progress. 2003-11-19 01:27:31 +00:00
Neil Jerram
d9d022a7d6 Work in progress. 2003-11-19 01:22:06 +00:00
Neil Jerram
64758fe259 Defer lookup of lazy-handler-dispatch. 2003-11-19 01:16:16 +00:00
Marius Vollmer
cef6deaff1 (Manual Conventions): Double-quote some statements formerly
single-quoted.  Remove some redundant quotes around code.  Clarify
meaning of `iff' further for those that didn't get it the first time
'round (like me).  Make graphical indicators samples, not code.  Put
results of evaluation on the same line as @result symbols.  Use @print
example as example of total usage, and remind readers not to forget
the difference.
2003-11-18 23:18:19 +00:00
Marius Vollmer
bdf26b606b *** empty log message *** 2003-11-18 20:01:57 +00:00
Marius Vollmer
f92e85f735 * print.c (scm_iprin1): Handle fractions.
* objects.h (scm_class_fraction): New.
* objects.c (scm_class_fraction): New.
(scm_class_of): Handle fractions.

* hash.c (scm_hasher): Handle fractions.

* numbers.c: New code for handling fraction all over the place.
(scm_odd_p, scm_even_p): Handle inexact integers.
(scm_rational_p): New function, same as scm_real_p.
(scm_round_number, scm_truncate_number, scm_ceiling, scm_floor):
New exact functions that replace the inexact 'dsubr'
implementations.
(scm_numerator, scm_denominator): New.

* numbers.h (SCM_NUMP): Recognize fractions.
(SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR,
SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR,
SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT,
SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR,
SCM_FRACTION_REDUCED): New.
(scm_floor, scm_ceiling, scm_truncate_number, scm_round_number):
New prototypes.
(scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator,
scm_rational_p): New prototypes.
(scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp,
scm_i_print_fraction): New prototypes.

* goops.c (create_standard_classes): Create "<fraction>" class.

* gc-mark.c (scm_gc_mark_dependencies): Handle fractions.

* gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a
case in the switch, but do nothing for now.

* eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions
to doubles when calling 'dsubr' functions.

* eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
2003-11-18 19:59:53 +00:00
Marius Vollmer
9dd9857f77 * tests/numbers.test ("string->number"): Expect exact rationals
for things like "1/2" and "#e1.2".
("inexact->exact"): Expect overflow error for infs and nans.

* tests/fractions.test: New file from Bill Schottstaedt.  Thanks!

* tests/bit-operations.test (fixnum-bit): Round the result so that
fixnum-bit really is an integer.
2003-11-18 19:57:30 +00:00
Rob Browning
28fda54472 *** empty log message *** 2003-11-18 06:14:29 +00:00
Rob Browning
9ca20a9c88 * gen-scmconfig.c (main): remove public definition of
SCM_SIZEOF___INT64 and SCM_SIZEOF_UNSIGNED___INT64 and add
direct typedef of long_long and ulong_long inside deprecated block
when appropriate.
2003-11-18 06:10:39 +00:00
Rob Browning
1fe5648d31 move long_long and ulong_long definitions to
gen-scmconfig.c so that we don't need to add SCM_SIZEOF___INT64
and SCM_SIZEOF_UNSIGNED___INT64 to the public namespace.
2003-11-18 06:10:11 +00:00
Rob Browning
ec3972f753 *** empty log message *** 2003-11-17 19:19:26 +00:00
Rob Browning
936f702bfd new file. 2003-11-17 19:15:30 +00:00
Rob Browning
fb2de91a2c rewrite ALLOCA related code as multiple lines so
it doesn't break with current autoconf substitutions.
2003-11-17 19:14:44 +00:00
Rob Browning
5a76d4dc05 *** empty log message *** 2003-11-17 18:59:08 +00:00
Marius Vollmer
9a1d7d7c8b *** empty log message *** 2003-11-17 16:57:27 +00:00
Marius Vollmer
b4d5926184 (scm_string_hash): New hashing algorithm that takes the complete
string into account.
2003-11-17 16:56:48 +00:00
Marius Vollmer
64daa01285 Expect a "Bad variable" error for (set! #f 1). 2003-11-17 16:55:03 +00:00
Marius Vollmer
6d1a2e9f4b (scm_m_generalized_set_x): Macroexpand the target when it
is a list.  This allows (@ ...) to work with set!.
(scm_m_generalized_set_x): Use ASSERT_SYNTAX_2 instead of
SCM_ASSYNT.
2003-11-17 16:52:05 +00:00
Marius Vollmer
aff7e166e8 *** empty log message *** 2003-11-17 00:38:25 +00:00
Marius Vollmer
da769b1937 * scheme-modules.texi: Document '@' and '@@'.
* scripts.texi: Mention that "-e (@ ...)" also works.
2003-11-17 00:36:00 +00:00
Marius Vollmer
473687d130 (@, @@): New macros. 2003-11-17 00:28:03 +00:00
Marius Vollmer
b58e742039 *** empty log message *** 2003-11-17 00:26:14 +00:00
Marius Vollmer
7893dbbf45 (scm_m_generalized_set_x): Macroexpand the target when it is a list.
This allows (@ ...) to work with set!.
2003-11-17 00:24:48 +00:00
Marius Vollmer
8b31d75b34 (scm_compile_shell_switches): Use scm_c_read_string for the "-e"
option instead of scm_str2symbol.  This allows things like (@ ...) to
be specified for the entry point.
2003-11-17 00:22:18 +00:00
Marius Vollmer
c62a38765d (scm_lreadr): detect EOF after backslash, and interpret \xNN
hexadecimal sequences.  From Paul Jarc, thanks!
2003-11-16 21:01:57 +00:00
Marius Vollmer
59e8c5a3e9 *** empty log message *** 2003-11-16 20:55:04 +00:00
Dirk Herrmann
37f5dfe533 * boot-9.scm: Started comment about module system workings. 2003-11-16 13:54:26 +00:00
Dirk Herrmann
461bffb131 * eval.c (scm_m_letstar): Create memoized code in place to
minimize consing.
2003-11-16 13:32:02 +00:00
Dirk Herrmann
6f81708ae0 * eval.c (s_splicing): Commented and reformulated.
(lookup_global_symbol, lookup_symbol): New static functions.

	(s_test, s_bindings, s_duplicate_bindings, s_variable): Removed.

	(try_macro_lookup, literal_p): Use lookup_symbol instead of
	creating a temporary pair for scm_lookupcar.

	(scm_unmemocar, unmemocar): Renamed scm_unmemocar to unmemocar,
	created deprecated wrapper function scm_unmemocar.

	(SCM_VALIDATE_NON_EMPTY_COMBINATION, scm_sym_else,
	scm_sym_unquote, scm_sym_uq_splicing, scm_sym_enter_frame,
	scm_sym_apply_frame, scm_sym_exit_frame, scm_sym_trace, f_apply,
	undefineds, sym_three_question_marks): Moved around without
	modifications.

	* eval.c, eval.h (scm_macroexp, scm_unmemocar): Deprecated.
2003-11-16 10:47:45 +00:00
Dirk Herrmann
910b512506 * eval.c (try_macro_lookup, expand_user_macros, is_system_macro_p,
m_expand_body, scm_m_expand_body): Grouped together with m_body.
	No further modifications.
2003-11-15 12:43:00 +00:00
Dirk Herrmann
c86c440b17 * libguile/eval.c (s_mixed_body_forms): New static identifier.
(canonicalize_define, scm_m_define): The check for a bad
	expression is performed in canonicalize_define now.

	(try_macro_lookup, expand_user_macros, is_system_macro_p): New
	static helper functions for m_expand_body.

	(m_expand_body): Use ASSERT_SYNTAX to signal syntax errors.  Only
	expand user defined macros.  Fixed handling of the definition/
	expression boundary.  Fixed handling of definitions grouped with
	'begin.  Use canonicalize_define to expand definitions.

	* test-suite/tests/syntax.test: Tests that check for the correct
	handling of internal defines with begin work now.
2003-11-15 12:27:54 +00:00
Dirk Herrmann
c3d948015a * tests/syntax.test: Fixed test that checks for the correct
handling of macros in the context of internal defines.
2003-11-15 11:51:17 +00:00
Kevin Ryde
c4a56a692d *** empty log message *** 2003-11-14 21:36:18 +00:00
Kevin Ryde
2a71634743 Use (test-suite lib), for the benefit of standalone execution. 2003-11-14 21:34:21 +00:00
Kevin Ryde
08134d1d76 *** empty log message *** 2003-11-14 21:27:36 +00:00
Kevin Ryde
1028fcb2cf (Cross building Guile): Describe GUILE_FOR_BUILD rather than
--with-guile-for-build.
2003-11-14 21:27:11 +00:00