   (^String toString [this] name)
   )
 
-(defn join-model [name joins join-fn join-pk]
-  (let [state (apply join-views join-fn join-pk joins)]
+(defn join-model [name joined-model joins join-fn join-pk]
+  (let [state (apply join-views join-fn join-pk joined-model joins)]
     (->JoinModel name state (atom []))))
 
 ;;--------------------------------------------------------------------------------

	bs (versioned-optimistic-map-model (str :bs) :name :version >)
	cs (versioned-optimistic-map-model (str :cs) :name :version >)
	joined-model (versioned-optimistic-map-model (str :joined) :name :version abc-more-recent-than?)
	join (join-model "join-model" [[as :name [:fk-b :fk-c] joined-model][bs :name :b][cs :name :c]] join-abc :name)
	view (test-view "test")
	a1 (->A :a1 0 :b :c)
	a1v1 (->A :a1 1 :b :c)


;;; attach lhs to all rhses such that any change to an rhs initiates an
;;; attempt to [re]join it to the lhs and vice versa.
(defn- join-views [join-fn join-pk joined-model [lhs-model lhs-pk-key lhs-fk-keys] & rhses]
  (let [rhs-count (count rhses)
        ;; need 2 pass initialisation
	indeces (atom [(lhs-init rhs-count) 
