Re: Linking to C

2010-11-03 Thread Nick Sabalausky
> Any options with just one dash afaik (ala -L) will pass through to dmd. > Yes, although they have to come before the main D file, so it has to be like this: rdmd -Lwhatever main.d NOT: rdmd main.d -Lwhatever

Re: datetime review part 2 [Update]

2010-11-03 Thread Jonathan M Davis
On Tuesday 02 November 2010 06:44:05 Steven Schveighoffer wrote: > On Thu, 28 Oct 2010 06:11:50 -0400, Jonathan M Davis > > wrote: > > Well, this thread obviously attracted a lot of interest. ;) > > I will respond, but I've been on vacation, I haven't had time to look at > it yet :) > > Don't b

Re: D2 on FreeBSD

2010-11-03 Thread Ezneh
Iain Buclaw Wrote: > http://ftp.digitalmars.com/dmd.2.050.zip > > As I said, the binaries are not part of the release, but there is a makefile > in > the source directories for dmd, druntime and phobos which should allow you to > build dmd2 for freebsd. > > make -f freebsd.mak > > Regards Tha

Re: datetime review part 2 [Update 2]

2010-11-03 Thread Jonathan M Davis
New version: http://is.gd/gEu9W I decided to try and take advantage of the new purity rules to make more of the functions pure, so more of them are pure now, but between the inability to have pure invariants and the majority of Phobos functions being impure, I didn't get to make anywhere as man

Re: Lints, Condate and bugs

2010-11-03 Thread Kagamin
Walter Bright Wrote: > > Every time I am comparing a signed with an unsigned I have an overflow risk > > in D. > > Not every time, no. In fact, it's rare. I believe you are *way* overstating > the > case. If you were right I'd be reading all the time about integer overflow > bugs, > not buffe

Re: Lints, Condate and bugs

2010-11-03 Thread Kagamin
Walter Bright Wrote: > Don wrote: > > I would strongly support that. But it doesn't really work. > > The problem is size_t. The fact that it's unsigned is a root of all > > kinds of evil. It means .length is unsigned!!! > > Personally I think that any creation or access to an object which is > >

Re: DWT build error function tango.io.FileSystem.FileSystem.toAbsolute is deprecated

2010-11-03 Thread Moritz Warning
On Wed, 03 Nov 2010 13:39:49 +0700, tuanhoanganh wrote: > I am a newbie of D language and DWT. > When i build DWT (lastest hg) and D language 1.0.65 i have a error > "...\dwt-win\dwt\dwthelper\File.d(80): Error: function > tango.io.FileSystem.FileSystem.toAbsolute is deprecated" How to fix it? > T

Re: D2 on FreeBSD

2010-11-03 Thread Anders F Björklund
Ezneh wrote: I know I can use other languages (C, C++, ect) but I really want to use D2. D is available in the ports tree too, under "lang/gdc". Not D2 though. --anders

Re: Immutable fields

2010-11-03 Thread Lars T. Kyllingstad
On Tue, 02 Nov 2010 20:54:35 -0400, bearophile wrote: > Is it correct for immutable struct fields to act like enum or static > const fields? (I don't think so, but I am wrong often): This is bug 3449: http://d.puremagic.com/issues/show_bug.cgi?id=3449 -Lars

Re: Immutable fields

2010-11-03 Thread bearophile
Lars T. Kyllingstad: > This is bug 3449: > > http://d.puremagic.com/issues/show_bug.cgi?id=3449 Thank you to you and the others that have answered in this thread. That's an important bug, it changes how much I can use immutables. Bye, bearophile

Re: Lints, Condate and bugs

2010-11-03 Thread Daniel Gibson
Kagamin schrieb: Who knows, how large arrays can get even on 32bit target? Probably not longer than 2^32 elements (minus a few for the rest of the program) because more couldn't be addressed.

Re: Deduction of Template Value Parameters

2010-11-03 Thread bearophile
gg: > The actual question why 5 and 4 and 5u and 4u are accepted in template > instantiation but only one is valid It may be a compiler bug. If confirmed you (or someone else) may put it into Bugzilla. Bye, bearophile

Re: Deduction of Template Value Parameters

2010-11-03 Thread Steven Schveighoffer
On Tue, 02 Nov 2010 21:56:44 -0400, gg wrote: Why we cant deduce value parameter of templates: void caracterize(uint m)(pp!(m)){ } class pp(uint m){ } void main(){ caracterize(pp!5); } fails with dmd chap.d chap.d(8): Error: template chap.caracterize(uint m) does not match an

D/Objective-C Preliminary Design

2010-11-03 Thread Michel Fortin
I posted on my blog a preliminary document outlining what I intent to implement in DMD to support the Objective-C object model. Comments? -- Michel Fortin michel.for...@michelf.com http://michelf.com/

Re: Deduction of Template Value Parameters

2010-11-03 Thread Steven Schveighoffer
On Wed, 03 Nov 2010 10:19:28 -0400, Steven Schveighoffer wrote: On Tue, 02 Nov 2010 21:56:44 -0400, gg wrote: Why we cant deduce value parameter of templates: void caracterize(uint m)(pp!(m)){ } class pp(uint m){ } void main(){ caracterize(pp!5); } fails with dmd chap.d

Re: Lints, Condate and bugs

2010-11-03 Thread retard
Wed, 03 Nov 2010 12:48:59 +0100, Daniel Gibson wrote: > Kagamin schrieb: >> Who knows, how large arrays can get even on 32bit target? > > Probably not longer than 2^32 elements (minus a few for the rest of the > program) because more couldn't be addressed. Having the whole 32-bit address space a

[help]operator overloading with opEquals in a class

2010-11-03 Thread zhang
This code belown can be compiled with DMD 2.050. However, it throws an error message: core.exception.HiddenFuncError: Hidden method called for main.AClass I'm not sure about whether it is a bug. Thanks for any help. import std.stdio; class AClass { int data; // It's wrong bool opEq

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Marianne Gagnon
I found a confusing part : Here is an abbreviated declaration for NSString: extern (Objective-C) class NSComboBox ... This declaration [...] will let know to the compiler that the NSColor class exists =P Otherwise seems nice but I'll let people that know DMD answer --Auria > I posted on my blo

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Michel Fortin
On 2010-11-03 13:44:27 -0400, Marianne Gagnon said: I found a confusing part : Here is an abbreviated declaration for NSString: extern (Objective-C) class NSComboBox ... This declaration [...] will let know to the compiler that the NSColor class exists Oops, I changed my example but forgot

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Jonathan M Davis
On Wednesday, November 03, 2010 05:07:25 zhang wrote: > This code belown can be compiled with DMD 2.050. However, it throws an > error message: core.exception.HiddenFuncError: Hidden method called for > main.AClass > > I'm not sure about whether it is a bug. Thanks for any help. > > > > import

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Benjamin Thaut
Am 03.11.2010 13:07, schrieb zhang: This code belown can be compiled with DMD 2.050. However, it throws an error message: core.exception.HiddenFuncError: Hidden method called for main.AClass I'm not sure about whether it is a bug. Thanks for any help. import std.stdio; class AClass { i

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Walter Bright
Michel Fortin wrote: I posted on my blog a preliminary document outlining what I intent to implement in DMD to support the Objective-C object model. Comments? Thanks for doing this! "To make Objective-C methods accessible to D prog

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Steven Schveighoffer
On Wed, 03 Nov 2010 13:57:09 -0400, Benjamin Thaut wrote: Am 03.11.2010 13:07, schrieb zhang: This code belown can be compiled with DMD 2.050. However, it throws an error message: core.exception.HiddenFuncError: Hidden method called for main.AClass I'm not sure about whether it is a bug.

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Jonathan M Davis
On Wednesday, November 03, 2010 10:57:09 Benjamin Thaut wrote: > Am 03.11.2010 13:07, schrieb zhang: > > This code belown can be compiled with DMD 2.050. However, it throws an > > error message: core.exception.HiddenFuncError: Hidden method called for > > main.AClass > > > > I'm not sure about whe

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Michel Fortin
On 2010-11-03 13:55:35 -0400, Walter Bright said: Thanks for doing this! You're welcome. "To make Objective-C methods accessible to D programs, we need to map them to a D function name. This is acomplished by declaring a member function and giving it a selector:" Why not just make the D

Re: D/Objective-C Preliminary Design

2010-11-03 Thread lurk
Nick Sabalausky Wrote: > "%u" wrote in message news:iap1l4$17h...@digitalmars.com... > >I found a slideshow called 'The Expressiveness of Go' recently. The > >conclusions are: > > > > * Go is not a small language but it is an expressive and comprehensible > > one. > > > > * Expressiveness comes

Re: Marketing D [ was Re: GCC 4.6 ]

2010-11-03 Thread Jérôme M. Berger
dsimcha wrote: > == Quote from Christopher Bergqvist (quasiconsci...@gmail.com)'s article >> Would it be possible to organize a "bounty" for having the backend released u >> nder an OSI-approved license? > > Vote++. I understand that this has worked in the past, though I don't > remember > off t

Scriptometer

2010-11-03 Thread bearophile
This is a comparison, how much good various languages are for scripting purposes: http://rigaux.org/language-study/scripting-language/ This test may be good both to see if there is something essential missing in Phobos2 and to see how D2 is fit for those purposes (the list contains some impleme

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Tomek Sowiński
Dnia 03-11-2010 o 13:07:25 zhang napisał(a): // It works //bool opEquals(Object a) //{ //writefln("running here."); //return data == (cast(AClass)a).data; //} It should be: override equals_t opEquals(Object o) { writefln("running here."); if (auto a = cast

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread bearophile
Tomek S: > I'm surprised it even compiled without 'override'. It's not obligatory yet: http://d.puremagic.com/issues/show_bug.cgi?id=3836 It's one of the warnings I am waiting to become errors: http://d.puremagic.com/issues/show_bug.cgi?id=4216 Bye, bearophile

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Andrei Alexandrescu
On 11/3/10 7:07 AM, zhang wrote: This code belown can be compiled with DMD 2.050. However, it throws an error message: core.exception.HiddenFuncError: Hidden method called for main.AClass I'm not sure about whether it is a bug. Thanks for any help. [snip] That hidden functions are signaled du

Re: The Computer Languages Shootout Game

2010-11-03 Thread Jérôme M. Berger
Diego Cano Lagneaux wrote: >>> >>> Of which there are very few. A linux distro or community repository >>> cannot distribute dmd at all, it is prohibited by the license. This is >>> primarily a practical issue, not an ideological one. >> >> Right.. I forgot the issue is also practical. If DigitalMa

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread bearophile
Andrei: > That hidden functions are signaled during run time and not compile time > is a misunderstanding between design and implementation. There should > not be a HiddenFunc exception and the compiler should just refuse to > compile the program. If you compile this program, derived from the

Re: Scriptometer

2010-11-03 Thread Kagamin
bearophile Wrote: > This is a comparison, how much good various languages are for scripting > purposes: > http://rigaux.org/language-study/scripting-language/ > > This test may be good both to see if there is something essential missing in > Phobos2 and to see how D2 is fit for those purposes (

Re: Scriptometer

2010-11-03 Thread Kagamin
Kagamin Wrote: > I remember llvm's configure script... Oh, no, not llvm's, but mingw's.

Re: Overzealous recursive template expansion protection?

2010-11-03 Thread Gareth Charnock
On 03/11/10 03:21, Robert Jacques wrote: struct BinaryOp(L,string op,R) { pragma(msg,"Instansiating " ~ typeof(this).stringof); BinaryOp!(typeof(this),s,R1) opBinary(string s,R1)(R1 r) { pragma(msg,"Instansiating BinaryOp.opBinary ~L.stringof ~ op ~ R1.stringof); retu

Re: [help]operator overloading with opEquals in a class

2010-11-03 Thread Jonathan M Davis
On Wednesday, November 03, 2010 13:27:16 Tomek Sowiński wrote: > BTW, anybody knows what the equals_t bool alias is for? I think that for some reason, opEquals() returned int in D1 instead of bool, but not having used D1, I'm 100% not sure. If that's the case, then using equals_t and having equ

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Walter Bright
Michel Fortin wrote: On 2010-11-03 13:55:35 -0400, Walter Bright said: Thanks for doing this! You're welcome. "To make Objective-C methods accessible to D programs, we need to map them to a D function name. This is acomplished by declaring a member function and giving it a selector:"

Re: Scriptometer

2010-11-03 Thread Tomek Sowiński
Dnia 03-11-2010 o 21:27:00 bearophile napisał(a): This is a comparison, how much good various languages are for scripting purposes: http://rigaux.org/language-study/scripting-language/ This test may be good both to see if there is something essential missing in Phobos2 and to see how D2 i

Re: Scriptometer

2010-11-03 Thread bearophile
Tomek S.: > Nice page. I submitted some "scripts" so D will be featured on it. You may show them here too. > BTW, I was stuck on "sed in place" -- remove #-comments from a file > (modifying the file, i.e. in place): > http://rigaux.org/language-study/scripting-language/#sed_in_place > Any ide

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Sean Kelly
Michel Fortin Wrote: > On 2010-11-03 13:55:35 -0400, Walter Bright said: > > > Thanks for doing this! > > You're welcome. > > > > "To make Objective-C methods accessible to D programs, we need to map > > them to a D function name. This is acomplished by declaring a member > > function and g

Re: Marketing D [ was Re: GCC 4.6 ]

2010-11-03 Thread Christopher Bergqvist
Yes, I don't want to run Walter into bankruptcy though. ;) Honestly, I do think it would change the perception of the language in a beneficial way if one could say that the whole reference compiler infrastructure were _unquestionably_ open source. On Nov 3, 2010, at 21:17, "Jérôme M. Berger" w

Re: Scriptometer

2010-11-03 Thread Lutger
Tomek Sowiński wrote: > Dnia 03-11-2010 o 21:27:00 bearophile > napisał(a): > >> This is a comparison, how much good various languages are for scripting >> purposes: >> http://rigaux.org/language-study/scripting-language/ >> This test may be good both to see if there is something essential >> mi

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Michel Fortin
On 2010-11-03 18:40:36 -0400, Walter Bright said: Michel Fortin wrote: On 2010-11-03 13:55:35 -0400, Walter Bright said: Thanks for doing this! You're welcome. "To make Objective-C methods accessible to D programs, we need to map them to a D function name. This is acomplished by declar

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Walter Bright
Michel Fortin wrote: You heard that right: someone is considering writing Cocoa programs because of D! That's great news! I think we should try to attract Cocoa programmers (and would-be Cocoa programmers) by offering them the strengths of D. What are those strengths? Some are things you pro

Re: Scriptometer

2010-11-03 Thread bearophile
Lutger: > Here is a quick attempt: > > import std.file, std.regex; > > void main(string[] args) > { > args[1].write( args[1].readText().replace( regex("#.*", "g"), "") ); > } It's cute. Compared to the Python version it doesn't work lazily (by lines). I have tried on Windows that D program

Re: Scriptometer

2010-11-03 Thread Jesse Phillips
bearophile Wrote: > Lutger: > > > Here is a quick attempt: > > > > import std.file, std.regex; > > > > void main(string[] args) > > { > > args[1].write( args[1].readText().replace( regex("#.*", "g"), "") ); > > } > > It's cute. Compared to the Python version it doesn't work lazily (by line

Re: D/Objective-C Preliminary Design

2010-11-03 Thread Jason House
Michel Fortin Wrote: > I posted on my blog a preliminary document outlining what I intent to > implement in DMD to support the Objective-C object model. > > > > Comments? It looks like a few things are already implemented. I'd recommen

Re: D/Objective-C Preliminary Design

2010-11-03 Thread BCS
Hello Michel, [o addObserver:self forKeyPath:@"window.frame" option:0 context:nil]; [...] Now imagine a whole program with functions like this one. Would you want to write a program like that? I know, not what you were saying but, err,.. No.