]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/db/types/types.factor
use reject instead of [ ... not ] filter.
[factor.git] / basis / db / types / types.factor
old mode 100755 (executable)
new mode 100644 (file)
index 30116e3..aedbaf9
@@ -33,19 +33,7 @@ SYMBOL: IGNORE
 
 : filter-ignores ( tuple specs -- specs' )
     [ <mirror> [ nip IGNORE = ] assoc-filter keys ] dip
-    [ slot-name>> swap member? not ] with filter ;
-
-ERROR: no-slot ;
-
-: offset-of-slot ( string tuple -- n )
-    class superclasses [ "slots" word-prop ] map concat
-    slot-named dup [ no-slot ] unless offset>> ;
-
-: get-slot-named ( name tuple -- value )
-    [ nip ] [ offset-of-slot ] 2bi slot ;
-
-: set-slot-named ( value name obj -- )
-    [ nip ] [ offset-of-slot ] 2bi set-slot ;
+    [ slot-name>> swap member? ] with reject ;
 
 ERROR: not-persistent class ;
 
@@ -63,7 +51,7 @@ ERROR: not-persistent class ;
 
 : set-primary-key ( value tuple -- )
     [
-        class db-columns
+        class-of db-columns
         find-primary-key first slot-name>>
     ] keep set-slot-named ;
 
@@ -111,13 +99,13 @@ FACTOR-BLOB NULL URL ;
     dup number? [ number>string ] when ;
 
 : remove-db-assigned-id ( specs -- obj )
-    [ +db-assigned-id+? not ] filter ;
+    [ +db-assigned-id+? ] reject ;
 
 : remove-relations ( specs -- newcolumns )
-    [ relation? not ] filter ;
+    [ relation? ] reject ;
 
 : remove-id ( specs -- obj )
-    [ primary-key>> not ] filter ;
+    [ primary-key>> ] reject ;
 
 ! SQLite Types: http://www.sqlite.org/datatype3.html
 ! NULL INTEGER REAL TEXT BLOB