Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Lutger
Andrei Alexandrescu wrote: ... > Now onto why ref was disallowed to bind to an rvalue. This is because > some functions take things by ref intending to change them. Passing an > rvalue is in such cases a bug. > > I agree there are functions that only want to use ref for speed > purposes. I sugg

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Yigal Chripun
On 20/04/2009 01:13, BCS wrote: Hello Yigal, everything you said is true. there is some sort of a compile-time since the code is getting compiled. But in the above scheme there isn't any real difference between run-time and compile-time and this distinction has lost its meaning. compare the fol

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Steven, Also, I don't think the requirement for this feature needs to be for the arguments to be templated, it should be sufficient to have a single string template argument. This way, you can overload opDotExp functions via argument lists. split the difference and allow either (but

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being argued that there should be a standard way to do a run time function invocation system? I'l

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello BCS, That didn't sound like I intended it to so... Clarification: I think most of us could convince most of the rest of us of the our point given face time because I don't think there are near as many opposing views as it seems. (That is with points of operation, not with issues of synt

Re: D2 weak references

2009-04-19 Thread Daniel Keep
Sean Kelly wrote: > Jason House wrote: >> Jason House wrote: >> >>> Tango's GC (and therefore >>> druntime's GC) has an explicit notification mechanism. >> >> I guess I shouldn't have assumed that the features of tango became >> part of druntime. I don't see any notification mechanism :( > > Sa

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Steven Schveighoffer
On Sun, 19 Apr 2009 10:42:19 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 19 Apr 2009 18:26:11 +0400, Steven Schveighoffer wrote: On Sun, 19 Apr 2009 06:26:57 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer wrote:

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Michel Fortin
Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: You completely lost me about the necessity of a standardized catch-all function. My view is that if you want to forward to someone else, you just call the runtime invoke() for the guy you want to forward to. So

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Georg Wrede
Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> wrote: What's a rationale behind an issue described bug 2621? http://d.puremagic.com/issues/show_bug.cgi?id=2621 Why isn't it allowed anymore? It broke quite a lot of my c

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Adam, BCS wrote: (In the above, you seeme to be working with the assumption of the non static opDotExp form. I, BTW, see no use for it as it adds no new functionality to D where as the static opDotExp(char[],T...)(T t) form adds a new ability) When you say static opDotExp I am assuming

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Andrei Alexandrescu
Christopher Wright wrote: Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-04-18 22:21:50 -0400, Andrei Alexandrescu said: I did, but sorry, it doesn't make sense and does nothing but continue the terrible confusion going in this thread. Then let's try to remove some of that confus

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Christopher Wright
Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-04-18 22:21:50 -0400, Andrei Alexandrescu said: I did, but sorry, it doesn't make sense and does nothing but continue the terrible confusion going in this thread. Then let's try to remove some of that confusion. Thanks for doing so.

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Adam Burton
BCS wrote: > Hello Adam, > >> BCS wrote: >> >>> Hello Adam, >>> On Sat, Apr 18, 2009 at 06:10:27PM -0700, Andrei Alexandrescu wrote: > The point of using "." is not syntactic convenience as much as the > ability of the Dynamic structure to work out of the box with > algor

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Yigal, everything you said is true. there is some sort of a compile-time since the code is getting compiled. But in the above scheme there isn't any real difference between run-time and compile-time and this distinction has lost its meaning. compare the following: process A: 1) use runtime

Re: GC object finalization not guaranteed

2009-04-19 Thread Unknown W. Brackets
Personally, I usually use destructors to clean up or to decrement use counts, bleach secure data, etc. but it should be guaranteed that if data is no longer allocated, the destructor is called. That may be elsewhere in the spec, though. Also, hardware failure should always be expected: Webse

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Yigal Chripun
On 19/04/2009 23:33, BCS wrote: Hello Yigal, On 19/04/2009 01:22, BCS wrote: Hello Yigal, On 18/04/2009 21:16, Andrei Alexandrescu wrote: In the syntax a.b how would either of a and b be identified at runtime? I mean, you write the code somewhere and it gets compiled. It's not like you'

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Yigal Chripun
On 19/04/2009 22:52, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> wrote: What's a rationale behind an issue described bug 2621? http://d.puremagic.com/issues/show_bug.cgi?id=2621 Why isn't it allowed anymore? It brok

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Yigal, On 19/04/2009 01:22, BCS wrote: Hello Yigal, On 18/04/2009 21:16, Andrei Alexandrescu wrote: In the syntax a.b how would either of a and b be identified at runtime? I mean, you write the code somewhere and it gets compiled. It's not like you're reading "a.b" from the console

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread BCS
Hello Adam, BCS wrote: Hello Adam, On Sat, Apr 18, 2009 at 06:10:27PM -0700, Andrei Alexandrescu wrote: The point of using "." is not syntactic convenience as much as the ability of the Dynamic structure to work out of the box with algorithms that use the standard notation. What if the d

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> wrote: What's a rationale behind an issue described bug 2621? http://d.puremagic.com/issues/show_bug.cgi?id=2621 Why isn't it allowed anymore? It broke quite a lot of my code. And while it is fixable

DCat - a compact web application server in D.

2009-04-19 Thread Steve Teale
OK, so this should be on D Announce, and is, but I'll echo it here since it contains components that may be of wider interest. Incomplete at this point, though there's a working example, but I have to break off now and do some building work. You can find documentation and a zip file (currently

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Rainer Deyke
Jarrett Billingsley wrote: > Let's nip this in the bud right now. A const value type parameter > should automatically decide whether to pass by reference or not. Suggested change: an 'in' parameter should be either by-value or by-reference at the compiler's discretion. There needs to be a way to

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2009-04-18 22:21:50 -0400, Andrei Alexandrescu said: I did, but sorry, it doesn't make sense and does nothing but continue the terrible confusion going in this thread. Then let's try to remove some of that confusion. Thanks for doing so. Given that my wits are spen

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Jarrett Billingsley
On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> wrote: > What's a rationale behind an issue described bug 2621? > http://d.puremagic.com/issues/show_bug.cgi?id=2621 > > Why isn't it allowed anymore? > > It broke quite a lot of my code. And while it is fixable by doing > > auto t

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Christopher Wright
Michel Fortin wrote: The thing is that the name of that "catchAllHandlerFunc" function needs to be standardised for it to work with runtime reflection. I agree with this wholeheartedly. However, opDotExp would be hamstringed if it were made to serve this function. Since classes can implemen

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread downs
Denis Koroskin wrote: > What's a rationale behind an issue described bug 2621? > http://d.puremagic.com/issues/show_bug.cgi?id=2621 > > Why isn't it allowed anymore? > > It broke quite a lot of my code. And while it is fixable by doing > > auto tmp = someFunctionThatRetunsStruct(); > someMethodT

Re: GC object finalization not guaranteed

2009-04-19 Thread Leandro Lucarella
Christopher Wright, el 18 de abril a las 22:06 me escribiste: > Walter Bright wrote: > >Leandro Lucarella wrote: > >>You missed the point. I'm not talking about freeing the memory. I'm > >>talking about finalizers. A finalizer could send a "bye" packet throgh the > >>net. That can't be handled by t

Re: GC object finalization not guaranteed

2009-04-19 Thread Leandro Lucarella
Leandro Lucarella, el 19 de abril a las 13:08 me escribiste: > Don, el 19 de abril a las 07:35 me escribiste: > > Leandro Lucarella wrote: > > >I think shared memory is an example of memory resource that's not freed by > > >the OS on program exit. > > > > Really? That sounds like an OS memory leak

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Jarrett Billingsley
On Sun, Apr 19, 2009 at 8:41 AM, Denis Koroskin <2kor...@gmail.com> wrote: > What's a rationale behind an issue described bug 2621? > http://d.puremagic.com/issues/show_bug.cgi?id=2621 > > Why isn't it allowed anymore? > > It broke quite a lot of my code. And while it is fixable by doing > > auto t

Re: GC object finalization not guaranteed

2009-04-19 Thread Leandro Lucarella
Don, el 19 de abril a las 07:35 me escribiste: > Leandro Lucarella wrote: > >I think shared memory is an example of memory resource that's not freed by > >the OS on program exit. > > Really? That sounds like an OS memory leak. Security issue, too: run > your program, allocated shared memory, then

Re: GC object finalization not guaranteed

2009-04-19 Thread Leandro Lucarella
Unknown W. Brackets, el 18 de abril a las 16:51 me escribiste: > Well, I guess it would be doable to guarantee destruction, but *only* if > order of destruction was not guaranteed. Yes, of course, order *can't* be guaranteed (unless you add read/write barriers and a lot of overhead at least =) >

Re: temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Mike Parker
Denis Koroskin wrote: What's a rationale behind an issue described bug 2621? http://d.puremagic.com/issues/show_bug.cgi?id=2621 Why isn't it allowed anymore? It broke quite a lot of my code. And while it is fixable by doing auto tmp = someFunctionThatRetunsStruct(); someMethodThatAcceptsStruct

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Denis Koroskin
On Sun, 19 Apr 2009 18:26:11 +0400, Steven Schveighoffer wrote: On Sun, 19 Apr 2009 06:26:57 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer wrote: On Sat, 18 Apr 2009 21:10:27 -0400, Andrei Alexandrescu wrote: Adam Burton

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Steven Schveighoffer
On Sun, 19 Apr 2009 10:26:11 -0400, Steven Schveighoffer wrote: On Sun, 19 Apr 2009 06:26:57 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer wrote: On Sat, 18 Apr 2009 21:10:27 -0400, Andrei Alexandrescu wrote: Adam Burto

Re: D2 weak references

2009-04-19 Thread Sean Kelly
Jason House wrote: Jason House wrote: Tango's GC (and therefore druntime's GC) has an explicit notification mechanism. I guess I shouldn't have assumed that the features of tango became part of druntime. I don't see any notification mechanism :( Same as Tango: alias void delegate(Object)

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Steven Schveighoffer
On Sun, 19 Apr 2009 06:26:57 -0400, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer wrote: On Sat, 18 Apr 2009 21:10:27 -0400, Andrei Alexandrescu wrote: Adam Burton wrote: Andrei Alexandrescu wrote: What about using something like

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Steven Schveighoffer
On Sun, 19 Apr 2009 02:00:50 -0400, Don wrote: Steven Schveighoffer wrote: Yeah, I get that it can be done manually. What I'm suggesting is that the compiler makes sure the static assert occurs if thbe result of compiling the template instance results in an empty function. I look at it

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Adam Burton
Adam Burton wrote: > BCS wrote: > >> Hello Adam, >> >>> On Sat, Apr 18, 2009 at 06:10:27PM -0700, Andrei Alexandrescu wrote: >>> The point of using "." is not syntactic convenience as much as the ability of the Dynamic structure to work out of the box with algorithms that use the

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Michel Fortin
On 2009-04-18 22:21:50 -0400, Andrei Alexandrescu said: I did, but sorry, it doesn't make sense and does nothing but continue the terrible confusion going in this thread. Then let's try to remove some of that confusion. You say: well if opDot were a template then a scripting language can't

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Adam Burton
Denis Koroskin wrote: > On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer > wrote: > >> On Sat, 18 Apr 2009 21:10:27 -0400, Andrei Alexandrescu >> wrote: >> >>> Adam Burton wrote: Andrei Alexandrescu wrote: >> What about using something like '->' for dynamic calls instead of >>>

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Adam Burton
BCS wrote: > Hello Adam, > >> On Sat, Apr 18, 2009 at 06:10:27PM -0700, Andrei Alexandrescu wrote: >> >>> The point of using "." is not syntactic convenience as much as the >>> ability of the Dynamic structure to work out of the box with >>> algorithms that use the standard notation. >>> >> Wha

Re: GC object finalization not guaranteed

2009-04-19 Thread Christopher Wright
Daniel Keep wrote: Walter Bright wrote: Leandro Lucarella wrote: Close a connection gracefully for example, I guess (I mean, send a "bye" packed, not just close the socket abruptly). Same for closing files writing some mark or something. They can be risky when finalization is not deterministic

Re: GC object finalization not guaranteed

2009-04-19 Thread Daniel Keep
Walter Bright wrote: > Leandro Lucarella wrote: >> Close a connection gracefully for example, I guess (I mean, send a "bye" >> packed, not just close the socket abruptly). Same for closing files >> writing some mark or something. They can be risky when finalization is >> not >> deterministic thou

temporary objects are not allowed to be pass by ref anymore

2009-04-19 Thread Denis Koroskin
What's a rationale behind an issue described bug 2621? http://d.puremagic.com/issues/show_bug.cgi?id=2621 Why isn't it allowed anymore? It broke quite a lot of my code. And while it is fixable by doing auto tmp = someFunctionThatRetunsStruct(); someMethodThatAcceptsStructByReference(tmp); it l

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Simen Kjaeraas
Adam Burton wrote: What about using something like '->' for dynamic calls instead of '.'? When you see '.' your safe in the knowledge that at a glance you know said method with said signature exists else the compiler will throw a paddy, when you see '->' you know that method call is evaluate

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Denis Koroskin
On Sun, 19 Apr 2009 05:40:32 +0400, Steven Schveighoffer wrote: On Sat, 18 Apr 2009 21:10:27 -0400, Andrei Alexandrescu wrote: Adam Burton wrote: Andrei Alexandrescu wrote: What about using something like '->' for dynamic calls instead of '.'? That's absolutely useless. If I have to w

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread downs
Daniel Keep wrote: > > bearophile wrote: >> downs: >>> bearophile: But a static foreach (on a static data structure that has opApply) is not doable yet, I think. >>> Foreach on a tuple is evaluated at compile-time. >> Yes, that's the whole point of that Range!(). >> But you can't use th

Re: GC object finalization not guaranteed

2009-04-19 Thread Robin KAY
Don wrote: [snip] I think shared memory is an example of memory resource that's not freed by the OS on program exit. Really? That sounds like an OS memory leak. Security issue, too: run your program, allocated shared memory, then exit. Repeat until all memory is exhausted. Run your program