Two standard libraries?
Steve Teale
steve.teale at britseyeview.com
Sat Jul 14 10:27:00 PDT 2007
Sean Kelly Wrote:
> Steve Teale wrote:
> > Sean Kelly Wrote:
> >
> >> Steve Teale wrote:
> >>> It seemes to me that given Walter's definition of the language - a system programming language - that Phobos is closer to the mark. If users want a more object oriented standard library, that's all well and good, but it should be a shoe-in, then if you want to use the OO stuff you can, but code that's been written to work with Phobos should work unmodified with other libraries. (Note the recent discussion on C++ security).
> >> While one might argue that it is easier to wrap a strictly procedural
> >> library with an OO layer than vice-versa, I think the ease with which
> >> any library may be encapsulated in a wrapper is more dependent on its
> >> design (the assumptions it makes, how features are exposed, etc) than on
> >> whether the interface uses functions or objects. That said, I don't
> >> personally consider Tango to be an object-oriented library because it
> >> does not require the user to define his own objects in order to use it.
> >>
> >>
> >> Sean
> >
> > Sean, I take your point, and maybe should not have used the term "OO", but my idea of progress is:
> >
> > printf("X is: %s\n", toStringz(x))
> > cout << "X is: " << x << endl;
> > Stdout("X is: ")(x).newline;
> > writefln("X is: %s", x);
> >
> > rather than:
> >
> > printf("X is: %s\n", toStringz(&x))
> > cout << "X is: " << x << endl;
> > writefln("X is: %s", x);
> > Stdout("X is: ")(x).newline;
> >
>
> For what it's worth, Stdout supports a number of different output
> methods. The "whisper syntax" you show above is just the most commonly
> known. For formatted output similar to writefln you'd do:
>
> Stdout.format( "X is: {}", x ).newline;
>
> Another option is:
>
> Stdout( "X is: ", x ).newline;
>
> This last prints comma-delimeted output, since that's how it appears in
> the Stdout call. For what it's worth, Kris recently explained all this
> on D.learn.
>
>
> Sean
Sean,
I give in. I know that your motivations are genuine. I just don't want two see classes of D citizens. In Europe we fought for centuries over this sort of thing. Somehow we should get to astate of affairs where if you are writing a library you should not have to make a religious choice as to which standard library you subscribe to. Please talk to Walter at the conference, and try and get this sorted. I would love to attend, but I live on the other side of the world, and still need to go to work.
Steve
More information about the Digitalmars-d
mailing list