Update of /cvsroot/wisp/wisp/modules
In directory usw-pr-cvs1:/tmp/cvs-serv31529/modules
Modified Files:
builtin.wid collectors.wim frer.wim wisptyp.wrti
Log Message:
Defined |new| dispatchers for |<c16string>|, |<box>|, and |<collector>|.
Index: builtin.wid
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/builtin.wid,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- builtin.wid 18 Sep 2002 21:06:19 -0000 1.178
+++ builtin.wid 18 Sep 2002 21:08:50 -0000 1.179
@@ -1940,12 +1940,13 @@
the results will be used as the actual dispatch points. Currently,
the following dispatch names are recognized:
- * ~ref~;
- * ~length~.
+ * ~length~;
+ * ~new~;
+ * ~ref~.
:Conforms to: Wisp extension.
- :See also: |ref|, |length|, |record-type-discriminator|.
+ :See also: |length|, |new|, |ref|, |record-type-discriminator|.
make-string
Index: collectors.wim
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/collectors.wim,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- collectors.wim 26 Aug 2002 16:18:18 -0000 1.8
+++ collectors.wim 18 Sep 2002 21:08:51 -0000 1.9
@@ -9,7 +9,7 @@
(module collectors)
(export
- <collector> collector->vector collector-find/add make-collector)
+ <collector> collector->vector collector-find/add)
; FIXME: This code is not thread-safe.
@@ -22,10 +22,11 @@
((not (integer? index)) (raise 'integer? index))
((assv index
(%coll-length)) => cdr)
- (else (raise 'range index)))))))
-
-(define (make-collector (comparer equal?))
- (%make-coll comparer '() 0))
+ (else (raise 'range index)))))
+ 'new (lambda (<collector> %make-coll %coll-obj=?
+ %coll-data %coll-length)
+ (lambda ((comparer equal?))
+ (%make-coll comparer '() 0)))))
(define (collector-find/add collector item)
(my c (rassoc item (%coll-data collector) (%coll-obj=? collector))
Index: frer.wim
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/frer.wim,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- frer.wim 7 Sep 2002 21:58:20 -0000 1.11
+++ frer.wim 18 Sep 2002 21:08:51 -0000 1.12
@@ -75,7 +75,7 @@
(else (raise 'frerrable-structure? x)))))))
(define (structure->frer x)
- (my symbols (make-collector eq?)
+ (my symbols (new <collector> eq?)
(my struc (%structure->frer x symbols)
(my const (%structure->frer (collector->vector symbols) #f)
(string-append "FRER\u[0]" const #\U+1B struc #\U+00)))))
Index: wisptyp.wrti
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/wisptyp.wrti,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- wisptyp.wrti 18 Sep 2002 21:07:35 -0000 1.15
+++ wisptyp.wrti 18 Sep 2002 21:08:51 -0000 1.16
@@ -63,6 +63,9 @@
(macro string-data
dup 2 cells + swap cell@ NC_C8STRING = if cell@ then)
+ (macro require-record-type
+ dup get-type 'RT_record_type <> if 'WB_record_type_huh swap go-raise then)
+
;; Unique node pointers
(macro NULL 0)
|