[render-refactor-1
strick**20120207064958
 Ignore-this: 9571b93e4341dece0f1587e5839ee59e
] hunk ./Pro.java 764
-            // if (str == null) {
-            // return "<*BAD_NULL_STR_IN_STR*>";
-            // }
hunk ./Pro.java 780
-                Str s = r.asStr();
+                Str s = (Str)r;
hunk ./Pro.java 782
-                if (s == null) {
-                    toss("Receiver of Str relop not a Str");
-                }
hunk ./Pro.java 794
-                    Str s = r.asStr();
+                    Str s = (Str)r;
hunk ./Pro.java 796
-                    if (s == null) {
-                        toss("Receiver of Str>>spli: not a Str");
-                    }
hunk ./Pro.java 813
-                    Str s = r.asStr();
+                    Str s = (Str)r;
hunk ./Pro.java 815
-                    if (s == null) {
-                        toss("Receiver of Str>>ap: not a Str");
-                    }
hunk ./Pro.java 825
-                            Str s = r.asStr();
+                            Str s = (Str)r;
hunk ./Pro.java 832
+            terp.tStr.addMethod(new JavMeth(terp.tStr, "head", "hd", "First char of Str.") {
+                public Pro apply(Frame f, Pro r, Pro[] args) {
+                    Str self = (Str)r;
+                    if (self.str.length() == 0) {
+                        toss("Cannot take head of empty Str");
+                    }
+                    return terp.newStr(self.str.substring(0, 1));
+                }
+            });
+            terp.tStr.addMethod(new JavMeth(terp.tStr, "tail", "tl", "All but first char of Str.") {
+                public Pro apply(Frame f, Pro r, Pro[] args) {
+                    Str self = (Str)r;
+                    if (self.str.length() == 0) {
+                        toss("Cannot take tail of empty Str");
+                    }
+                    return terp.newStr(self.str.substring(1));
+                }
+            });
+            terp.tStr.addMethod(new JavMeth(terp.tStr, "length", "len", "Length of Str.") {
+                public Pro apply(Frame f, Pro r, Pro[] args) {
+                    return terp.newNum(((Str)r).str.length());
+                }
+            });
+            terp.tStr.addMethod(new JavMeth(terp.tStr, "toNumber", "num", "Convert ASCII Str to Num") {
+                public Pro apply(Frame f, Pro r, Pro[] args) {
+                    Str self = (Str)r;
+                    double x = 0;
+                    try {
+                        x = new Float(self.str);
+                    } catch (NumberFormatException ex) {
+                        toss("Cannot convert Str to Num: <%s>", self.str);
+                    }
+                    return terp.newNum(x);
+                }
+            });
hunk ./Pro.java 869
-                    return new Str(terp, r.asStr().str.toLowerCase());
+                    return terp.newStr(((Str)r).str.toLowerCase());
hunk ./Pro.java 874
-                    return new Str(terp, r.asStr().str.toUpperCase());
+                    return terp.newStr(((Str)r).str.toUpperCase());
hunk ./Pro.java 879
-                    return new Str(terp, r.asStr().str.trim());
+                    return terp.newStr(((Str)r).str.trim());
hunk ./Talk.java 7
-import java.util.ArrayList;
hunk ./Talk.java 9
-import java.util.List;
hunk ./Talk.java 11
-import net.yak.stalk.Cls.Meth;
-import net.yak.stalk.Expr.Send;
hunk ./Talk.java 435
-                url = "/TopApp";
+                url = "/Home";
hunk ./Talk.java 437
-            ;
hunk ./Talk.java 449
-                Pro result_pro = self.asObj().eval(fmt("self handle: %s quer: %s", newStr(url), qDict));
+                Pro result_pro = self.asObj().eval(fmt("self handle: %s query: %s", newStr(url), qDict));
hunk ./WebServer.java 50
-        terp = new Terp(Talk.STANDARD_INIT_FILENAME);
-        this.terp = terp;
-        this.TYPE = terp.newStr("type");
-        this.LIST = terp.newStr("list");
-        this.VALUE = terp.newStr("value");
-        this.ACTION = terp.newStr("action");
-        this.TITLE = terp.newStr("title");
-        this.TEXT = terp.newStr("text");
-        this.EDIT = terp.newStr("edit");
-        this.UPPER = terp.newStr("upper");
-        this.LOWER = terp.newStr("lower");
-        this.FIELD1 = terp.newStr("field1");
-        this.FIELD2 = terp.newStr("field2");
-        this.VALUE1 = terp.newStr("value1");
-        this.VALUE2 = terp.newStr("value2");
+        Terp t = new Terp(Talk.STANDARD_INIT_FILENAME);
+        this.terp = t;
+        this.TYPE = t.newStr("type");
+        this.LIST = t.newStr("list");
+        this.VALUE = t.newStr("value");
+        this.ACTION = t.newStr("action");
+        this.TITLE = t.newStr("title");
+        this.TEXT = t.newStr("text");
+        this.EDIT = t.newStr("edit");
+        this.UPPER = t.newStr("upper");
+        this.LOWER = t.newStr("lower");
+        this.FIELD1 = t.newStr("field1");
+        this.FIELD2 = t.newStr("field2");
+        this.VALUE1 = t.newStr("value1");
+        this.VALUE2 = t.newStr("value2");
hunk ./WebServer.java 183
-            return defaultString == null ? x.toString() : defaultString;
+            return defaultString == null ? "nil" : defaultString;
hunk ./WebServer.java 202
-            String title = maybeString(dict.dict.get(TITLE), "Untitled");
-            Ht.tag(page, "title", null, title);
-            Ht.tag(page, "h2", null, title);
hunk ./WebServer.java 225
-            Ht.tag(page, "p", null, dict.toString());
hunk ./WebServer.java 238
-            String title = maybeString(dict.dict.get(TITLE), "Untitled");
-            Ht.tag(page, "title", null, title);
-            Ht.tag(page, "h2", null, title);
hunk ./WebServer.java 239
-            Ht.tag(page, "p", null, dict.toString());
hunk ./WebServer.java 263
-            String title = maybeString(dict.dict.get(TITLE), "Untitled");
-            Ht.tag(page, "title", null, title);
-            Ht.tag(page, "h2", null, title);
hunk ./WebServer.java 264
-            Ht.tag(page, "p", null, dict.toString());
hunk ./WebServer.java 270
-        Terp terp;
hunk ./WebServer.java 273
-            this.terp = dict.terp();
hunk ./WebServer.java 277
+                Ht inner;
hunk ./WebServer.java 279
-                    return new ListDictRenderer(dict).toHt();
-                }
-                if (type.equals(TEXT)) {
-                    return new TextDictRenderer(dict).toHt();
-                }
-                if (type.equals(EDIT)) {
-                    return new EditDictRenderer(dict).toHt();
+                    inner = new ListDictRenderer(dict).toHt();
+                } else if (type.equals(TEXT)) {
+                    inner = new TextDictRenderer(dict).toHt();
+                } else if (type.equals(EDIT)) {
+                    inner = new EditDictRenderer(dict).toHt();
+                } else {
+                    inner = crudeFallbackToHt();
hunk ./WebServer.java 287
-                return crudeFallbackToHt();
+                
+                Ht head = new Ht();
+                Ht.tag(head, "title", null, maybeString(dict.dict.get(TITLE), "Untitled"));
+                
+                Ht body = new Ht();
+                Ht.tag(body, "b", null, maybeString(dict.dict.get(TITLE), "Untitled"));
+                Ht.tag(body, "hr", null, "");
+                body.append(inner);
+                Ht.tag(body, "hr", null, "");
+                Ht.tag(body, "small", null, dict.toString());
+                
+                return Ht.tag(null, "html", null, head.append(body));
hunk ./WebServer.java 329
-            beginNewTerp();
+            //beginNewTerp();
hunk ./init.txt 104
-class TopApp App
+class Home App
hunk ./init.txt 106
-meth TopApp handle:quer:
+meth Home handle:query:
hunk ./init.txt 121
-meth Browse handle:quer:
+meth Browse handle:query:
hunk ./init.txt 180
-meth EditMethod handle:quer:
+meth EditMethod handle:query:
hunk ./init.txt 206
-meth SubmitMethod handle:quer:
+meth SubmitMethod handle:query:
hunk ./init.txt 214
-  z= co definemethod: mn abbrev: '' docstr: '' code: ( b at: 'text' ) .
+  z= co definemethod: mn abbrev: '' doc: '' code: ( b at: 'text' ) .
hunk ./init.txt 216
-  MAP[ 'type' . 'text' .
+  DICT[ 'type' . 'text' .
hunk ./init.txt 226
-meth FormDoit handle:quer:
-  MAP[ 'type' . 'edit' .
+meth FormDoit handle:query:
+  DICT[ 'type' . 'edit' .
hunk ./init.txt 235
-meth SubmitDoit handle:quer:
+meth SubmitDoit handle:query:
hunk ./init.txt 237
-  MAP[ 'type' . 'text' .
+  DICT[ 'type' . 'text' .