~ chicken-core (chicken-5) af18bae84421be691356f48fcd6ca450ae2439db


commit af18bae84421be691356f48fcd6ca450ae2439db
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Aug 22 19:25:27 2011 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Aug 22 19:25:27 2011 +0200

    documented struct types; allow bare type names for core struct types

diff --git a/defaults.make b/defaults.make
index 54da6595..79836c2e 100644
--- a/defaults.make
+++ b/defaults.make
@@ -277,7 +277,7 @@ else
 CHICKEN_OPTIONS += -no-warnings
 endif
 ifndef BUILDING_CHICKEN_BOOT
-CHICKEN_OPTIONS += -specialize
+#XXX CHICKEN_OPTIONS += -specialize
 endif
 CHICKEN_OPTIONS += $(EXTRA_CHICKEN_OPTIONS)
 CHICKEN_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -explicit-use -no-trace
diff --git a/manual/Types b/manual/Types
index 57af5c1a..1144184e 100644
--- a/manual/Types
+++ b/manual/Types
@@ -144,6 +144,32 @@ or {{:}} should follow the syntax given below:
 
 (*) Note: no type-variables are bound inside {{(not TYPE)}}.
 
+Some types are internally represented as structure types, but you can also use
+these names directly in type-specifications - {{TYPE}} corresponds to
+{{(struct TYPE)}} in this case:
+
+<table>  
+<tr><th>Structure type</th><th>meaning</th></tr>
+<tr><td>{{u8vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{s8vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{u16vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{s16vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{u32vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{s32vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{f32vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{f64vector}}</td><td>SRFI-4 byte vector</td></tr>
+<tr><td>{{thread}}</td><td>SRFI-18 thread</td></tr>
+<tr><td>{{queue}}</td><td></td>see "data-structures" unit</tr>
+<tr><td>{{environment}}</td><td>evaluation environment</td></tr>
+<tr><td>{{time}}</td><td>SRFI-18 "time" object</td></tr>
+<tr><td>{{continuation}}</td><td>continuation object</td></tr>
+<tr><td>{{lock}}</td><td>lock object from "posix" unit</td></tr>
+<tr><td>{{mmap}}</td><td>memory mapped file</td></tr>
+<tr><td>{{condition}}</td><td>object representing exception</td></tr>
+<tr><td>{{hash-table}}</td><td>SRFI-69 hash-table</td></tr>
+<tr><td>{{tcp-listener}}</td><td>listener object from "tcp" unit</td></tr>
+</table>
+
 
 ==== Predicates
 
diff --git a/scrutinizer.scm b/scrutinizer.scm
index 5a2629c8..6cbcbe0d 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -316,7 +316,6 @@
 	      (else
 	       (let-values (((atypes values-rest)
 			     (procedure-argument-types ptype nargs typeenv)))
-		 (d "  argument-types: ~a (~a)" atypes values-rest)
 		 (unless (= (length atypes) nargs)
 		   (let ((alen (length atypes)))
 		     (report 
@@ -1608,6 +1607,7 @@
 (define (validate-type type name)
   ;; - returns converted type or #f
   ;; - also converts "(... -> ...)" types
+  ;; - converts some typenames to struct types (u32vector, etc.)
   ;; - drops "#!key ..." args by converting to #!rest
   ;; - handles "(T1 -> T2 : T3)" (predicate) 
   ;; - simplifies result
@@ -1644,6 +1644,11 @@
 			 pointer locative fixnum float pointer-vector
 			 deprecated noreturn values))
 	     t)
+	    ((memq t '(u8vector s8vector u16vector s16vector u32vector s32vector
+				f32vector f64vector thread queue environment time
+				continuation lock mmap condition hash-table
+				tcp-listener))
+	     `(struct ,t))
 	    ((not (pair? t)) 
 	     (cond ((memq t typevars)
 		    (set! usedvars (cons t usedvars))
Trap