Re: D Tools Special Interest Group (SIG)

2011-04-13 Thread spir
On 04/13/2011 12:04 AM, Sean Kelly wrote: On Apr 1, 2011, at 11:53 AM, Bruno Medeiros wrote: On 22/03/2011 23:41, Jonas Drewsen wrote: Hi, It seems that every now and then a discussion about build tools or D package management pops up in this group. Many people on this list have a huge

gsoc 2011:interviews

2011-04-13 Thread aman bansal
respected mentors, can any body tell when are interviews and coding tests for the gsoc 2011 proposals will start??? regards, -- aman bansal

Ceylon language

2011-04-13 Thread bearophile
The first description of the Ceylon language, designed for business computing (for large teams developing multi-user applications) and meant to replace Java, from Red Hat, that will run on the Java Virtual Machine itself:

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Bruno Medeiros
On 11/04/2011 20:54, Steven Schveighoffer wrote: In most of the editors I use, the default is to use spaces for indentation. So what happens is someone opens a file that uses tabs for indentation, then adds some lines. However, their editor only uses spaces *for those lines they added*, which

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Bruno Medeiros
On 11/04/2011 22:03, David Gileadi wrote: On 4/11/11 1:51 PM, Jérôme M. Berger wrote: Nick Sabalausky wrote: Andrej Mitrovicandrej.mitrov...@gmail.com wrote in message news:mailman.3396.1302548836.4748.digitalmar...@puremagic.com... Smart editors also allow you to unindent with a single

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Bruno Medeiros
On 12/04/2011 21:08, Nick Sabalausky wrote: Jérôme M. Bergerjeber...@free.fr wrote in message news:io2396$1nuo$1...@digitalmars.com... spir wrote: A drawback is one cannot directly have different indent levels, for instance to indent collection contents more, or less, than blocks of code.

Re: Proposal for std.path replacement

2011-04-13 Thread Bruno Medeiros
On 07/04/2011 09:32, Lars T. Kyllingstad wrote: On Wed, 06 Apr 2011 15:51:15 +0100, Bruno Medeiros wrote: Thanks for the feedback, I will read it more thoroughly when I take up work on std.path again. Just a general comment, though: Having the exact same functionality on Windows and POSIX

Re: D Tools Special Interest Group (SIG)

2011-04-13 Thread Bruno Medeiros
On 12/04/2011 23:04, Sean Kelly wrote: On Apr 1, 2011, at 11:53 AM, Bruno Medeiros wrote: On 22/03/2011 23:41, Jonas Drewsen wrote: Hi, It seems that every now and then a discussion about build tools or D package management pops up in this group. Many people on this list have a huge amount

Re: Complete D grammar

2011-04-13 Thread Bruno Medeiros
On 06/04/2011 19:05, Ellery Newcomer wrote: On 03/29/2011 07:53 AM, Bruno Medeiros wrote: On 28/03/2011 18:19, Luca Boasso wrote: You can find an ANTLR grammar for D v1 at http://www.dsource.org/projects/antlrd/browser/toys/v3d/parsed.g (by Ellery Newcomer) I never should have uploaded that

Re: http://lang-index.sourceforge.net/

2011-04-13 Thread Emil Madsen
On 11 April 2011 03:22, Andrei Alexandrescu seewebsiteforem...@erdani.orgwrote: I wonder how accurate this language popularity index is. Andrei I wouldn't belive it; 1http://www.youtube.com/results?search_query=%2B%22C%2B%2B%20programming%22 result on youtube? - atleast according to the

Re: Linux RPM out of date

2011-04-13 Thread Kai Meyer
On 04/12/2011 07:00 PM, Jesse Phillips wrote: Kai Meyer Wrote: On 04/12/2011 05:22 PM, Kai Meyer wrote: On 04/08/2011 10:47 AM, Kai Meyer wrote: I've been waiting patiently for the Linux RPM to be updated (it's currently 2.051). Do I need to continue to wait, or should I volunteer some time

Re: Anyone interested in simpleaudio.d too?

2011-04-13 Thread Bernard Helyer
If you use OSS, it's completely worthless. I know OSS4 is great, but most modern distros don't use it. If sound is playing, it won't work (unless launched with padsp/aoss), if it isn't, you've suddenly blocked sound for the user. I really don't give shit how simple it is, or the politics, it's

Csmith - C compiler stress test

2011-04-13 Thread Robert Clipsham
I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to stress test C compilers and has found 350+ bugs in GCC/LLVM alone over the past couple of years. It might be interesting to run dmc through this, and maybe adapt the tool to generate

Re: YesOrNo: useful idiom helper or wanking?

2011-04-13 Thread Bernard Helyer
Named arguments. Seriously. Named arguments. *stares into Andrei's soul*

Re: Anyone interested in simpleaudio.d too?

2011-04-13 Thread Andrej Mitrovic
From reading about it more it seems PortAudio is usable as an MIT license.

std.parallelism: Review resumes now

2011-04-13 Thread Lars T. Kyllingstad
We now resume the formal review of David Simcha's std.parallelism module. Code and documentation can be found here: https://github.com/dsimcha/std.parallelism/blob/master/parallelism.d http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html Please post reviews and comments in this

Re: Anyone interested in simpleaudio.d too?

2011-04-13 Thread Adam D. Ruppe
Andrej Mitrovic wrote: What about PortAudio? Any idea where the usable documentation is? I glanced through the wiki but it seems to devote all its time to explaining how to compile it... not a good sign. btw though, this is one of the reasons why I often prefer doing it myself rather than using

Re: Csmith - C compiler stress test

2011-04-13 Thread Trass3r
Am 13.04.2011, 16:13 Uhr, schrieb Robert Clipsham rob...@octarineparrot.com: I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to stress test C compilers and has found 350+ bugs in GCC/LLVM alone over the past couple of years. It

Re: Anyone interested in simpleaudio.d too?

2011-04-13 Thread Andrej Mitrovic
What about PortAudio? It seems to have some kind of custom license, so I don't know if it's boost-compatible: http://www.portaudio.com/license.html It does look quite permissive, so if it's boost-compatible I see no reason not to use it. It takes care of handling playback for you on a multitude

Re: Ceylon language

2011-04-13 Thread Kagamin
bearophile Wrote: String? name = process.args.first; if (exists name) { writeLine(Hello name !); } else { writeLine(Hello World!); } Use of an optional value must be guarded by the if (exists ... ) construct. Therefore, NullPointerExceptions are impossible. How will it

Re: Csmith - C compiler stress test

2011-04-13 Thread David Nadlinger
On 4/13/11 5:16 PM, Trass3r wrote: I think I also came across such a tool but I'm not sure if it was this one. Since it uses a grammar (subset) to generate the programs it should be perfectly possible to adapt it for D. Though it is mainly intended to find bugs in the parts of a compiler that

Re: D Tools Special Interest Group (SIG)

2011-04-13 Thread Sean Kelly
Not sure. Is ddbg open and available? Sent from my iPhone On Apr 13, 2011, at 6:49 AM, Bruno Medeiros brunodomedeiros+spam@com.gmail wrote: On 12/04/2011 23:04, Sean Kelly wrote: On Apr 1, 2011, at 11:53 AM, Bruno Medeiros wrote: On 22/03/2011 23:41, Jonas Drewsen wrote: Hi, It seems

Re: Csmith - C compiler stress test

2011-04-13 Thread Emil Madsen
On 13 April 2011 17:27, David Nadlinger s...@klickverbot.at wrote: On 4/13/11 5:16 PM, Trass3r wrote: I think I also came across such a tool but I'm not sure if it was this one. Since it uses a grammar (subset) to generate the programs it should be perfectly possible to adapt it for D.

Hans Fugal is our 10th GSoC 2011 mentor

2011-04-13 Thread Andrei Alexandrescu
I'm very glad to announce that my coworker Hans Fugal has accepted to become a GSoC mentor. Hans is a brilliant all-around hacker, a language enthusiast, and one of the early promoters of D inside Facebook, in addition to being a great community member and a nice fellow. We have ten mentors

Re: Ceylon language

2011-04-13 Thread bearophile
Kagamin: How will it work on this code? String? name = process.args.first; myLibCustomEnforce(exists name); writeLine(Hello name !); If you want to implement the feature well, then the compiler has to manage a bit of type state too. The state of the type of the (here immutable) variable

Re: Hans Fugal is our 10th GSoC 2011 mentor

2011-04-13 Thread Walter Bright
On 4/13/2011 9:42 AM, Andrei Alexandrescu wrote: I'm very glad to announce that my coworker Hans Fugal has accepted to become a GSoC mentor. Hans is a brilliant all-around hacker, a language enthusiast, and one of the early promoters of D inside Facebook, in addition to being a great community

Re: Linux RPM out of date

2011-04-13 Thread Jesse Phillips
Kai Meyer Wrote: Ok, how should I go about this then? -Kai Meyer Send the updated RPMs to Walter after each release. If you have an easy tool to build them you can ask Walter if he would like it. Note he likes bash files because he can review what they are doing easily.

Re: Csmith - C compiler stress test

2011-04-13 Thread Walter Bright
On 4/13/2011 7:13 AM, Robert Clipsham wrote: I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to stress test C compilers and has found 350+ bugs in GCC/LLVM alone over the past couple of years. It might be interesting to run dmc through

Re: Csmith - C compiler stress test

2011-04-13 Thread Steven Schveighoffer
On Wed, 13 Apr 2011 14:45:17 -0400, Walter Bright newshou...@digitalmars.com wrote: On 4/13/2011 7:13 AM, Robert Clipsham wrote: I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to stress test C compilers and has found 350+ bugs in

Re: Csmith - C compiler stress test

2011-04-13 Thread Daniel Gibson
Am 13.04.2011 20:57, schrieb Steven Schveighoffer: On Wed, 13 Apr 2011 14:45:17 -0400, Walter Bright newshou...@digitalmars.com wrote: On 4/13/2011 7:13 AM, Robert Clipsham wrote: I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to

Re: Linux RPM out of date

2011-04-13 Thread Kai Meyer
On 04/13/2011 12:46 PM, Jesse Phillips wrote: Kai Meyer Wrote: Ok, how should I go about this then? -Kai Meyer Send the updated RPMs to Walter after each release. If you have an easy tool to build them you can ask Walter if he would like it. Note he likes bash files because he can review

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Jérôme M. Berger
Nick Sabalausky wrote: J�r�me M. Berger jeber...@free.fr wrote in message news:io230l$1ldc$3...@digitalmars.com... Well, I have worked in both environments, and I have seen a lot more mess ups with tabs than with spaces... Other than that (and the fact that almost *no* editors are able to do

Re: Linux RPM out of date

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 2:04 PM, Kai Meyer wrote: On 04/13/2011 12:46 PM, Jesse Phillips wrote: Kai Meyer Wrote: Ok, how should I go about this then? -Kai Meyer Send the updated RPMs to Walter after each release. If you have an easy tool to build them you can ask Walter if he would like it. Note he

Re: [OT] open-source license issues

2011-04-13 Thread Jérôme M. Berger
Daniel Gibson wrote: Am 12.04.2011 20:11, schrieb Jérôme M. Berger: Daniel Gibson wrote: Am 12.04.2011 12:45, schrieb Nick Sabalausky: Actually, because of that, I could likely be enticed by an (L)GPL-like license if it was actually readable like zlib, BSD, or MIT, and easier for

Re: Hans Fugal is our 10th GSoC 2011 mentor

2011-04-13 Thread Andrej Mitrovic
It looks like quite a few people are interested in D over there at Facebook? Congrats.

Re: Ceylon language

2011-04-13 Thread Kagamin
bearophile Wrote: How will it work on this code? String? name = process.args.first; myLibCustomEnforce(exists name); writeLine(Hello name !); If you want to implement the feature well, then the compiler has to manage a bit of type state too. The state of the type of the (here

Re: Csmith - C compiler stress test

2011-04-13 Thread Iain Buclaw
== Quote from Walter Bright (newshou...@digitalmars.com)'s article On 4/13/2011 7:13 AM, Robert Clipsham wrote: I've just come across Csmith: http://embed.cs.utah.edu/csmith/ The tool randomly generates valid C99 code to stress test C compilers and has found 350+ bugs in GCC/LLVM

Re: Csmith - C compiler stress test

2011-04-13 Thread Walter Bright
On 4/13/2011 11:45 AM, Walter Bright wrote: I talked to one of the others, he didn't think it would be that hard to adapt it to D, but we'd have to do it ourselves. s/others/authors/

Re: Ceylon language

2011-04-13 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:io458e$elr$1...@digitalmars.com... Ceylon does not support method overloading (or any other kind of overloading). Eewww. Haxe is like that and it's nothing but a royal pain in the ass. If a value of type T can be null, it must be

Re: Csmith - C compiler stress test

2011-04-13 Thread Walter Bright
On 4/13/2011 11:57 AM, Steven Schveighoffer wrote: As much as this might be a fun project, and might find bugs for D, I have to point out that there are *plenty* of bugs in dmd that need fixing. Any would be takers for this project should also consider lending a hand at fixing existing bugs.

Re: D Tools Special Interest Group (SIG)

2011-04-13 Thread Kagamin
Sean Kelly Wrote: Not sure. Is ddbg open and available? Yes, Artistic License 2.0 http://ddbg.mainia.de/releases.html

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Nick Sabalausky
Jérôme M. Berger jeber...@free.fr wrote in message news:io4sng$1p9b$1...@digitalmars.com... Nick Sabalausky wrote: J?r?me M. Berger jeber...@free.fr wrote in message news:io230l$1ldc$3...@digitalmars.com... Well, I have worked in both environments, and I have seen a lot more mess ups with

Re: Linux RPM out of date

2011-04-13 Thread Kai Meyer
On 04/13/2011 01:12 PM, Andrei Alexandrescu wrote: On 4/13/11 2:04 PM, Kai Meyer wrote: On 04/13/2011 12:46 PM, Jesse Phillips wrote: Kai Meyer Wrote: Ok, how should I go about this then? -Kai Meyer Send the updated RPMs to Walter after each release. If you have an easy tool to build them

Re: Csmith - C compiler stress test

2011-04-13 Thread Steven Schveighoffer
On Wed, 13 Apr 2011 16:00:46 -0400, Walter Bright newshou...@digitalmars.com wrote: On 4/13/2011 11:57 AM, Steven Schveighoffer wrote: As much as this might be a fun project, and might find bugs for D, I have to point out that there are *plenty* of bugs in dmd that need fixing. Any would

Re: Ceylon language

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 3:03 PM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:io458e$elr$1...@digitalmars.com... Ceylon does not support method overloading (or any other kind of overloading). Eewww. Haxe is like that and it's nothing but a royal pain in the ass. If

Re: Csmith - C compiler stress test

2011-04-13 Thread Walter Bright
On 4/13/2011 1:22 PM, Steven Schveighoffer wrote: I'm not saying, don't write a program to find bugs. I'm saying, if you want to help D, a better option than trying to find bugs is to fix the bugs we have. Often, people come to me with what can I do for D? I give a list of suggestions, and

Try it now

2011-04-13 Thread Andrei Alexandrescu
I'm quite excited about the new look of std (right now realized only by http://d-programming-language.org/phobos-prerelease/std_algorithm.html). Here's a suggestion on how we could improve it more. Adam wrote an in-browser evaluator for D programs. These, when presented on the homepage with

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
Andrei wrote: Adam wrote an in-browser evaluator for D programs. These, when presented on the homepage with hello, world in them are of limited usefulness. However, a personalized try it now button present for _each_ artifact in an std module would be of great usefulness. Indeed. I actually

Re: Try it now

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 3:54 PM, Adam D. Ruppe wrote: Andrei wrote: Adam wrote an in-browser evaluator for D programs. These, when presented on the homepage with hello, world in them are of limited usefulness. However, a personalized try it now button present for _each_ artifact in an std module would be of

Re: Ceylon language

2011-04-13 Thread bearophile
Kagamin: Do you describe, how Ceylon can work hypotetically or how it actually works? There is no Ceylon implementation yet, and even its authors probably will have to change some of their ideas during the implementation phase, so there is not much real about what I have written. I have just

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Jérôme M. Berger
Nick Sabalausky wrote: J�r�me M. Berger jeber...@free.fr wrote in message news:io4sng$1p9b$1...@digitalmars.com... Nick Sabalausky wrote: J?r?me M. Berger jeber...@free.fr wrote in message news:io230l$1ldc$3...@digitalmars.com... Well, I have worked in both environments, and I have seen a

Re: Try it now

2011-04-13 Thread bearophile
Andrei: When I try some html or javascript I find it very useful to go to one of those sites that allow me to try some code right then and there. The key aspect is that the code edit field is already filled with code that is close to what I'm looking for, which I can then edit and try

Re: Ceylon language

2011-04-13 Thread bearophile
template fs(alias f) { auto fs(Range)(Range s) { return map!f(s); } } And by the way, this is similar to the manual partial application of Ceylon, just with a worse syntax. Bye, bearophile

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for D))

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 4:17 PM, Jérôme M. Berger wrote: Nick Sabalausky wrote: J�r�me M. Bergerjeber...@free.fr wrote in message news:io4sng$1p9b$1...@digitalmars.com... Nick Sabalausky wrote: J?r?me M. Bergerjeber...@free.fr wrote in message news:io230l$1ldc$3...@digitalmars.com... Well, I have

Re: Try it now

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 4:26 PM, bearophile wrote: Andrei: When I try some html or javascript I find it very useful to go to one of those sites that allow me to try some code right then and there. The key aspect is that the code edit field is already filled with code that is close to what I'm looking for,

GSoC 2011 update: we have 3 slots

2011-04-13 Thread Andrei Alexandrescu
Digital Mars has received 3 slots for GSoC 2011. That means we need to choose three student projects to go with. We have enjoyed many strong applications and we have a great lineup of mentors, but Google is reluctant to allocate a lot of slots to first-time participants because historically

Re: Try it now

2011-04-13 Thread Matthias Pleh
[..snip..] Hey, that's so awesome, guys! Keep up that work :) °Matthias

Re: Try it now

2011-04-13 Thread Andrej Mitrovic
That is so awesome, great job Adam! Now I *finally* have an excuse for those reports I made of examples which don't compile (where the response was nobody said examples /have/ to compile, they're just demonstrations..).

Re: Try it now

2011-04-13 Thread bearophile
Adam D. Ruppe: * Since most of them don't actually output anything, the program now detects output.length == 0 and says Program run successfully. upon completion to give some feedback. This is a problem. Unittest code is not meant to produce an output, while online snippets to try are

Re: [OT] Spaces/tabs (Was: simple display (from: GUI library for

2011-04-13 Thread Jussi Jumppanen
Bruno Medeiros Wrote: Why would editors not allow you to enter that right? I was wondering the same thing? Works fine in Eclipse, again because when it auto-indents on Enter, it uses the indentation of the previous line. :) It also worked fine in Zeus, because it too uses this same Enter

Re: Try it now

2011-04-13 Thread Andrej Mitrovic
It does alarm NoScript, which blocks it. It runs fine if I disable it though, and probably most people don't use noscript.

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
Andrej Mitrovic wrote: It does alarm NoScript, which blocks it. Well, it *is* a script... It would be possible to move the logic server side easily enough, but I think the scripted interface is better anyway - no need to show the output and edit windows at all times. The script allows us to

Re: Try it now

2011-04-13 Thread Andrej Mitrovic
I've always wondered.. how do you detect malicious D code? Or if there's an infinite loop in the code? Or if the compiler suddenly crashes? Or if the compilation takes so long that DMD exhausts all memory? It seems like a dangerous thing to allow user code execution, but I've no idea what goes

Re: Try it now

2011-04-13 Thread bearophile
Adam D. Ruppe: Well, it *is* a script... It would be possible to move the logic server side easily enough, but I think the scripted interface is better anyway - no need to show the output and edit windows at all times. The script allows us to only show them when requested. Well designed

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
bearophile wrote: Well designed user interfaces degrade gracefully. That's exactly why I took the approach I did... see below. Here this means hiding the output and edit windows if JavaScript is enabled, and showing them if JS is not available on the user browser. Showing has a cost. The

Re: Try it now

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 5:39 PM, Adam D. Ruppe wrote: Andrei Alexandrescu wrote: To take this to pro level: * Button shold be on the same like as Example: and spell Try now. Maybe a more attractive shape/icon could help too. * Once pressed, the subsequent edit should contain a Cancel that undoes the action.

Re: Try it now

2011-04-13 Thread Andrei Alexandrescu
On 4/13/11 6:11 PM, bearophile wrote: Adam D. Ruppe: * Since most of them don't actually output anything, the program now detects output.length == 0 and says Program run successfully. upon completion to give some feedback. This is a problem. Unittest code is not meant to produce an

Re: Try it now

2011-04-13 Thread bearophile
Adam D. Ruppe: With the script, it's possible to have the best of both worlds. But, without the script, I just don't feel it's worth it. Toys shouldn't get in the way of the main goal. Here's another idea: 1) detect if the user has active JS; 2) If the JS is active, then hide the in/out

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
Andrej Mitrovic wrote: I've always wondered.. how do you detect malicious D code? It doesn't. What it does is use the ulimit feature in linux to limit the resources available to each process so they can't do anything. Try it: int[] a; a.length = 5_000_000; // Memory allocation failed for(;;)

Re: Try it now

2011-04-13 Thread bearophile
Andrei: I disagree. I find examples that use assert() much clearer than examples that print something to the console and then explain in a comment what you ought to be seeing. I don't understand why you say that. Isn't learning and understanding based on feedback? If all the examples do is

Re: Try it now

2011-04-13 Thread Jonathan M Davis
On 4/13/11 6:11 PM, bearophile wrote: Adam D. Ruppe: * Since most of them don't actually output anything, the program now detects output.length == 0 and says Program run successfully. upon completion to give some feedback. This is a problem. Unittest code is not meant to produce

Re: Try it now

2011-04-13 Thread Walter Bright
On 4/13/2011 1:54 PM, Adam D. Ruppe wrote: Indeed. I actually wrote a little javascript thing for that new home page that's reusable across other ddoc or similar sites. Check it out: I think what you've done is very innovative and cool!

Re: Try it now

2011-04-13 Thread bearophile
Adam D. Ruppe: Anyway, as you can see, I tried to cover all my bases with enough fallback plans that I'm not concerned about malicious code at all. The author of codepad has a similar amount of healthy paranoia: Can you break it? You're welcome to try. Let me know if you have any success!

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
bearophile wrote: This is a problem. Unittest code is not meant to produce an output, while online snippets to try are meant to nearly always produce a meaningful output. I don't know - I like the approach Andrei took in the docs, writing a series of true assertations. assert(sort([4, 2]) ==

Re: Try it now

2011-04-13 Thread Adam D. Ruppe
bearophile wrote: If the JS is not active then hide everything, both windows and try it button, but add at the top of the page an alternative page That could work. Links to little popups to try now could work too. For this, we'll probably want to add it to my ddoc post-processor (same program

Re: Try it now

2011-04-13 Thread Walter Bright
On 4/13/2011 6:04 PM, Adam D. Ruppe wrote: I don't know - I like the approach Andrei took in the docs, writing a series of true assertations. assert(sort([4, 2]) == [2, 4]); does look pretty neat. I guess the alternative is: writeln(sort[4, 2]); // prints [2, 4] but it's not as compact with

Re: Try it now

2011-04-13 Thread Simen kjaeraas
On Thu, 14 Apr 2011 01:11:48 +0200, bearophile bearophileh...@lycos.com wrote: Adam D. Ruppe: * Since most of them don't actually output anything, the program now detects output.length == 0 and says Program run successfully. upon completion to give some feedback. This is a problem.

Re: Semicolon can be left out after do-while

2011-04-13 Thread Steven Schveighoffer
On Tue, 12 Apr 2011 18:00:40 -0400, spir denis.s...@gmail.com wrote: On 04/12/2011 11:51 PM, Steven Schveighoffer wrote: On Tue, 12 Apr 2011 17:21:57 -0400, spir denis.s...@gmail.com wrote: On 04/12/2011 09:21 PM, Steven Schveighoffer wrote: int main(){ int a,b; do{ scanf(%d %d,a,b);

Else clauses for loops

2011-04-13 Thread Magnus Lie Hetland
Hi! A feature I use surprisingly often in Python is the else clause on loops. Is there something similar in D? Basically, the idea is that your loop is looking for something (or some condition), and that you'll break out of it if you find what you're looking for. If no break occurs, the else

Re: Before and after in contracts?

2011-04-13 Thread Magnus Lie Hetland
On 2011-04-11 18:42:18 +0200, bearophile said: Your need is perfectly natural it's named old values or prestate in contract programming, and currently it's probably the biggest hole in the D contract programming. It was discussed three or four times, like: [snip] Interesting. I don't know

Re: Else clauses for loops

2011-04-13 Thread Bernard Helyer
You could wrap the loop in an if clause: if (condition) while (true) { // ... } else { // ... }

Re: Semicolon can be left out after do-while

2011-04-13 Thread Emil Madsen
On 13 April 2011 14:36, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 12 Apr 2011 18:00:40 -0400, spir denis.s...@gmail.com wrote: On 04/12/2011 11:51 PM, Steven Schveighoffer wrote: On Tue, 12 Apr 2011 17:21:57 -0400, spir denis.s...@gmail.com wrote: On 04/12/2011 09:21 PM,

Re: implib

2011-04-13 Thread Bernard Helyer
implib is for working with Windows libraries. Why on earth do you need it on OS X?

Re: Semicolon can be left out after do-while

2011-04-13 Thread Andrej Mitrovic
On 4/13/11, Steven Schveighoffer schvei...@yahoo.com wrote: I know that if(xyz); is not *ever* what I meant, but in C it compiles. However, in D, it tells me I shouldn't do that. I've been caught by DMD doing this a couple of times. It saved my butt. Thanks, Walter!

Re: Semicolon can be left out after do-while

2011-04-13 Thread Steven Schveighoffer
On Wed, 13 Apr 2011 09:44:54 -0400, Emil Madsen sove...@gmail.com wrote: On 13 April 2011 14:36, Steven Schveighoffer schvei...@yahoo.com wrote: I know that if(xyz); is not *ever* what I meant, but in C it compiles. However, in D, it tells me I shouldn't do that. What results is less

Re: Semicolon can be left out after do-while

2011-04-13 Thread Kai Meyer
On 04/13/2011 07:44 AM, Emil Madsen wrote: On 13 April 2011 14:36, Steven Schveighoffer schvei...@yahoo.com mailto:schvei...@yahoo.com wrote: On Tue, 12 Apr 2011 18:00:40 -0400, spir denis.s...@gmail.com mailto:denis.s...@gmail.com wrote: On 04/12/2011 11:51 PM, Steven

Re: implib

2011-04-13 Thread Tine Sukljan
On 4/13/11 3:59 PM, Bernard Helyer wrote: implib is for working with Windows libraries. Why on earth do you need it on OS X? In the examples that comes with GLFW library there are some def files. And the Makefile uses implib to get the lib files from them. So I searched for implib.

Re: Semicolon can be left out after do-while

2011-04-13 Thread Emil Madsen
On 13 April 2011 16:17, Kai Meyer k...@unixlords.com wrote: On 04/13/2011 07:44 AM, Emil Madsen wrote: On 13 April 2011 14:36, Steven Schveighoffer schvei...@yahoo.com mailto:schvei...@yahoo.com wrote: On Tue, 12 Apr 2011 18:00:40 -0400, spir denis.s...@gmail.com

Re: Before and after in contracts?

2011-04-13 Thread bearophile
Magnus Lie Hetland: For me, I'd be happy if I could simply declare and initialize the variables myself somehow before the body is executed, and then check them in the out-block. Indeed, as you may have seen in the linked threads, this was the main proposal in D. For me it's acceptable, if

Re: Else clauses for loops

2011-04-13 Thread bearophile
Bernard Helyer: You could wrap the loop in an if clause: if (condition) while (true) { // ... } else { // ... } This is the semantics of the else clause of Python for (and while) loops: bool broken = false; for (...) { if (...) { broken = true;

How do I flush the output of write?

2011-04-13 Thread Andrej Mitrovic
Calling write doesn't automatically flush the output to the screen. Is there a function I could call to do it manually? writeln doesn't suffer from this problem.

Re: How do I flush the output of write?

2011-04-13 Thread Steven Schveighoffer
On Wed, 13 Apr 2011 14:00:04 -0400, Andrej Mitrovic n...@none.none wrote: Calling write doesn't automatically flush the output to the screen. Is there a function I could call to do it manually? writeln doesn't suffer from this problem. stdout.flush(); -Steve

Re: How do I flush the output of write?

2011-04-13 Thread Andrej Mitrovic
I kept trying to do flush(stdout), but I had the syntax wrong I guess. :) Thx.

Re: How do I flush the output of write?

2011-04-13 Thread Steven Schveighoffer
On Wed, 13 Apr 2011 15:41:07 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I kept trying to do flush(stdout), but I had the syntax wrong I guess. :) fflush(stdout) is the way to do it in C, so that's probably where you got it from. in D, stdout is actually a File struct,

Unmatched static array size assignment

2011-04-13 Thread Andrej Mitrovic
Code: void main() { static string[2] szFormat = [%s, %s]; } This compiles, but this is buggy code. The first declaration should have been: static string[2] szFormat = [%s, %s]; I can't tell whether the first case is legit code. You might *want* to initialize all the elements with the same

Re: Unmatched static array size assignment

2011-04-13 Thread bearophile
Andrej Mitrovic: void main() { static string[2] szFormat = [%s, %s]; } This compiles, but this is buggy code. Please vote this old bug report of mine, about this problem: http://d.puremagic.com/issues/show_bug.cgi?id=3849 See also: http://d.puremagic.com/issues/show_bug.cgi?id=481

Re: Unmatched static array size assignment

2011-04-13 Thread Andrej Mitrovic
Yeah, I don't have a lot of votes left, in fact I only have one left. :s I think we're basically on our own when it comes to these kinds of issues. We'll either get a compiler with a better warning system (maybe GDC.. DDMD in the future), or we'll make some kind of Lint tool for D. The latter

Re: Unmatched static array size assignment

2011-04-13 Thread bearophile
Andrej Mitrovic: We'll either get a compiler with a better warning system In that bug report I ask for an error, not a warning. or we'll make some kind of Lint tool for D. Eventually some lint tools will surely be written for D, but lot of people don't use lints. What I am looking here is

So why doesn't popFront return an element?

2011-04-13 Thread Andrej Mitrovic
I'm trying to understand the design of ranges. Why does popFront only set the front() property to return the next element in the range? Why not return the element in the call to popFront right away? For example code like this (which doesn't work since popFront doesn't return): void main() {

Re: So why doesn't popFront return an element?

2011-04-13 Thread Jesse Phillips
Andrej Mitrovic Wrote: Isn't it wasteful to have to call both popFront() and front() to simultaneously remove an element from a range and return it? I mean it's an extra function call, right? Isn't also a waste to return something that isn't going to be used? There are times it is

  1   2   >