www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - TDPL Errata: Page 208

reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
The last example:

override bool opEquals(Object rhs)
{
    // the other must be at least a Widget
    auto that = cast(Widget) rhs;
    if (!that)
        return false;
    
    // do they compare equals as Widgets? if not, we're done
    if (!super.opEquals(that))
        return false;
    
    // is it a TextWidget?
    auto that2 = cast(TextWidget) rhs;
    
    // if not, we're done comparing with success
    if (!that2)
        return true;
    
    // compare as TextWidgets
    return text == that.text;
}


Last return should be:

return text == that2.text;
Aug 09 2010
parent reply "Yao G." <nospamyao gmail.com> writes:
Andrei has this errata web page:  
http://www.erdani.com/tdpl/errata/index.php?title=Main_Page

I think you should edit the wiki and add them, because here your message  
will be lost between all the flux of messages.

On Mon, 09 Aug 2010 15:29:06 -0500, Andrej Mitrovic  
<andrej.mitrovich gmail.com> wrote:

 The last example:

 override bool opEquals(Object rhs)
 {
     // the other must be at least a Widget
     auto that = cast(Widget) rhs;
     if (!that)
         return false;
    // do they compare equals as Widgets? if not, we're done
     if (!super.opEquals(that))
         return false;
    // is it a TextWidget?
     auto that2 = cast(TextWidget) rhs;
    // if not, we're done comparing with success
     if (!that2)
         return true;
    // compare as TextWidgets
     return text == that.text;
 }


 Last return should be:

 return text == that2.text;
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 09 2010
next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Doh! I didn't realize it was editable. I will update it with all of my
(confirmed) findings so far.

Thx Yao.

On Mon, Aug 9, 2010 at 10:35 PM, Yao G. <nospamyao gmail.com> wrote:

 Andrei has this errata web page:
 http://www.erdani.com/tdpl/errata/index.php?title=Main_Page

 I think you should edit the wiki and add them, because here your message
 will be lost between all the flux of messages.


 On Mon, 09 Aug 2010 15:29:06 -0500, Andrej Mitrovic <
 andrej.mitrovich gmail.com> wrote:

  The last example:
 override bool opEquals(Object rhs)
 {
    // the other must be at least a Widget
    auto that = cast(Widget) rhs;
    if (!that)
        return false;
   // do they compare equals as Widgets? if not, we're done
    if (!super.opEquals(that))
        return false;
   // is it a TextWidget?
    auto that2 = cast(TextWidget) rhs;
   // if not, we're done comparing with success
    if (!that2)
        return true;
   // compare as TextWidgets
    return text == that.text;
 }


 Last return should be:

 return text == that2.text;
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 09 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Andrej Mitrovic wrote:
 Doh! I didn't realize it was editable. I will update it with all of my 
 (confirmed) findings so far.
Perfect. Thank you! Andrei
Aug 09 2010
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Yao G. wrote:
 Andrei has this errata web page: 
 http://www.erdani.com/tdpl/errata/index.php?title=Main_Page
 
 I think you should edit the wiki and add them, because here your message 
 will be lost between all the flux of messages.
 
 On Mon, 09 Aug 2010 15:29:06 -0500, Andrej Mitrovic 
 <andrej.mitrovich gmail.com> wrote:
 
 The last example:

 override bool opEquals(Object rhs)
 {
     // the other must be at least a Widget
     auto that = cast(Widget) rhs;
     if (!that)
         return false;
    // do they compare equals as Widgets? if not, we're done
     if (!super.opEquals(that))
         return false;
    // is it a TextWidget?
     auto that2 = cast(TextWidget) rhs;
    // if not, we're done comparing with success
     if (!that2)
         return true;
    // compare as TextWidgets
     return text == that.text;
 }


 Last return should be:

 return text == that2.text;
Yes please. Andrej, doing so for your past reports would be very much appreciated. Thanks! Andrei
Aug 09 2010
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 Yes please. Andrej, doing so for your past reports would be very much 
 appreciated. Thanks!
Should add him to your list of reviewers!
Aug 09 2010
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I thought only Guido van Rossum hide a time machine? :p

On Mon, Aug 9, 2010 at 10:51 PM, Walter Bright
<newshound2 digitalmars.com>wrote:

 Andrei Alexandrescu wrote:

 Yes please. Andrej, doing so for your past reports would be very much
 appreciated. Thanks!
Should add him to your list of reviewers!
Aug 09 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Ok it's done, at least for the confirmed ones.

But I will need someone to take a look at some of my unanswered posts for
confirmation on whether these are errors/bugs:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114394
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114395
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114397
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114891(Perhaps
I'm misunderstanding the commet there, but ultimately a Friend
method gets called)


On Mon, Aug 9, 2010 at 10:40 PM, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 Yao G. wrote:

 Andrei has this errata web page:
 http://www.erdani.com/tdpl/errata/index.php?title=Main_Page

 I think you should edit the wiki and add them, because here your message
 will be lost between all the flux of messages.

 On Mon, 09 Aug 2010 15:29:06 -0500, Andrej Mitrovic <
 andrej.mitrovich gmail.com> wrote:

  The last example:
 override bool opEquals(Object rhs)
 {
    // the other must be at least a Widget
    auto that = cast(Widget) rhs;
    if (!that)
        return false;
   // do they compare equals as Widgets? if not, we're done
    if (!super.opEquals(that))
        return false;
   // is it a TextWidget?
    auto that2 = cast(TextWidget) rhs;
   // if not, we're done comparing with success
    if (!that2)
        return true;
   // compare as TextWidgets
    return text == that.text;
 }


 Last return should be:

 return text == that2.text;
Yes please. Andrej, doing so for your past reports would be very much appreciated. Thanks! Andrei
Aug 09 2010
prev sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Ok I also managed to screw up the tables. How do I escape the "|" character?
There's an example with a logical OR and its messing with the html tables.

On Mon, Aug 9, 2010 at 11:48 PM, Andrej Mitrovic <andrej.mitrovich gmail.com
 wrote:
 Ok it's done, at least for the confirmed ones.

 But I will need someone to take a look at some of my unanswered posts for
 confirmation on whether these are errors/bugs:


 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114394

 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114395

 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114397

 http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&artic
e_id=114891(Perhaps I'm misunderstanding the commet there, but ultimately a
Friend
 method gets called)



 On Mon, Aug 9, 2010 at 10:40 PM, Andrei Alexandrescu <
 SeeWebsiteForEmail erdani.org> wrote:

 Yao G. wrote:

 Andrei has this errata web page:
 http://www.erdani.com/tdpl/errata/index.php?title=Main_Page

 I think you should edit the wiki and add them, because here your message
 will be lost between all the flux of messages.

 On Mon, 09 Aug 2010 15:29:06 -0500, Andrej Mitrovic <
 andrej.mitrovich gmail.com> wrote:

  The last example:
 override bool opEquals(Object rhs)
 {
    // the other must be at least a Widget
    auto that = cast(Widget) rhs;
    if (!that)
        return false;
   // do they compare equals as Widgets? if not, we're done
    if (!super.opEquals(that))
        return false;
   // is it a TextWidget?
    auto that2 = cast(TextWidget) rhs;
   // if not, we're done comparing with success
    if (!that2)
        return true;
   // compare as TextWidgets
    return text == that.text;
 }


 Last return should be:

 return text == that2.text;
Yes please. Andrej, doing so for your past reports would be very much appreciated. Thanks! Andrei
Aug 09 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Andrej Mitrovic wrote:
 Ok I also managed to screw up the tables. How do I escape the "|" 
 character? There's an example with a logical OR and its messing with the 
 html tables.
I found this with google: http://www.mediawiki.org/wiki/Extension:Pipe_Escape Andrei
Aug 09 2010
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
*facepalm*

I thought HTML was supossed to be easy.. I keep getting back "Template:!"
with a link. I can't get it to work. That also seems to be an extension tha=
t
needs to be installed, no?

Tell me, to these look similar to the OR symbol for you?:
=C9=C9

It's a "Greek capital letter iota", it looks exactly the same as the normal
|| to me, but doesn't need to be escaped.

On Tue, Aug 10, 2010 at 12:02 AM, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 Andrej Mitrovic wrote:

 Ok I also managed to screw up the tables. How do I escape the "|"
 character? There's an example with a logical OR and its messing with the
 html tables.
I found this with google: http://www.mediawiki.org/wiki/Extension:Pipe_Escape Andrei
Aug 09 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Andrej Mitrovic wrote:
 *facepalm*
 
 I thought HTML was supossed to be easy.. I keep getting back 
 "Template:!" with a link. I can't get it to work. That also seems to be 
 an extension that needs to be installed, no?
 
 Tell me, to these look similar to the OR symbol for you?:
 ии
 
 It's a "Greek capital letter iota", it looks exactly the same as the 
 normal || to me, but doesn't need to be escaped.
Andrei
Aug 09 2010
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Fixed.

2010/8/10 Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>

 Andrej Mitrovic wrote:

 *facepalm*

 I thought HTML was supossed to be easy.. I keep getting back "Template:!=
"
 with a link. I can't get it to work. That also seems to be an extension =
that
 needs to be installed, no?

 Tell me, to these look similar to the OR symbol for you?:
 =C9=C9

 It's a "Greek capital letter iota", it looks exactly the same as the
 normal || to me, but doesn't need to be escaped.
Andrei
Aug 09 2010