The Artima Developer Community
Sponsored Link

Weblogs Forum
Error in "Building More Flexible Types with Mixins"

5 replies on 1 page. Most recent reply: Jan 12, 2006 9:11 AM by Christopher Diggins

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Error in "Building More Flexible Types with Mixins" (View in Weblogs)
Posted: Dec 31, 2005 8:09 AM
Reply to this message Reply
Summary
I made a mistake in my latest Agile C++ article for C++ Users Journal, and I want to retract it.
Advertisement
I made a big mistake in my latest article "Building More Flexible Types with Mixins", I called the technique of a class inheriting from a template parameter an example of the Curiously Recurring Template Pattern (CRTP). Instead it is an example of a, as far as I know, unnamed pattern of inheritance of a template parameter. If this pattern indeed lacks a name I propose the Parameterized Inheritance Pattern ( PIP ). Thanks to Terje Slettebo for pointing out the error.


Kresimir Cosic

Posts: 34
Nickname: kreso1
Registered: Jan, 2006

Re: Error in "Building More Flexible Types with Mixins" Posted: Jan 1, 2006 9:25 PM
Reply to this message Reply
I might be wrong, and I am not sure that I completely understood your article "Building More Flexible Types with Mixins", but here is my two cents...

The problem seems to be in the class IterableConcept, where the type Iterator is required, but this type is different for each concrete implementation. I once thought it could be nice to have a language where types are first-class entities. Then you could have a pointer-to-type, which is just what may be required for Iterator. Making type a first class entity should not be too hard, it should be something like a pointer to type's vtable.

This would be cool, as the following code would work:

main()
{
int n;
type arrayOfTypes[]={Stack_array, Stack_vector, Stack_other};

scanf ("%d",&n);
AbstractStack* stack=new arrayOfTypes[n];
.....
}

where 0<=n<3, Stack_array, Stack_vector and Stack_other implement AbstractStack, and keyword type is a type that can hold type :) .

Max Lybbert

Posts: 314
Nickname: mlybbert
Registered: Apr, 2005

Aargh! Posted: Jan 3, 2006 9:39 AM
Reply to this message Reply
I get a mention for making comments on the article, and now you have to retract part of it! That can't look too good for me (g).

Matthew Wilson

Posts: 145
Nickname: bigboy
Registered: Jun, 2004

Re: Error in "Building More Flexible Types with Mixins" Posted: Jan 3, 2006 4:37 PM
Reply to this message Reply
Any chance you can show the code, for those of us too slovenly (or too busy on finishing a certain new book) to have got round to ripping off the plazzie?

Matthew

Happy New Year, btw

Robert Parnell

Posts: 22
Nickname: robparnl
Registered: Jul, 2005

Re: Error in "Building More Flexible Types with Mixins" Posted: Jan 12, 2006 8:45 AM
Reply to this message Reply
Well,

Certainly, you should retract it. Considering they just "closed" publication.

Where are you going to print this C++ erotica, now? Including the correcte4d article, of course.

RobP

PS. Where is that Heron thing at now? Did not you mention late December, it was going to come out?

PSS. I find it ironic, everyone helping yor write even better C++ aritcles. You should give us credit, too. Or do all big name writers do this sort of thing?

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Error in "Building More Flexible Types with Mixins" Posted: Jan 12, 2006 9:11 AM
Reply to this message Reply
> Well,
>
> Certainly, you should retract it. Considering they just
> "closed" publication.

That was actually my retraction. With CUJ closing, I can't actually print the corrections.

> Where are you going to print this C++ erotica, now?

I may continue to write the occasional article for Doctor Dobbs. I hope that at some point soon, I can start writing about Heron instead. In general though my goal is to move towards writing for science/engineering journals, where I think my contributions may have more impact.

> Including the correcte4d article, of course.
>
> RobP
>
> PS. Where is that Heron thing at now? Did not you mention
> late December, it was going to come out?

The Heron language keeps changing directions. There is now a version of the Heron to C++ translator available at http://www.heron-language.com/downloads.html which generates C++ classes which provide implicit behavioral subtyping semantics. More information is available at http://www.heron-language.com/heronfront.html

> PSS. I find it ironic, everyone helping yor write even
> better C++ aritcles. You should give us credit, too.

I am sorry if I overlooked anyone. I would be happy to retroactively attribute acknowledgements where appropriate. Did you (or anyone else) make any specific contributions to my articles that I overlooked? I have had literally thousands of comments on my blog, so it is easy to overlook someone.

Perhaps in the future, I should acknowledge the Artima community at large. This will definitely be the case in my writing about Heron in the future.

Flat View: This topic has 5 replies on 1 page
Topic: Are Web Services an Investment or an infinite Cost? Previous Topic   Next Topic Topic: Are your loops volatile controlled?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use