Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Joe Hildebrand
On 6/27/10 8:37 PM, "Sean Kelly" wrote: > I'd like to cast a vote for a SAX-style parser. A DOM parser can be built on > top of it, and frankly, a SAX parser the only kind I'd ever use. I'm either > working with large streams where building a tree is impractical, or > performance is enough of a

Re: enforce()?

2010-06-28 Thread Norbert Nemec
On 19/06/10 22:46, Andrei Alexandrescu wrote: On 06/19/2010 03:55 PM, bearophile wrote: Inside Phobos2 I have counted about 160 usages of the "body" keyword. I think contract programming can be used more often inside Phobos2 (and maybe some usages of enforce() can be turned into contract program

Re: An idea for the D community

2010-06-28 Thread Petr
Thats no good. I had a brief look at it and its said to work on D2 as well so i had my hopes high. Which kind of goes back to having a github type website(lets call it DHUB) for all important D projects, so that if someone wants to fork the project its ready and there. A RubyGems type application

Re: enforce()?

2010-06-28 Thread Norbert Nemec
On 20/06/10 22:17, Walter Bright wrote: An input to a dll is user input, and should be validated (for the sake of security, and other reasons). Validating it is not debugging. In that case, feel free to compile DLLs with external contract checking switched on, but please do not blur the concep

Backquotes look like regular quotes in TDPL?

2010-06-28 Thread Jacob Carlborg
Is it just me or are the backquotes looking like regular quotes in TDPL? They're introduced on page 36, section 2.2.5.1. -- /Jacob Carlborg

Re: enforce()?

2010-06-28 Thread Simen kjaeraas
Norbert Nemec wrote: A library designer should trust the library user to act responsibly. After all - if the application breaks it is the application designer who has to answer for it. And if the application designer finds that his design breaks due to a change in the library, he will blame t

Re: Backquotes look like regular quotes in TDPL?

2010-06-28 Thread Tyro[a.c.edwards]
== Quote from Jacob Carlborg (d...@me.com)'s article > Is it just me or are the backquotes looking like regular quotes in TDPL? > They're introduced on page 36, section 2.2.5.1. It's not you, they do in fact look like regular quotes. That however, is a byproduct of the font chosen. Look closely at

Re: enforce()?

2010-06-28 Thread Andrei Alexandrescu
On 06/28/2010 03:15 AM, Norbert Nemec wrote: On 19/06/10 22:46, Andrei Alexandrescu wrote: On 06/19/2010 03:55 PM, bearophile wrote: Inside Phobos2 I have counted about 160 usages of the "body" keyword. I think contract programming can be used more often inside Phobos2 (and maybe some usages of

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Michel Fortin
On 2010-06-27 07:04:30 -0400, Justin Johansson said: May I ask is anybody working on redeveloping std.xml in the D2/Phobos library? (Currently it looks like it needs to be started over from scratch) Also what is the level of interest from library users for decent XML support in D2/Phobos?

Re: Make D more public visible

2010-06-28 Thread Steven Schveighoffer
On Mon, 21 Jun 2010 13:32:24 -0400, Ankh wrote: In article , a...@a.a says... | |"Simen Haugen" wrote in message |news:i01t9q$2oj...@digitalmars.com... |> I've just started using stackoverflow.com, and it's a great way of getting |> answers. | |All I'm going to say is: |http://www.mail-arch

Re: Make D more public visible

2010-06-28 Thread Simen kjaeraas
On Mon, 28 Jun 2010 13:33:04 +0200, Steven Schveighoffer wrote: On Mon, 21 Jun 2010 13:32:24 -0400, Ankh wrote: In article , a...@a.a says... | |"Simen Haugen" wrote in message |news:i01t9q$2oj...@digitalmars.com... |> I've just started using stackoverflow.com, and it's a great way of

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Steven Schveighoffer
On Sat, 26 Jun 2010 20:19:44 -0400, Michal Minich wrote: On Sun, 27 Jun 2010 09:36:04 +0930, Justin Johansson wrote: immutable class Foo { static private Foo instance; static this() { // line 9 instance = new Foo; } static Foo opCall() {

Re: enforce()?

2010-06-28 Thread bearophile
Andrei Alexandrescu: > C APIs also check their arguments. Try again, C doesn't have DbC :-) Norbert Nemec says some good things. Bye, bearophile

Re: enforce()?

2010-06-28 Thread bearophile
Norbert Nemec: > [...] to place code for input contract checking in the *calling* code. [...] > Output contract checks, on the other hand should be compiled inside the > returning routine. Is this a positive thing to do? Can this be done? (D must support separate compilation, but in many situati

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Steven Schveighoffer
On Sun, 27 Jun 2010 14:56:21 -0400, Yao G. wrote: I did a simple implementation of a pull parser, using this API as reference: http://xmlpull.org/ But I used a iterator similar to the one used by Steve (from dcollections) to parse the doc. It turns out that Tango did something similar fi

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Justin Johansson
Steven Schveighoffer wrote: On Sat, 26 Jun 2010 20:19:44 -0400, Michal Minich wrote: On Sun, 27 Jun 2010 09:36:04 +0930, Justin Johansson wrote: immutable class Foo { static private Foo instance; static this() {// line 9 instance = new Foo; } static Foo

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Steven Schveighoffer
On Mon, 28 Jun 2010 08:07:40 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: On Sat, 26 Jun 2010 20:19:44 -0400, Michal Minich wrote: On Sun, 27 Jun 2010 09:36:04 +0930, Justin Johansson wrote: immutable class Foo { static private Foo instance; static this() {

Re: enforce()?

2010-06-28 Thread Michel Fortin
On 2010-06-28 07:17:53 -0400, Andrei Alexandrescu said: On 06/28/2010 03:15 AM, Norbert Nemec wrote: On 19/06/10 22:46, Andrei Alexandrescu wrote: On 06/19/2010 03:55 PM, bearophile wrote: Inside Phobos2 I have counted about 160 usages of the "body" keyword. I think contract programming can

MPIR lib

2010-06-28 Thread bearophile
This is derived from the GNU multiprecision libs: http://www.mpir.org/ It has LGPL licence, is this usable as implementation of D2 bigint? Bye, bearophile

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Justin Johansson
Steven Schveighoffer wrote: On Mon, 28 Jun 2010 08:07:40 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: btw. The reason I marked the static instance member as private was simply to enforce stylist use of Foo() rather than Foo.instance Yuck Foo().xyz :) But, whatever floats your

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Steven Schveighoffer
On Mon, 28 Jun 2010 08:40:36 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: On Mon, 28 Jun 2010 08:07:40 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: To go one step further, if you want it to truly be a singleton type, you should mark the constructor private.

Re: Backquotes look like regular quotes in TDPL?

2010-06-28 Thread Jacob Carlborg
On 2010-06-28 12:50, Tyro[a.c.edwards] wrote: == Quote from Jacob Carlborg (d...@me.com)'s article Is it just me or are the backquotes looking like regular quotes in TDPL? They're introduced on page 36, section 2.2.5.1. It's not you, they do in fact look like regular quotes. That however, is

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Justin Johansson
Ellery Newcomer wrote: On 06/27/2010 10:16 AM, Justin Johansson wrote: OTOH, there are some really significant W3C specs that you may or may not be aware of and these are really difficult to implement in regular imperative languages like C/C++ and Java. Java, being all that is the following of

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Justin Johansson
Steven Schveighoffer wrote: On Mon, 28 Jun 2010 08:40:36 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: On Mon, 28 Jun 2010 08:07:40 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: To go one step further, if you want it to truly be a singleton type, you should mark

Re: immutable singleton pattern with static opCall

2010-06-28 Thread Justin Johansson
Steven Schveighoffer wrote: On Mon, 28 Jun 2010 08:07:40 -0400, Justin Johansson wrote: Steven Schveighoffer wrote: On Sat, 26 Jun 2010 20:19:44 -0400, Michal Minich wrote: On Sun, 27 Jun 2010 09:36:04 +0930, Justin Johansson wrote: immutable class Foo { static private Foo instance;

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Alix Pexton
On 28/06/2010 13:04, Steven Schveighoffer wrote: On Sun, 27 Jun 2010 14:56:21 -0400, Yao G. wrote: I did a simple implementation of a pull parser, using this API as reference: http://xmlpull.org/ But I used a iterator similar to the one used by Steve (from dcollections) to parse the doc. It t

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Steven Schveighoffer
On Mon, 28 Jun 2010 09:59:45 -0400, Alix Pexton wrote: I've never used anything like SAX myself, though I have used the DOM quite a lot, and spent most of the time wishing it worked a bit more like StAX (even though I hadn't heard of StAX at the time ^^). DOM is usually built on top of

Re: The X Macro

2010-06-28 Thread KlausO
I did something similar some time ago: import std.stdio; struct EnumDescription { char[] name; char[] description; }; // // generates an enum, an associated string table and a "save" lookup // function which determines the string which belongs to an given enum // char[] generate_enum(char[

Re: Renaming std.conv

2010-06-28 Thread Sean Kelly
Andrei Alexandrescu Wrote: > > We haven't reached consensus on where to put enforce() and friends. Any > other ideas? Of the above, I like std.checks. > > Better yet, how about defining std.exception that includes a host of > exception-related functionality (such as defining exceptions that reta

Re: enforce()?

2010-06-28 Thread Sean Kelly
Andrei Alexandrescu Wrote: > > C APIs also check their arguments. Not the standard C library, as far as I know. Of course, it's also gotten a lot of flak for this.

Re: Renaming std.conv

2010-06-28 Thread Rory McGuire
On Mon, 28 Jun 2010 17:36:15 +0200, Sean Kelly wrote: Andrei Alexandrescu Wrote: We haven't reached consensus on where to put enforce() and friends. Any other ideas? Of the above, I like std.checks. Better yet, how about defining std.exception that includes a host of exception-related func

Re: Renaming std.conv

2010-06-28 Thread Sean Kelly
Rory McGuire Wrote: > On Mon, 28 Jun 2010 17:36:15 +0200, Sean Kelly > wrote: > > > Andrei Alexandrescu Wrote: > >> > >> We haven't reached consensus on where to put enforce() and friends. Any > >> other ideas? Of the above, I like std.checks. > >> > >> Better yet, how about defining std.excep

bind() vs curry()

2010-06-28 Thread lurker
What's the difference between std.bind.bind and std.funtional.curry? They seem to perform the same function (though bind() seams more flexible). It is really a need for both functions in phobos? Thanks

Data-binding infrastructure.

2010-06-28 Thread lurker
Do you think Phobos could benefit by adding data-binding interfaces? The purpose is to provide the infrastructure necessary so that other libraries (GUI Toolkits, Validation, ORMs, etc) can inter-operate seamlessly. In .NET there's a whole set of interfaces for this purpose. They don't have a grea

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread lurker
I'm very interested. Tango's XML code was very good and damn fast. Maybe license issues can be worked out for that part at least?

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread BLS
On 28/06/2010 14:04, Steven Schveighoffer wrote: I myself have tried to think of how xml can be done with ranges, but I believe one of the key elements is it has to parse xml without loading the entire document to be efficient enough for some applications. A DOM style parser which presents a ran

Re: Make D more public visible

2010-06-28 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.ve0c1egpeav...@localhost.localdomain... > On Mon, 21 Jun 2010 13:32:24 -0400, Ankh wrote: > >> In article , a...@a.a says... >> | >> |"Simen Haugen" wrote in message >> |news:i01t9q$2oj...@digitalmars.com... >> |> I've just started using stackover

Re: Renaming std.conv

2010-06-28 Thread Rory McGuire
On Mon, 28 Jun 2010 18:01:55 +0200, Sean Kelly wrote: Rory McGuire Wrote: On Mon, 28 Jun 2010 17:36:15 +0200, Sean Kelly wrote: > Andrei Alexandrescu Wrote: >> >> We haven't reached consensus on where to put enforce() and friends. Any >> other ideas? Of the above, I like std.checks. >>

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2010-06-27 07:04:30 -0400, Justin Johansson said: May I ask is anybody working on redeveloping std.xml in the D2/Phobos library? (Currently it looks like it needs to be started over from scratch) Also what is the level of interest from library users for decent XML

Re: enforce()?

2010-06-28 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2010-06-28 07:17:53 -0400, Andrei Alexandrescu said: On 06/28/2010 03:15 AM, Norbert Nemec wrote: On 19/06/10 22:46, Andrei Alexandrescu wrote: On 06/19/2010 03:55 PM, bearophile wrote: Inside Phobos2 I have counted about 160 usages of the "body" keyword. I think co

Re: enforce()?

2010-06-28 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: C APIs also check their arguments. Try again, C doesn't have DbC :-) What I meant to say was that even the standard library of a language famous for its to-the-metal performance still checks parameters compulsively whenever it can. Search e.g. this pa

Re: enforce()?

2010-06-28 Thread Andrei Alexandrescu
Sean Kelly wrote: Andrei Alexandrescu Wrote: C APIs also check their arguments. Not the standard C library, as far as I know. Of course, it's also gotten a lot of flak for this. Nonono. They check whenever they can. Oftentimes they're unable to check. Example: fseek checks its whence para

Re: Renaming std.conv

2010-06-28 Thread Andrei Alexandrescu
Sean Kelly wrote: Rory McGuire Wrote: On Mon, 28 Jun 2010 17:36:15 +0200, Sean Kelly wrote: Andrei Alexandrescu Wrote: We haven't reached consensus on where to put enforce() and friends. Any other ideas? Of the above, I like std.checks. Better yet, how about defining std.exception that i

Re: Status of std.xml (D2/Phobos)

2010-06-28 Thread Michel Fortin
On 2010-06-28 14:27:13 -0400, Andrei Alexandrescu said: Here's the generated documentation: http://michelf.com/docs/d/mfr/xmltok.html http://michelf.com/docs/d/mfr/xml.html I'm slowly revamping it to use ranges instead of strings. I think a tokenizer should be a higher-order range that is

Re: enforce()?

2010-06-28 Thread Danny Wilson
Op Mon, 28 Jun 2010 10:33:24 +0200 schreef Norbert Nemec : Conceptually, the ultimate solution would certainly be to place code for input contract checking in the *calling* code. After all, this checking code serves to debug the calling code, so it should be left to the caller to decide w

Re: MPIR lib

2010-06-28 Thread Walter Bright
bearophile wrote: This is derived from the GNU multiprecision libs: http://www.mpir.org/ It has LGPL licence, is this usable as implementation of D2 bigint? No, LGPL is not a Boost compatible license. It is considerably more restrictive.

Re: MPIR lib

2010-06-28 Thread Michel Fortin
On 2010-06-28 16:22:47 -0400, Walter Bright said: bearophile wrote: This is derived from the GNU multiprecision libs: http://www.mpir.org/ It has LGPL licence, is this usable as implementation of D2 bigint? No, LGPL is not a Boost compatible license. It is considerably more restrictive. I

Re: MPIR lib

2010-06-28 Thread Steven Schveighoffer
On Mon, 28 Jun 2010 17:36:19 -0400, Michel Fortin wrote: On 2010-06-28 16:22:47 -0400, Walter Bright said: bearophile wrote: This is derived from the GNU multiprecision libs: http://www.mpir.org/ It has LGPL licence, is this usable as implementation of D2 bigint? No, LGPL is not a Boos

Re: MPIR lib

2010-06-28 Thread bearophile
Steven Schveighoffer: > What's wrong with d2's bigint that Don has written? MPIR is "not invented here" :-) Moving part of the development of a very tricky part of code full of long asm routines (see their amount of code finely tuned for different CPUs) to someone else that has more resources an

Re: MPIR lib

2010-06-28 Thread Steven Schveighoffer
On Mon, 28 Jun 2010 18:18:46 -0400, bearophile wrote: Steven Schveighoffer: What's wrong with d2's bigint that Don has written? MPIR is "not invented here" :-) Moving part of the development of a very tricky part of code full of long asm routines (see their amount of code finely tuned

Re: I'd like to try D, but...

2010-06-28 Thread Neal Becker
Sean Kelly wrote: > Jacob Carlborg Wrote: > >> On 2010-06-23 15:42, Neal Becker wrote: >> > My main interest is building python-callable modules (which I currently >> > do >> > with C++/boost::python). Problem is, D can't be used for this, because >> > it >> > can't produce shared libraries (exc

Rob Pike about Go, seems D has a lot of friends.

2010-06-28 Thread BLS
Read the comments, a lot of them bring in D. Some D related questions should be answered. http://radar.oreilly.com/2010/06/does-the-world-need-yet-anothe.html Bjoern

Re: Rob Pike about Go, seems D has a lot of friends.

2010-06-28 Thread Jonathan M Davis
On Monday, June 28, 2010 16:03:40 BLS wrote: > Read the comments, a lot of them bring in D. Some D related questions > should be answered. > http://radar.oreilly.com/2010/06/does-the-world-need-yet-anothe.html > Bjoern D did seem to pop up in the comments a fair bit, which is certainly interestin

Re: Rob Pike about Go, seems D has a lot of friends.

2010-06-28 Thread Andrei Alexandrescu
Jonathan M Davis wrote: On Monday, June 28, 2010 16:03:40 BLS wrote: Read the comments, a lot of them bring in D. Some D related questions should be answered. http://radar.oreilly.com/2010/06/does-the-world-need-yet-anothe.html Bjoern D did seem to pop up in the comments a fair bit, which is c

Re: DMD Backend Long-term

2010-06-28 Thread BCS
Hello dsimcha, If we're really lucky, Bilski Vs. Kappos (http://en.wikipedia.org/wiki/In_re_Bilski) will send all the software patent attorneys to the poorhouse next week and we can just start trampling freely. FWIW: http://www.supremecourt.gov/opinions/09pdf/08-964.pdf -- ... <

Re: MPIR lib

2010-06-28 Thread BCS
Hello bearophile, Steven Schveighoffer: What's wrong with d2's bigint that Don has written? MPIR is "not invented here" :-) Moving part of the development of a very tricky part of code full of long asm routines (see their amount of code finely tuned for different CPUs) to someone else that h

Re: Renaming std.conv

2010-06-28 Thread Lars T. Kyllingstad
On Sun, 27 Jun 2010 18:09:02 -0500, Andrei Alexandrescu wrote: > On 06/17/2010 04:10 AM, Lars T. Kyllingstad wrote: >> On Wed, 16 Jun 2010 07:31:39 -0700, Andrei Alexandrescu wrote: >> >>> Michel Fortin wrote: On 2010-06-16 05:15:24 -0400, Walter Bright said: > The difference

Re: Renaming std.conv

2010-06-28 Thread Andrei Alexandrescu
Lars T. Kyllingstad wrote: On Sun, 27 Jun 2010 18:09:02 -0500, Andrei Alexandrescu wrote: On 06/17/2010 04:10 AM, Lars T. Kyllingstad wrote: On Wed, 16 Jun 2010 07:31:39 -0700, Andrei Alexandrescu wrote: Michel Fortin wrote: On 2010-06-16 05:15:24 -0400, Walter Bright said: The differen

Using ()s in @property functions

2010-06-28 Thread dsimcha
Once enforcement of @property is enabled, we need to decide whether calling an @property function using ()s should be legal. In other words, should @property **require** omission of ()s or just allow it? My vote is for just allowing omission, because I've run into the following ambiguity while de

Re: dmd build fail

2010-06-28 Thread Ellery Newcomer
On 06/27/2010 11:01 AM, Ellery Newcomer wrote: from revision 560 I'm getting /usr/bin/ld: evalu8.o: undefined reference to symbol 'fetestexcept@@GLIBC_2.1' /usr/bin/ld: note: 'fetestexcept@@GLIBC_2.1' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line /lib/libm.so.6: c

Re: Using ()s in @property functions

2010-06-28 Thread Rainer Deyke
On 6/28/2010 20:40, dsimcha wrote: > Once enforcement of @property is enabled, we need to decide whether calling an > @property function using ()s should be legal. No, "we" don't. Walter does. > In other words, should > @property **require** omission of ()s or just allow it? My vote is for ju

Re: Using ()s in @property functions

2010-06-28 Thread Robert Jacques
On Tue, 29 Jun 2010 00:02:32 -0400, Rainer Deyke wrote: On 6/28/2010 20:40, dsimcha wrote: Once enforcement of @property is enabled, we need to decide whether calling an @property function using ()s should be legal. No, "we" don't. Walter does. No, Walter doesn't. Walter and others w

Re: Using ()s in @property functions

2010-06-28 Thread Robert Jacques
On Tue, 29 Jun 2010 00:02:32 -0400, Rainer Deyke wrote: On 6/28/2010 20:40, dsimcha wrote: In other words, should @property **require** omission of ()s or just allow it? My vote is for just allowing omission, because I've run into the following ambiguity while debugging std.range. Here's

Re: Using ()s in @property functions

2010-06-28 Thread Nick Sabalausky
"Robert Jacques" wrote in message news:op.ve1p6xrt26s...@sandford.myhome.westell.com... > On Tue, 29 Jun 2010 00:02:32 -0400, Rainer Deyke > wrote: >> On 6/28/2010 20:40, dsimcha wrote: >>> In other words, should >>> @property **require** omission of ()s or just allow it? My vote is for >>>

Re: Using ()s in @property functions

2010-06-28 Thread Nick Sabalausky
"dsimcha" wrote in message news:i0bme6$2ph...@digitalmars.com... > Once enforcement of @property is enabled, we need to decide whether > calling an > @property function using ()s should be legal. In other words, should > @property **require** omission of ()s or just allow it? My vote is for >

Re: Using ()s in @property functions

2010-06-28 Thread Robert Jacques
On Tue, 29 Jun 2010 01:38:45 -0400, Nick Sabalausky wrote: "Robert Jacques" wrote in message [snip] So... If we allow properties to be called using () syntax, we have corner case ambiguities. And if we don't allow properties to be called using () syntax, we have corner case ambiguities and

Re: Using ()s in @property functions

2010-06-28 Thread Robert Jacques
On Tue, 29 Jun 2010 01:53:05 -0400, Nick Sabalausky wrote: "dsimcha" wrote in message news:i0bme6$2ph...@digitalmars.com... Once enforcement of @property is enabled, we need to decide whether calling an @property function using ()s should be legal. In other words, should @property **require*