]> gitweb.factorcode.org Git - factor.git/commitdiff
add methods to vs+/vs-/vs* on specialized-arrays so that they saturate as well
authorJoe Groff <arcata@gmail.com>
Fri, 4 Dec 2009 20:43:50 +0000 (12:43 -0800)
committerJoe Groff <arcata@gmail.com>
Fri, 4 Dec 2009 20:43:50 +0000 (12:43 -0800)
basis/specialized-arrays/specialized-arrays-tests.factor
basis/specialized-arrays/specialized-arrays.factor

index ef2654be4506bc8628c10a45eba3b1f39cf1d534..c7e1285689a60e3023f1fec764004c98b1f86b4c 100644 (file)
@@ -10,8 +10,6 @@ FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: int
 SPECIALIZED-ARRAYS: bool ushort char uint float ulonglong ;
 
-[ ulonglong ] [ ulonglong-array{ } element-type ] unit-test
-
 [ t ] [ { 1 2 3 } >int-array int-array? ] unit-test
 
 [ t ] [ int-array{ 1 2 3 } int-array? ] unit-test
index b6f7209cc6324e4ae2c4ee2b35ca936c623ccb6c..aab0408dc3b1a6436665ee6ec169f890b79f71a4 100644 (file)
@@ -104,6 +104,10 @@ SYNTAX: A@ scan-object scan-object <direct-A> suffix! ;
 
 INSTANCE: A specialized-array
 
+M: A vs+ [ + T c-type-clamp ] 2map ;
+M: A vs- [ - T c-type-clamp ] 2map ;
+M: A vs* [ * T c-type-clamp ] 2map ;
+
 ;FUNCTOR
 
 GENERIC: (underlying-type) ( c-type -- c-type' )