[e-cvs] cvs commit: e/src/jsrc/org/erights/e/elib/serial PassByConstruction.java Persistent.java

markm@eros.cs.jhu.edu markm@eros.cs.jhu.edu
Sun, 23 Sep 2001 01:14:48 -0400


markm       01/09/23 01:14:48

  Modified:    src      Makefile
               src/jsrc/net/captp/jcomm LocatorUnum.java SturdyRef.java
               src/jsrc/org/erights/e/elang/syntax ELexer.java
               src/jsrc/org/erights/e/elib/prim MirandaMethods.java
                        StaticMaker.java
               src/jsrc/org/erights/e/elib/serial PassByConstruction.java
                        Persistent.java
  Log:
  some bug fixes

Revision  Changes    Path
1.119     +2 -2      e/src/Makefile

Index: Makefile
===================================================================
RCS file: /cvs/e/src/Makefile,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- Makefile	2001/09/14 01:35:21	1.118
+++ Makefile	2001/09/23 05:14:48	1.119
@@ -7,8 +7,8 @@
 
 # Prefix tagging this release's attributes
 PREFIX=E
-DOTVER=0.8.10alpha1
-TAGVER=0_8_10alpha1
+DOTVER=0.8.10alpha2
+TAGVER=0_8_10alpha2
 RELEASE=working
 
 TOP=..



1.10      +3 -3      e/src/jsrc/net/captp/jcomm/LocatorUnum.java

Index: LocatorUnum.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/LocatorUnum.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LocatorUnum.java	2001/09/06 09:55:38	1.9
+++ LocatorUnum.java	2001/09/23 05:14:48	1.10
@@ -76,7 +76,7 @@
     }
 
     /**
-     * The basic operation underlying 'SturdyRef.getGrip()'. This is where
+     * The basic operation underlying 'SturdyRef.getRcvr()'. This is where
      * a reference to a remote object actually gets the various underlying
      * comm systems connected so that we can send messages.
      *
@@ -88,14 +88,14 @@
      *                   via whoever we got it from long enough to fetch our
      *                   own Remote reference via this lookup.
      */
-    public Object getGrip(ConstList searchPath,
+    public Object getRcvr(ConstList searchPath,
                           String vatID,
                           BigInteger swissNum,
                           Object optFarVine)
     throws IOException, IndexOutOfBoundsException {
         if (Trace.captp.debug && Trace.ON) {
             Trace.captp.debugm
-                ("" + this + ".getGrip(" + searchPath + ", " + vatID +
+                ("" + this + ".getRcvr(" + searchPath + ", " + vatID +
                  ", " + swissNum + ", " + optFarVine + ")");
         }
         ProxyConnection optProxyConn =



1.14      +6 -6      e/src/jsrc/net/captp/jcomm/SturdyRef.java

Index: SturdyRef.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/SturdyRef.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SturdyRef.java	2001/09/07 05:49:20	1.13
+++ SturdyRef.java	2001/09/23 05:14:48	1.14
@@ -128,25 +128,25 @@
      * Return a (live) reference to the object which this SturdyRef
      * designates.  The result may be either a direct or eventual reference.
      */
-    public Object getGrip() throws IOException {
-        return myLocatorUnum.getGrip(mySearchPath,
+    public Object getRcvr() throws IOException {
+        return myLocatorUnum.getRcvr(mySearchPath,
                                      myHostID,
                                      mySwissNum,
                                      null);
     }
 
     /**
-     * @deprecated Use getGrip() instead.
+     * @deprecated Use getRcvr() instead.
      */
     public Object liveRef() throws IOException {
-        return getGrip();
+        return getRcvr();
     }
 
     /**
-     * @deprecated Use getGrip() instead.
+     * @deprecated Use getRcvr() instead.
      */
     public Object promiseRef() throws IOException {
-        return getGrip();
+        return getRcvr();
     }
 
     /**



1.53      +7 -0      e/src/jsrc/org/erights/e/elang/syntax/ELexer.java

Index: ELexer.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elang/syntax/ELexer.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- ELexer.java	2001/09/10 00:06:51	1.52
+++ ELexer.java	2001/09/23 05:14:48	1.53
@@ -1010,6 +1010,13 @@
                 buf.append((char)myChar);
                 nextChar();
 
+            } else if (myChar == '$' && peekChar('\\')) {
+                //See
+    //https://bugs.sieve.net/bugs/?func=detailbug&bug_id=125408&group_id=16380
+                nextChar();
+                buf.append(charConstant());
+                nextChar();
+
             } else {
                 //interpolated '$' or '@' is neither eaten nor added to the
                 //value of the resulting QuasiOpen token.



1.40      +74 -3     e/src/jsrc/org/erights/e/elib/prim/MirandaMethods.java

Index: MirandaMethods.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elib/prim/MirandaMethods.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- MirandaMethods.java	2001/09/07 05:49:22	1.39
+++ MirandaMethods.java	2001/09/23 05:14:48	1.40
@@ -49,14 +49,85 @@
     private MirandaMethods() {}
 
     /**
-     * Why, you may think, do we still need an order() message when we've got
-     * poE?  With this order message, if the first message throws a
+     * For sending messages contingent on an earier success.
+     * <p>
+     * This method does the equivalent of
+     * <pre>
+     *     to order(self, nestedVerb, nestedArgs) :any {
+     *         [E call(self, nestedVerb, nestedArg), self]
+     *     }
+     * </pre>
+     * In other words, it calls the receiving object with the message
+     * <code>nestedVerb(nestedArgs...)</code>, and, if successful, returns
+     * a pair of the result of this call and the receiving object itself.
+     * <p>
+     * What is this for?  Consider the client code fragment
+     * <pre>
+     *      databaseRcvr <- put(key1, value1)
+     *      def value2Vow := databaseRcvr <- get(key2)
+     * </pre>
+     * E's <a
+     * href="http://www.erights.org/elib/concurrency/partial-order.html"
+     * >partial ordering semantics</a> ensure that put will be delivered
+     * before get is delivered.  That is often good enough.  But it is a
+     * weaker guarantee than that provided by the following sequential code
+     * <pre>
+     *      database put(key1, value1)
+     *      def value2Vow := database get(key2)
+     * </pre>
+     * In this code, not only will get only happen after put is delivered,
+     * get will only happen after put <i>succeeds</i>.  If put instead throws
+     * an exception, the get will never happen.  Often we want this effect.
+     * How can we acheive this with eventual-sends to eventual references?
+     * <p>
+     * When one wants to take an action contingent on the results of a
+     * previous action, the conventional E answer is to use a
+     * when-catch-finally expression
+     * <pre>
+     *     def ackVow := databaseRcvr <- put(key1, value1)
+     *     def value2Vow := when (ackVow) -> done(_) :any {
+     *         databaseRcvr <- get(key2)
+     *     } catch problem {
+     *         throw(problem)
+     *     }
+     * </pre>
+     * This is fine, as is probably the solution to be used by default for
+     * this situation.  However, it does force a round-trip between the get
+     * and put, and so loses the benefits of pipelining.  Using the order
+     * message, we can get contingent execution + pipelining, at some cost in
+     * obscurity.  (Note: often, the cost of obscurity will dominate)
+     * <pre>
+     *     def pairVow := databaseRcvr <- order("put", [key1, value1])
+     *     # If put's return value were interesting, we'd 'pairVow <- get(0)'
+     *     def newDBRcvr := pairVow <- get(1)
+     *     def value2Vow := newDBRcvr <- get(key2)
+     * </pre>
+     * If put throws, then pairVow will resolve directly to broken, so newDB
+     * will likewise resolve to broken, as will value2Vow
+     */
+    static public Object[] order(Object self,
+                                 String nestedVerb,
+                                 Object[] nestedArgs)
+    {
+        Object[] result = {
+            E.callAll(self, nestedVerb, nestedArgs),
+            self
+        };
+        return result;
+    }
+
+    /**
+     * With this order message, if the first message throws a
      * non-Ejection, then the successor messages are not delivered.  Instead
      * of being forwarded, the 'after' Resolver is smashed with the first
      * message's problem.
+     *
+     * @deprecated Use {@link order(Object, String, Object[])} instead, as it
+     *             properly pipelines and smashes the after channel
      */
     static public Object order(Object self,
-                               String nestedVerb, Object[] nestedArgs,
+                               String nestedVerb,
+                               Object[] nestedArgs,
                                Resolver after)
     {
         Object result = null;



1.18      +1 -1      e/src/jsrc/org/erights/e/elib/prim/StaticMaker.java

Index: StaticMaker.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elib/prim/StaticMaker.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- StaticMaker.java	2001/09/07 05:49:22	1.17
+++ StaticMaker.java	2001/09/23 05:14:48	1.18
@@ -69,7 +69,7 @@
         //"java.lang.StrictMath", only after we remove random()
         "java.lang.String",
         "java.lang.StringBuffer",
-        "java.lang.Throwable", //must enforce transPassByCopy
+        "java.lang.Throwable", //XXX must enforce transPassByCopy
         "java.lang.Void",
 
         "java.math.BigInteger",



1.12      +4 -0      e/src/jsrc/org/erights/e/elib/serial/PassByConstruction.java

Index: PassByConstruction.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elib/serial/PassByConstruction.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- PassByConstruction.java	2001/09/06 09:55:51	1.11
+++ PassByConstruction.java	2001/09/23 05:14:48	1.12
@@ -63,6 +63,10 @@
         //of the stack trace, and we currently have no way to enforce the
         //transitive adherence to any rules by Throwable subclasses.
         "java.lang.Throwable",
+
+        //since JDK1.4.  See
+    //https://bugs.sieve.net/bugs/?func=detailbug&bug_id=125434&group_id=16380
+        "java.lang.StackTraceElement"
     };
 
     /**



1.5       +1 -0      e/src/jsrc/org/erights/e/elib/serial/Persistent.java

Index: Persistent.java
===================================================================
RCS file: /cvs/e/src/jsrc/org/erights/e/elib/serial/Persistent.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Persistent.java	2001/09/06 09:55:51	1.4
+++ Persistent.java	2001/09/23 05:14:48	1.5
@@ -65,6 +65,7 @@
         //of the stack trace, and we currently have no way to enforce the
         //transitive adherence to any rules by Throwable subclasses.
         "java.lang.Throwable",
+        "java.lang.StackTraceElement",
 
         //We'd like these to be (at least honorarily) Selfless, and therefore
         //PassByCopy, but they don't implement their own equals() and