1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

Deprecate struct "self" slots

* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use a normal slot instead
  of a self slot.
* libguile/print.c (make_print_state): Initialize "handle" slot
  manually.
* libguile/struct.c (issue_deprecation_warning_for_self_slots): New
  helper, called when making vtables to issue deprecation warnings for
  "self" slots.  Avoids warning for the "self" slot that's part of the
  fixed vtable slots.
  (scm_i_struct_inherit_vtable_magic): Call
  issue_deprecation_warning_for_self_slots.
* doc/ref/api-data.texi (Vtables, Structure Basics): Remove references
  to self slots.
* NEWS: Add entry.
This commit is contained in:
Andy Wingo 2017-09-22 11:23:00 +02:00
parent 9ac0544eff
commit 04f48e94b5
5 changed files with 38 additions and 15 deletions

12
NEWS
View file

@ -26,7 +26,7 @@ If you don't care whether the URI is a relative-ref or not, use
In the future `uri?' will return a true value only for URIs that specify
a scheme.
** Tail arrays deprecated
** Struct tail arrays deprecated
Guile's structures used to have a facility whereby each instance of a
vtable can contain a variable-length tail array of values. The length
@ -57,6 +57,16 @@ will be removed from Guile 3.0. Likewise, `make-struct' /
`scm_make_struct_no_tail'. Perhaps one day we will be able to reclaim
the `make-struct' name!
** Struct "self" slots deprecated
It used to be that you could make a structure vtable that had "self"
slots. Instances of that vtable would have those slots initialized to
the instance itself. This can be useful in C code where you might have
a pointer to the data array, and want to get the `SCM' handle for the
structure. However this was a little used complication without any use
in Scheme code. To replace it, just use "p" slots and initialize the
slot values manually on initialization.
* Bug fixes
** Enable GNU Readline 7.0's support for "bracketed paste".