From b0ecf83ef0f3dfbfce808c2cfc88ff0c8d9809f1 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 23 Sep 2017 11:14:27 +0200 Subject: Deprecate opaque struct fields * NEWS: Add entry. * doc/ref/api-data.texi (Vtables, Structure Basics): Remove mention of opaque field protection. * libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail): Remove discussion of opaque fields. (set_vtable_layout_flags): Issue a deprecation warning when opaque fields are used. --- NEWS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 78e3b30c3..fec9af30f 100644 --- a/NEWS +++ b/NEWS @@ -67,6 +67,20 @@ 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. +** Struct fields with opaque ("o") protection deprecated + +Struct fields are declared with a "protection", meaning read-only ('r'), +read-write ('w'), or opaque ('o'). There is also "hidden" ('o') which +is read-write but which isn't initialized by arguments passed to +`make-struct/no-tail', but that's a detail. Opaque struct fields were +used to allocate storage in a struct that could only be accessed by C. +This facility was very rarely used (unused in Guile itself) but now that +we are implementing more and more in Scheme, it is completely useless. + +To enforce permissions on struct fields, instead layer on an abstraction +at a higher level, in the same way that immutable record fields are +simply those which don't have an accessor. + * Bug fixes ** Enable GNU Readline 7.0's support for "bracketed paste". -- cgit v1.2.3