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

16 commits

Author SHA1 Message Date
Ludovic Courtès
10b9343f04 Change `scm_ramapc' prototype to avoid empty declarators (bug #23681).
* libguile/array-map.h (scm_ramapc): Change `cproc' to `void *' instead
  of using empty declarators.

* libguile/array-map.c (scm_ramapc): Adjust accordingly.
2011-02-13 14:47:33 +01:00
Andy Wingo
a587d6a973 more fixes to equal? for arrays
* libguile/array-map.c (array_compare, scm_array_equal_p): Rewrite as
  something that operates on the generic array handle infrastructure.
  Based on array->list.
  (scm_i_array_equal_p): Change the docs, as array-equal? is now the same
  as equal?, except that it typechecks its args.

* doc/ref/api-compound.texi (Array Procedures): Update array-equal?
  docs.

* libguile/deprecated.h:
* libguile/deprecated.c (scm_raequal): Deprecate.

* libguile/bytevectors.c (scm_bytevector_eq_p): Bugfix: bytevectors are
  bytevector=? only if their element type is the same.

* libguile/eq.c (scm_equal_p): Only dispatch to scm_array_equal_p if
  both args are arrays (generically).

* test-suite/tests/arrays.test ("equal?"): Add some more tests.
2010-04-01 00:25:06 +02:00
Andy Wingo
3ffd1ba96e fix equal? between an array and a non-array
OK let's try again. While the thanks go to Daniel Llorens del Río for
the tip, the blame continues going to me :)

* test-suite/Makefile.am:
* test-suite/tests/arrays.test: Add a test.

* libguile/array-map.c (raeql): Handle a few 0-dimensional cases. If the
  shapes of the arrays don't match, just return #f instead of raising
  an error.
2010-03-31 00:05:01 +02:00
Andy Wingo
f1d19308ad provide missing prototypes
* libguile/array-map.c:
* libguile/chars.c:
* libguile/eq.c:
* libguile/strorder.c: Provide declarations missing after the asubrs/rpsubrs ->
  gsubr conversion.
2010-01-07 23:49:15 +01:00
Andy Wingo
e7efe8e793 decruftify scm_sys_protects
* libguile/root.h
* libguile/root.c (scm_sys_protects): It used to be that for some reason
  we'd define a special array of "protected" values. This was a little
  silly, always, but with the BDW GC it's completely unnecessary. Also
  many of these variables were unused, and none of them were good API.
  So remove this array, and either eliminate, make static, or make
  internal the various values.

* libguile/snarf.h: No need to generate calls to scm_permanent_object.

* guile-readline/readline.c (scm_init_readline): No need to call
  scm_permanent_object.

* libguile/array-map.c (ramap, rafe): Remove the dubious nullvect
  optimizations.

* libguile/async.c (scm_init_async): No need to init scm_asyncs, it is
  no more.

* libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is
  no more.

* libguile/gc.c: Make scm_protects a static var.
  (scm_storage_prehistory): Change the sanity check to use the address
  of protects.
  (scm_init_gc_protect_object): No need to clear the scm_sys_protects,
  as it is no more.

* libguile/keywords.c: Make the keyword obarray a static var.
* libguile/numbers.c: Make flo0 a static var.
* libguile/objprop.c: Make object_whash a static var.
* libguile/properties.c: Make properties_whash a static var.

* libguile/srcprop.h:
* libguile/srcprop.c: Make scm_source_whash a global with internal
  linkage.

* libguile/strings.h:
* libguile/strings.c: Make scm_nullstr a global with internal linkage.

* libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect,
  it's unused.
2009-12-05 12:38:43 +01:00
Andy Wingo
8a1f4f98e1 remove rpsubrs
* libguile/tags.h: Remove rpsubrs (I chose to interpret the terse name
  as "recursive predicate subrs"). Just use gsubrs with rest arguments,
  or do a fold yourself.

* libguile/array-map.c (scm_i_array_equal_p): Do the comparison in
  order, why not.

* libguile/chars.c:
* libguile/eq.c:
* libguile/numbers.c:
* libguile/strorder.c: Add 0,2,1 gsubr wrappers for rpsubrs like eq?, <,
  etc.

* libguile/goops.c (scm_class_of)
* libguile/procprop.c (scm_i_procedure_arity)
* libguile/procs.c (scm_thunk_p)
* libguile/vm.c (apply_foreign): Remove rpsubr cases.

* test-suite/tests/numbers.test ("=", "<"): Turn a couple xfails into
  passes.
2009-12-04 13:05:00 +01:00
Andy Wingo
31d845b4bc remove asubrs
* libguile/tags.h (scm_tcs_subrs, scm_tc7_asubr): Remove definitions.

* libguile/goops.c (scm_class_of)
* libguile/procprop.c (scm_i_procedure_arity)
* libguile/procs.c (scm_thunk_p)
* libguile/vm.c (apply_foreign): Remove cases for asubrs.

* libguile/array-map.c: Gut all of the optimizations, because there are
  no more asubrs, soon won't be rpsubrs, and all of this should happen
  on the Scheme level, ideally.
2009-12-03 17:05:14 +01:00
Andy Wingo
b04ab0c624 remove scm_tc7_dsubr
* libguile/tags.h: Remove scm_tc7_dsubr. There are no more users of
  this.

* libguile/array-map.c:
* libguile/eval.c:
* libguile/eval.i.c:
* libguile/goops.c:
* libguile/procprop.c:
* libguile/procs.h: Remove all dsubr cases.
2009-12-03 15:33:09 +01:00
Andy Wingo
df338a2264 remove tc7_subr_* and tc7_lsubr_*
* libguile/tags.h: Remove tc7 #defines for subrs, replacing them with
  placeholders. These were public, but hopfully unused. I don't see how
  to usefully deprecate them.

* libguile/array-map.c (scm_array_map_x): Remove special cases for
  certain subr types. This might make things slower for the moment,
  otoh, native compilation should moot that question.

* libguile/eval.i.c:
* libguile/eval.c: Remove subr-handling cases. To regain this speed and
  more won't have to wait for native compilation, though -- this change
  smooths the way for subr dispatch in the VM.

* libguile/gsubr.c (scm_i_gsubr_apply): Fix a bug in which we didn't
  detect too-many-arguments. This would only show up when using ceval,
  as only ceval called this function.

* test-suite/tests/ramap.test ("array-map!"): Change the expected
  exception if passed a procedure of the wrong arity. It now gives
  wrong-num-args.
  more won't have to wait for native compilation, though -- this change
  smooths the way for subr dispatch in the VM.

* libguile/goops.c (scm_class_of): Remove subr cases. No speed
  implication.

* libguile/objects.c (scm_valid_object_procedure_p): Remove this public
  but undocumented, and useless, function. I do not think this will
  affect anyone at all.
  (scm_set_object_procedure_x): Replace a call to
  scm_valid_object_procedure_p with scm_procedure_p, and actually wrap
  with a scm_is_true.

* module/oop/goops.scm (initialize-object-procedure): Don't call
  valid-object-procedure?.
2009-12-03 15:22:07 +01:00
Ludovic Courtès
d66b74dce7 Avoid unneeded `scm_dynwind_free ()'.
* libguile/array-map.c (indices_gc_hint): New variable.
  (scm_ramapc, scm_array_index_map_x): Avoid `scm_dynwind_free ()' using
  `scm_gc_malloc_pointerless ()'.
2009-09-09 19:27:42 +02:00
Andy Wingo
f332e95717 generic vector ops to own file
* libguile/Makefile.am:
* libguile/vectors.c:
* libguile/vectors.h:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h: Move generic vector ops off into their
  own file too. The implementation is now based on the generic
  array-handle infrastructure.

* libguile.h:
* libguile/array-map.c:
* libguile/bitvectors.c:
* libguile/random.c:
* libguile/srfi-4.c: Update includers.
2009-07-19 15:15:44 +02:00
Andy Wingo
1030b45049 move generic array foo out to its own file
* libguile/arrays.h:
* libguile/arrays.c:
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c: Move some generic functionality out of
  arrays.c to a new file.

* libguile/array-map.c:
* libguile/deprecated.c:
* libguile/init.c: Update includers.
2009-07-19 15:15:44 +02:00
Andy Wingo
66b9d7d304 remove enclosed arrays
* libguile/arrays.h:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/deprecated.c: Remove "enclosed arrays". The only user-facing
  procedures that this affects are scm_enclose_array / enclose-array. If
  enclosed arrays are added back, it should be through the generic array
  interface; but really, it sounds like something that would be better
  implemented in Scheme.
2009-07-19 15:15:44 +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
cf39614240 bitvector exodus from unif.[ch]
* libguile/Makefile.am:
* libguile/unif.c:
* libguile/unif.h:
* libguile/bitvectors.c:
* libguile/bitvectors.h: Move bitvector functionality out of unif.[ch].

* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/init.c:
* libguile/read.c:
* libguile/srfi-4.c:
* libguile/vectors.c: Oh, what a tangled web we weave...
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
Renamed from libguile/ramap.c (Browse further)