Talk:Errata

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(Erratum page 90)
Current revision (18:29, 9 July 2012) (edit) (undo)
 
(5 intermediate revisions not shown.)
Line 1: Line 1:
(Please discuss, review and move to main page if correct)
(Please discuss, review and move to main page if correct)
-
== Chapter 6 ==
 
-
page 90:<br/>
+
-- Cordeo 21:47, 7 October 2010 (UTC)
-
"... simply add the more complicated way of saying hello to its definition:
+
-
<code>
+
-
public '''abstract class''' HelloClass '''extends''' SimpleHelloClass {
+
-
}
+
-
</code>
+
-
This change is ..."
+
-
should define the complicated sayHelloTo:
+
Thanks for pointing this out, I've included your points into [[Errata 6]]. The snippet code was OK, just it showed just a part of the source file, not whole. I fixed that in http://source.apidesign.org/hg/apidesign/rev/e49c5a2d9b32
-
<code>
+
 
-
public '''abstract class''' HelloClass '''extends''' SimpleHelloClass {
+
--[[User:JaroslavTulach|JaroslavTulach]] 06:47, 11 October 2010 (UTC)
-
'''public abstract''' String sayHelloTo(String who);
+
 
 +
 
 +
Page 350: In the create30 method, the implementation of Visitor.dispatchNumber(Number n) defines RealWrapper.getValue() which calls n.getValue but that method does not exist. It should be n.doubleValue():
 +
<source lang="java">
 +
public double getValue() {
 +
return n.doubleValue();
}
}
-
</code>
+
</source>
 +
 
 +
[[User:JaroslavTulach|My]] reply: No, it is ''n.getValue()'', as the ''Number'' is not {{JDK|java/lang|Number}} but rather own implementation defined at
 +
<source lang="java" snippet="visitor.clientprovider.v1"/>
 +
 
 +
I'll make a note in the [[Errata]] page.
 +
 
 +
--[[User:JaroslavTulach|JaroslavTulach]] 14:12, 9 July 2012 (UTC)
 +
 
 +
Sorry, I missed the point
 +
--[[Special:Contributions/82.169.78.58|82.169.78.58]] 18:29, 9 July 2012 (UTC)

Current revision

(Please discuss, review and move to main page if correct)

-- Cordeo 21:47, 7 October 2010 (UTC)

Thanks for pointing this out, I've included your points into Errata 6. The snippet code was OK, just it showed just a part of the source file, not whole. I fixed that in http://source.apidesign.org/hg/apidesign/rev/e49c5a2d9b32

--JaroslavTulach 06:47, 11 October 2010 (UTC)


Page 350: In the create30 method, the implementation of Visitor.dispatchNumber(Number n) defines RealWrapper.getValue() which calls n.getValue but that method does not exist. It should be n.doubleValue():

public double getValue() {
   return n.doubleValue();
 }

My reply: No, it is n.getValue(), as the Number is not Number but rather own implementation defined at

Code from Language.java:
See the whole file.

public interface Expression {
    public abstract void visit(Visitor v);
}
public interface Plus extends Expression {
    public Expression getFirst();
    public Expression getSecond();
}
public interface Number extends Expression {
    public int getValue();
}
 
public static abstract class Visitor {
    Visitor() {}
 
    public static Visitor create(Version10 v) {
        return create10(v);
    }
 
    public interface Version10 {
        public boolean visitUnknown(Expression e);
        public void visitPlus(Plus s);
        public void visitNumber(Number n);
    }
 
    public abstract void dispatchPlus(Plus p);
    public abstract void dispatchNumber(Number n);
}
 

I'll make a note in the Errata page.

--JaroslavTulach 14:12, 9 July 2012 (UTC)

Sorry, I missed the point --82.169.78.58 18:29, 9 July 2012 (UTC)

Personal tools
buy