Andy Wingo
ab455d1f1b
eqv? not a generic, equal? dispatches to generic only for objects
...
* libguile/eq.c (scm_eqv_p): Not a generic any more. Since eqv? is used
by e.g. `case', which should be able to compile into dispatch tables,
it really doesn't make sense to dispatch out to a generic.
(scm_equal_p): So it was always the case that (equal? 'foo "foo") =>
#f. But (equal? 'foo 'bar) could actually be extended by a generic.
This was a bug, if you follow the other logic of the code. Changed so
that generic functions can only extend the domain of equal? when
operating on goops objects.
* oop/goops.scm: No more eqv? generic.
* test-suite/tests/goops.test: Remove eqv? tests.
2009-11-26 00:25:07 +01:00
Andy Wingo
efcebb5b56
fold objects.[ch] into goops.[ch]
...
Remove objects.h #includes as appropriate.
2009-11-15 20:28:12 +01:00
Ludovic Courtès
807e5a6641
Use a TC7 tag instead of a SMOB for bytevectors.
...
* libguile/bytevectors.c (scm_tc16_bytevector): Remove.
(SCM_BYTEVECTOR_SET_LENGTH, SCM_BYTEVECTOR_SET_CONTENTS,
SCM_BYTEVECTOR_SET_INLINE, SCM_BYTEVECTOR_SET_ELEMENT_TYPE,
make_bytevector_from_buffer, scm_is_bytevector,
scm_bootstrap_bytevectors): Adjust to the SMOB->tc7 change.
(scm_i_print_bytevector): New, formerly `print_bytevector ()'.
(bytevector_equal_p): Remove.
* libguile/bytevectors.h (SCM_BYTEVECTOR_LENGTH,
SCM_BYTEVECTOR_CONTENTS, SCM_BYTEVECTOR_P): Adjust to SMOB->tc7
change.
(SCM_BYTEVECTOR_FLAGS, SCM_SET_BYTEVECTOR_FLAGS): New macros.
(scm_tc16_bytevector): Remove declaration.
(scm_i_print_bytevector): New declaration.
* libguile/eq.c (scm_equal_p): Handle `scm_tc7_bytevector'.
* libguile/evalext.c (scm_self_evaluating_p): Likewise.
* libguile/print.c (iprin1): Likewise.
* libguile/tags.h (scm_tc7_bytevector): New.
(scm_tc7_unused_8): Remove.
* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): Adjust.
* test-suite/tests/bytevectors.test ("Datum
Syntax")["self-evaluating?"]: New test.
2009-08-30 20:12:09 +02:00
Andy Wingo
2fa901a51f
rename unif.[ch] to arrays.[ch]
...
* libguile/Makefile.am:
* libguile/unif.c:
* libguile/unif.h:
* libguile/arrays.c:
* libguile/arrays.h: Rename unif.[ch] to arrays.[ch].
* libguile.h:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/eq.c:
* libguile/gc-card.c:
* libguile/gc-malloc.c:
* libguile/gc-mark.c:
* libguile/gc.c:
* libguile/init.c:
* libguile/inline.h:
* libguile/print.c:
* libguile/random.c:
* libguile/read.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srfi-4.c:
* libguile/srfi-4.h:
* libguile/strports.c:
* libguile/vectors.c:
* libguile/vectors.h: Update includers.
2009-07-19 14:53:03 +02:00
Andy Wingo
5d1b3b2db9
rename ramap.[ch] to array-map.[ch]
...
* libguile/array-map.c:
* libguile/array-map.h: Rename from ramap.c and ramap.h.
* libguile.h:
* libguile/Makefile.am:
* libguile/eq.c:
* libguile/init.c:
* libguile/sort.c:
* libguile/unif.c:
* libguile/vectors.c: All referrers changed.
2009-07-19 14:53:03 +02:00
Neil Jerram
53befeb700
Change Guile license to LGPLv3+
...
(Not quite finished, the following will be done tomorrow.
module/srfi/*.scm
module/rnrs/*.scm
module/scripts/*.scm
testsuite/*.scm
guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
dbb605f575
Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than
#if'.
2008-09-13 15:35:27 +02:00
Han-Wen Nienhuys
22fc179acd
* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
...
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h
* private-options.h: new file: contain hardcoded option
definitions.
2007-01-22 15:14:40 +00:00
Ludovic Courtès
d15ad007c9
Changes from arch/CVS synchronization
2006-06-13 07:48:42 +00:00
Marius Vollmer
af4f861210
* eq.c (scm_equal_p): Use scm_array_equal_p explicitely when one
...
of the arguments is a array. This allows vectors to be equal to
one-dimensional arrays.
* tests/unif.test ("vector equal? one-dimensional array"): New.
2006-05-29 21:54:13 +00:00
Kevin Ryde
2b829bbb3d
merge from 1.8 branch
2006-04-17 00:05:42 +00:00
Marius Vollmer
92205699d0
The FSF has a new address.
2005-05-23 19:57:22 +00:00
Marius Vollmer
354116f7c2
(SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Removed.
...
(scm_vector_elements, scm_vector_writable_elements,
scm_generalized_vector_get_handle): Moved to vectors.[hc] from
unif.[hc].
(SCM_SIMPLE_VECTOR_LOC): Removed.
(SCM_VECTOR_MAX_LENGTH, SCM_VECTOR_LENGTH, SCM_VELTS,
SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET,
scm_vector_equal_p): Moved from vectors.[hc] to deprecated.[hc].
(scm_vector_equal_p, scm_i_vector_equal_p): Renamed former to
latter. Changed use in eq.c.
2005-01-07 15:44:09 +00:00
Kevin Ryde
4450a22762
More of:
...
(scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
recent revision to the reference manual.
2004-12-10 00:49:51 +00:00
Kevin Ryde
602d32dd48
(scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
...
recent revision to the reference manual.
2004-12-09 23:49:46 +00:00
Marius Vollmer
241b64d63f
Do no longer handle scm_tc7_bvect bitvectors.
2004-11-09 16:14:22 +00:00
Marius Vollmer
b7a7750adf
Do no longer handle old-style uniform vectors.
2004-11-02 19:47:20 +00:00
Marius Vollmer
d315ee57b4
* print.c (iprin1): Removed code for scm_tc7_byvect.
...
* objects.c (scm_class_of): Likewise.
* gc-mark.c (scm_gc_mark_dependencies): Likewise.
* gc-card.c (scm_i_sweep_card): Likewise.
* evalext.c (scm_self_evaluating_p): Likewise.
* eq.c (scm_equal_p): Likewise.
2004-10-27 18:21:43 +00:00
Marius Vollmer
d2e53ed6f8
*** empty log message ***
2004-09-22 17:41:37 +00:00
Marius Vollmer
789d2fc8dd
(scm_equal_p): Allow smobs with different flags to be equal by testing
...
for smobs before insisting on equal SCM_CELL_TYPES.
2004-09-21 22:05:11 +00:00
Marius Vollmer
0e12d408bd
(real_eqv): Pretend that all NaNs are equal.
2004-09-08 14:32:47 +00:00
Kevin Ryde
728ad4b7cd
(scm_equal_p): Remove real==fraction and fraction==real, they
...
must be #f according to R5RS. (equal? follows eqv?, and for eqv? an
exact and inexact is #f.)
2004-08-17 23:19:04 +00:00
Marius Vollmer
bc36d0502b
* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
...
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-27 15:41:49 +00:00
Marius Vollmer
7888309be8
* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
...
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +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
Dirk Herrmann
534c55a97d
This set of patches introduces a new tc7 code scm_tc7_number for
...
numbers. Bignums, reals and complex numbers are turned from smobs
into subtypes of scm_tc7_number.
* tags.h (scm_tc7_number): New.
* eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
(scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
(scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
(scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
(scm_class_of), print.c (scm_iprin1), smob.c
(scm_smob_prehistory): Don't handle bignums, reals and complex
numbers as subtypes of scm_tc7_smob any more.
* numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
scm_tc16_complex): Moved definitions from tags.h to numbers.h.
2003-09-18 20:55:40 +00:00
Dirk Herrmann
6b412e9171
* eq.c (scm_eqv_p, scm_equal_p): Removed uses of
...
SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
* eq.c (scm_eqv_p, scm_equal_p): Reordered comparisons from
0.0==some_expression to some_expression==0.0. The latter is
better readable. The former is preferred by some people, since it
leads to a compiler error when confusing == with =. However, when
using gcc, a warning will be issued if in an if-statement an
assigment appears. Since many Guile developers are using gcc,
such errors will not remain unnoticed anyway. We can therefore
focus on better readability.
2003-09-06 08:50:26 +00:00
Dirk Herrmann
baa84a205c
* eq.c (scm_equal_p): Use SCM_TYP7 to check if an object is of
...
type string, not SCM_TYP7S.
2003-09-04 19:21:21 +00:00
Mikael Djurfeldt
47cd67db2f
* tests/goops.test: Added tests for correctness of class
...
precedence list in all basic classes and tests for eqv? and
equal?.
* goops.scm (compute-getters-n-setters): Check for bad init-thunk.
(eqv?): Added default method.
(equal?): New default method which uses eqv?.
* eq.c (scm_eqv_p): Turned into a primitive generic.
2003-04-17 19:23:52 +00:00
Marius Vollmer
73be1d9e8e
Changed license terms to the plain LGPL thru-out.
2003-04-05 19:15:35 +00:00
Rob Browning
cb32fdbf9b
* eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
2003-04-04 21:47:46 +00:00
Rob Browning
1a603dc072
* eq.c:: fix various preprocessor usages of new public
...
symbols to expect 0 or 1 values rather than 1 or undefined.
i.e. change #ifdef to #if, etc.
2003-03-27 20:06:23 +00:00
Rob Browning
1f4d02c24b
* eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
...
HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
with "SCM_SIZEOF_LONG_LONG != 0".
2003-03-25 23:54:15 +00:00
Mikael Djurfeldt
a48d60b1c0
* srfi-1.c (scm_init_srfi_1): Extend root module map and for-each
...
with the versions in this module using
scm_c_extend_primitive_generic.
* goops.scm (equal?): Define default method.
* goops.c (scm_primitive_generic_generic): Enable primitive
generic if not enabled.
(scm_sys_goops_loaded): Setup unextended primitive generics.
* goops.c, goops.h (scm_c_extend_primitive_generic): New function.
* snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
snarf macros.
* numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
testing example. All uses of SCM_GPROC should be converted.)
* procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
scm_assoc.
* eq.c (scm_equal_p): Turned into a primitive generic.
2003-03-06 12:51:57 +00:00
Gary Houston
9540b68f94
* eq.c: include <string.h>
2002-07-10 22:25:55 +00:00
Marius Vollmer
96d00047de
(real_eqv): New.
...
(scm_eqv_p): Use it when comparing reals and complexes.
2002-05-08 20:11:27 +00:00
Thien-Thi Nguyen
a6b844c224
Retire inclusion guard macro SCM_MAGIC_SNARFER.
2002-03-14 03:47:43 +00:00
Thien-Thi Nguyen
a06e3a75b2
Remove "face-lift" comment.
2001-07-09 07:36:48 +00:00
Dirk Herrmann
7a7f7c5314
* Made creation of new smob types thread safe.
...
* Minor cleanups to smob usage.
2001-04-21 21:50:08 +00:00
Dirk Herrmann
22a52da14d
* Replaced a lot of calls to SCM_C[AD]R with more appropriate macros.
...
* Minor cleanups to hashtable implementation.
* Minor code beautifications.
2001-03-30 15:03:23 +00:00
Keisuke Nishida
783e777478
Remove #include <stdio.h>. Add #include <string.h>.
2001-03-09 23:33:41 +00:00
Marius Vollmer
8dc9439fc6
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
...
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
Neil Jerram
cdbc74184f
* Docstring fixes - adding texinfo markup and removing extraneous trailing newlines.
2000-08-18 09:30:54 +00:00
Dirk Herrmann
eb42e2f03a
More distinguished handling of real and complex values.
2000-05-10 12:34:43 +00:00
Mikael Djurfeldt
a059974535
* Makefile.am (DEFS): Added. automake adds -I options to DEFS,
...
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.
* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
2000-04-21 14:16:44 +00:00
Dirk Herrmann
fbd485ba49
Don't use C operators == and != to compare SCM values.
2000-03-29 16:22:57 +00:00
Michael Livshin
89e00824a0
* *.[hc]: add Emacs magic at the end of file, to ensure GNU
...
indentation style.
2000-03-19 19:01:16 +00:00
Dirk Herrmann
28b3236d36
Only include async.h where it is actually needed.
2000-03-18 09:16:48 +00:00
Dirk Herrmann
ba11fd4cb6
Only include root.h where it is actually needed.
2000-03-18 08:44:04 +00:00
Dirk Herrmann
003d1fd046
Only include vectors.h in those files, where it is actually needed.
2000-03-17 15:23:03 +00:00