D Programming Language source (dmd, phobos, etc.) has moved to github

2011-01-23 Thread Walter Bright
https://github.com/organizations/D-Programming-Language We're all learning how to use github, but by most accounts it seems to be the best available system for the diverse group of people who work on it.

Re: D Programming Language source (dmd, phobos, etc.) has moved to github

2011-01-23 Thread David Wang
Dear Walter, I went to the github and try to download the source, I found that the latest version on github is the old version. for example: druntime - Downloads: dmd-2.042 Phobos - Downloads: phobos-2.046 DMD - Downloads: dmd-2.046 I think the actural latest version of D should be

Re: D Programming Language source (dmd, phobos, etc.) has moved to github

2011-01-23 Thread Walter Bright
David Wang wrote: Dear Walter, I went to the github and try to download the source, I found that the latest version on github is the old version. for example: druntime - Downloads: dmd-2.042 Phobos - Downloads: phobos-2.046 DMD - Downloads: dmd-2.046 I think the actural latest version

Re: D Programming Language source (dmd, phobos, etc.) has moved to github

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 21:00:21 David Wang wrote: Dear Walter, I went to the github and try to download the source, I found that the latest version on github is the old version. for example: druntime - Downloads: dmd-2.042 Phobos - Downloads: phobos-2.046 DMD - Downloads:

Phobos 2.051 CHM Help File

2011-01-23 Thread Jussi Jumppanen
For any one that might be interested, here's a Phobos 2.051 help file in Windows CHM format: http://www.zeusedit.com/z300/phobos.2.051.zip

Re: renamepalooza time

2011-01-23 Thread Ali Çehreli
spir wrote: On 01/23/2011 12:03 AM, Ali Çehreli wrote: Sounds similar to using whitespace for visual grouping like in a*b + c*d or [ [1,2,3] , [4,5,6] ] But may be a bit too complicated for a public, free-willing, style, don't you think? Rather for an enforced project or

Re: Potential patent issues

2011-01-23 Thread Russel Winder
On Sat, 2011-01-22 at 15:54 -0500, Jean Crystof wrote: Nick Sabalausky Wrote: I've been under the impression that, as a rule, the USPTO doesn't check for prior art and deliberately leaves invalid due to prior art up to the courts. That's how it works. The patent threat is always

Re: Casting between delegates with qualified value type parameters

2011-01-23 Thread Daniel Murphy
Sean Eskapp eatingstap...@gmail.com wrote in message news:ih9rhr$2c1k$1...@digitalmars.com... Is there a reason for this, or is it a bug? Sounds like it could be http://d.puremagic.com/issues/show_bug.cgi?id=3797 All sorts of implicit conversions are currently allowed between function

Re: renamepalooza time

2011-01-23 Thread spir
On 01/23/2011 09:13 AM, Ali Çehreli wrote: Agreed, but I will keep using an underscore after is. Another reason why I do so is, when used with camelcase, that little is capitalizes the next word just to be consistent with the camelcase part of the naming conventions. When we have an attribute of

Re: replaceFirst, findPieces, and takeExactly

2011-01-23 Thread spir
On 01/23/2011 06:21 AM, Andrei Alexandrescu wrote: On 1/22/11 10:59 PM, Jonathan M Davis wrote: This will be a _fantastic_ function to have. I think that I probably even have an enhancement request somewhere that includes such a function. It's far too common that you have to find something and

detecting classes, structs, arrays in templates

2011-01-23 Thread Luke J. West
Hi, I want to specialize a template function - call it print() - for three cases: classes, structs and arrays. Ideally I'd like something that looks 'functional' like a proper specialization, but perhaps I need to use static if. I'm still at the beginning of my journey with D so I'd be grateful

Re: eliminate junk from std.string?

2011-01-23 Thread Joel C. Salomon
On 01/11/2011 07:17 PM, Jonathan M Davis wrote: Renaming a function and having a deprecated alias to the old name for a few releases eases the transition would definitely be good practice. aliasing a function just to have another name for the same thing wouldn't be good practice. There

Re: detecting classes, structs, arrays in templates

2011-01-23 Thread Simen kjaeraas
Luke J. West l...@west.me.uk wrote: Hi, I want to specialize a template function - call it print() - for three cases: classes, structs and arrays. Ideally I'd like something that looks 'functional' like a proper specialization, but perhaps I need to use static if. I'm still at the beginning of

Re: detecting classes, structs, arrays in templates

2011-01-23 Thread bearophile
Luke J. West: Hi, I want to specialize a template function - call it print() - for three cases: classes, structs and arrays. Ideally I'd like something that looks 'functional' like a proper specialization, but perhaps I need to use static if. I'm still at the beginning of my journey with D

Re: detecting classes, structs, arrays in templates

2011-01-23 Thread Luke J. West
Thanks for that bearophile - I'll get myself subscribed right away. Bye for now, Luke On Sun, 23 Jan 2011 09:17:05 -0500, bearophile bearophileh...@lycos.com said: Luke J. West: Hi, I want to specialize a template function - call it print() - for three cases: classes, structs and

Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Dmitry Olshansky
After hitting some troubles with optlink in the past (though my problems got solved others may be not) I was in constant search for alternatives. The good news: there *do* happen to be very versatile linker for windows able to produce 32/64bit PE, that supports OMF format and so on. Another

Opt-out closures

2011-01-23 Thread Sean Eskapp
I get errors when working with nested functions and structs or scoped classes, because closures can't be used with anything with scoped destruction. This makes complete sense, but I don't even want the closure functionality of these nested functions. Personally, I would like to be able to opt-out

Re: Opt-out closures

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 06:36:27 Sean Eskapp wrote: I get errors when working with nested functions and structs or scoped classes, because closures can't be used with anything with scoped destruction. This makes complete sense, but I don't even want the closure functionality of these nested

Re: Opt-out closures

2011-01-23 Thread Sean Eskapp
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article On Sunday 23 January 2011 06:36:27 Sean Eskapp wrote: I get errors when working with nested functions and structs or scoped classes, because closures can't be used with anything with scoped destruction. This makes complete

Re: Opt-out closures

2011-01-23 Thread Sean Eskapp
== Quote from bearophile (bearophileh...@lycos.com)'s article Sean Eskapp: I want to be able to access the enclosing scope, but NOT after the function has exited; I should have the option of accessing the enclosing scope, but at the cost of making my delegate not a closure. It seems

Re: Opt-out closures

2011-01-23 Thread bearophile
Sean Eskapp: I want to be able to access the enclosing scope, but NOT after the function has exited; I should have the option of accessing the enclosing scope, but at the cost of making my delegate not a closure. It seems a worth thing to ask for. A possible syntax (not currently

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-23 Thread Joel C. Salomon
On 01/14/2011 09:34 AM, Steven Schveighoffer wrote: Is it common to have multiple modifiers on a single character? The problem I see with using decomposed canonical form for strings is that we would have to return a dchar[] for each 'element', which severely complicates code that, for

Re: replaceFirst, findPieces, and takeExactly

2011-01-23 Thread Andrei Alexandrescu
On 1/23/11 1:22 AM, Jim wrote: Andrei Alexandrescu Wrote: I suspect there might be a simple and intuitive way to define a family of functions that give you whatever portions of the find you're interested in (before, match, after, before and match, match and after). That could be either a naming

Re: renamepalooza time

2011-01-23 Thread Brad
On 2011-01-21, Jonathan M Davis jmdavisp...@gmx.com wrote: tr? The name means nothing to me. I haven't a clue where the name comes from, so I can't really give a better version of the same name. As it is, tr seems fine to me, particularly since tR just seems stupid. It should probably get a

Re: replaceFirst, findPieces, and takeExactly

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 07:12:34 Andrei Alexandrescu wrote: On 1/23/11 1:22 AM, Jim wrote: Andrei Alexandrescu Wrote: I suspect there might be a simple and intuitive way to define a family of functions that give you whatever portions of the find you're interested in (before, match,

Re: renamepalooza time

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 07:12:16 Brad wrote: On 2011-01-21, Jonathan M Davis jmdavisp...@gmx.com wrote: tr? The name means nothing to me. I haven't a clue where the name comes from, so I can't really give a better version of the same name. As it is, tr seems fine to me, particularly since

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Andrej Mitrovic
Yeah I can reproduce the same thing as you have. I did manage to convert an OMF to COFF file format, and link it with GCC (MinGW). See my thread here: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.comgroup=digitalmars.Dartnum=127079 I have yet to try it on more complex

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Andrej Mitrovic
Perhaps this page would be helpful for the linker guys: http://www.digitalmars.com/d/2.0/abi.html

Re: druntime !!!!

2011-01-23 Thread Iain Buclaw
== Quote from Brad Roberts (bra...@puremagic.com)'s article On 1/22/2011 4:32 PM, Robert Clipsham wrote: On 22/01/11 23:58, bioinfornatics wrote: They are something wrong with druntime management!!! Why druntime do not support gdc or ldc2? Its is very crap thing i hope druntime will add

Re: Opt-out closures

2011-01-23 Thread bearophile
Andrew Wiley: I don't like being too negative, but if we're removing scope as a storage class because it can leave unsafe dangling pointers, how likely is it that we'll get delegates that can have dangling pointers? I have written that without too much thinking, so I'm sure that's not a

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Dmitry Olshansky
On 23.01.2011 20:43, Andrej Mitrovic wrote: Yeah I can reproduce the same thing as you have. I did manage to convert an OMF to COFF file format, and link it with GCC (MinGW). See my thread here:

Can your programming language do this?

2011-01-23 Thread Adam D. Ruppe
alias DataObjectFromSqlCreateTable!(import(db.sql), users) User; // sql source code , table to fetch void main() { auto obj = new User(null); // that null should actually be a db handle if you want to be able to commit changes // read/write access to the

Re: Can your programming language do this?

2011-01-23 Thread Simen kjaeraas
Adam D. Ruppe destructiona...@gmail.com wrote: alias DataObjectFromSqlCreateTable!(import(db.sql), users) User; // sql source code , table to fetch void main() { auto obj = new User(null); // that null should actually be a db handle if you want to be

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Andrej Mitrovic
Yeah, we're kind of stuck with Optlink for now.

Re: Opt-out closures

2011-01-23 Thread Torarin
2011/1/23 Sean Eskapp eatingstap...@gmail.com: I want to be able to access the enclosing scope, but NOT after the function has exited; I should have the option of accessing the enclosing scope, but at the cost of making my delegate not a closure. Until we have a dedicated syntax for it, I

Re: druntime !!!!

2011-01-23 Thread Brad Roberts
On 1/23/2011 9:56 AM, Iain Buclaw wrote: == Quote from Brad Roberts (bra...@puremagic.com)'s article On 1/22/2011 4:32 PM, Robert Clipsham wrote: On 22/01/11 23:58, bioinfornatics wrote: They are something wrong with druntime management!!! Why druntime do not support gdc or ldc2? Its is very

Re: druntime !!!!

2011-01-23 Thread Jacob Carlborg
On 2011-01-23 18:56, Iain Buclaw wrote: == Quote from Brad Roberts (bra...@puremagic.com)'s article On 1/22/2011 4:32 PM, Robert Clipsham wrote: On 22/01/11 23:58, bioinfornatics wrote: They are something wrong with druntime management!!! Why druntime do not support gdc or ldc2? Its is very

Re: Opt-out closures

2011-01-23 Thread Jacob Carlborg
On 2011-01-23 16:08, bearophile wrote: Sean Eskapp: I want to be able to access the enclosing scope, but NOT after the function has exited; I should have the option of accessing the enclosing scope, but at the cost of making my delegate not a closure. It seems a worth thing to ask for. A

Re: Can your programming language do this?

2011-01-23 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:ihhsv0$1fgf$1...@digitalmars.com... alias DataObjectFromSqlCreateTable!(import(db.sql), users) User; // sql source code , table to fetch void main() { auto obj = new User(null); // that null

Re: Can your programming language do this?

2011-01-23 Thread Adam D. Ruppe
Simen kjaeraas wrote: I've known that D could do it, and I've occasionally poked at it myself, but always felt it was too much work for something that isn't all that hard to do by hand. Yeah, that's the way I feel about it mostly. What finally pushed me over the edge here was writing yet

Re: Opt-out closures hack

2011-01-23 Thread Sean Eskapp
== Quote from Torarin (torar...@gmail.com)'s article 2011/1/23 Sean Eskapp eatingstap...@gmail.com: I want to be able to access the enclosing scope, but NOT after the function has exited; I should have the option of accessing the enclosing scope, but at the cost of making my delegate

Re: druntime !!!!

2011-01-23 Thread Iain Buclaw
== Quote from Brad Roberts (bra...@puremagic.com)'s article On 1/23/2011 9:56 AM, Iain Buclaw wrote: == Quote from Brad Roberts (bra...@puremagic.com)'s article On 1/22/2011 4:32 PM, Robert Clipsham wrote: On 22/01/11 23:58, bioinfornatics wrote: They are something wrong with druntime

Re: question: prefer SSE over x87 asm code?

2011-01-23 Thread Trass3r
Note that SSE is less precise than x87.

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Walter Bright
Dmitry Olshansky wrote: If the D becomes common used language we can examine its new features and take in into consideration. But... Maybe is's easier to contact with D developer and ask for new features in objects. If the author wants to email me with any specific questions, I'd be happy to

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Dmitry Olshansky
On 23.01.2011 23:55, Walter Bright wrote: Dmitry Olshansky wrote: If the D becomes common used language we can examine its new features and take in into consideration. But... Maybe is's easier to contact with D developer and ask for new features in objects. If the author wants to email me

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Trass3r
Sadly true. They intend to replace it with a library based solution, I don't know why.

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Andrej Mitrovic
I don't understand it either. AFAIK they are being removed because they're unsafe, and are being replaced by an unsafe library solution.

Re: Is it true scope declarations are being removed?

2011-01-23 Thread bearophile
Andrej Mitrovic: I don't understand it either. AFAIK they are being removed because they're unsafe, and are being replaced by an unsafe library solution. I have hated see typedef and scoped classes go (I have even missed delete), but you need a bit of faith in the future and in Andrei

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Trass3r
I don't understand it either. AFAIK they are being removed because they're unsafe, and are being replaced by an unsafe library solution. I have the same feeling. While I do understand why typedef is poorly designed (http://d.puremagic.com/issues/show_bug.cgi?id=5467) I can't imagine how a

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Trass3r
Hopefully we can get the author to support dmd. I can't wait years until optlink might support x64.

Re: Is it true scope declarations are being removed?

2011-01-23 Thread so
On Mon, 24 Jan 2011 00:11:48 +0200, Trass3r u...@known.com wrote: Sadly true. They intend to replace it with a library based solution, I don't know why. If the library solution is as good as the original, it is a big plus. If only we could do the same for everything!

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-01-23 Thread Walter Bright
Dmitry Olshansky wrote: On 23.01.2011 23:55, Walter Bright wrote: Dmitry Olshansky wrote: If the D becomes common used language we can examine its new features and take in into consideration. But... Maybe is's easier to contact with D developer and ask for new features in objects. If the

Re: Is it true scope declarations are being removed?

2011-01-23 Thread Jonathan M Davis
On Friday 21 January 2011 06:10:26 Sean Eskapp wrote: Someone mentioned to me that scope declarations, e.g. scope class A{} or scope A myNewObject; are being removed from the language. Is this true? If so, how will RAII-type classes be implemented? std.typecons.scoped is the replacement

Re: druntime !!!!

2011-01-23 Thread Sean Kelly
bioinfornatics Wrote: They are something wrong with druntime management!!! Why druntime do not support gdc or ldc2? Should it? Even if the devlopers of GDC and LDC2 were interested (and neither have contacted me indicating this), I'm not sure it's an optimal workflow to have all compiler

first git commit

2011-01-23 Thread Andrei Alexandrescu
We've moved the entire camp to github: dmd compiler, phobos, druntime, website, installer. I'm happy to report that we have our first git commit: https://github.com/D-Programming-Language/phobos/commit/81a4a4034aabe83d41cf2a0a202fedb428da66b6 Andrei

Re: first git commit

2011-01-23 Thread Andrej Mitrovic
I like the new diff. Although there doesn't seem to be syntax highlighting (or is that usual for diffs?). Anyway, congrats!

Re: first git commit

2011-01-23 Thread foobar
Andrei Alexandrescu Wrote: We've moved the entire camp to github: dmd compiler, phobos, druntime, website, installer. I'm happy to report that we have our first git commit: https://github.com/D-Programming-Language/phobos/commit/81a4a4034aabe83d41cf2a0a202fedb428da66b6 Andrei

Re: first git commit

2011-01-23 Thread Caligo
On Sun, Jan 23, 2011 at 10:14 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: We've moved the entire camp to github: dmd compiler, phobos, druntime, website, installer. I'm happy to report that we have our first git commit:

Re: throws(statement, ErrorType)

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 00:47:13 bearophile wrote: spir: How to write a predicate like: assert( throws(someStatement, ErrorType) ); Are you using Design By Contract a lot? Contracts need to contain asserts only... Not necessarily. In fact, in general, the tact that has been taken

Re: Structs with pointers?

2011-01-23 Thread Dmitry Olshansky
On 23.01.2011 2:02, bearophile wrote: Is this another compiler bug? The situation is nice: struct Foo1 {} struct Foo2 { int x; } const struct Foo3 { int* p; } struct Foo4 { int* p; } void bar1(Foo1 f) {} void bar2(Foo2 f) {} void bar3(Foo3 f) {} void bar4(Foo4 f) {} void main() { const f1

Re: throws(statement, ErrorType)

2011-01-23 Thread spir
On 01/23/2011 09:47 AM, bearophile wrote: spir: How to write a predicate like: assert( throws(someStatement, ErrorType) ); Are you using Design By Contract a lot? Contracts need to contain asserts only... Bye, bearophile No, not yet. I don't see your point. Denis

Re: throws(statement, ErrorType)

2011-01-23 Thread spir
On 01/23/2011 06:32 AM, Jonathan M Davis wrote: On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote: *There are several of those, like assertExcThrown, etc. Try searching the newsgroups for std.unittest or std.datetime and there should be a link to the source if you want it right now.

Re: Naming Conventions Style Guide?

2011-01-23 Thread spir
On 01/23/2011 06:05 AM, %u wrote: Hmm.. I thought naming enums with capital letters was a standard thing in D land. I prefer them that way since they're constants, and since I almost always use a tag for an enum I never mistake it for anything else. YMMV. Huh, I guess now I see why they are

Re: Naming Conventions Style Guide?

2011-01-23 Thread spir
On 01/23/2011 06:28 AM, Jonathan M Davis wrote: The problem is that constants are used all over the place in D - far more than you'd use in most other languages (primarily because of CTFE, I belive). If you use all-caps for stuff like enums, then you're constantly using variables which are all

Re: throws(statement, ErrorType)

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 03:14:48 spir wrote: On 01/23/2011 06:32 AM, Jonathan M Davis wrote: On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote: *There are several of those, like assertExcThrown, etc. Try searching the newsgroups for std.unittest or std.datetime and there should

Re: throws(statement, ErrorType)

2011-01-23 Thread spir
On 01/23/2011 12:36 PM, Jonathan M Davis wrote: On Sunday 23 January 2011 03:14:48 spir wrote: On 01/23/2011 06:32 AM, Jonathan M Davis wrote: On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote: *There are several of those, like assertExcThrown, etc. Try searching the newsgroups for

Re: throws(statement, ErrorType)

2011-01-23 Thread spir
On 01/23/2011 12:36 PM, Jonathan M Davis wrote: On Sunday 23 January 2011 03:14:48 spir wrote: On 01/23/2011 06:32 AM, Jonathan M Davis wrote: On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote: *There are several of those, like assertExcThrown, etc. Try searching the newsgroups for

Re: Naming Conventions Style Guide?

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 03:22:36 spir wrote: On 01/23/2011 06:28 AM, Jonathan M Davis wrote: The problem is that constants are used all over the place in D - far more than you'd use in most other languages (primarily because of CTFE, I belive). If you use all-caps for stuff like enums,

Re: throws(statement, ErrorType)

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 03:55:48 spir wrote: On 01/23/2011 12:36 PM, Jonathan M Davis wrote: On Sunday 23 January 2011 03:14:48 spir wrote: On 01/23/2011 06:32 AM, Jonathan M Davis wrote: On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote: *There are several of those, like

Re: How to use structs for RAII?

2011-01-23 Thread Jacob Carlborg
On 2011-01-23 00:03, Sean Eskapp wrote: It was recommended to me to use structs for RAII instead of scope classes, since scope is being removed (?). However, since default-constructors for structs can't exist, how does one do this? You can use a static opCall, like this: struct Foo {

Re: How to use structs for RAII?

2011-01-23 Thread Jacob Carlborg
On 2011-01-23 01:14, Andrej Mitrovic wrote: A workaround: import std.stdio; import std.exception; struct A { int x; this(void* none) { if (none !is null) { enforce(0, Tried to pass a parameter to A's constructor); } writeln(in

Re: Structs with pointers?

2011-01-23 Thread Mafi
Am 23.01.2011 11:00, schrieb Dmitry Olshansky: On 23.01.2011 2:02, bearophile wrote: Is this another compiler bug? The situation is nice: struct Foo1 {} struct Foo2 { int x; } const struct Foo3 { int* p; } struct Foo4 { int* p; } void bar1(Foo1 f) {} void bar2(Foo2 f) {} void bar3(Foo3 f) {}

Re: Structs with pointers?

2011-01-23 Thread Dmitry Olshansky
On 23.01.2011 19:05, Mafi wrote: Am 23.01.2011 11:00, schrieb Dmitry Olshansky: On 23.01.2011 2:02, bearophile wrote: Is this another compiler bug? The situation is nice: struct Foo1 {} struct Foo2 { int x; } const struct Foo3 { int* p; } struct Foo4 { int* p; } void bar1(Foo1 f) {} void

Re: Naming Conventions Style Guide?

2011-01-23 Thread Andrej Mitrovic
On 1/23/11, %u wfunct...@hotmail.com wrote: Yeah, MMWV. :] Men are from Mars, Women are from Venus? :D I don't know what that abbreviation means. I think some enums are in all caps because they're a workaround for not being able to use e.g. in in a TypeTuple, so they're kind of special.

Re: throws(statement, ErrorType)

2011-01-23 Thread bearophile
Jonathan M Davis: Not necessarily. In fact, in general, the tact that has been taken with Phobos is that you use assertions when you're verifying that Phobos is correct, and you use enforce (or an if-statement which throws an exception) when verifying that arguments given by outside code is

Re: How to use structs for RAII?

2011-01-23 Thread Andrej Mitrovic
Ah, I keep forgetting about opCall. Nice tips there.

Re: Naming Conventions Style Guide?

2011-01-23 Thread %u
I don't know what that abbreviation means. Haha I kind of made that up... just meant My Mileage *Will* Vary :) Huh, I never noticed the keyword conflict; that's totally legitimate, although personally I'd prefer PascalCased. But I don't like the related to the language idea; it shouldn't be

template alias

2011-01-23 Thread Luke J. West
Hi, I don't want to keep typing isNumeric!T | isSomeChar!T. I want to type isBuiltIn!T instead, but am trying to work out how to implement it. Something like template isBuiltInT(T) {const bool t=isNumeric!T | isSomeChar!T};} alias isBuiltInT.t isBuiltIn; But that doesn't compile. How should

Re: template alias

2011-01-23 Thread Andrej Mitrovic
Use the eponymous trick: import std.stdio; import std.traits; template isBuiltInT(T) { enum isBuiltInT = isNumeric!T || isSomeChar!T; } void main() { assert(isBuiltInT!(int)); assert(isBuiltInT!(char)); }

Re: template alias

2011-01-23 Thread Simen kjaeraas
Luke J. West l...@west.me.uk wrote: Hi, I don't want to keep typing isNumeric!T | isSomeChar!T. I want to type isBuiltIn!T instead, but am trying to work out how to implement it. Something like template isBuiltInT(T) {const bool t=isNumeric!T | isSomeChar!T};} alias isBuiltInT.t isBuiltIn;

Re: Assigning Interface to Object

2011-01-23 Thread Daniel Murphy
Mandeep Singh Brar mand...@brars.co.in wrote in message news:ihf3gs$2kve$1...@digitalmars.com... Hi, I was just thinking if implementing interfaces as abstract classes could be a workaround. Since D anyways allows multiple inheritance, so would it make sense to just declare interfaces as

Re: Assigning Interface to Object

2011-01-23 Thread Daniel Murphy
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.764.1295584412.4748.digitalmars-d-le...@puremagic.com... Speaking of COM.. has anyone successfully used COM interfaces in D2? I'm asking because a few months ago I gave them a try but I kept having random access

Re: How to wrap SDL?

2011-01-23 Thread Dan Olson
Sean Eskapp eatingstap...@gmail.com writes: == Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article You can use scoped!() from std.typecons: snip You must not escape a reference to the object outside of the foo() scope. Note that you will get a runtime error if you try to do

Re: Structs with pointers?

2011-01-23 Thread Dan Olson
bearophile bearophileh...@lycos.com writes: Is this another compiler bug? The situation is nice: struct Foo1 {} struct Foo2 { int x; } const struct Foo3 { int* p; } struct Foo4 { int* p; } void bar1(Foo1 f) {} void bar2(Foo2 f) {} void bar3(Foo3 f) {} void bar4(Foo4 f) {} void main()

Anyone have a clue how to download the Orange repository?

2011-01-23 Thread Andrej Mitrovic
D:\dev\svnsvn co http://svn.dsource.org/projects/orange/ orange svn: OPTIONS of 'http://svn.dsource.org/projects/orange': 200 OK (http://svn.dsource.org) D:\dev\svnsvn co http://svn.dsource.org/projects/orange/trunk orange svn: OPTIONS of 'http://svn.dsource.org/projects/orange/trunk': 200 OK

Re: Anyone have a clue how to download the Orange repository?

2011-01-23 Thread Trass3r
The problem is it uses a Mercurial repository.

Re: Anyone have a clue how to download the Orange repository?

2011-01-23 Thread Andrej Mitrovic
Aw it's in that tiny box on the right, I missed it. Thanks!

Re: throws(statement, ErrorType)

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 09:24:25 bearophile wrote: Jonathan M Davis: Not necessarily. In fact, in general, the tact that has been taken with Phobos is that you use assertions when you're verifying that Phobos is correct, and you use enforce (or an if-statement which throws an exception)

Re: sort and shared

2011-01-23 Thread Adam Conner-Sax
Thanks. I'll wait for now since (gulp!) casting away shared just for the sort works and I'm not sure what I'm doing wrong with the patching. Adam

[Issue 3934] Some untidy attributes

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3934 --- Comment #16 from bearophile_h...@eml.cc 2011-01-23 07:18:39 PST --- This shows something strange, dmd 2.051: const struct Foo1 { int* p; } struct Foo2 { int* p; } void bar1(Foo1 f1) {} void bar2(Foo2 f2) {} void main() { const f1 =

[Issue 2810] Bogus forward reference error with auto function

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2810 --- Comment #10 from bearophile_h...@eml.cc 2011-01-23 07:17:03 PST --- Hit by the same bug, the reduced code: int main() { return foo(); } auto foo() { return 0; } -- Configure issuemail:

[Issue 3934] Some untidy attributes

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3934 --- Comment #17 from bearophile_h...@eml.cc 2011-01-23 09:26:37 PST --- (In reply to comment #16) This shows something strange, dmd 2.051: According to Mafi that code is correct:

[Issue 5478] New: API/ABI differences/issues in d-runtime

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5478 Summary: API/ABI differences/issues in d-runtime Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component:

[Issue 5354] formatValue: range templates introduce 3 bugs related to class struct cases

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5354 --- Comment #12 from Andrei Alexandrescu and...@metalanguage.com 2011-01-23 13:28:48 PST --- There are good arguments for going either way wrt the relative priority of toString and range interface. Using toString by default is in a way the

[Issue 5354] formatValue: range templates introduce 3 bugs related to class struct cases

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5354 --- Comment #13 from Denis Derman denis.s...@gmail.com 2011-01-23 14:25:33 PST --- (In reply to comment #12) There are good arguments for going either way wrt the relative priority of toString and range interface. Using toString by

[Issue 5424] Cant assign interfaces to Variants

2011-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5424 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Status|ASSIGNED|RESOLVED

spawn bug?

2011-01-23 Thread Adam Conner-Sax
The attached code usually hangs (running on OSX, dmd 2.051). It uses spawn to create a new thread. All the thread does is create a large array of doubles. In one case it uses the Array!double from std.container. In the other case it uses the built in dynamic double[]. It declares the array,

Re: spawn bug?

2011-01-23 Thread Jonathan M Davis
On Sunday 23 January 2011 20:34:16 Adam Conner-Sax wrote: The attached code usually hangs (running on OSX, dmd 2.051). It uses spawn to create a new thread. All the thread does is create a large array of doubles. In one case it uses the Array!double from std.container. In the other case it