Re: lazy thoughts

2009-01-13 Thread noobie
Andrei Alexandrescu Wrote: noobie wrote: Andrei Alexandrescu Wrote: int[] arr = [ 1, 2, 3, 4 ]; auto squares = map!(a * a)(arr); arr[] = [ 5, 6, 7, 8 ]; Now iterating squares will see different numbers than the original ones. Okay, what is the problem in maintaining a

Re: new principle of division between structures and classes

2009-01-13 Thread noobie
Interesting. (Link?) http://sourceforge.net/mailarchive/forum.php?thread_name=e8fc97ba090537g3ce284b3m63f6fe2c1543...@mail.gmail.comforum_name=gdalgorithms-list I think Bill was referring to Tom Forsyth's post in that thread.

Re: lazy thoughts

2009-01-13 Thread Robert Fraser
Andrei Alexandrescu wrote: Robert Fraser wrote: Andrei Alexandrescu wrote: Dunno. According to SPJ, automatically parallelizing map was a failed experiment in Haskell. Explicit parallelizing a la pmap seems to be the way to go. Source? I think as processors grow in number, automatic

Re: Warning: volatile does NOT do what you think it does. WRT. DS or similar development.

2009-01-13 Thread downs
Walter Bright wrote: downs wrote: Walter: I'm certain that you thought changing the behavior of volatile was a good idea at the time, ill-defined though it was, but let me assure you, the act left a gaping hole in the language. You are using the GDC back end, and I don't know what it does

Re: Properties

2009-01-13 Thread Christopher Wright
Benji Smith wrote: Nick Sabalausky wrote: John Reimer terminal.n...@gmail.com wrote in message news:28b70f8c119528cb42154f5d1...@news.digitalmars.com... Hello Nick, But, of course, adjectives (just like direct/indirect objects) are themselves nouns. Umm... May I make a little correction

Re: lazy thoughts

2009-01-13 Thread bearophile
Andrei Alexandrescu: I'll wait for bearophile to tell if he feels he hasn't gotten the credit he believes he deserves before I answer this particular point. I'm having a bad week for matters unrelated to D. You are doing lot of work for D, so don't worry for me. I was just a bit sad seeing

Re: lazy thoughts

2009-01-13 Thread Fawzi Mohamed
On 2009-01-13 10:27:10 +0100, Robert Fraser fraseroftheni...@gmail.com said: Andrei Alexandrescu wrote: Robert Fraser wrote: Andrei Alexandrescu wrote: Dunno. According to SPJ, automatically parallelizing map was a failed experiment in Haskell. Explicit parallelizing a la pmap seems to be

Re: Properties

2009-01-13 Thread John Reimer
Hello Christopher, Benji Smith wrote: Nick Sabalausky wrote: John Reimer terminal.n...@gmail.com wrote in message news:28b70f8c119528cb42154f5d1...@news.digitalmars.com... Hello Nick, But, of course, adjectives (just like direct/indirect objects) are themselves nouns. Umm... May I

Re: lazy thoughts

2009-01-13 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: I'll wait for bearophile to tell if he feels he hasn't gotten the credit he believes he deserves before I answer this particular point. I'm having a bad week for matters unrelated to D. You are doing lot of work for D, so don't worry for me. I was just a

BRAINSTORM: return type of 'exception'

2009-01-13 Thread Russell Lewis
So I was listening to the discussion about opApply in the lazy thread. Somebody mentioned that opApply would be better if we could eliminate the int return code. So I thought, well, you could make the unusual situations (return, break, etc.) exceptions, but that would be too slow... Then I

Re: BRAINSTORM: return type of 'exception'

2009-01-13 Thread Benjamin Shropshire
Hello Russell, The idea here is that if you had return type 'exception', then exceptions coming out of that function would be returned as return values rather than thrown with the ordinary mechanism. [...] Thoughts? An interesting idea. Might be of particular use if you have a function (or

Re: BRAINSTORM: return type of 'exception'

2009-01-13 Thread dsimcha
== Quote from Russell Lewis (webmas...@villagersonline.com)'s article So I was listening to the discussion about opApply in the lazy thread. Somebody mentioned that opApply would be better if we could eliminate the int return code. So I thought, well, you could make the unusual situations

Re: writef

2009-01-13 Thread Claus D. Volko
Adam D. Ruppe Wrote: On Sun, Jan 11, 2009 at 10:15:45AM -0500, Claus D. Volko wrote: Thanks for your answer. It sounds plausible to me. Do you know how to manually cause a flush? I've found this code snippet: fflush(stdout); That should do it and is imported in std.stdio; I've tried

Re: writef

2009-01-13 Thread Steven Schveighoffer
Claus D. Volko wrote Adam D. Ruppe Wrote: On Sun, Jan 11, 2009 at 10:15:45AM -0500, Claus D. Volko wrote: Thanks for your answer. It sounds plausible to me. Do you know how to manually cause a flush? I've found this code snippet: fflush(stdout); That should do it and is imported in

Re: lazy thoughts

2009-01-13 Thread Jason House
Andrei Alexandrescu Wrote: bearophile wrote: Andrei Alexandrescu: I'll wait for bearophile to tell if he feels he hasn't gotten the credit he believes he deserves before I answer this particular point. I'm having a bad week for matters unrelated to D. You are doing lot of work for

Re: lazy thoughts

2009-01-13 Thread Bill Baxter
On Wed, Jan 14, 2009 at 7:39 AM, Jason House jason.james.ho...@gmail.com wrote: Point #3 is on the mark. A URL to quality documentstion is worth 100 posts declaring the superiority of dlibs. A URL to browseable source wouldn't hurt either. Given how much you promote your library here, it's

Re: const and mutable declarations in one union

2009-01-13 Thread BCS
Reply to Sergey, Consider following definition: |class Node |{ |union |{ |protected Rect _rect; |const struct |{ |short x, y; |ushort width, height; |} |} |setRect(...) { ... } |} The point is to have a readonly view of

Re: const and mutable declarations in one union

2009-01-13 Thread Sergey Kovrov
On 1/14/2009 2:18 AM, BCS wrote: cost = you can't chnage it invariant = Will not change at all ... Setting it in a decleration my put it in read only memeory or even hard code it into expressions Well this is usually oblivious, but not in case of union. Which might be a little bit

Re: scope as template struct

2009-01-13 Thread Robert Fraser
Christian Kamm wrote: With the features of D2 you can get pretty close to implementing scope classes as a template struct: private final class PlacementNewClass(T) : T { // forward constructors here! new(uint size, byte[__traits(classInstanceSize, PlacementNewClass)] mem) { return mem;

Docs on dsource

2009-01-13 Thread dsimcha
Really stupid question from a total SVN noob: I uploaded some docs to SVN for a dsource project, and linked to them via the project wiki. When I follow the link to the docs, I get an HTML forbidden error. How do I change the permissions in that SVN directory to make the docs viewable as plain

Overload by return type

2009-01-13 Thread dsimcha
Just curious, why doesn't D, and why don't more statically typed languages in general, support overload by return type? I haven't exactly thought through all the pros and cons, but at first glance it seems like an incredibly useful thing. What's the catch that I'm missing?

Re: Docs on dsource

2009-01-13 Thread John Reimer
Hello dsimcha, Really stupid question from a total SVN noob: I uploaded some docs to SVN for a dsource project, and linked to them via the project wiki. When I follow the link to the docs, I get an HTML forbidden error. How do I change the permissions in that SVN directory to make the docs

Re: Overload by return type

2009-01-13 Thread John Reimer
Hello dsimcha, Just curious, why doesn't D, and why don't more statically typed languages in general, support overload by return type? I haven't exactly thought through all the pros and cons, but at first glance it seems like an incredibly useful thing. What's the catch that I'm missing?

Re: Overload by return type

2009-01-13 Thread Tim M
On Wed, 14 Jan 2009 18:31:53 +1300, dsimcha dsim...@yahoo.com wrote: Just curious, why doesn't D, and why don't more statically typed languages in general, support overload by return type? I haven't exactly thought through all the pros and cons, but at first glance it seems like an

Re: timezone problem

2009-01-13 Thread Qian Xu
BTW: Is there any Date.Format(-mm-dd) function?

Re: timezone problem

2009-01-13 Thread Sergey Gromov
Tue, 13 Jan 2009 11:27:40 +0100, Qian Xu wrote: Hi All, I am fighting with date time conversion and have a problem right now: I want to convert a local timestamp to UTC timestamp. So I have to get the time zone information. However in some countries (ie. German, US), the offset is not

Re: timezone problem

2009-01-13 Thread Stewart Gordon
Qian Xu wrote: BTW: Is there any Date.Format(-mm-dd) function? Not in Phobos. But there is such a thing in my utility library: http://pr.stewartsplace.org.uk/d/sutil/ Stewart.

Re: Delegate contravariance

2009-01-13 Thread Steven Schveighoffer
Silvio Ricardo Cordeiro wrote Is there any good reason why the following code doesn't work? The function foo requires as its argument a delegate that receives a B. This means that, because of the type soundness of the D language, the delegate will only be called with instances of B. Now, why

Re: How to append a new line to a File/FileConduit?

2009-01-13 Thread Sam Hu
Thanks.It works now. Regards, Sam