NEWS-wip-vector-cleanup.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. (wip-vector-cleanup for Guile 3.0) -*- coding: utf-8; mode: org; -*-
  2. TBA to NEWS for this branch.
  3. * Forward incompatible changes
  4. Applying these changes will make your program work with this version of
  5. Guile and continue working with older versions (at least back to 2.2).
  6. ** vector->list and vector-copy require a true vector argument.
  7. Use array->list and array-copy (from (ice-9 arrays)) on general arrays.
  8. ** scm_is_simple_vector has been removed.
  9. Use scm_is_vector instead.
  10. ** libguile/generalized-vectors.[hc] libguile/generalized-arrays.[hc] and have been removed.
  11. If you were including these headers directly for any reason, just include libguile.h instead.
  12. ** scm_from_contiguous_typed_array has been removed.
  13. This function was undocumented. Instead, use scm_make_typed_array and
  14. the array handle functions to copy data to the new array.
  15. ** uniform-array->bytevector has been moved from (rnrs bytevectors) / (rnrs) to core.
  16. This function is undocumented.
  17. * Backward incompatible changes
  18. Applying these changes will make your program work with this version of
  19. Guile and STOP working with older versions.
  20. ** scm_array_p takes a single argument.
  21. This function used to take a second unused argument for the sake of
  22. compatibility with older versions of Guile. Just remove this argument from your
  23. calls.
  24. ** SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET and SCM_SIMPLE_VECTOR_LENGTH have been renamed.
  25. Use SCM_VECTOR_REF, SCM_VECTOR_SET and SCM_VECTOR_LENGTH instead.
  26. ** The vector argument to scm_vector_elements / scm_vector_writable_elements must be a true vector. Handle/inc arguments have been removed.
  27. Use scm_array_get_handle and scm_array_handle_elements / scm_array_handle_writable_elements on general #t arrays.
  28. ** The vector argument to scm_bitvector_elements / scm_bitvector_writable_elements must be a true bitvector. Handle/inc arguments have been removed.
  29. Use scm_array_get_handle and scm_array_handle_bit_elements / scm_array_handle_bit_writable_elements on general bit arrays.
  30. Use scm_array1_bit_elements (NEW) / scm_array1_bit_writable_elements (NEW) on rank-1 bit arrays.
  31. * Bugfixes introducing incompatibility
  32. ** vector-move-right! vector-move-left! require true vector arguments
  33. These functions weren't advertised to work on non-vector arrays. They did try to, but only incorrectly. For example:
  34. (define a (vector 1 2 3 4 5))
  35. (define b (make-array 0 '(1 5)))
  36. (vector-move-right! a 0 2 b 2)
  37. b
  38. => #1@1(0 0 1 2 0)
  39. instead of the correct result #1@1(0 1 2 0 0). This buggy support has been removed.
  40. * Compatible changes
  41. ** vector-copy! from (srfi :43) is provided in core.
  42. * Rationale / TODO
  43. The ultimate goal of this patch set is to have arrays be strictly layered above typed vectors so they can be replaced by a different implementation without affecting the latter.
  44. ** Status as of 3.0.0
  45. - The _elements functions require the array handle interface even for true vectors, when all of handle, inc and off are unnecessary. This creates a burden (having to declare & release handles, etc).
  46. - The srfi-4 _elements functions don't accept arbitrary rank-1 xxxarray even though they require the array handle interface (inc, handle are superfluous).
  47. ** Plan [4/8]
  48. - [X] Provide scm_VTYPE_(writable_)elements with signature [(SCM) -> pointer] for all vector types.
  49. - [ ] Provide scm_array1_VTYPE_(writable_)elements with signature [(SCM, &handle, ...) -> pointer] for all vector types. These replace the old scm_VTYPE_(writable_)elements but will be available on the array API and not on the xxxvector APIs.
  50. - [X] Remove the dependence of vector.c on array-handle-h
  51. - [X] Remove the dependence of VECTOR-TYPE-ref -> array_handle use seen in scm_array_get_handle.
  52. - [ ] Remove the dependence of bitvector.c srfi-4.c etc. on array-handle.h
  53. - [X] Bug: setaffinity in posix.c failed to release the mask handle
  54. - [ ] Bug: scm_bitvector_elements doesn't select for type = bit
  55. - [ ] Bug: bit-set*! already requires second arg to be true bitvector
  56. * Other
  57. ** basic rank-1 ops on VECTOR_TYPEs need (len begin inc) instead of (begin end)
  58. - look at CBLAS/BLIS
  59. - this is a problem because all the RnRS & SRFIs use (begin end) :-(