gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/doc/pegboard/containment--benja peg.rst


From: Benja Fallenstein
Subject: [Gzz-commits] gzz/doc/pegboard/containment--benja peg.rst
Date: Tue, 29 Oct 2002 07:50:09 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      02/10/29 07:50:09

Modified files:
        doc/pegboard/containment--benja: peg.rst 

Log message:
        Changes to reflect discussion

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/containment--benja/peg.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/doc/pegboard/containment--benja/peg.rst
diff -u gzz/doc/pegboard/containment--benja/peg.rst:1.1 
gzz/doc/pegboard/containment--benja/peg.rst:1.2
--- gzz/doc/pegboard/containment--benja/peg.rst:1.1     Mon Oct 28 07:05:21 2002
+++ gzz/doc/pegboard/containment--benja/peg.rst Tue Oct 29 07:50:09 2002
@@ -3,8 +3,8 @@
 ==================================================================
 
 :Author:       Benja Fallenstein
-:Date:         $Date: 2002/10/28 12:05:21 $
-:Revision:     $Revision: 1.1 $
+:Date:         $Date: 2002/10/29 12:50:09 $
+:Revision:     $Revision: 1.2 $
 :Date-Created: 2002-10-28
 :Status:       Current
 
@@ -36,7 +36,7 @@
 -------
 
 For now, let's handle containment through a 
-``gzz.zzutil.Contaiment`` class with the following methods::
+``gzz.zzutil.Containment`` class with the following methods::
 
     public static String getContainedText(Cell c) {
        // ...
@@ -54,6 +54,31 @@
 list of contained cells; ``P`` does the reverse. (Actually, let's
 use the prefix mechanism explained in PEG 1022: other window if
 no cells are marked; the marked cells, if any; in the future,
-the cell identified by number, if any.)
+the cell identified by number, if any.) If the cell to be put
+"inside" another cell is already connected in a containment
+structure (i.e., is already inside some other cell), it is
+cloned and the clone is put instead.
+
+To encapsulate this properly, let's have an additional method
+in ``Containment``::
+
+    public static void addContainedCell(Cell add, Cell into) 
+                                 throws IllegalArgumentException {
+       // ...
+    }
+
+This method puts ``add`` at the end of the list of cells contained
+in ``into``, *if* ``add`` has no connections on ``d..contain-list``
+and no negward connection on ``d.contain``. Otherwise, it throws
+an ``IllegalArgumentException``.
+
+It doesn't do the cloning because that behavior is considered
+specific to the binding. In the binding, we can then write::
+
+    try {
+       addContainedCell(add, into);
+    } catch(IllegalArgumentException _) {
+       addContainedCell(add.zzclone(), into);
+    }
 
 - Benja




reply via email to

[Prev in Thread] Current Thread [Next in Thread]