add methods to vs+/vs-/vs* on specialized-arrays so that they saturate as well

db4
Joe Groff 2009-12-04 12:43:50 -08:00
parent 63b89c65f9
commit 270fe50ba3
2 changed files with 4 additions and 2 deletions

View 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

View 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' )