[cells-devel] Connecting two models

Ken Tilton kentilton at gmail.com
Wed Oct 10 13:34:51 UTC 2012


Sorry, Google decided to send that. Trying again:
>>
>> (defun test ()
>>   (let* ((model (make-model :model))
>>          (view  (make-view :view))
>>          (controller (make-controller model view)))
>>     (setf (item-index model) 2)
>>     (item-index view)))
>
 If the above is really what you want to do you can just:

 (defun test ()
    (let* ((model (make-model :model))
             (view  (make-instance 'view
                         :item-index (c? (item-index model))) ;; model
is captured in a closure via lexical scoping
        (setf (item-index model) 2)
        (item-index view)))

When you want to build things other ways, you just always need to be
able to navigate around your application model to find the entities on
which you want another entity to depend, and the solution will vary
based on how your model changes shape over time (so ask again when you
get to something more elaborate than the above).

hth, kt

ps. Hi, Frank!




More information about the cells-devel mailing list