summaryrefslogtreecommitdiffstats
path: root/recobj.scm
diff options
context:
space:
mode:
authorJim Pick <jim@jimpick.com>1998-03-08 23:05:22 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:27 -0800
commitb21cac3362022718634f7086964208b2eed8e897 (patch)
tree16f4b2e70645c0e8e2202023170b5a94baa967e3 /recobj.scm
parent3796d2595035e192ed4bf1c9a6bfdb13c3c9d261 (diff)
parentf24b9140d6f74804d5599ec225717d38ca443813 (diff)
downloadslib-b21cac3362022718634f7086964208b2eed8e897.tar.gz
slib-b21cac3362022718634f7086964208b2eed8e897.zip
Import Debian changes 2c0-3debian/2c0-3
slib (2c0-3) unstable; urgency=low * New maintainer. * slibconfig script to automatically configure guile. * Fix type in description, closes: Bug#18996 slib (2c0-2) unstable; urgency=low * Minor fix for debian/rules targets slib (2c0-1) unstable; urgency=low * New upstream source * New maintainer
Diffstat (limited to 'recobj.scm')
-rw-r--r--recobj.scm54
1 files changed, 0 insertions, 54 deletions
diff --git a/recobj.scm b/recobj.scm
deleted file mode 100644
index caf55a6..0000000
--- a/recobj.scm
+++ /dev/null
@@ -1,54 +0,0 @@
-;;; "recobj.scm" Records implemented as objects.
-;;;From: whumeniu@datap.ca (Wade Humeniuk)
-
-(require 'object)
-
-(define record-type-name (make-generic-method))
-(define record-accessor (make-generic-method))
-(define record-modifier (make-generic-method))
-(define record? (make-generic-predicate))
-(define record-constructor (make-generic-method))
-
-(define (make-record-type type-name field-names)
- (define self (make-object))
-
- (make-method! self record-type-name
- (lambda (self)
- type-name))
- (make-method! self record-accessor
- (lambda (self field-name)
- (let ((index (comlist:position field-name field-names)))
- (if (not index)
- (slib:error "record-accessor: invalid field-name argument."
- field-name))
- (lambda (obj)
- (record-accessor obj index)))))
-
- (make-method! self record-modifier
- (lambda (self field)
- (let ((index (comlist:position field field-names)))
- (if (not index)
- (slib:error "record-accessor: invalid field-name argument."
- field-name))
- (lambda (obj newval)
- (record-modifier obj index newval)))))
-
- (make-method! self record? (lambda (self) #t))
-
- (make-method! self record-constructor
- (lambda (class . field-values)
- (let ((values (apply vector field-values)))
- (define self (make-object))
- (make-method! self record-accessor
- (lambda (self index)
- (vector-ref values index)))
- (make-method! self record-modifier
- (lambda (self index newval)
- (vector-set! values index newval)))
- (make-method! self record-type-name
- (lambda (self) (record-type-name class)))
- self)))
- self)
-
-(provide 'record-object)
-(provide 'record) \ No newline at end of file