Re: iota with custom boundary conditions

2012-11-14 Thread Joseph Rushton Wakeling
On 11/13/2012 04:11 PM, Joseph Rushton Wakeling wrote: It's maybe not the most important use-case, but if the change can be introduced in a non-breaking way, why not? Actually, this was probably the main reason I brought it up: _is_ it possible to do this as a non-breaking change? In

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 8:59 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 14:32:34 UTC, Andrei Alexandrescu wrote: On 11/14/12 4:23 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 00:04:56 UTC, deadalnix wrote: That is what java's volatile do. It have several uses cases,

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 9:15 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 14:16:57 UTC, Andrei Alexandrescu wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote: If the compiler should/does not add memory barriers, then is there a reason for having

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread David Nadlinger
On Wednesday, 14 November 2012 at 17:31:07 UTC, David Nadlinger wrote: Thus, »we«, meaning on a language level, don't need to change anything about the current situations, […] Let my clarify that: We don't necessarily need to tuck on any extra semantics to the language other than what we

Re: function overload on full signature?

2012-11-14 Thread monarch_dodra
On Wednesday, 14 November 2012 at 06:52:57 UTC, Rob T wrote: In C++ there are conversion operators, which are not exactly the same as function overloading, but the correct function is selected based on the type on the left hand side. Example class A { operator bool(){ return _b; }

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 9:31 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 15:08:35 UTC, Andrei Alexandrescu wrote: Sorry, I was imprecise. We need to (a) define intrinsics for loading and storing data with high-level semantics (a short list: acquire, release, acquire+release, and

Re: function overload on full signature?

2012-11-14 Thread monarch_dodra
On Wednesday, 14 November 2012 at 06:52:57 UTC, Rob T wrote: In C++ there are conversion operators, which are not exactly the same as function overloading, but the correct function is selected based on the type on the left hand side. Example class A { operator bool(){ return _b; }

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Andrej Mitrovic
On 11/14/12, David Nadlinger s...@klickverbot.at wrote: On Wednesday, 14 November 2012 at 15:27:36 UTC, Denis Shelomovskij wrote: * Instruct reviewers to install SmartGit, KDiff3 or something with human readable diff and fetch from repos of pull request senders. - Will spend reviewers

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Andrej Mitrovic
On 11/14/12, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: Personally, I always have my Tortoise* tools set up to use Beyond Compare. Beyond Compare for the win. I agree GitHub's diff isn't that good. But even BitBucket has fallen into the frenzy of adding special effects. The

Re: Binary compatibility on Linux

2012-11-14 Thread John Colvin
On Monday, 12 November 2012 at 07:22:04 UTC, Jacob Carlborg wrote: As I understand it Debian is a more stable distribution and Ubuntu is a faster moving target. The question is how much faster. Would Ubuntu LTS be more ahead of compared to the latest stable Debian. Debian testing is a

Re: hashed array?

2012-11-14 Thread Dmitry Olshansky
11/14/2012 9:44 PM, Andrei Alexandrescu пишет: On 11/14/12 1:25 AM, Don Clugston wrote: On 12/11/12 20:42, Jonathan M Davis wrote: On Monday, November 12, 2012 11:36:38 H. S. Teoh wrote: I contend that the problem with built-in AA's is their implementation, not the fact that they're built-in.

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Nick Sabalausky
On Wed, 14 Nov 2012 19:20:26 +0100 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 11/14/12, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: Personally, I always have my Tortoise* tools set up to use Beyond Compare. Beyond Compare for the win. I agree GitHub's diff

Re: function overload on full signature?

2012-11-14 Thread Timon Gehr
On 11/14/2012 06:30 PM, Rob T wrote: On Wednesday, 14 November 2012 at 09:16:13 UTC, Walter Bright wrote: I'm not requesting this to be a feature of D, I'm only asking why it is not being done. Because types are resolved bottom-up, and if the return type were part of the overloading, there

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Alex Rønne Petersen
On 14-11-2012 16:27, Denis Shelomovskij wrote: Current Github diff is very primitive and is almost like unified diff format which isn't for humans at all. This complicates and slows down code revision simultaneously reducing its quality. Something must be done about it to stop wasting people

Re: function overload on full signature?

2012-11-14 Thread Timon Gehr
On 11/14/2012 06:43 PM, foobar wrote: On Tuesday, 13 November 2012 at 21:34:28 UTC, Rob T wrote: I'm wondering why overloading has been implemented to only match on the argument list rather than the full signature which includes the return type? I know I would use it if it was available. I'm

Re: hashed array?

2012-11-14 Thread Rainer Schuetze
On 11/14/2012 7:20 PM, Dmitry Olshansky wrote: 11/14/2012 9:44 PM, Andrei Alexandrescu пишет: This is new! What does this mean? I'm sure it is nothing new. Basically AA is a reference type but it is auto-magically created on the first insertion. This is called magic null behavior. void

Re: I'm back

2012-11-14 Thread Timon Gehr
On 11/14/2012 06:43 PM, Andrei Alexandrescu wrote: On 11/14/12 7:29 AM, H. S. Teoh wrote: But since this isn't going to be fixed properly, then the only solution left is to arbitrarily declare transient ranges as not ranges (even though the concept of ranges itself has no such implication, and

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Iain Buclaw
On 14 November 2012 17:50, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 9:15 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 14:16:57 UTC, Andrei Alexandrescu wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote:

Re: hashed array?

2012-11-14 Thread Don
On 14.11.2012 20:15, Rainer Schuetze wrote: On 11/14/2012 7:20 PM, Dmitry Olshansky wrote: 11/14/2012 9:44 PM, Andrei Alexandrescu пишет: This is new! What does this mean? I'm sure it is nothing new. Basically AA is a reference type but it is auto-magically created on the first insertion.

Re: I'm back

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 20:18:26 Timon Gehr wrote: That is a very imprecise approximation. I think it does not cover any ground: The day eg. 'array' will require this kind of non-transient element range is the day where I will write my own. std.array.array _cannot_ work with a

Re: hashed array?

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 20:29:03 Don wrote: It doesn't need to allocate any keys or values. It just needs to allocate whatever structure it needs to keep track of how many items it has. As if you added an element, and then removed it. Except that that doesn't play nicely with init.

Re: Binary compatibility on Linux

2012-11-14 Thread Jacob Carlborg
On 2012-11-14 19:20, John Colvin wrote: Debian testing is a rolling distribution, so it is always in an unstable state. Debian stable is, as it says, stable. To answer your question, just look at what debain version the particular ubuntu LTS version is based on. Good point, how can I do that?

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jacob Carlborg
On 2012-11-14 18:36, Andrei Alexandrescu wrote: The hypothesis that atomic primitives can be implemented as a library. I don't know these kind of things, that's why I'm asking. -- /Jacob Carlborg

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Denis Shelomovskij
14.11.2012 22:16, Andrej Mitrovic пишет: On 11/14/12, David Nadlinger s...@klickverbot.at wrote: On Wednesday, 14 November 2012 at 15:27:36 UTC, Denis Shelomovskij wrote: * Instruct reviewers to install SmartGit, KDiff3 or something with human readable diff and fetch from repos of pull request

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jacob Carlborg
On 2012-11-14 18:40, Andrei Alexandrescu wrote: Memory ordering must be built into the language and understood by the compiler. Ok, thanks for the expatiation. -- /Jacob Carlborg

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 12, 2012, at 2:57 AM, Johannes Pfau nos...@example.com wrote: Am Sun, 11 Nov 2012 18:30:17 -0800 schrieb Walter Bright newshou...@digitalmars.com: To make a shared type work in an algorithm, you have to: 1. ensure single threaded access by aquiring a mutex 2. cast away shared

Re: hashed array?

2012-11-14 Thread Don
On 14.11.2012 16:39, H. S. Teoh wrote: On Wed, Nov 14, 2012 at 10:25:53AM +0100, Don Clugston wrote: On 12/11/12 20:42, Jonathan M Davis wrote: On Monday, November 12, 2012 11:36:38 H. S. Teoh wrote: I contend that the problem with built-in AA's is their implementation, not the fact that

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote: If the compiler should/does not add memory barriers, then is there a reason for having it built into the language?

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 6:32 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: This is a simplification of what should be going on. The core.atomic.{atomicLoad, atomicStore} functions must be intrinsics so the compiler generate sequentially consistent code with them (i.e. not

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 12:01 PM, Sean Kelly s...@invisibleduck.org wrote: On Nov 14, 2012, at 6:32 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: This is a simplification of what should be going on. The core.atomic.{atomicLoad, atomicStore} functions must be intrinsics so the

Re: What's the deal with __thread?

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 6:26 AM, Don Clugston d...@nospam.com wrote: IIRC it was used prior to 2.030. In the spec, it is in the keyword list, and it's also listed in the Migrating to shared article. That's all. There are a small number of uses of it in the DMD test suite. Is it still valid?

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Alex Rønne Petersen
On 14-11-2012 21:00, Sean Kelly wrote: On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote: If the compiler should/does not add memory barriers, then is there a reason

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 12:07 PM, Alex Rønne Petersen a...@lycus.org wrote: On 14-11-2012 21:00, Sean Kelly wrote: On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote: If

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 13, 2012, at 1:14 AM, luka8088 luka8...@owave.net wrote: On Tuesday, 13 November 2012 at 09:11:15 UTC, luka8088 wrote: On 12.11.2012 3:30, Walter Bright wrote: On 11/11/2012 10:46 AM, Alex Rønne Petersen wrote: It's starting to get outright embarrassing to talk to newcomers about D's

Re: I'm back

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 07:29:34 H. S. Teoh wrote: On Wed, Nov 14, 2012 at 12:51:45AM +0100, deadalnix wrote: Le 13/11/2012 20:13, Jonathan M Davis a écrit : On Tuesday, November 13, 2012 09:45:17 H. S. Teoh wrote: Unfortunately, using ranges in their most general sense is looking

Re: dlang.org: library reference

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 06:40:54 Ellery Newcomer wrote: Can we get this updated? std.traits.ParameterIdentifierTuple and std.traits.ParameterDefaultValueTuple are not showing up, but have been around at least since 2.060 was released They don't have ddoc comments, just normal comments.

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 9:50 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: First, there are more kinds of atomic loads and stores. Then, the fact that the calls are not supposed to be reordered must be a guarantee of the language, not a speculation about an implementation. We

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Andrej Mitrovic
On 11/14/12, Alex Rønne Petersen a...@lycus.org wrote: Or we could switch to Phabricator for our entire review process which has an absolutely awesome side-by-side diff and is generally a fantastic tool for distributed-style software projects. See my email to dmd-internals:

Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA

2012-11-14 Thread Martin Drašar
Dne 14.11.2012 18:18, Regan Heath napsal(a): I hope this gives a hint where the problem might be. I hope so to .. but I don't have a clue. I'm not at all familiar with the output of dumpobj so I can't really debug this any further. TBH I was banking on you not finding the symbols or them

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Michel Fortin
On 2012-11-14 14:30:19 +, Timon Gehr timon.g...@gmx.ch said: On 11/14/2012 01:42 PM, Michel Fortin wrote: On 2012-11-14 10:30:46 +, Timon Gehr timon.g...@gmx.ch said: So do I. A thread-local static variable does not imply global state. (The execution stack is static.) Eg. in a few

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Walter Bright
On 11/14/2012 3:14 AM, Benjamin Thaut wrote: A small code example which would break as soon as we allow destructing of shared value types would really be nice. I hate to repeat myself, but: Thread 1: 1. create shared object 2. pass reference to that object to Thread 2 3. destroy

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Walter Bright
On 11/14/2012 7:08 AM, Andrei Alexandrescu wrote: On 11/14/12 6:39 AM, Alex Rønne Petersen wrote: On 14-11-2012 15:14, Andrei Alexandrescu wrote: On 11/14/12 1:19 AM, Walter Bright wrote: On 11/13/2012 11:56 PM, Jonathan M Davis wrote: Being able to have double-checked locking work would be

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Alex Rønne Petersen
On 14-11-2012 21:15, Sean Kelly wrote: On Nov 14, 2012, at 12:07 PM, Alex Rønne Petersen a...@lycus.org wrote: On 14-11-2012 21:00, Sean Kelly wrote: On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Alex Rønne Petersen
On 14-11-2012 21:36, Andrej Mitrovic wrote: On 11/14/12, Alex Rønne Petersen a...@lycus.org wrote: Or we could switch to Phabricator for our entire review process which has an absolutely awesome side-by-side diff and is generally a fantastic tool for distributed-style software projects. See my

Re: DConf 2013 on kickstarter.com: we're live!

2012-11-14 Thread Mike van Dongen
On Tuesday, 13 November 2012 at 01:08:01 UTC, Andrei Alexandrescu wrote: Update - we've crossed $20K! At this point we're one major backer away from achieving the goal, and we're looking at a number of options. Please share with your friends and coworkers, and bring the discussion up with your

Re: Const ref and rvalues again...

2012-11-14 Thread luka8088
On 13.11.2012 15:07, martin wrote: On Tuesday, 13 November 2012 at 08:34:19 UTC, luka8088 wrote: Your proposal isn't really related to this thread's topic Um, Const ref and rvalues again, I suggest it to be the default behavior, how is this not related ? The topic here is binding rvalues to

Re: DConf 2013 on kickstarter.com: we're live!

2012-11-14 Thread Mike van Dongen
On Tuesday, 13 November 2012 at 01:08:01 UTC, Andrei Alexandrescu wrote: Update - we've crossed $20K! At this point we're one major backer away from achieving the goal, and we're looking at a number of options. Please share with your friends and coworkers, and bring the discussion up with your

Re: DConf 2013 on kickstarter.com: we're live!

2012-11-14 Thread Mike van Dongen
On Tuesday, 13 November 2012 at 01:08:01 UTC, Andrei Alexandrescu wrote: Update - we've crossed $20K! At this point we're one major backer away from achieving the goal, and we're looking at a number of options. Please share with your friends and coworkers, and bring the discussion up with your

Re: hashed array?

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 10:20 AM, Dmitry Olshansky wrote: 11/14/2012 9:44 PM, Andrei Alexandrescu пишет: On 11/14/12 1:25 AM, Don Clugston wrote: The thing that really really should change is the bizarre 'magic null' semantics of AAs. This is new! What does this mean? I'm sure it is nothing new.

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 11:21 AM, Iain Buclaw wrote: On 14 November 2012 17:50, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 9:15 AM, David Nadlinger wrote: On Wednesday, 14 November 2012 at 14:16:57 UTC, Andrei Alexandrescu wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On

Re: What's the deal with __thread?

2012-11-14 Thread Walter Bright
On 11/14/2012 12:06 PM, Sean Kelly wrote: On Nov 14, 2012, at 6:26 AM, Don Clugston d...@nospam.com wrote: IIRC it was used prior to 2.030. In the spec, it is in the keyword list, and it's also listed in the Migrating to shared article. That's all. There are a small number of uses of it in the

Re: I'm back

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 11:18 AM, Timon Gehr wrote: On 11/14/2012 06:43 PM, Andrei Alexandrescu wrote: On 11/14/12 7:29 AM, H. S. Teoh wrote: But since this isn't going to be fixed properly, then the only solution left is to arbitrarily declare transient ranges as not ranges (even though the concept of

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 12:04 PM, Sean Kelly wrote: On Nov 14, 2012, at 9:50 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: First, there are more kinds of atomic loads and stores. Then, the fact that the calls are not supposed to be reordered must be a guarantee of the language, not a

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 12:36 PM, Andrej Mitrovic wrote: On 11/14/12, Alex Rønne Petersena...@lycus.org wrote: Or we could switch to Phabricator for our entire review process which has an absolutely awesome side-by-side diff and is generally a fantastic tool for distributed-style software projects. See

Re: Growing a Language (applicable to @attribute design)

2012-11-14 Thread Walter Bright
On 11/14/2012 3:06 AM, Simen Kjaeraas wrote: On 2012-43-14 11:11, Walter Bright newshou...@digitalmars.com wrote: On 11/14/2012 1:49 AM, renoX wrote: That's not strictly true: type inference works better for built-in types than for user-defined types, with auto x = 1; x is an int, how do I

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 12:00 PM, Sean Kelly wrote: On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob Carlborg wrote: If the compiler should/does not add memory barriers, then is there a reason

Re: Growing a Language (applicable to @attribute design)

2012-11-14 Thread Walter Bright
On 11/14/2012 3:18 AM, Timon Gehr wrote: template Foo(alias a){ } struct S{} alias S X; // ok alias int Y; // ok mixin Foo!S; // ok mixin Foo!int; // not ok Please fix that. (Everything should be ok.) Please file a bugzilla for that.

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 1:06 PM, Walter Bright wrote: On 11/14/2012 3:14 AM, Benjamin Thaut wrote: A small code example which would break as soon as we allow destructing of shared value types would really be nice. I hate to repeat myself, but: Thread 1: 1. create shared object 2. pass reference to that

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 1:09 PM, Walter Bright wrote: Yes. And also, I agree that having something typed as shared must prevent the compiler from reordering them. But that's separate from inserting memory barriers. It's the same issue at hand: ordering properly and inserting barriers are two ways to

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread luka8088
On 14.11.2012 20:54, Sean Kelly wrote: On Nov 13, 2012, at 1:14 AM, luka8088luka8...@owave.net wrote: On Tuesday, 13 November 2012 at 09:11:15 UTC, luka8088 wrote: On 12.11.2012 3:30, Walter Bright wrote: On 11/11/2012 10:46 AM, Alex Rønne Petersen wrote: It's starting to get outright

Re: DConf 2013 on kickstarter.com: we're live!

2012-11-14 Thread Mike van Dongen
On Tuesday, 13 November 2012 at 01:08:01 UTC, Andrei Alexandrescu wrote: Update - we've crossed $20K! At this point we're one major backer away from achieving the goal, and we're looking at a number of options. Please share with your friends and coworkers, and bring the discussion up with your

Re: DConf 2013 on kickstarter.com: we're live!

2012-11-14 Thread Mike van Dongen
On Monday, 22 October 2012 at 17:25:28 UTC, Andrei Alexandrescu wrote: We're on! For one month starting today, we're raising funding for DConf 2013. http://www.kickstarter.com/projects/2083649206/the-d-programming-language-conference-2013-0 Please pledge your support and encourage your

Re: dlang.org: library reference

2012-11-14 Thread Andrej Mitrovic
On 11/14/12, Ellery Newcomer ellery-newco...@utulsa.edu wrote: Can we get this updated? std.traits.ParameterIdentifierTuple and std.traits.ParameterDefaultValueTuple are not showing up, but have been around at least since 2.060 was released Related

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 2:21 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 12:00 PM, Sean Kelly wrote: On Nov 14, 2012, at 6:16 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 11/14/12 1:20 AM, Walter Bright wrote: On 11/13/2012 11:37 PM, Jacob

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Sean Kelly
On Nov 14, 2012, at 2:25 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 11/14/12 1:09 PM, Walter Bright wrote: Yes. And also, I agree that having something typed as shared must prevent the compiler from reordering them. But that's separate from inserting memory barriers.

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jason House
On Monday, 12 November 2012 at 02:31:05 UTC, Walter Bright wrote: To make a shared type work in an algorithm, you have to: 1. ensure single threaded access by aquiring a mutex 2. cast away shared 3. operate on the data 4. cast back to shared 5. release the mutex This is a fairly reasonable

Re: I'm back

2012-11-14 Thread Daniel Murphy
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:k80l8p$397$1...@digitalmars.com... On 11/14/12 7:29 AM, H. S. Teoh wrote: But since this isn't going to be fixed properly, then the only solution left is to arbitrarily declare transient ranges as not ranges (even though

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they introduce in the video (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw() const

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they introduce in the video I posted (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw()

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they introduce in the video (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw() const

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they introduce in the video I posted (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw()

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 4:50 PM, Sean Kelly wrote: On Nov 14, 2012, at 2:25 PM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 11/14/12 1:09 PM, Walter Bright wrote: Yes. And also, I agree that having something typed as shared must prevent the compiler from reordering them. But that's

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they introduced in the video I posted (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw()

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/11/12 6:30 PM, Walter Bright wrote: 1. ensure single threaded access by aquiring a mutex 2. cast away shared 3. operate on the data 4. cast back to shared 5. release the mutex This is very different from how I view we should do things (and how we actually agreed to do things and how I

Re: I'm back

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 5:30 PM, Daniel Murphy wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message news:k80l8p$397$1...@digitalmars.com... On 11/14/12 7:29 AM, H. S. Teoh wrote: But since this isn't going to be fixed properly, then the only solution left is to arbitrarily declare

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 18:30:56 Andrei Alexandrescu wrote: On 11/11/12 6:30 PM, Walter Bright wrote: 1. ensure single threaded access by aquiring a mutex 2. cast away shared 3. operate on the data 4. cast back to shared 5. release the mutex This is very different from how I

Re: Pyd thread

2012-11-14 Thread Ellery Newcomer
Just tried building a shared library on linux with dmd (and calling it from C). It works! Holy crap, it even runs my static constructors and unittests! I only had to screw with the linking process a little bit! It doesn't work for x64, though. Gives me /usr/bin/ld:

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrej Mitrovic
On 11/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: From what I recall of what TDPL says It says (on p.413) reading and writing shared values are guaranteed to be atomic, for pointers, arrays, function pointers, delegates, class references, and struct types containing exactly one of these

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jonathan M Davis
On Thursday, November 15, 2012 04:12:47 Andrej Mitrovic wrote: On 11/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: From what I recall of what TDPL says It says (on p.413) reading and writing shared values are guaranteed to be atomic, for pointers, arrays, function pointers, delegates,

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Jonathan M Davis
On Thursday, November 15, 2012 03:51:13 Jonathan M Davis wrote: I have no idea what we want to do about this situation though. Regardless of what we do with memory barriers and the like, it has no impact on whether casts are required. And I think that introducing the shared equivalent of const

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they intrdouced in the video I posted (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw()

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Andrei Alexandrescu
On 11/14/12 7:24 PM, Jonathan M Davis wrote: On Thursday, November 15, 2012 03:51:13 Jonathan M Davis wrote: I have no idea what we want to do about this situation though. Regardless of what we do with memory barriers and the like, it has no impact on whether casts are required. And I think

Re: Something needs to happen with shared, and soon.

2012-11-14 Thread Michel Fortin
On 2012-11-15 02:51:13 +, Jonathan M Davis jmdavisp...@gmx.com said: I have no idea what we want to do about this situation though. Regardless of what we do with memory barriers and the like, it has no impact on whether casts are required. One thing I'm confused about right now is how

Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA

2012-11-14 Thread Rainer Schuetze
On 11/14/2012 9:49 PM, Martin Drašar wrote: Dne 14.11.2012 18:18, Regan Heath napsal(a): I hope this gives a hint where the problem might be. I hope so to .. but I don't have a clue. I'm not at all familiar with the output of dumpobj so I can't really debug this any further. TBH I was

Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA

2012-11-14 Thread Martin Drašar
Dne 15.11.2012 7:45, Rainer Schuetze napsal(a): [...] importcore.sys.windows.windows(C:\Program Files\D\dmd2\windows\bin\..\..\src\druntime\import\core\sys\windows\windows.di) since dmd 2.060 most of the files in druntme/import are plain copies of the source .d files, not

Re: D wiki

2012-11-14 Thread Vladimir Panteleev
On Tuesday, 13 November 2012 at 21:45:50 UTC, Brad Roberts wrote: On Tue, 13 Nov 2012, Walter Bright wrote: On 11/13/2012 11:26 AM, David Nadlinger wrote: The only question raised by my suggestion is hosting. I don't know what infrastructure dlang.org is hosted on right now, and if

Re: [RFC] A huge problem with Github diff

2012-11-14 Thread Thomas Koch
Andrei Alexandrescu wrote: On 11/14/12 12:36 PM, Andrej Mitrovic wrote: On 11/14/12, Alex Rønne Petersena...@lycus.org wrote: Or we could switch to Phabricator for our entire review process which has an absolutely awesome side-by-side diff and is generally a fantastic tool for

Re: Getting rid of dynamic polymorphism and classes

2012-11-14 Thread Tommi
Here's the duck-typing design pattern they intrdouced in the video I posted (in C++ again, sorry): #include conio.h #include memory #include type_traits #include utility #include vector class SomeShape { public: SomeShape() = default; explicit SomeShape(int volume) {} void draw()

Re: Binary compatibility on Linux

2012-11-14 Thread Thomas Koch
Jacob Carlborg wrote: On 2012-11-14 19:20, John Colvin wrote: Debian testing is a rolling distribution, so it is always in an unstable state. Debian stable is, as it says, stable. To answer your question, just look at what debain version the particular ubuntu LTS version is based on.

Re: Is Override Still Mandatory?

2012-11-14 Thread Jonathan M Davis
On Wednesday, November 14, 2012 07:59:06 Rob T wrote: That's good news. If I were to use the latest pre-release version of dmd that was relatively safe, how will I find it, or is it OK to use the master branch? The master branch _is_ the pre-release version. dmd, druntime, and Phobos do not

Re: Shared value types can not be destructed

2012-11-14 Thread Benjamin Thaut
Am 13.11.2012 17:25, schrieb Benjamin Thaut: Apperently this is by design: http://d.puremagic.com/issues/show_bug.cgi?id=8295 To clarify: It is not possible to define a destructor that will be called on the destruction of a shared struct. In a different thread Walter commeted this bug with: If

operations on rectangular arrays

2012-11-14 Thread dominic jones
Hello, This code snippet: int[][] A = [[1, 2], [2, 3]]; int[][] B = [[2, 3], [1, 2]]; int[2][2] C; C = A[][] + B[][]; fails with the message: Error: cannot implicitly convert expression (A[][] + B[][]) of type int[][] to int[2LU][] Is there a succinct work-around (i.e. without

Re: operations on rectangular arrays

2012-11-14 Thread bearophile
dominic jones: Is there a succinct work-around (i.e. without using foreach)? 2D built-in array operations are not supported. APL-style orthogonality isn't at home in D, it seems. Bye, bearophile

Coverting ubyte to string.

2012-11-14 Thread Knud Soerensen
Hi I am working with a c library which return a unsigned char * As suggested on http://digitalmars.com/d/1.0/htomodule.html I have converted it to (ubyte *). Now is there an easy way to convert this to a string ? Knud

Re: Inferring function argument types from other argument types

2012-11-14 Thread Joseph Rushton Wakeling
On 11/13/2012 06:47 PM, Ali Çehreli wrote: Still, please create a bug report: :) Done :-) http://d.puremagic.com/issues/show_bug.cgi?id=9024

Safely writing to the same file in parallel foreach loop

2012-11-14 Thread Joseph Rushton Wakeling
Suppose that I've got a foreach loop in which I write output to a file: auto f = File(test.txt, w); f.close(); // to start with a blank file foreach(i; iota(0, 100)) { f = File(test.txt, a); f.writeln(i); f.close(); } I'm guessing it is at least

Re: Coverting ubyte to string.

2012-11-14 Thread Vijay Nayar
This might help. import std.c.string; void main() { // The input data: ubyte* ustr = cast(ubyte*) bobcat\0.ptr; // Conversion to 'string'. char* cstr = cast(char*) ustr; string str = cast(string) cstr[0..strlen(cstr)]; assert(str == bobcat); } - Vijay On Wednesday, 14 November

Re: Is Override Still Mandatory?

2012-11-14 Thread Rob T
On Wednesday, 14 November 2012 at 08:04:55 UTC, Jonathan M Davis wrote: but I'm one of the Phobos developers. It's fine if you use master (it could help us find regressions if nothing else), but I wouldn't really advise using it just to be able to use the -di flag. There have been a few

taskPool.map using functions with more than one input

2012-11-14 Thread Joseph Rushton Wakeling
Is it possible to use taskPool.map with functions that take more than one input? Consider the following code which uses map to convert a given value to its sum with another number: import std.algorithm, std.parallelism, std.range, std.stdio; real pairsum(real x, real y) {

Re: Safely writing to the same file in parallel foreach loop

2012-11-14 Thread Joseph Rushton Wakeling
On 11/14/2012 06:49 PM, Vijay Nayar wrote: Could you put the file access in a synchronized block? http://dlang.org/statement.html#SynchronizedStatement Oh, good call -- seems to work. If you try and run the parallel code without it, there's a pretty nasty-looking error:

<    1   2   3   >