mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
They should be deprecated entirely except that they are used for object documentation. Some other day. * libguile/objprop.c: * libguile/objprop.h: Remove. * libguile/deprecated.h: * libguile/deprecated.c (scm_object_properties): (scm_set_object_properties_x): (scm_object_property): (scm_set_object_property_x): Add deprecation shims. * module/ice-9/deprecated.scm (object-properties*): (set-object-properties!*): (object-property*): (set-object-property!*): Add deprecation shims. * libguile/init.c: * libguile.h: Remove objprops. * module/ice-9/object-properties.scm: Add pure Scheme implementation here. * module/ice-9/documentation.scm: * module/scripts/api-diff.scm: * module/scripts/read-text-outline.scm: * module/scripts/scan-api.scm: * module/scripts/summarize-guile-TODO.scm: * module/srfi/srfi-64.scm: Include object-properties module.
117 lines
4.4 KiB
Scheme
117 lines
4.4 KiB
Scheme
;;;; Copyright (C) 2025 Free Software Foundation, Inc.
|
|
;;;;
|
|
;;;; This library is free software; you can redistribute it and/or
|
|
;;;; modify it under the terms of the GNU Lesser General Public
|
|
;;;; License as published by the Free Software Foundation; either
|
|
;;;; version 3 of the License, or (at your option) any later version.
|
|
;;;;
|
|
;;;; This library is distributed in the hope that it will be useful,
|
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
;;;; Lesser General Public License for more details.
|
|
;;;;
|
|
;;;; You should have received a copy of the GNU Lesser General Public
|
|
;;;; License along with this library; if not, write to the Free Software
|
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
;;;;
|
|
|
|
(define-module (ice-9 deprecated)
|
|
#:use-module (ice-9 guardians)
|
|
#:use-module (ice-9 object-properties)
|
|
#:use-module (ice-9 weak-tables)
|
|
#:export ((make-guardian* . make-guardian)
|
|
module-observe-weak
|
|
(make-object-property* . make-object-property)
|
|
(make-weak-key-hash-table* . make-weak-key-hash-table)
|
|
(make-weak-value-hash-table* . make-weak-value-hash-table)
|
|
(make-doubly-weak-hash-table* . make-doubly-weak-hash-table)
|
|
(weak-key-hash-table?* . weak-key-hash-table?)
|
|
(weak-value-hash-table?* . weak-value-hash-table?)
|
|
(doubly-weak-hash-table?* . doubly-weak-hash-table?)))
|
|
|
|
#;
|
|
(define-syntax-rule (define-deprecated name message exp)
|
|
(begin
|
|
(define-syntax rule
|
|
(identifier-syntax
|
|
(begin
|
|
(issue-deprecation-warning message)
|
|
exp)))
|
|
(export rule)))
|
|
|
|
(define (make-guardian*)
|
|
(issue-deprecation-warning
|
|
"make-guardian in the default environment is deprecated. Import it
|
|
from (ice-9 guardians) instead.")
|
|
(make-guardian))
|
|
|
|
(define* (module-observe-weak module observer-id #:optional (proc observer-id))
|
|
(issue-deprecation-warning
|
|
"module-observe-weak is deprecated. Use module-observe instead.")
|
|
(module-observe module proc))
|
|
|
|
(define (make-object-property*)
|
|
(issue-deprecation-warning
|
|
"make-object-property in the default environment is deprecated. Import
|
|
it from (ice-9 object-properties) instead.")
|
|
(make-object-property))
|
|
|
|
(define (object-properties* obj)
|
|
(issue-deprecation-warning
|
|
"object-properties in the default environment is deprecated. Import
|
|
it from (ice-9 object-properties) instead.")
|
|
(object-properties obj))
|
|
|
|
(define (set-object-properties!* obj props)
|
|
(issue-deprecation-warning
|
|
"set-object-properties! in the default environment is deprecated. Import
|
|
it from (ice-9 object-properties) instead.")
|
|
(set-object-properties! obj props))
|
|
|
|
(define (object-property* obj key)
|
|
(issue-deprecation-warning
|
|
"object-property in the default environment is deprecated. Import
|
|
it from (ice-9 object-properties) instead.")
|
|
(object-property obj key))
|
|
|
|
(define (set-object-property!* obj key value)
|
|
(issue-deprecation-warning
|
|
"set-object-properties! in the default environment is deprecated. Import
|
|
it from (ice-9 object-properties) instead.")
|
|
(set-object-property! obj key value))
|
|
|
|
(define* (make-weak-key-hash-table* #:optional (n 0))
|
|
(issue-deprecation-warning
|
|
"make-weak-key-hash-table in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(make-weak-key-hash-table))
|
|
|
|
(define* (make-weak-value-hash-table* #:optional (n 0))
|
|
(issue-deprecation-warning
|
|
"make-weak-value-hash-table in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(make-weak-value-hash-table))
|
|
|
|
(define* (make-doubly-weak-hash-table* #:optional (n 0))
|
|
(issue-deprecation-warning
|
|
"make-weak-key-hash-table in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(make-doubly-weak-hash-table))
|
|
|
|
(define (weak-key-hash-table?* x)
|
|
(issue-deprecation-warning
|
|
"weak-key-hash-table? in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(weak-key-hash-table? x))
|
|
|
|
(define (weak-value-hash-table?* x)
|
|
(issue-deprecation-warning
|
|
"weak-value-hash-table? in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(weak-value-hash-table? x))
|
|
|
|
(define (doubly-weak-hash-table?* x)
|
|
(issue-deprecation-warning
|
|
"doubly-weak-hash-table? in the default environment is deprecated.
|
|
Import it from (ice-9 weak-tables) instead.")
|
|
(doubly-weak-hash-table? x))
|