[cells-gtk-cvs] CVS update: public_html/faq.html

Peter Denno pdenno at common-lisp.net
Sun Oct 2 19:04:40 UTC 2005


Update of /project/cells-gtk/cvsroot/public_html
In directory common-lisp.net:/tmp/cvs-serv15592

Modified Files:
	faq.html 
Log Message:
reflects some suggestions from kt
Date: Sun Oct  2 21:04:39 2005
Author: pdenno

Index: public_html/faq.html
diff -u public_html/faq.html:1.8 public_html/faq.html:1.9
--- public_html/faq.html:1.8	Sat Oct  1 21:03:15 2005
+++ public_html/faq.html	Sun Oct  2 21:04:39 2005
@@ -36,7 +36,8 @@
       <li><a href="#q6">What GTK Widgets are implemented in cells-gtk?</a></li>
       <li><a href="#q7">Do I have to use cells?</a></li>
       <li><a href="#q8">What is libcellsgtk.so about?</a></li>
-      <li><a href="#q8.5">What is the difference between using c-in and c? in a slot's :initform?</a></li>
+      <li><a href="#q8.5">What is the difference between using c-input (AKA c-in) and c-formula (AKA c?) in a 
+             slot's :initform?</a></li>
       <li><a href="#q9">Why do I need :owner here? It looks like c? would bind self to the mk-whatever
                     enclosing the c?</a></li>
       <li><a href="#q10">How do I do xyz?</a></li>
@@ -61,46 +62,55 @@
 <strong>A:</strong> From the Cells website: "Cells is a mature, stable extension to CLOS that allows you 
    to create classes, the instances of which have slots whose values are determined by 
    a formula." 
-<p/> Here is an explanation from the viewpoint of a Cells-GTK programmer:
+<p/>
+From <a href='http://bc.tech.coop/blog/030911.html'>Bill Clementson's Blog</a>: 
+ "...Cells allows you to define classes whose slots can be dynamically 
+  (and automatically) updated and for which standard 'observers' can be defined that react to changes 
+  in those slots."
+<p/> 
+   Here is an explanation from the viewpoint of a Cells-GTK programmer:
    Cells provides Cells-GTK with two essential features: (1) a part-subpart relationship,
    as is typically found in GUIs -- it allows the user to express that, e.g., this window contains these 
    buttons and subwindows etc.; (2) the expression of a program's state machine, as viewed from the 
    context of the user's interaction through the GUI. This last point is especially noteworthy, and 
    needs more explanation. If you are at all familiar with developing moderately complex software
-   that is operated through a GUI, then you have probably learned this: Keeping what is presented through 
+   that is operated through a GUI, then you have probably learned this lesson: Keeping what is presented through 
    the GUI in-sync with what the user is allowed to do, and in-sync with the computational state of 
    the program is often tedious, complicated work. Specifically, there are the issues of what menu items 
    ought to be made sensitive when, what items should be presented in list, what text should appear in
    entries, etc. Cells-GTK helps with these tasks by providing an abstraction over the details; each
-   of the tasks just listed can be controlled by (a) rules that specify the value of attributes of graphic 
-   features in the part-subpart declaration  (that declaration is called 'defpart' in cells-gtk); 
-   and, (b) rules that specify the value of CLOS slots. [Footnote, In the details of the implementation, 
+   of the tasks just listed can be controlled by (a) formula that specify the value of attributes of graphic 
+   features in the part-subpart declaration (that declaration is called 'defpart' in cells-gtk); 
+   and, (b) formula that specify the value of CLOS slots. [Footnote, In the details of the implementation, 
    (a) is just a usage of (b). But it helps to think of the ability to set a GUI feature with a
-   rule as something different than setting the value of slot with a rule.]. An example of (a)
-   is setting the :sensitive feature of a GTK menu item. For this, I might use the rule (c? (user-file *my-gui*)).
+   formula as something different than setting the value of slot with a formula.]. (c) 'observers' (to 
+   use Bill Clementson's term) that watch over GUI features and react to changes. 
+<p/>
+   An example of (a)
+   is setting the :sensitive feature of a GTK menu item. For this, I might use the formula (c? (user-file *my-gui*)).
    Here user-file is the accessor of some object *my-gui*. :sensitive is a boolean, so whenever there
    is a non-nil value in the slot user-file, the menu item is sensitive. That doesn't look a whole lot 
    different than giving :sensitive whatever value (user-file *my-gui*) evaluates to.
    The difference is that in Cells-GTK, the Cells codes watches over 'instrumented' slots such as user-file 
    and automatically updates those attributes of a Cell-GTK object (such as a menu item's :sensitive feature) 
-   that are governed by a Cells rule. Thus, I don't have to explicitly update the value of 
+   that are governed by a Cells formula. Thus, I don't have to explicitly update the value of 
    :sensitive -- it happens automatically. 
    <p/>
    So what is this talk about 'expression of a program's state machine?' Well, the idea is that 
-   in a GUI operated by Cells-GTK, transition into a state is governed by cells-rules on 
+   in a GUI operated by Cells-GTK, transition into a state is governed by cells-formulae on 
    GUI features and cells-instrumented slots. E.g. when the user loads a file, (c? (user-file *my-gui*))
    becomes true and the program enters the state where some menu item that wasn't sensitive now is 
-   -- the cells rules are rules on the arcs out of states. Is that stretching it too much? 
+   -- the cells formulae are formulae on the arcs out of states. Is that stretching it too much? 
    I don't know, it makes sense to me.
    <p/>
    See also:
     <ul>      
+       <li><a href='http://bc.tech.coop/blog/030911.html'>
+            Bill Clementson's Blog</a></li>
        <li><a href="http://common-lisp.net/project/cells/">
             http://common-lisp.net/project/cells/</a></li>
        <li><a href="http://www.tilton-technology.com/cells_top.html">
              http://www.tilton-technology.com/cells_top.html</a></li>
-       <li><a href="http://home.comcast.net/~bc19191/2003_09_07_bill-clementson_archive.html">
-            http://home.comcast.net/~bc19191/2003_09_07_bill-clementson_archive.html</a></li>
     </ul>
 
 <p/>
@@ -197,10 +207,16 @@
 <p/>
 
 <p/>
-<strong id="q8.5">Q: What is the difference between using c-in and c? in a slot's :initform ?</strong><p/>
-<strong>A:</strong> The usual semantics of :initform do not apply when :initform is given a c? rule.
-Instead of just setting the value at initialization, when c? is used, the value of the slot is
-checked and updated using the rule throughout program execution.
+<strong id="q8.5">Q: What is the difference between using c-input (AKA c-in) and c-formula (AKA c?) in a slot's 
+:initform ?</strong><p/>
+<strong>A:</strong>The two define different kinds of cells:<br/>
+A c-input cell is a cell whose value may be set through explicit declarative code, such as by using setf on the slot.
+<br/>
+A c-formula cell is a cell whose value is obtained through evaluation of a formula.
+<br/>
+Note that the usual semantics of :initform do not apply when :initform is given by c-formula. 
+Instead of just setting the value at initialization, the c-formula (an arbitrary lisp form) 
+specifies the dynamic relationship between the slot's value and other aspects of the program state. 
 <p/>
 
 <strong id="q9">Q: Why do I need :owner here? It looks like c? would bind self to the mk-whatever




More information about the Cells-gtk-cvs mailing list