Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Peter Alexander
== Quote from Nick Sabalausky (a...@a.a)'s article > Interesting thing, but devil's advocate: What would be the uses/benefits of > that versus just having "for each element" versions of the operators? Well the obvious benefit is that you don't have to create all those extra version -- you get them

Assigning map result, and in-place map

2010-09-03 Thread Bert van Leeuwen
I'm a D n00b, so excuse my question if it is silly. I've cursorily "followed" D for a few years, but only now bought "The D Programming Language" (great book, very nicely written!) and started to really play with it. I've run into two questions which I have not been able to find the answers to

Re: Miscellaneous memory management questions

2010-09-03 Thread Peter Alexander
== Quote from Simen kjaeraas (simen.kja...@gmail.com)'s article > Peter Alexander wrote: > > 1. How do I disable the GC? > In a way, you don't. You can, however, replace it with a stub GC. Cool. So the stub GC does nothing and has no overhead? > > 4. Any plans for allocators? > None of which I

Re: Assigning map result, and in-place map

2010-09-03 Thread Nick Sabalausky
"Bert van Leeuwen" wrote in message news:i5qftb$2a2...@digitalmars.com... > I'm a D n00b, so excuse my question if it is silly. I've cursorily > "followed" D for a few years, but only now bought "The D Programming > Language" (great book, very nicely written!) and started to really play > with

Re: Assigning map result, and in-place map

2010-09-03 Thread Pelle
On 09/03/2010 11:42 AM, Bert van Leeuwen wrote: 2) Related to above, I want to do something like map, but not return a new array, I want to modify elements in-place in the array. How do I do that? (without explicitly iterating with foreach etc.) I don't know if this is intended to be support

Re: Assigning map result, and in-place map

2010-09-03 Thread Bert van Leeuwen
Thanks! Nick Sabalausky Wrote: > "Bert van Leeuwen" wrote in message > news:i5qftb$2a2...@digitalmars.com... > > I'm a D n00b, so excuse my question if it is silly. I've cursorily > > "followed" D for a few years, but only now bought "The D Programming > > Language" (great book, very nicely w

Re: Assigning map result, and in-place map

2010-09-03 Thread Bert van Leeuwen
Pelle Wrote: > On 09/03/2010 11:42 AM, Bert van Leeuwen wrote: > > > 2) Related to above, I want to do something like map, but not return a new > > array, I want to modify elements in-place in the array. How do I do that? > > (without explicitly iterating with foreach etc.) > > I don't know if

Re: Assigning map result, and in-place map

2010-09-03 Thread Denis Koroskin
On Fri, 03 Sep 2010 14:32:47 +0400, Bert van Leeuwen wrote: Pelle Wrote: On 09/03/2010 11:42 AM, Bert van Leeuwen wrote: > 2) Related to above, I want to do something like map, but not return a new array, I want to modify elements in-place in the array. How do I do that? (without explici

Re: Assigning map result, and in-place map

2010-09-03 Thread Pelle
On 09/03/2010 12:32 PM, Bert van Leeuwen wrote: Pelle Wrote: On 09/03/2010 11:42 AM, Bert van Leeuwen wrote: 2) Related to above, I want to do something like map, but not return a new array, I want to modify elements in-place in the array. How do I do that? (without explicitly iterating wit

Re: Assigning map result, and in-place map

2010-09-03 Thread Bert van Leeuwen
Pelle Wrote: > On 09/03/2010 12:32 PM, Bert van Leeuwen wrote: > > Pelle Wrote: > > > >> On 09/03/2010 11:42 AM, Bert van Leeuwen wrote: > >> > >>> 2) Related to above, I want to do something like map, but not return a > >>> new array, I want to modify elements in-place in the array. How do I do

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Simen kjaeraas
Philippe Sigaud wrote: Hey, this question on SO makes for a good challenge: http://stackoverflow.com/questions/3608834/is-it-possible-to-generically-implement-the-amb-operator-in-d The amb operator does this: amb([1, 2]) * amb([3, 4, 5]) == amb([3, 4, 5, 6, 8, 10]) amb(["hello", "world"]) ~

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Steven Schveighoffer
On Thu, 02 Sep 2010 16:03:59 -0400, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message news:i5ov60$2c5...@digitalmars.com... "Steven Schveighoffer" wrote in message news:op.vieozxaleav...@localhost.localdomain... Love my iPhone. Love it. My last two phones were a Palm Treo and a S

Re: [OT] Dark Star (1974) - the platinum age of movies

2010-09-03 Thread BCS
Hello Nick, "Walter Bright" wrote in message news:i5pa6s$316...@digitalmars.com... Andrei Alexandrescu wrote: The scene was of the main character driving on a busy highway into a crowded metropolis. The meaning was to question the veracity and meaning of perception, existence, and human int

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Justin Johansson
On 02/09/10 05:38, Philippe Sigaud wrote: Hey, this question on SO makes for a good challenge: http://stackoverflow.com/questions/3608834/is-it-possible-to-generically-implement-the-amb-operator-in-d It's great to see someone doing the first D discussion topic with the [challenge] annotation.

Re: Bug 3999 and 4261

2010-09-03 Thread Andrej Mitrovic
I just stumbled upon this in std.typecons: http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#defineEnum Might be useful from some, I guess. On Fri, Sep 3, 2010 at 7:09 AM, Don wrote: >

Re: [OT] Dark Star (1974) - the platinum age of movies

2010-09-03 Thread Justin Johansson
On 03/09/10 23:38, BCS wrote: Venison makes really bad beef. And as long as you expect it to tates like beef it will taste bad. Same goes for most anything, if you think it's something it's not, you'll think it's a bad example of what it's not. It's rather serendipitous that you say that as I r

Re: The new Mono GC

2010-09-03 Thread Craig Black
This would be awesome if the Mono guys were willing to cooperate. -Craig

Re: The new Mono GC

2010-09-03 Thread Justin Johansson
On 02/09/10 08:03, bearophile wrote: Is it possible to try to replace (or just perform experiments) the D GC with this one? http://developers.sones.de/2010/09/01/taking-the-new-and-shiny-mono-simple-generational-garbage-collector-mono-sgen-for-a-walk/ Delegating the creation and management of

Re: Bug 3999 and 4261

2010-09-03 Thread bearophile
Andrej Mitrovic: > I just stumbled upon this in std.typecons: > http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#defineEnum > Might be useful from some, I guess. Thank you. I think std.typecons.defineEnum() may be removed. I don't think it's useful now. Bye, bearophile

[challenge] Hamming numbers

2010-09-03 Thread bearophile
Justin Johansson: > Bearophile, if you are reading this perhaps you might like > to repost some of you previous "challenges" which have not > received much attention with the [challenge] annotation in > the subject line. See: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.

Re: Please comment on http://d-programming-language.org/

2010-09-03 Thread Andrei Alexandrescu
On 9/2/10 21:58 CDT, Boris Wang wrote: I think AA just laid emphasis on the proprietor of d language I didn't participate to the creation of the content or layout. Andrei

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Peter Alexander
== Quote from Simen kjaeraas (simen.kja...@gmail.com)'s article > Yes, very much so. However, Peter Alexander has misunderstood the > ambiguous operator. Hey, I was just going by what the guy posted :) He mentioned nothing of tuples, and his examples certainly didn't show any tuples.

Re: Please comment on http://d-programming-language.org/

2010-09-03 Thread David Gileadi
On 9/3/10 10:43 AM, Andrei Alexandrescu wrote: On 9/2/10 21:58 CDT, Boris Wang wrote: I think AA just laid emphasis on the proprietor of d language I didn't participate to the creation of the content or layout. Andrei Yup, I'm the guy responsible for the new design (like it or hate it), an

Re: The new Mono GC

2010-09-03 Thread Sean Kelly
Justin Johansson Wrote: > On 02/09/10 08:03, bearophile wrote: > > Is it possible to try to replace (or just perform experiments) the D GC > > with this one? > > > > http://developers.sones.de/2010/09/01/taking-the-new-and-shiny-mono-simple-generational-garbage-collector-mono-sgen-for-a-walk/ > >

Re: [challenge] Hamming numbers

2010-09-03 Thread Don
bearophile wrote: Justin Johansson: Bearophile, if you are reading this perhaps you might like to repost some of you previous "challenges" which have not received much attention with the [challenge] annotation in the subject line. See: http://www.digitalmars.com/webnews/newsgroups.php?art_grou

Re: Bug 3999 and 4261

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 11:58 CDT, bearophile wrote: Andrej Mitrovic: I just stumbled upon this in std.typecons: http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#defineEnum Might be useful from some, I guess. Thank you. I think std.typecons.defineEnum() may be removed. I don't think it's useful n

Re: The new Mono GC

2010-09-03 Thread Jacob Carlborg
On 2010-09-03 19:58, Sean Kelly wrote: Justin Johansson Wrote: On 02/09/10 08:03, bearophile wrote: Is it possible to try to replace (or just perform experiments) the D GC with this one? http://developers.sones.de/2010/09/01/taking-the-new-and-shiny-mono-simple-generational-garbage-collector

Re: The new Mono GC

2010-09-03 Thread Steven Schveighoffer
On Wed, 01 Sep 2010 18:33:40 -0400, bearophile wrote: Is it possible to try to replace (or just perform experiments) the D GC with this one? http://developers.sones.de/2010/09/01/taking-the-new-and-shiny-mono-simple-generational-garbage-collector-mono-sgen-for-a-walk/ Delegating the creat

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Philippe Sigaud
On Fri, Sep 3, 2010 at 19:51, Peter Alexander wrote: > == Quote from Simen kjaeraas (simen.kja...@gmail.com)'s article > > Yes, very much so. However, Peter Alexander has misunderstood the > > ambiguous operator. > > Hey, I was just going by what the guy posted :) He mentioned > nothing of tuples

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Philippe Sigaud
On Fri, Sep 3, 2010 at 16:30, Justin Johansson wrote: > On 02/09/10 05:38, Philippe Sigaud wrote: > >> Hey, this question on SO makes for a good challenge: >> >> >> http://stackoverflow.com/questions/3608834/is-it-possible-to-generically-implement-the-amb-operator-in-d >> > > It's great to see so

Re: [challenge] Hamming numbers

2010-09-03 Thread Peter Alexander
== Quote from Don (nos...@nospam.com)'s article > That's not a very useful problem, because the timing depends entirely on > BigInt, which is completely unoptimised for small values. True, but it would be nice to get it as concise as Haskell's. In an ideal world, we'd simply write it as: auto H(

Re: [challenge] Hamming numbers

2010-09-03 Thread bearophile
Don: > That's not a very useful problem, because the timing depends entirely on > BigInt, which is completely unoptimised for small values. You are usually right, but this time what you say is useless. There are other means to judge how good a program is, beside running time: - Total line count

blosc

2010-09-03 Thread bearophile
Something that seems fit for the D2 standard library, a lossless compressor meant to speed up some memory-heavy operations (already used in Pytables): http://blosc.pytables.org/trac Bye, bearophile

this as lvalue?

2010-09-03 Thread JMRyan
I wouldn't have thought of "this" representing an lvalue. However, the following absurdity compiles and executes flawlessly. Just don't uncomment the assignment to y.i! class Yikes { int i; this() { this = null; } } void main() { auto y = new Yikes(); // y.i = 0; } Is this a

Re: [challenge] Hamming numbers

2010-09-03 Thread Don
bearophile wrote: Don: That's not a very useful problem, because the timing depends entirely on BigInt, which is completely unoptimised for small values. You are usually right, but this time what you say is useless. There are other means to judge how good a program is, beside running time: -

Re: Please comment on http://d-programming-language.org/

2010-09-03 Thread Adam B
How is the website programmed? If done properly the page content is independent of the style. Use page templates and CSS stylesheets so that you have a single point of change for the entire website. Stay away from static HTML files. Use PHP, JSP, Freemarker or something similar. Using styleshe

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vigl6wxpeav...@localhost.localdomain... > On Thu, 02 Sep 2010 16:03:59 -0400, Nick Sabalausky wrote: > >> "Nick Sabalausky" wrote in message >> news:i5ov60$2c5...@digitalmars.com... >>> >>> B. Closed platforms are evil (not to be confused with clo

Re: [challenge] Hamming numbers

2010-09-03 Thread bearophile
Don: > Well, I would hate for somebody to waste their time trying to optimise > that problem either for speed or memory consumption, when both are > limited by a fairly simple, short-term library issue. What is the short-term Phobos issue that limits the memory usage? In the current Phobos2 I h

Re: this as lvalue?

2010-09-03 Thread bearophile
JMRyan: > Is this a bug in the compiler (v.2.047)? Am I missing something in > thinking it shouldn't be? I think it's not a bug. It's not a common need, but a method may way want to swap this with another. In Phobos this is done on a struct, see: http://www.dsource.org/projects/phobos/browser/t

Re: this as lvalue?

2010-09-03 Thread Jonathan M Davis
On Friday 03 September 2010 13:22:51 JMRyan wrote: > I wouldn't have thought of "this" representing an lvalue. However, the > following absurdity compiles and executes flawlessly. Just don't > uncomment the assignment to y.i! > > class Yikes > { > int i; > this() { this = null; } > } >

Re: this as lvalue?

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 16:03 CDT, bearophile wrote: JMRyan: Is this a bug in the compiler (v.2.047)? Am I missing something in thinking it shouldn't be? I think it's not a bug. It's not a common need, but a method may way want to swap this with another. In Phobos this is done on a struct, see: http://www

Re: this as lvalue?

2010-09-03 Thread Jonathan M Davis
On Friday 03 September 2010 14:22:46 Andrei Alexandrescu wrote: > On 9/3/10 16:03 CDT, bearophile wrote: > > JMRyan: > >> Is this a bug in the compiler (v.2.047)? Am I missing something in > >> thinking it shouldn't be? > > > > I think it's not a bug. It's not a common need, but a method may way

32-bit Memory Limitations

2010-09-03 Thread John Demme
Hello all- I apologize since I'm sure this question has been asked numerous times previous, but I could not find it in the last 10k messages. Is there a rough time line for 64-bit DMD 2 support? (For Linux--I don't care about Windows.) I understand that Walter is working on it and certainly d

Re: this as lvalue?

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 16:33 CDT, Jonathan M Davis wrote: Still, I don't know how you could make it a true rvalue. It's very simple - make "this" the result of a hypothetical function call. Andrei

Re: The new Mono GC

2010-09-03 Thread Sean Kelly
Jacob Carlborg Wrote: > On 2010-09-03 19:58, Sean Kelly wrote: > > > > It sounds pretty nice, but this bullet point could be a problem: > > > > * Uses write barriers to min i mize the work done on minor collections. > > Why would write barriers be a problem, could you elaborate? I think write ba

Re: Please comment on http://d-programming-language.org/

2010-09-03 Thread David Gileadi
On 9/3/10 1:31 PM, Adam B wrote: How is the website programmed? If done properly the page content is independent of the style. Use page templates and CSS stylesheets so that you have a single point of change for the entire website. Stay away from static HTML files. Use PHP, JSP, Freemarker or

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Steven Schveighoffer
On Fri, 03 Sep 2010 16:36:55 -0400, Nick Sabalausky wrote: "Steven Schveighoffer" wrote in message Then I guess 99% of phones are evil? 99% of phones? Certainly not. 99% of *cell* phones? Absolutely, yes. Service provider lock-in is one of the primary reasons I've never bought one. Yes,

Re: this as lvalue?

2010-09-03 Thread Jonathan M Davis
On Friday 03 September 2010 14:38:27 Andrei Alexandrescu wrote: > On 9/3/10 16:33 CDT, Jonathan M Davis wrote: > > Still, I don't know how you could make it a true rvalue. > > It's very simple - make "this" the result of a hypothetical function call. > > Andrei Ah, that would do it. Though you w

Re: 32-bit Memory Limitations

2010-09-03 Thread bearophile
John Demme: > Is this a one man-week feature or several man-months? I think few Walter-months. Each Walter-month is about three human-months ;-) Bye, bearophile

Re: this as lvalue?

2010-09-03 Thread bearophile
Andrei Alexandrescu: > For classes this must be an rvalue. OK. Why? Bye, bearophile

Re: 32-bit Memory Limitations

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 17:10 CDT, bearophile wrote: John Demme: Is this a one man-week feature or several man-months? I think few Walter-months. Each Walter-month is about three human-months ;-) Should be quicker than that. I think we'll have something usable before the end of this month. Walter wanted

Re: this as lvalue?

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 17:16 CDT, bearophile wrote: Andrei Alexandrescu: For classes this must be an rvalue. OK. Why? If you could change this from within a method you'd pretty much ruin everything about object orientation. Andrei

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Andrei Alexandrescu
On 9/3/10 16:51 CDT, Steven Schveighoffer wrote: Well, it's just that they haven't got to it yet, or maybe they don't feel it's as important as other issues. If something is 99% perfect and you want to point out the 1%, I guess you're entitled to it. But if everything else out there is only 90% p

[OT] Use case for a 4-D matrix

2010-09-03 Thread Tomek Sowiński
Dnia 03-09-2010 o 23:37:18 John Demme napisał(a): (Yes, all of those exponents are 4, not 2. This is actually a 4 dimensional matrix, but for the purpose of most parts of the computation, I can treat it like a typical 2-dim matrix. Not relevant, I suppose, but perhaps interesting.) Very

Re: this as lvalue?

2010-09-03 Thread Jonathan M Davis
On Friday 03 September 2010 15:18:25 Andrei Alexandrescu wrote: > On 9/3/10 17:16 CDT, bearophile wrote: > > Andrei Alexandrescu: > >> For classes this must be an rvalue. > > > > OK. Why? > > If you could change this from within a method you'd pretty much ruin > everything about object orientatio

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Simen kjaeraas
Peter Alexander wrote: == Quote from Simen kjaeraas (simen.kja...@gmail.com)'s article Yes, very much so. However, Peter Alexander has misunderstood the ambiguous operator. Hey, I was just going by what the guy posted :) He mentioned nothing of tuples, and his examples certainly didn't show

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Simen kjaeraas
Philippe Sigaud wrote: Now, the 'real'/intriguing/mind-bending amb operator (from the 60's) does like the Haskell implementation linked in SO does: backtracking on the results to avoid some condition. If someone is up to the challenge of implementing it in D, great! Maybe with closures? I never

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Simen kjaeraas
Simen kjaeraas wrote: I believe this will only work with arrays as input. Either that, or I need a way to make this work: struct Foo( R ) if ( isForwardRange!R ) { bool delegate( ElementType!R ) bar; Filter!( bar, R ) range; } Or, well, something like it. I need a static type for

Re: [OT] Use case for a 4-D matrix

2010-09-03 Thread BCS
Hello Tomek, Dnia 03-09-2010 o 23:37:18 John Demme napisał(a): (Yes, all of those exponents are 4, not 2. This is actually a 4 dimensional matrix, but for the purpose of most parts of the computation, I can treat it like a typical 2-dim matrix. Not relevant, I suppose, but perhaps interesti

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread BCS
Hello Walter, Michel Fortin wrote: Basically, you wanted to do what I did with my website. What was the problem exactly? Creating a style sheet that displays the contents well when read linearly? Or was it about how to trigger this particular style sheet for iPhone and iPods? The later's quite

Re: Logger For D Design Doc

2010-09-03 Thread sybrandy
Apologies, but it appears I left in a section I should have removed...ignore the "NOTES" section that contains a bulleted list. The rest of the document describes everything in that list in better detail. Casey

Logger For D Design Doc

2010-09-03 Thread sybrandy
Hello, As promised, I took some time to create a small document (just a text file) to describe a potential logger for D. Glog was a major influence on how the design turned out, though there are some differences. Please note it's not a 100% solution yet. Hopefully this is closer to what An

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Walter Bright
BCS wrote: Setup a mobile.digitalmars.com that has hosts the same files as www.* but a different .css? A little work with the config files and you might even need only one copy of the files on the server. That might work.

Re: [OT] Dark Star (1974) - the platinum age of movies

2010-09-03 Thread BLS
On 02/09/2010 22:30, bearophile wrote: BLS: But if you like SF, buy the book from Stanislaw Lem. IMO the best SF author and philosopher ever. The SF author I like most is Greg Egan. Any group of ten of his short stories contain more ideas than the whole career of an average SF author :-) Bye

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Walter Bright
Nick Sabalausky wrote: But I have spent a fair amount of time with other Apple products. I even used OSX as my primary system for about a year or two. And (aside from the Apple II, which obviously doesn't quite count) there has never been a piece of Apple software I've used more than a little f

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Andrej Mitrovic
I'm pretty sure that's only for albums which are stored as a single flac file. They usually come with a .cue file which stores track lengths so you can split up the huge flac file into each track as a flac. Then you can have per-track info stored in the flac files themselves. As for splitting a .fl

Re: [OT] Dark Star (1974) - the platinum age of movies

2010-09-03 Thread bearophile
BLS: > Thanks, Is there a book you would recommend from Greg Egan ? To be > honest with you I have never heard about him. Greg Egan is exceptionally good and he invents some of the most incredible ideas, but he's not for everyone. He writes the hardest SF. So if you don't like scientifically a

Re: [Slight OT] TDPL in Russia

2010-09-03 Thread Walter Bright
It still makes no sense to have it as a separate file. Andrej Mitrovic wrote: I'm pretty sure that's only for albums which are stored as a single flac file. They usually come with a .cue file which stores track lengths so you can split up the huge flac file into each track as a flac. Then you ca

Re: The new Mono GC

2010-09-03 Thread Walter Bright
Sean Kelly wrote: I think write barriers in this context are calls out to the GC to notify it of reference changes, and these are generated by the compiler. A language like D that can call inline ASM, external C routines, etc, simply can't provide that guarantee. SafeD maybe. Such write barri

Re: 32-bit Memory Limitations

2010-09-03 Thread John Demme
Excellent. Thanks very much. Andrei Alexandrescu wrote: > On 9/3/10 17:10 CDT, bearophile wrote: >> John Demme: >>> Is this a one man-week feature or several man-months? >> >> I think few Walter-months. >> Each Walter-month is about three human-months ;-) > > Should be quicker than that. I thin

Re: [OT] Use case for a 4-D matrix

2010-09-03 Thread John Demme
Tomek Sowiński wrote: > Dnia 03-09-2010 o 23:37:18 John Demme napisał(a): > >> (Yes, all of those exponents are 4, not 2. This is actually a 4 >> dimensional >> matrix, but for the purpose of most parts of the computation, I can >> treat it >> like a typical 2-dim matrix. Not relevant, I suppo

Re: [Challenge] implementing the ambiguous operator in D

2010-09-03 Thread Philippe Sigaud
On Sat, Sep 4, 2010 at 01:40, Simen kjaeraas wrote: > Simen kjaeraas wrote: > > I believe this will only work with arrays as input. Either that, or I need >> a way to make this work: >> >> struct Foo( R ) if ( isForwardRange!R ) { >> bool delegate( ElementType!R ) bar; >> Filter!( bar,