Re: D and SCons

2012-09-04 Thread Russel Winder
Chris, (and T), > I'm using Scons for a couple of toy D projects. What's the best channel > for feedback/bug reports? Thanks for getting back to me. The reasons for calling for the attention of people using SCons for D building is because I think I need to change the way the D tools are develope

Re: Can DMD be built with g++?

2012-09-04 Thread Don Clugston
On 30/08/12 22:21, Andrej Mitrovic wrote: On 8/30/12, Alex Rønne Petersen wrote: How are you building, what platform, etc... Ah geez I forgot there's a makefile (doh!), I need to look into passing the right flags first. I'm trying this on win32 via MinGW btw. That's a different story. Dunn

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread Regan Heath
On Mon, 03 Sep 2012 21:04:56 +0100, Era Scarecrow wrote: On Monday, 3 September 2012 at 18:45:42 UTC, Jonathan M Davis wrote: However, one thing to remember that complicates this a bit is that it's perfectly possible to declare a function which is overloaded with one function taking a poi

Re: The review of std.hash package

2012-09-04 Thread Johannes Pfau
Am Wed, 29 Aug 2012 04:57:32 +0200 schrieb "Jesse Phillips" : > All this discussion on the use of auto in the docs made me notice > something else about the docs I missed. > > I like how ranges are documented and think digest could do the > same. Instead of an ExampleDigest, just write the deta

Re: Trouble creating a formatted assert wrapper

2012-09-04 Thread Don Clugston
On 03/09/12 23:48, Chris Nicholson-Sauls wrote: On Monday, 3 September 2012 at 11:17:39 UTC, Chris Nicholson-Sauls wrote: 1) Empty array stands in for empty variadic. [snip] In reality, though, we have neither of these things. [snip] Turns out, I was quite wrong, and I'm happy to be. Empty a

Re: Trouble creating a formatted assert wrapper

2012-09-04 Thread Chris Nicholson-Sauls
On Tuesday, 4 September 2012 at 09:24:26 UTC, Don Clugston wrote: On 03/09/12 23:48, Chris Nicholson-Sauls wrote: I reiterate my impression that magical __FILE__ and __LINE__ should be provided by some other means. It was a special-case hack to fix a special-case need. It was extremely easy t

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread monarch_dodra
On Monday, 3 September 2012 at 21:18:28 UTC, Carl Sturtivant wrote: On Monday, 3 September 2012 at 12:12:46 UTC, monarch_dodra wrote: [SNIP] In a nutshell, I think you're broadly saying that you want to program with a struct S the same way whether it's stack or heap allocated. (Good code reu

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread monarch_dodra
On Tuesday, 4 September 2012 at 02:42:42 UTC, Jonathan M Davis wrote: On Monday, September 03, 2012 14:13:10 monarch_dodra wrote: I was playing around with a very big struct, and told myself I wanted it allocated on the heap. This meant I was now manipulating S* instead of an S. [snip] Enhance

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread Artur Skawina
On 09/03/12 20:45, Jonathan M Davis wrote: > > It's a perfectly valid enhancement request to want > > void func(S s, int i) {...} > > to be be callable with S*, given that normally function calls on an S* don't > require you to dereference anything. No, it's not. See http://d.puremagic.com/iss

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread Artur Skawina
On 09/03/12 23:19, Carl Sturtivant wrote: > So I'm wondering if a language extension along the following lines would > solve your problem, simply asking the compiler to use heap allocation when > the variable is declared, e.g. > > @heap auto s = S(); //secretly allocated with new, but used as i

Re: Vote for std.digest: ACCEPTED!

2012-09-04 Thread Johannes Pfau
Am Fri, 31 Aug 2012 01:37:10 +0400 schrieb Dmitry Olshansky : > On 30-Aug-12 12:33, Johannes Pfau wrote: > > Am Thu, 30 Aug 2012 00:55:40 +0400 > [snip] > > >> The end result is we need to get a version of copy that: > >> - doesn't break existing code > >> - takes destination by ref when possible

Re: Trouble creating a formatted assert wrapper

2012-09-04 Thread Don Clugston
On 04/09/12 11:43, Chris Nicholson-Sauls wrote: On Tuesday, 4 September 2012 at 09:24:26 UTC, Don Clugston wrote: On 03/09/12 23:48, Chris Nicholson-Sauls wrote: I reiterate my impression that magical __FILE__ and __LINE__ should be provided by some other means. It was a special-case hack to

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Steven Schveighoffer
On Sat, 01 Sep 2012 21:21:50 -0400, Nick Sabalausky wrote: On Thu, 30 Aug 2012 09:35:31 -0400 "Steven Schveighoffer" wrote: For example, I use netbeans to write php -- a dynamic language. There are no real variable type declarations, so when you start typing, auto-complete sucks unless you

Re: D and SCons

2012-09-04 Thread H. S. Teoh
On Tue, Sep 04, 2012 at 09:06:56AM +0100, Russel Winder wrote: [...] > What is comes down to is whether people testing the evolution of D > tooling would be happy to work with a fork of SCons or whether it is > necessary to work with a separate package and a distributed SCons. [...] I'm OK to use

Re: Embedded non-assignable containers

2012-09-04 Thread José Armando García Sancio
On Sun, Sep 2, 2012 at 12:39 AM, Philippe Sigaud wrote: > > > To make a type "double linkable" the developer needs to mixin the > following mixin template: > > > >> mixin template DoubleLinkable() > >> { > >> typeof(this) next; > >> typeof(this) prev; > >> } > > > > > > The next and prev point

Re: Embedded non-assignable containers

2012-09-04 Thread José Armando García Sancio
On Sat, Sep 1, 2012 at 6:40 PM, bearophile wrote: > José Armando García Sancio: > > I recently read an interesting blog Why should I have written ZeroMQ in C, >> not C++ (part II) by Martin Sústrik. The >> >> title is misleading; to me its main observation is that

Re: D and SCons

2012-09-04 Thread Chris Holdsworth
On 04/09/2012 17:01, H. S. Teoh wrote: On Tue, Sep 04, 2012 at 09:06:56AM +0100, Russel Winder wrote: [...] What is comes down to is whether people testing the evolution of D tooling would be happy to work with a fork of SCons or whether it is necessary to work with a separate package and a dist

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 12:51:53 Artur Skawina wrote: > On 09/03/12 20:45, Jonathan M Davis wrote: > > It's a perfectly valid enhancement request to want > > > > void func(S s, int i) {...} > > > > to be be callable with S*, given that normally function calls on an S* > > don't require you

Re: pointers, functions, and uniform call syntax

2012-09-04 Thread Era Scarecrow
On Tuesday, 4 September 2012 at 10:51:36 UTC, Artur Skawina wrote: On 09/03/12 20:45, Jonathan M Davis wrote: It's a perfectly valid enhancement request to want void func(S s, int i) {...} to be be callable with S*, given that normally function calls on an S* don't require you to dereferenc

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jacob Carlborg
On 2012-09-04 15:59, Steven Schveighoffer wrote: I have on occasion had the benefit of simply adding a member variable to instances of a class when I needed it without having to burden the rest of the code with knowing about that variable. I felt dirty doing it... But I think you are right --

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Adam D. Ruppe
On Tuesday, 4 September 2012 at 19:18:05 UTC, Jacob Carlborg wrote: I've also wished quite many times I had dynamic typing in D. I think we're *fairly* close with things like std.variant, especially combined with some helpers. Take a look: Variant a = 10; string b = a; // can't, and I say that

scope for array parameters

2012-09-04 Thread Benjamin Thaut
To make functions definitions more expressive and give the compiler more information to optimize I propose to make array function parameters extendable with 'scope' such as follows: size_t find(scope float[] haystack, float needle){ ... } This would give the compiler the information that the a

Re: scope for array parameters

2012-09-04 Thread Benjamin Thaut
Am 04.09.2012 22:18, schrieb Alex Rønne Petersen: On 04-09-2012 22:13, Benjamin Thaut wrote: This is already what scope does today. See http://dlang.org/function.html: "references in the parameter cannot be escaped (e.g. assigned to a global variable)" It's just that the compiler doesn't actual

Re: scope for array parameters

2012-09-04 Thread Alex Rønne Petersen
On 04-09-2012 22:13, Benjamin Thaut wrote: To make functions definitions more expressive and give the compiler more information to optimize I propose to make array function parameters extendable with 'scope' such as follows: size_t find(scope float[] haystack, float needle){ ... } This would gi

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 22:19:55 Benjamin Thaut wrote: > Am 04.09.2012 22:18, schrieb Alex Rønne Petersen: > > On 04-09-2012 22:13, Benjamin Thaut wrote: > > This is already what scope does today. See http://dlang.org/function.html: > > > > "references in the parameter cannot be escaped (e.

Re: D-etractions A real world programmers view on D

2012-09-04 Thread SomeDude
On Tuesday, 4 September 2012 at 19:18:05 UTC, Jacob Carlborg wrote: On 2012-09-04 15:59, Steven Schveighoffer wrote: I have on occasion had the benefit of simply adding a member variable to instances of a class when I needed it without having to burden the rest of the code with knowing about t

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 22:44:07 SomeDude wrote: > The only experience I've had with dynamic typing (in Python), I > can say I hated it. I prefer to write Java code, which I think > tells a lot about my love for dynamic typing. I probably wouldn't > mind writing some Lua code, but not in the

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 22:13:44 Benjamin Thaut wrote: > What do you think about this idea? scope on function parameters is supposed to prevent any reference to that data escaping from the function. e.g. scope on a delegate would make it an error to assign that delegate to anything which

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Chris Cain
On Tuesday, 4 September 2012 at 21:08:42 UTC, Jonathan M Davis wrote: Dynamic typing is evil. - Jonathan M Davis This is now my email signature. Thanks.

Re: scope for array parameters

2012-09-04 Thread bearophile
Jonathan M Davis: Once scope is properly enforced, then optimizing based on it would be great, but until it is, it's a _bad_ idea. Today we use "in" often for function arguments, and it implies "scope". Surely some of those programs use the arguments wrongly, this means they probably sometim

Re: D-etractions A real world programmers view on D

2012-09-04 Thread bearophile
Chris Cain: This is now my email signature. Thanks. Fundamentalism has no place in engineering. Bye, bearophile

Re: scope for array parameters

2012-09-04 Thread Peter Alexander
On Tuesday, 4 September 2012 at 21:41:58 UTC, bearophile wrote: Jonathan M Davis: Once scope is properly enforced, then optimizing based on it would be great, but until it is, it's a _bad_ idea. Today we use "in" often for function arguments, and it implies "scope". Surely some of those prog

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Chris Cain
On Tuesday, 4 September 2012 at 21:46:12 UTC, bearophile wrote: Fundamentalism has no place in engineering. It just made me smile. I still sometimes use Python for small projects and I'm going to be getting more serious about learning Javascript (and maybe a variant like CoffeeScript). Howeve

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 23:57:24 Peter Alexander wrote: > It's very unfortunate because it puts us in a lose-lose > situations where we can't fix the language without breaking > people's code. I think the best course of action is to fix these > things as soon as possible and get the problem

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Tuesday, September 04, 2012 23:42:33 bearophile wrote: > Jonathan M Davis: > > Once scope is properly enforced, then optimizing based on it > > would be great, but until it is, it's a _bad_ idea. > > Today we use "in" often for function arguments, and it implies > "scope". Surely some of those

Re: scope for array parameters

2012-09-04 Thread ixid
What does -property supposedly solve? It creates a horrid mess of brackets that ruin the elegance of UFCS code.

Re: scope for array parameters

2012-09-04 Thread bearophile
Jonathan M Davis: That's part of why I keep saying not to use in whenever it comes up. scope is very broken, so in is very broken. And honestly, given how often arrays are used in structs, I suspect that it's not at all uncommon for in to be used incorrectly. The situation with "in"/"scope"

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Wednesday, September 05, 2012 01:13:00 ixid wrote: > What does -property supposedly solve? It's supposed to make it so that property functions are used as variables and non-property functions are used as functions, since the point of property functions is to emulate variables. It's very buggy

Re: scope for array parameters

2012-09-04 Thread Jonathan M Davis
On Wednesday, September 05, 2012 01:50:12 bearophile wrote: > > I believe that the only case that > > has _any_ protection at all with scope right now is delegates, > > which almost never should be const. > > Do you mean code like this? What's bad about this? My delegate > arguments > /function po

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Nick Sabalausky
On Tue, 04 Sep 2012 21:18:41 +0200 Jacob Carlborg wrote: > On 2012-09-04 15:59, Steven Schveighoffer wrote: > > > > This, of course, all comes from two guys who really like static > > typing :) We *may* have a biased view. > I like to think it's the other way around: I like static typing *beca

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Nick Sabalausky
On Tue, 04 Sep 2012 22:44:07 +0200 "SomeDude" wrote: > > The only experience I've had with dynamic typing (in Python), I > can say I hated it. I prefer to write Java code, which I think > tells a lot about my love for dynamic typing. > Wow, now *that's* hard-core static typing fan :) Language

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jacob Carlborg
On 2012-09-04 21:39, Adam D. Ruppe wrote: On Tuesday, 4 September 2012 at 19:18:05 UTC, Jacob Carlborg wrote: I've also wished quite many times I had dynamic typing in D. I think we're *fairly* close with things like std.variant, especially combined with some helpers. Take a look: Variant a =

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jacob Carlborg
On 2012-09-04 22:44, SomeDude wrote: The only experience I've had with dynamic typing (in Python), I can say I hated it. I prefer to write Java code, which I think tells a lot about my love for dynamic typing. I probably wouldn't mind writing some Lua code, but not in the large. Unless you are w

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jacob Carlborg
On 2012-09-05 08:17, Nick Sabalausky wrote: Wow, now *that's* hard-core static typing fan :) Languages like ActionScript 2 and PHP (ie, the worst of the dynamic bunch - or at least I *hope*) have conditioned me to develop a severe allergic reaction to any and all dynamic typing. But if my only

Re: D-etractions A real world programmers view on D

2012-09-04 Thread Jacob Carlborg
On 2012-09-05 07:55, Nick Sabalausky wrote: I don't know if maybe my experience is different from usual, but personally, I haven't *ever* wished I had dynamic typing in D. Templates and (on rare occasion) variants have always been perfectly sufficient (and even preferable) in any cases I've ever