Problem this names of shared libraries

2012-06-26 Thread mezozoysky
Hello! I'm not sure if this is the right thread for this question. If you know in which thread this question should be, please point me to it. I've see a strange things using dmd 2.059 with my debian/testing os. Linker returns an error, when I link external shared libraries to my code. I

Re: Problem this names of shared libraries

2012-06-26 Thread mezozoysky
Oh... sorry for typos.

How to overload opertators for enums

2012-06-26 Thread Tobias Pankrath
This should be a tribool-like type. enum Value : byte { Undef = 0, True = 1, False = -1 }; unittest { with(Value) { assert(~Undef == Undef); // failure assert(~True == False); assert(~False == True); } When I overload opUnary!(~) in this way, unittests fail. Value

Re: A little story

2012-06-26 Thread Don Clugston
On 25/06/12 14:24, bearophile wrote: Dmitry Olshansky: Except for the fact, that someone has to implement it. I am not seeing one of the posts of this thread. So I'll answer here. The good thing regarding the run-time overflow integral tests is that they are already implemented and

Re: Problem this names of shared libraries

2012-06-26 Thread Jacob Carlborg
On 2012-06-26 10:45, mezozoysky wrote: Hello! I'm not sure if this is the right thread for this question. If you know in which thread this question should be, please point me to it. I've see a strange things using dmd 2.059 with my debian/testing os. Linker returns an error, when I link

Re: A little story

2012-06-26 Thread bearophile
Don Clugston: Bearophile, haven't you ever read that paper on integer overflow, which you keep posting to the newsgroup??? I have read it time ago, but it seems not having run-time overflow tests is not an option for certain programming endeavors of mine. This is why I have partially

Re: How to overload opertators for enums

2012-06-26 Thread bearophile
Tobias Pankrath: When I overload opUnary!(~) in this way, unittests fail. Currently in D you can only overload struct and class operators. Bye, bearophile

Re: filename.writeln() across network

2012-06-26 Thread Paul
On Thursday, 21 June 2012 at 19:52:26 UTC, Danny Arends wrote: On Thursday, 21 June 2012 at 17:14:34 UTC, Regan Heath wrote: On Thu, 21 Jun 2012 14:56:37 +0100, Paul phshaf...@gmail.com wrote: I wrote a program that parses a text file and writes results as it is processing the file (i.e.

Re: std.file.copy

2012-06-26 Thread bioinfornatics
Le lundi 25 juin 2012 à 20:18 -0400, Jonathan M Davis a écrit : On Tuesday, June 26, 2012 02:08:00 bioinfornatics wrote: the function std.file.copy do not overwrite a file if dest already exist and they are nothing about this into documentation: http://dlang.org/phobos/std_file.html#copy

Circle Calculator Help

2012-06-26 Thread Alexander
Hello everybody! I am new to D, and I am working on a program that calculates the area and circumference of a circle. However, when I compile it and run it, it waits for the user to input the radius, but then it closes while displaying a bunch of stuff. I've tried several ways to get it to

Re: Circle Calculator Help

2012-06-26 Thread Alexander
By the way, this is just my 2nd program in D. It is just for fun, and I'm doing it to practice using this language. This is normally how I teach myself languages. I write a simple one then a more complex one on and on until I'm fluent in the language. I don't have the book (but I'll get it

Re: Circle Calculator Help

2012-06-26 Thread Adam D. Ruppe
You should be able to just do a readln() before exiting to give the user a chance to read everything, and hit enter to exit.

Re: aa.remove in a destructor

2012-06-26 Thread Ellery Newcomer
On 06/24/2012 01:56 PM, Ellery Newcomer wrote: Come to think of it, though, shouldn't the standard library provide an aa implementation that doesn't rely on the gc? ah, screw it, I'll just write my own.

[linux, ubuntu] personal D module not found in the same directory

2012-06-26 Thread le TeXnicien de surface
hello all I'm begining to learn to program with D. I've made this tiny module written in file truc.d module module truc; double carre(double x){ return x*x; } /module and this tiny program written in file jeteste.d prgm import truc; // I've also tried import T = truc; import std.stdio;

Re: [linux, ubuntu] personal D module not found in the same directory

2012-06-26 Thread Jesse Phillips
On Tuesday, 26 June 2012 at 16:55:56 UTC, le TeXnicien de surface wrote: and I obtain this message: jeteste.o: In function `_Dmain': jeteste.d:(.text._Dmain+0x1e): undefined reference to `_D4truc5carreFdZd' collect2: ld a retourné 1 code d'état d'exécution --- errorlevel 1 where do I err?

Re: [linux, ubuntu] personal D module not found in the same directory

2012-06-26 Thread le TeXnicien de surface
On Tuesday, 26 June 2012 at 17:14:07 UTC, Jesse Phillips wrote: On Tuesday, 26 June 2012 at 16:55:56 UTC, le TeXnicien de surface wrote: and I obtain this message: jeteste.o: In function `_Dmain': jeteste.d:(.text._Dmain+0x1e): undefined reference to `_D4truc5carreFdZd' collect2: ld a

Re: aa.remove in a destructor

2012-06-26 Thread Steven Schveighoffer
On Sun, 24 Jun 2012 14:56:20 -0400, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 06/24/2012 02:53 AM, Dmitry Olshansky wrote: I think no, as any with operation involving GC. For instance while you are removing elements table may decide to rehash itself and that means it may trigger

Re: Circle Calculator Help

2012-06-26 Thread Alexander
On Tuesday, 26 June 2012 at 14:53:33 UTC, Adam D. Ruppe wrote: You should be able to just do a readln() before exiting to give the user a chance to read everything, and hit enter to exit. I just tried that, and it still closed right after I typed the radius. It looks almost like error code

Re: Circle Calculator Help

2012-06-26 Thread Steven Schveighoffer
On Tue, 26 Jun 2012 10:40:18 -0400, Alexander alexan...@alexandermohn.com wrote: Hello everybody! I am new to D, and I am working on a program that calculates the area and circumference of a circle. However, when I compile it and run it, it waits for the user to input the radius, but

Re: [linux, ubuntu] personal D module not found in the same directory

2012-06-26 Thread Graham Fawcett
On Tuesday, 26 June 2012 at 17:23:58 UTC, le TeXnicien de surface wrote: On Tuesday, 26 June 2012 at 17:14:07 UTC, Jesse Phillips wrote: On Tuesday, 26 June 2012 at 16:55:56 UTC, le TeXnicien de surface wrote: and I obtain this message: jeteste.o: In function `_Dmain':

Re: Circle Calculator Help

2012-06-26 Thread Timon Gehr
On 06/26/2012 09:43 PM, Steven Schveighoffer wrote: On Tue, 26 Jun 2012 10:40:18 -0400, Alexander alexan...@alexandermohn.com wrote: ... //Wait void wait() { writefln (Type A to continue!); exittest(); } //Exit tester void exittest() { char[] a; stdin.readln(a); if (a == A)

Re: [linux, ubuntu] personal D module not found in the same directory

2012-06-26 Thread le TeXnicien de surface
On Tuesday, 26 June 2012 at 19:50:15 UTC, Graham Fawcett wrote: You should also be able to do this: rdmd --build-only jeteste.d Normally, the rdmd tool will compile and immediately execute the jeteste program. Rdmd is smarter than dmd, because it will calculate all the files that you need

Re: Circle Calculator Help

2012-06-26 Thread Alexander
I'll probably put in this alternative: void wait() { char[] a; while(a != A) { writeln(Type A to continue!); stdin.readln(a); } Thanks!

Re: Circle Calculator Help

2012-06-26 Thread Alexander
So, I've taken out the loop part that is interesting and replaced it with the readln() alternative. However, I'm still getting what looks like an error. I managed to take a screenshot of what pops up, and here is what it says:

Re: Circle Calculator Help

2012-06-26 Thread Steven Schveighoffer
On Tue, 26 Jun 2012 16:39:07 -0400, Alexander alexan...@alexandermohn.com wrote: So, I've taken out the loop part that is interesting and replaced it with the readln() alternative. However, I'm still getting what looks like an error. I managed to take a screenshot of what pops up, and here

Re: Circle Calculator Help

2012-06-26 Thread bearophile
Steven Schveighoffer: Oh, readln includes the newline by default, so to!float is choking on that. Similar things happen often. But Andrei says this is good, because it's more orthogonal. As Sting, I don't subscribe to this point of view. Orthogonality isn't more important than

What is the 'macro' keyword for?

2012-06-26 Thread Ali Çehreli
It is listed as a reserved keyword - in TDPL - at http://dlang.org/lex.html - at https://github.com/bhelyer/SDC/blob/master/src/sdc/token.d Is it still used? What is/was it for? Ali

Re: What is the 'macro' keyword for?

2012-06-26 Thread Jonathan M Davis
On Tuesday, June 26, 2012 14:35:23 Ali Çehreli wrote: It is listed as a reserved keyword - in TDPL - at http://dlang.org/lex.html - at https://github.com/bhelyer/SDC/blob/master/src/sdc/token.d Is it still used? What is/was it for? Nothing right now. If we ever get any kind of AST

Re: What is the 'macro' keyword for?

2012-06-26 Thread H. S. Teoh
On Tue, Jun 26, 2012 at 02:35:23PM -0700, Ali Çehreli wrote: It is listed as a reserved keyword - in TDPL - at http://dlang.org/lex.html - at https://github.com/bhelyer/SDC/blob/master/src/sdc/token.d Is it still used? What is/was it for? [...] AFAIK, it is reserved for the future

Re: Circle Calculator Help

2012-06-26 Thread Steven Schveighoffer
On Tue, 26 Jun 2012 17:17:29 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: Oh, readln includes the newline by default, so to!float is choking on that. Similar things happen often. But Andrei says this is good, because it's more orthogonal. As Sting, I don't

Re: Circle Calculator Help

2012-06-26 Thread Alexander
That must be why, I didn't import std.string! Thanks!

Re: Circle Calculator Help

2012-06-26 Thread bearophile
Steven Schveighoffer: I agree with Andrei, there is no outlet for errors in the to!T function, exception is the logical choice. Maybe I was not clear enough, so let me explain a bit better. What I don't like is to!int(15\n) to be seen as an error in the first place. I'd like it to ignore

Re: Circle Calculator Help

2012-06-26 Thread Steven Schveighoffer
On Tue, 26 Jun 2012 19:10:25 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: I agree with Andrei, there is no outlet for errors in the to!T function, exception is the logical choice. Maybe I was not clear enough, so let me explain a bit better. What I don't like

Re: Circle Calculator Help

2012-06-26 Thread Sean Kelly
On Jun 26, 2012, at 4:40 PM, Steven Schveighoffer wrote: On Tue, 26 Jun 2012 19:10:25 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: I agree with Andrei, there is no outlet for errors in the to!T function, exception is the logical choice. Maybe I was not

Re: Circle Calculator Help

2012-06-26 Thread Steven Schveighoffer
On Tue, 26 Jun 2012 19:44:34 -0400, Sean Kelly s...@invisibleduck.org wrote: On Jun 26, 2012, at 4:40 PM, Steven Schveighoffer wrote: On Tue, 26 Jun 2012 19:10:25 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: I agree with Andrei, there is no outlet for errors

Re: Circle Calculator Help

2012-06-26 Thread Timon Gehr
On 06/27/2012 01:40 AM, Steven Schveighoffer wrote: On Tue, 26 Jun 2012 19:10:25 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: I agree with Andrei, there is no outlet for errors in the to!T function, exception is the logical choice. Maybe I was not clear enough,