Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
c140a781
Commit
c140a781
authored
33 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Initial revision
parent
12b650ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/scavhook.lisp
+55
-0
55 additions, 0 deletions
code/scavhook.lisp
with
55 additions
and
0 deletions
code/scavhook.lisp
0 → 100644
+
55
−
0
View file @
c140a781
;;; -*- Package: EXT -*-
;;;
;;; **********************************************************************
;;; This code was written as part of the CMU Common Lisp project at
;;; Carnegie Mellon University, and has been placed in the public domain.
;;; If you want to use this code or any part of CMU Common Lisp, please contact
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/scavhook.lisp,v 1.1 1991/07/30 00:40:04 wlott Exp $"
)
;;;
;;; **********************************************************************
;;;
;;; This file implements the ``Scavenger Hook'' extension.
;;;
;;; Written by William Lott
;;;
(
in-package
"EXT"
)
(
export
'
(
scavenger-hook
scavenger-hook-p
make-scavenger-hook
scavenger-hook-value
scavenger-hook-function
))
(
defun
scavenger-hook-p
(
object
)
"Returns T if OBJECT is a scavenger-hook, and NIL if not."
(
scavenger-hook-p
object
))
(
defun
make-scavenger-hook
(
&key
value
(
function
(
required-argument
)))
"Create a new scavenger-hook with the specified VALUE and FUNCTION. For
as long as the scavenger-hook is alive, the scavenger in the garbage
collector will note whenever VALUE is moved, and arrange for FUNCTION
to be funcalled."
(
declare
(
type
function
function
))
(
c::%make-scavenger-hook
value
function
))
(
defun
scavenger-hook-value
(
scavhook
)
"Returns the VALUE being monitored by SCAVHOOK. Can be setf."
(
declare
(
type
scavenger-hook
scavhook
))
(
scavenger-hook-value
scavhook
))
(
defun
(
setf
scavenger-hook-value
)
(
value
scavhook
)
(
declare
(
type
scavenger-hook
scavhook
))
(
setf
(
scavenger-hook-value
scavhook
)
value
))
(
defun
scavenger-hook-function
(
scavhook
)
"Returns the FUNCTION invoked when the monitored value is moved. Can be
setf."
(
declare
(
type
scavenger-hook
scavhook
))
(
scavenger-hook-function
scavhook
))
(
defun
(
setf
scavenger-hook-function
)
(
function
scavhook
)
(
declare
(
type
function
function
)
(
type
scavenger-hook
scavhook
))
(
setf
(
scavenger-hook-function
scavhook
)
function
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment