Talk:Errata

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Current revision (18:29, 9 July 2012) (edit) (undo)
 
(One intermediate revision not shown.)
Line 6: Line 6:
--[[User:JaroslavTulach|JaroslavTulach]] 06:47, 11 October 2010 (UTC)
--[[User:JaroslavTulach|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():
 +
<source lang="java">
 +
public double getValue() {
 +
return n.doubleValue();
 +
}
 +
</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