Re: static arrays becoming value types

2009-10-20 Thread bearophile
Walter Bright: The previous behavior for function parameters can be retained by making it a ref parameter: void foo(ref T[3] a) If I have generic code, like a templated function, that accepts both a dynamic and a static array, the function call will change its performance signature

Re: Revamped concurrency API (Don can you contact Bartosz ?)

2009-10-20 Thread Don
Nick B wrote: Nick B wrote: Bartosz Milewski wrote: Nick B Wrote: Could you give us _any_ kind of test case (even if it's enormous)? Bartosz - are you able to provide a test case as requested by Don ? Then it might be possible, to get this bug fixed. Nick B. I can send you the files I

Re: static arrays becoming value types

2009-10-20 Thread Don
Walter Bright wrote: Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and special cases in the language semantics, such as functions not being able to return static arrays, and out parameters not being possible to

Re: d3 ?

2009-10-20 Thread Don
dolive wrote: will appear d3 ? What are the tasks ? it's not backward compatible with D2 ? What major changes ? when to stop adding new content of d2 ? thank you very much to all dolive http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel

Re: d3 ?

2009-10-20 Thread dolive
Bill Baxter дµ½: On Mon, Oct 19, 2009 at 2:26 PM, Jason House jason.james.ho...@gmail.com wrote: dolive Wrote: will appear d3 ? What are the tasks ?  it's not backward compatible with D2 ? What major changes ? My understanding is that there will be a significant gap between the

Re: Eliminate new for class object creation?

2009-10-20 Thread Chris Nicholson-Sauls
Andrei Alexandrescu wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@ object---Test(@\meta{args}@)@---and the

Re: d3 ?

2009-10-20 Thread dolive
Don дµ½: dolive wrote: will appear d3 ? What are the tasks ? it's not backward compatible with D2 ? What major changes ? when to stop adding new content of d2 ? thank you very much to all dolive http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel thank you very

Re: Eliminate new for class object creation?

2009-10-20 Thread Kagamin
Andrei Alexandrescu Wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@

Re: static arrays becoming value types

2009-10-20 Thread Ary Borenszweig
Walter Bright wrote: Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and special cases in the language semantics, such as functions not being able to return static arrays, and out parameters not being possible to

Re: static arrays becoming value types

2009-10-20 Thread Kagamin
Jason House Wrote: I've never heard the argument why they should be value types. Weren't they value types from the start? That's surprise. What do you think is memory layout of such array: int[3][] ? And what is memory layout of int[] ?

Re: static arrays becoming value types

2009-10-20 Thread Kagamin
Walter Bright Wrote: Andrei and I agonized over this for some time, and eventually came to the conclusion that static arrays should become value types. Nothing to agonize about really (except for C compatibility), they're value types and their behavior must be consistent.

Re: static arrays becoming value types

2009-10-20 Thread bearophile
Don: I think this change is mandatory. We need it for SIMD operations. Why? Why the compiler can't optimize things and perform SIMD operations with the fixed-sized array semantics of D1? (I ask this for LDC too, that's mostly D1 still). Bye, bearophile

Re: static arrays becoming value types

2009-10-20 Thread Don
bearophile wrote: Don: I think this change is mandatory. We need it for SIMD operations. Why? Why the compiler can't optimize things and perform SIMD operations with the fixed-sized array semantics of D1? (I ask this for LDC too, that's mostly D1 still). Bye, bearophile Because they are

Re: dmd support for IDEs + network GUI

2009-10-20 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:mailman.208.1255923114.20261.digitalmar...@puremagic.com... On Mon, Oct 12, 2009 at 09:06:38PM -0400, Nick Sabalausky wrote: Excellent! Sounds exactly like what I had in mind. I'll definately want to keep an eye on this. Any

Re: LRU cache for ~=

2009-10-20 Thread Fawzi Mohamed
On 2009-10-20 03:41:59 +0200, Walter Bright newshou...@digitalmars.com said: Denis Koroskin wrote: Safe as in SafeD (i.e. no memory corruption) :) Right. The problems with other definitions of safe is they are too ill-defined. no (or as little as possible) undefined behaviour comes to

Re: Revamped concurrency API

2009-10-20 Thread Tim Matthews
Andrei Alexandrescu wrote: Speaking of switch, I have tried to convince Walter to require either a break; or a goto case xxx; at the end of each snippet inside a switch. I was surprised by his answer: but I use fall through all the time! :o) I personally think requiring a goto case xxx; is

Re: static arrays becoming value types

2009-10-20 Thread Max Samukha
On Mon, 19 Oct 2009 18:50:46 -0700, Walter Bright newshou...@digitalmars.com wrote: Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and special cases in the language semantics, such as functions not being able to

Re: Eliminate new for class object creation?

2009-10-20 Thread Lionello Lunesu
On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added keyword makes that clear. Also, somebody mentioned using 'new' to allocate structs on

Re: LRU cache for ~=

2009-10-20 Thread Don
Andrei Alexandrescu wrote: Rainer Deyke wrote: Andrei Alexandrescu wrote: One surprising (but safe) behavior that remains with slices is this: void fun(int[] a) { a[0] = 0; a ~= 42; a[0] = 42; } The caller may or may not see 42 in the first slot after the call. Your definition of

Re: Eliminate new for class object creation?

2009-10-20 Thread Max Samukha
On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added

Re: Eliminate new for class object creation?

2009-10-20 Thread Yigal Chripun
Chris Nicholson-Sauls Wrote: Andrei Alexandrescu wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Lionello Lunesu wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added keyword makes that clear. That's actually one problem: a

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Max Samukha wrote: On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved,

Re: Communicating between in and out contracts

2009-10-20 Thread Steven Schveighoffer
On Sun, 18 Oct 2009 03:44:39 -0400, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: Rainer Deyke wrote: The expression may mutate stuff. It shouldn't. It's an error if it does, just like it's an error for an assertion or post/precondition to have any side effects. It

Re: 64-bit

2009-10-20 Thread Tomas Lindquist Olsen
On Mon, Oct 19, 2009 at 10:26 PM, Nick Sabalausky a...@a.a wrote: Fawzi Mohamed fmoha...@mac.com wrote in message news:hbhi5q$1gq...@digitalmars.com... On 2009-10-18 20:01:26 +0200, language_fan f...@bar.com.invalid said: Sun, 18 Oct 2009 16:35:53 +0200, Fawzi Mohamed thusly wrote: on x86

Re: Communicating between in and out contracts

2009-10-20 Thread Michel Fortin
On 2009-10-20 08:16:01 -0400, Steven Schveighoffer schvei...@yahoo.com said: Incidentally, shouldn't all access to the object in the in contract be const by default anyways? Hum, access to everything (including global variables, arguments), not just the object, should be const in a

Re: T[new] misgivings

2009-10-20 Thread Steven Schveighoffer
On Fri, 16 Oct 2009 05:49:12 -0400, Walter Bright newshou...@digitalmars.com wrote: Don wrote: There are two sensible options: I see the question as, is T[new] a value type or a reference type? I see it as a reference type, and so assignment should act like a reference assignment, not

Re: Revamping associative arrays

2009-10-20 Thread Steven Schveighoffer
On Sat, 17 Oct 2009 14:58:08 -0400, BCS n...@anon.com wrote: Hello Chris Nicholson-Sauls, Andrei Alexandrescu wrote: Associative arrays are today quite problematic because they don't offer any true iteration. Furthermore, the .keys and .values properties create new arrays, which is

Re: Revamping associative arrays

2009-10-20 Thread Steven Schveighoffer
On Sat, 17 Oct 2009 14:28:51 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Associative arrays are today quite problematic because they don't offer any true iteration. Furthermore, the .keys and .values properties create new arrays, which is wasteful. Another issue with

Re: T[new] misgivings

2009-10-20 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Fri, 16 Oct 2009 05:49:12 -0400, Walter Bright newshou...@digitalmars.com wrote: Don wrote: There are two sensible options: I see the question as, is T[new] a value type or a reference type? I see it as a reference type, and so assignment should act like a

Re: Revamped concurrency API (Don can you contact Bartosz ?)

2009-10-20 Thread Leandro Lucarella
Don, el 20 de octubre a las 09:00 me escribiste: Unfortunately, I have undone some of my changes trying to bypass the bug, so at the moment I don't even have the buggy version, but it can be reconstructed. We can discuss it off-line, if you want. Use my email address with -nospam removed.

Re: static arrays becoming value types

2009-10-20 Thread dsimcha
== Quote from bearophile (bearophileh...@lycos.com)'s article Walter Bright: The previous behavior for function parameters can be retained by making it a ref parameter: void foo(ref T[3] a) If I have generic code, like a templated function, that accepts both a dynamic and a static

Re: Eliminate new for class object creation?

2009-10-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM,

Re: static arrays becoming value types

2009-10-20 Thread Leandro Lucarella
dsimcha, el 20 de octubre a las 02:44 me escribiste: == Quote from Walter Bright (newshou...@digitalmars.com)'s article Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and special cases in the language

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon,

(Another) XML Module Candidate

2009-10-20 Thread Michel Fortin
I've built an XML parsing library in the last few months as an experimentation of D2 template capabilities and as an attempt to work with ranges. The idea is that if successful enough it could become part of Phobos 2. You can use it to do tokenization as an event parser or a pull parser or a

Re: static arrays becoming value types

2009-10-20 Thread language_fan
Tue, 20 Oct 2009 10:34:35 -0300, Leandro Lucarella thusly wrote: dsimcha, el 20 de octubre a las 02:44 me escribiste: == Quote from Walter Bright (newshou...@digitalmars.com)'s article Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a

Re: LRU cache for ~=

2009-10-20 Thread Steven Schveighoffer
On Mon, 19 Oct 2009 14:51:32 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I just wrote this to Sean and Walter and subsequently discussed it with Walter. Walter thinks this should work. Does anyone have the time and inclination to test this out? It would involve hacking

Re: LRU cache for ~=

2009-10-20 Thread Steven Schveighoffer
On Mon, 19 Oct 2009 22:37:26 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu

Re: LRU cache for ~=

2009-10-20 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 19 Oct 2009 14:51:32 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I just wrote this to Sean and Walter and subsequently discussed it with Walter. Walter thinks this should work. Does anyone have the time and inclination to test this out?

Re: LRU cache for ~=

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 10:14:52 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: On Mon, 19 Oct 2009 14:51:32 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I just wrote this to Sean and Walter and subsequently discussed it with

Re: LRU cache for ~=

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 10:05:42 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 19 Oct 2009 22:37:26 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu

Re: LRU cache for ~=

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 10:37:40 -0400, Robert Jacques sandf...@jhu.edu wrote: So you want to synchronize the ~= function? I thought the LRU would be thread local and therefore independent of these issues, as well as being faster. And if the LRU isn't thread-local, then why not make it part of

Re: LRU cache for ~=

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 10:14:52 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: This is a very good idea. Incidentally, you only need the upper bound location, the beginning location is irrelevant, since you don't grow down. Awesome, didn't

Re: The demise of T[new]

2009-10-20 Thread Bill Baxter
On Tue, Oct 20, 2009 at 6:25 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 18 Oct 2009 17:05:39 -0400, Walter Bright newshou...@digitalmars.com wrote: The purpose of T[new] was to solve the problems T[] had with passing T[] to a function and then the function resizes the T[].

Re: LRU cache for ~=

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 10:48:31 -0400, Robert Jacques sandf...@jhu.edu wrote: On Tue, 20 Oct 2009 10:05:42 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: I'd think you only want to clear the entries affected by the collection. If it was free and simple to only clear the affected

Re: static arrays becoming value types

2009-10-20 Thread Leandro Lucarella
language_fan, el 20 de octubre a las 13:52 me escribiste: Tue, 20 Oct 2009 10:34:35 -0300, Leandro Lucarella thusly wrote: dsimcha, el 20 de octubre a las 02:44 me escribiste: == Quote from Walter Bright (newshou...@digitalmars.com)'s article Currently, static arrays are (as in C)

Re: Eliminate new for class object creation?

2009-10-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 20 de octubre a las 08:42 me escribiste: Why not Scoped!T ? I think the purpose for this that the lifetime of the object is bounded to the scope, right? I think is hard to figure that out from InSitu!T than Scoped!T. /useless discussion It's not a useless

Re: Communicating between in and out contracts

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 08:36:14 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-10-20 08:16:01 -0400, Steven Schveighoffer schvei...@yahoo.com said: Incidentally, shouldn't all access to the object in the in contract be const by default anyways? Hum, access to everything

stack frame optimization problem

2009-10-20 Thread sprucely
This works with g++ and inline ATT assembly, but I have had no such luck in D. I have many simple functions that need to be executed sequentially and have identical stack frames. To avoid the overhead of setting up and tearing down the stack frames I want to jmp from the body of one function to

Re: The demise of T[new]

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 11:10:20 -0400, Bill Baxter wbax...@gmail.com wrote: On Tue, Oct 20, 2009 at 6:25 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 18 Oct 2009 17:05:39 -0400, Walter Bright newshou...@digitalmars.com wrote: The purpose of T[new] was to solve the problems T[] had

Re: Communicating between in and out contracts

2009-10-20 Thread Michel Fortin
On 2009-10-20 11:44:00 -0400, Steven Schveighoffer schvei...@yahoo.com said: On Tue, 20 Oct 2009 08:36:14 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-10-20 08:16:01 -0400, Steven Schveighoffer schvei...@yahoo.com said: Incidentally, shouldn't all access to the object

Re: static arrays becoming value types

2009-10-20 Thread Steven Schveighoffer
On Mon, 19 Oct 2009 21:50:46 -0400, Walter Bright newshou...@digitalmars.com wrote: Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and special cases in the language semantics, such as functions not being

Re: Communicating between in and out contracts

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 11:57:05 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-10-20 11:44:00 -0400, Steven Schveighoffer schvei...@yahoo.com said: On Tue, 20 Oct 2009 08:36:14 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-10-20 08:16:01 -0400, Steven

Re: LRU cache for ~=

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 11:24:21 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 20 Oct 2009 10:48:31 -0400, Robert Jacques sandf...@jhu.edu wrote: On Tue, 20 Oct 2009 10:05:42 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: I'd think you only want to clear the

Re: The demise of T[new]

2009-10-20 Thread Bill Baxter
On Tue, Oct 20, 2009 at 8:50 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 20 Oct 2009 11:10:20 -0400, Bill Baxter wbax...@gmail.com wrote: On Tue, Oct 20, 2009 at 6:25 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 18 Oct 2009 17:05:39 -0400, Walter Bright

Re: static arrays becoming value types

2009-10-20 Thread dsimcha
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Mon, 19 Oct 2009 21:50:46 -0400, Walter Bright newshou...@digitalmars.com wrote: Currently, static arrays are (as in C) half-value types and half-reference types. This tends to cause a series of weird problems and

Re: The demise of T[new]

2009-10-20 Thread Andrei Alexandrescu
grauzone wrote: Steven Schveighoffer wrote: I still think having an Appender object or struct is a worthwhile thing, the pre-allocate array then set length to zero model is a hack at best. Would that work with Andrei's append cache at all? Setting the length to zero and then appending is

Re: Communicating between in and out contracts

2009-10-20 Thread Michel Fortin
On 2009-10-20 12:04:20 -0400, Steven Schveighoffer schvei...@yahoo.com said: On Tue, 20 Oct 2009 11:57:05 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-10-20 11:44:00 -0400, Steven Schveighoffer schvei...@yahoo.com said: On Tue, 20 Oct 2009 08:36:14 -0400, Michel Fortin

Re: stack frame optimization problem

2009-10-20 Thread bearophile
sprucely: This works with g++ and inline ATT assembly, but I have had no such luck in D. What compiler are you using? I think LDC isn't yet able to do this (it's LLVM limit, that may get lifted in future). Bye, bearophile

Re: The demise of T[new]

2009-10-20 Thread Denis Koroskin
On Tue, 20 Oct 2009 21:01:17 +0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: grauzone wrote: Steven Schveighoffer wrote: I still think having an Appender object or struct is a worthwhile thing, the pre-allocate array then set length to zero model is a hack at best. Would

Re: The demise of T[new]

2009-10-20 Thread Bill Baxter
On Tue, Oct 20, 2009 at 10:05 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Bill Baxter wrote: To Andrei, do you really feel comfortable trying to explain this in your book?  It seems like it will be difficult to explain that ~= is sometimes efficient for appending but not

Re: The demise of T[new]

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 12:30:57 -0400, Bill Baxter wbax...@gmail.com wrote: On Tue, Oct 20, 2009 at 8:50 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 20 Oct 2009 11:10:20 -0400, Bill Baxter wbax...@gmail.com wrote: On Tue, Oct 20, 2009 at 6:25 AM, Steven Schveighoffer

Re: The demise of T[new]

2009-10-20 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Steven Schveighoffer wrote: I still think having an Appender object or struct is a worthwhile thing, the pre-allocate array then set length to zero model is a hack at best. Would that work with Andrei's append cache at all? Setting the length to

Re: Communicating between in and out contracts

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 13:13:07 -0400, Michel Fortin michel.for...@michelf.com wrote: So what we need is semi-pure functions that can see all the globals as const data, or in other terms having no side effect but which can be affected by their environment. Another function qualifier, isn't it

Re: The demise of T[new]

2009-10-20 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: If your goal is to affect the original array, then you should accept a ref argument or not append to it. I think that's an entirely reasonable (and easy to explain) stance. Andrei

Re: The demise of T[new]

2009-10-20 Thread Bill Baxter
On Tue, Oct 20, 2009 at 11:30 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: If your goal is to affect the original array, then you should accept a ref argument or not append to it. I think that's an entirely reasonable (and easy to explain) stance.

Re: Eliminate new for class object creation?

2009-10-20 Thread Rainer Deyke
Andrei Alexandrescu wrote: Lionello Lunesu wrote: Also, somebody mentioned using 'new' to allocate structs on the heap; I've never actually done that, but it sounds like using 'new' would be the perfect way to do just that. Yah, I guess I'll drop it. Consistency with structs demands that

Re: Eliminate new for class object creation?

2009-10-20 Thread Chad J
Andrei Alexandrescu wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: No problem. You will be able to use InSitu!T. It is much better to confine unsafe features to libraries instead of putting them in the language. { auto foo =

Re: static arrays becoming value types

2009-10-20 Thread language_fan
Tue, 20 Oct 2009 12:39:47 -0300, Leandro Lucarella thusly wrote: language_fan, el 20 de octubre a las 13:52 me escribiste: Tue, 20 Oct 2009 10:34:35 -0300, Leandro Lucarella thusly wrote: dsimcha, el 20 de octubre a las 02:44 me escribiste: == Quote from Walter Bright

Re: Revamped concurrency API (Don can you contact Bartosz ?)

2009-10-20 Thread Nick B
Don wrote: Don, are you able to contact Bartosz, re the details of this test case. Nick B Bartosz has sent it to me. I can reproduce the error. It's my top priority, but it'll take a while -- it's nasty. Don - thanks for filing this. I did try to contact you, via bugzilla email (which

Re: The demise of T[new]

2009-10-20 Thread Steven Schveighoffer
On Tue, 20 Oct 2009 14:43:16 -0400, Bill Baxter wbax...@gmail.com wrote: On Tue, Oct 20, 2009 at 11:30 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: If your goal is to affect the original array, then you should accept a ref argument or not append

Re: Eliminate new for class object creation?

2009-10-20 Thread Pelle Månsson
Andrei Alexandrescu wrote: Max Samukha wrote: On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one.

Re: stack frame optimization problem

2009-10-20 Thread Vladimir Panteleev
On Tue, 20 Oct 2009 18:45:50 +0300, sprucely timber...@gmail.com wrote: This works with g++ and inline ATT assembly, but I have had no such luck in D. I have many simple functions that need to be executed sequentially and have identical stack frames. To avoid the overhead of setting up and

Re: Proposed D2 Feature: = for anonymous delegates

2009-10-20 Thread Pelle Månsson
Jason House wrote: Andrei Alexandrescu Wrote: Jason House wrote: Am I the only one that has trouble remembering how to write an inline anonymous delegate when calling a function? At a minimum, both Scala and C# use (args) = { body; } syntax. Can we please sneak it into D2? We have (args) {

Re: stack frame optimization problem

2009-10-20 Thread sprucely
bearophile, DMD 1.0.43 I think. But I'll have to check to make sure, because I was experimenting with LDC at one point. So does this mean there's nothing inherently wrong with my snippet? My C++ code was also modifying the this pointer as it jumped from a member function of one class to a

Re: dmd support for IDEs + network GUI

2009-10-20 Thread Nick B
Nick Sabalausky wrote: Adam D. Ruppe destructiona...@gmail.com wrote in message news:mailman.208.1255923114.20261.digitalmar...@puremagic.com... On Mon, Oct 12, 2009 at 09:06:38PM -0400, Nick Sabalausky wrote: Excellent! Sounds exactly like what I had in mind. I'll definately want to keep an

Re: Proposed D2 Feature: = for anonymous delegates

2009-10-20 Thread Andrei Alexandrescu
Pelle Månsson wrote: Jason House wrote: Andrei Alexandrescu Wrote: Jason House wrote: Am I the only one that has trouble remembering how to write an inline anonymous delegate when calling a function? At a minimum, both Scala and C# use (args) = { body; } syntax. Can we please sneak it into

Re: Communicating between in and out contracts

2009-10-20 Thread Jérôme M. Berger
Steven Schveighoffer wrote: On Tue, 20 Oct 2009 13:13:07 -0400, Michel Fortin michel.for...@michelf.com wrote: So what we need is semi-pure functions that can see all the globals as const data, or in other terms having no side effect but which can be affected by their environment. Another

Re: stack frame optimization problem

2009-10-20 Thread sprucely
To try to be sure I had the correct syntax I tried the -S option of g++ along with a switch for intel syntax to output the assembly. However the portion corresponding to the inline assembly was still in ATT syntax. For my resulting D executable I tried using hte, but it would abort after

Re: LRU cache for ~=

2009-10-20 Thread Christopher Wright
Brad Roberts wrote: On Mon, 19 Oct 2009, Walter Bright wrote: Denis Koroskin wrote: Safe as in SafeD (i.e. no memory corruption) :) Right. The problems with other definitions of safe is they are too ill-defined. There's SafeD, which has a fairly formal definition. But a fairly generic

Re: d3 ?

2009-10-20 Thread Stewart Gordon
Jason House wrote: dolive Wrote: will appear d3 ? What are the tasks ? it's not backward compatible with D2 ? What major changes ? My understanding is that there will be a significant gap between the finalization of D2 and the start of D3. Bartosz's ownership scheme may be part of D3.

Re: static arrays becoming value types

2009-10-20 Thread Leandro Lucarella
language_fan, el 20 de octubre a las 19:19 me escribiste: One nasty thing about D's structs is that they don't have structural equivalence relation unlike tuples. So you need to use the same container struct type to get the same semantics. To achieve that you would need some kind of STuple

Condition Mutexes

2009-10-20 Thread dsimcha
I'm messing around w/ core.sync. Does anyone know what I'm doing wrong in this program? It just hangs. If I could figure out ()##$) condition mutexes (right now, I'm using busy spinning), I might have a decent implementation of parallelForeach over ranges. import core.sync.mutex,

Re: stack frame optimization problem

2009-10-20 Thread downs
sprucely wrote: To try to be sure I had the correct syntax I tried the -S option of g++ along with a switch for intel syntax to output the assembly. However the portion corresponding to the inline assembly was still in ATT syntax. For my resulting D executable I tried using hte, but it

Re: static arrays becoming value types

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 20:38:33 -0400, Leandro Lucarella llu...@gmail.com wrote: language_fan, el 20 de octubre a las 19:19 me escribiste: One nasty thing about D's structs is that they don't have structural equivalence relation unlike tuples. So you need to use the same container struct type

Re: dmd support for IDEs + network GUI

2009-10-20 Thread Adam D. Ruppe
On 10/20/09, Nick B ni...@gmail.com wrote: Re your use of a binary protocol. Perhaps instead of re-inventing the wheel, Eh, my code is already written and works. One of the advantages to my code generator reading a C like syntax is that I might be able to fully automate porting some

Re: static arrays becoming value types

2009-10-20 Thread Leandro Lucarella
Robert Jacques, el 20 de octubre a las 21:06 me escribiste: Real tuple types do not have a special type tag which gets injected implicitly with structs. So every time you try to do something lightweight by emulating tuples, you need to refer to the global Tuple type or bang your head to the

Re: static arrays becoming value types

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 22:45:53 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Robert Jacques wrote: On Tue, 20 Oct 2009 20:38:33 -0400, Leandro Lucarella llu...@gmail.com wrote: Yes, D support for tuples is way far from ideal. How so? I think this is merely the difference

Re: static arrays becoming value types

2009-10-20 Thread Robert Jacques
On Tue, 20 Oct 2009 23:30:48 -0400, Leandro Lucarella llu...@gmail.com wrote: Robert Jacques, el 20 de octubre a las 21:06 me escribiste: Now, if SOL allowed tuples to do things you can't do today in D, like assign a tuple to a struct with the same signature, then this might be a point. But

Re: Condition Mutexes

2009-10-20 Thread Graham St Jack
On Wed, 21 Oct 2009 00:56:13 +, dsimcha wrote: I'm messing around w/ core.sync. Does anyone know what I'm doing wrong in this program? It just hangs. If I could figure out ()##$) condition mutexes (right now, I'm using busy spinning), I might have a decent implementation of

Re: static arrays becoming value types

2009-10-20 Thread Yigal Chripun
On 21/10/2009 05:48, Robert Jacques wrote: On Tue, 20 Oct 2009 23:30:48 -0400, Leandro Lucarella llu...@gmail.com wrote: Robert Jacques, el 20 de octubre a las 21:06 me escribiste: Now, if SOL allowed tuples to do things you can't do today in D, like assign a tuple to a struct with the same

Re: amazing function behavior

2009-10-20 Thread Don
Kagamin wrote: Zarathustra Wrote: Oh, I just find out cause of this behaviour in other module I had: extern (Windows) alias dword function() Tfunc1; extern (Windows) alias dword function(wstr) Tfunc2; const Tfunc2 func2; static this(){ func2 = cast(Tfunc1)0x0; // for DMD2 It is not error!!!

Re: amazing function behavior

2009-10-20 Thread Zarathustra
Don Wrote: It isn't. Tfunc2 is a function pointer, which is typically the same as size_t. So any int can be stored inside it. It's generally a very bad idea to do so, of course. Never mind what is stored inside func2. 0x00 is only to simplify the code. Tfunc1 - pointer to function without

Re: amazing function behavior

2009-10-20 Thread Phil Deets
On Mon, 19 Oct 2009 02:39:57 -0500, Zarathustra adam.chrapkow...@gmail.com wrote: Function is never called but why? look at: window.Window.wndProc : case WM.LBUTTONDOWN //__ module window; private import base; private import structs; private

[Issue 3422] Structs with default initializers bigger than register size cannot be default parameters

2009-10-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3422 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au ---

[Issue 3422] ICE(cgcod.c) Structs with default initializers bigger than register size cannot be default parameters

2009-10-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3422 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||ice-on-valid-code

[Issue 3423] New: The Bartosz Blocker

2009-10-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3423 Summary: The Bartosz Blocker Product: D Version: 2.035 Platform: All OS/Version: All Status: NEW Keywords: patch, wrong-code Severity: blocker Priority:

Re: [Issue 3423] Destructor and postblit don't get copied to the header file when using -H

2009-10-20 Thread Don
d-bugm...@puremagic.com wrote: http://d.puremagic.com/issues/show_bug.cgi?id=3423 Leandro Lucarella llu...@gmail.com changed: What|Removed |Added CC|

[Issue 3424] New: Ref counting still doesn't work for std.stdio.File

2009-10-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3424 Summary: Ref counting still doesn't work for std.stdio.File Product: D Version: 2.035 Platform: Other OS/Version: Windows Status: NEW Severity: critical Priority:

  1   2   >