]> gitweb.factorcode.org Git - factor.git/commitdiff
removed with-datastack usage (using output>array)
authorSascha Matzke <sascha.matzke@didolo.org>
Mon, 13 Apr 2009 09:55:44 +0000 (11:55 +0200)
committerSascha Matzke <sascha.matzke@didolo.org>
Mon, 13 Apr 2009 09:55:44 +0000 (11:55 +0200)
made dirty-flag handling optional

mongodb/tuple/collection/collection.factor
mongodb/tuple/index/index.factor
mongodb/tuple/persistent/persistent.factor
mongodb/tuple/state/state.factor

index d75e143b7b297c89e88daec13f56aeb3c645f30b..939223b0b178ffde1d9f9a1000df3c9a5e47b42b 100644 (file)
@@ -1,7 +1,7 @@
 
 USING: accessors arrays assocs bson.constants classes classes.tuple
 combinators continuations fry kernel mongodb.driver sequences strings
-vectors words ;
+vectors words combinators.smart ;
 
 IN: mongodb.tuple
 
@@ -50,7 +50,7 @@ CONSTANT: MDB_COLLECTION_MAP "_mdb_col_map"
 PRIVATE>
 
 : MDB_ADDON_SLOTS ( -- slots )
-    { } [ MDB_OID_FIELD MDB_META_FIELD ] with-datastack ; inline
+    [ MDB_OID_FIELD MDB_META_FIELD ] output>array ; inline
 
 : link-class ( collection class -- )
     over classes>>
index 270fecfd3849c0d4ba1ca6d603928bfa41ea59e6..1e7a679df3b663e3cf81c4b04d12082a4fe0a85a 100644 (file)
@@ -7,8 +7,6 @@ SINGLETONS: +fieldindex+ +compoundindex+ +deepindex+ ;
 
 IN: mongodb.tuple.index
 
-FROM: mongodb.tuple => +fieldindex+ +compoundindex+ +deepindex+ ;
-
 TUPLE: tuple-index name spec ;
 
 <PRIVATE
index 329d9cb0c7da5678f17f374e1c3644f901263b18..9a8a5f8dc756e13f3172e43627edc5aff9dca61d 100644 (file)
@@ -52,12 +52,12 @@ TUPLE: cond-value value quot ;
 CONSTRUCTOR: cond-value ( value quot -- cond-value ) ;
 
 : write-mdb-persistent ( value quot: ( tuple -- assoc ) -- value' )
-   over needs-store?
-   [ over [ (( tuple -- assoc )) call-effect ] dip 
-     [ tuple-collection name>> ] keep
-     [ add-storable ] dip
-   ] [ drop ] if 
-   [ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
+    over needs-store? mdb-dirty-handling? get and
+    [ over [ (( tuple -- assoc )) call-effect ] dip 
+      [ tuple-collection name>> ] keep
+      [ add-storable ] dip
+    ] [ drop ] if 
+    [ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
 
 : write-field ( value quot: ( tuple -- assoc ) -- value' )
    <cond-value> {
index b358cd8e38a5f300c06b5b5671971293383ee570..955f66c6ce5d2615dafb3a08b982e5895562ac4a 100644 (file)
@@ -12,6 +12,8 @@ CONSTANT: MDB_DIRTY_ADVICE     "mdb-dirty-set"
 
 PRIVATE>
 
+SYMBOL: mdb-dirty-handling?
+
 : advised-with? ( name word loc -- ? )
    word-prop key? ; inline