Re: dmd 1.051 and 2.036 release

2009-11-08 Thread Pablo Ripolles
Walter Bright Wrote: http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.036.zip I've noticed that the dmd2/src/druntime/doc/ folder that was on 035 is now gone! is that an expected deletion? Walter, thanks again!

Re: dmd 1.051 and 2.036 release

2009-11-08 Thread Walter Bright
Pablo Ripolles wrote: Walter Bright Wrote: http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.036.zip I've noticed that the dmd2/src/druntime/doc/ folder that was on 035 is now gone! is that an expected deletion? Hmm, probably not! But it can easily be

Re: opPow, opDollar

2009-11-08 Thread Matti Niemenmaa
Stewart Gordon wrote: Andrei Alexandrescu wrote: Matti Niemenmaa wrote: Haskell has three exponentiation operators in the standard library: ^, ^^, and **. They are for non-negative integral exponents, integral exponents, and floating-point exponents respectively. I wonder whether that's an

scope(exit) considered harmful

2009-11-08 Thread Justin Johansson
Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back on again: #if true .. this code is back on now #endif or if (true) { ..

Re: scope(exit) considered harmful

2009-11-08 Thread Jacob Carlborg
On 11/8/09 11:46, Justin Johansson wrote: Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back on again: #if true .. this code

Re: Primary D Website Dilapidated?

2009-11-08 Thread AJ
Jesse Phillips wrote: On Fri, 06 Nov 2009 23:57:24 -0600, AJ wrote: Steven Schveighoffer wrote: Oh, and BTW, invariant is deprecated, use immutable instead. I assume you are referring to the use of 'invariant' in the documentation? If so, you should report it as a bug.

Re: scope(exit) considered FREAKING AWESOME

2009-11-08 Thread downs
auto var = hairilyAllocatedObject(); scope(exit) cleanupObject(var); sock.send(htmlhead/headbody); scope(exit) sock.send(/body/html); logln(Digraph D {); scope(exit) logln(}); SDL_LockSurface(display.surface); scope(exit) SDL_UnlockSurface(display.surface); auto dg = {

Re: scope(exit) considered harmful

2009-11-08 Thread KennyTM~
On Nov 8, 09 18:46, Justin Johansson wrote: Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back on again: #if true .. this

Re: scope(exit) considered harmful

2009-11-08 Thread Ellery Newcomer
Justin Johansson wrote: but in the D world beware the Ides of Scopes because if your curly brace block with the true/false conditional contains a scope(exit) you will get explainable but unexpected behaviour if this code is enabled inside an if(true) block. Elaboration?

Re: scope(exit) considered FREAKING AWESOME

2009-11-08 Thread Daniel Keep
downs wrote: ... http://stackoverflow.com/questions/1247778/is-ds-scope-failure-success-exit-necessary/1248484#1248484

Re: opPow, opDollar

2009-11-08 Thread Bill Baxter
On Sat, Nov 7, 2009 at 2:43 AM, Don nos...@nospam.com wrote: Walter Bright wrote: Don wrote: A little while ago I said I'd create a patch for ^^ as an exponentiation. A couple of people had requested that I make a post to the ng so they'd know when it happens. Here it is. This is opPow(),

Re: scope(exit) considered harmful

2009-11-08 Thread dsimcha
Hey, I never programmed at all seriously in C++ before coming to D and I somehow figured out scope(exit). I'm not even sure you'd be able to pry scope(exit) out of my cold, dead hands. I might super-glue it to my hands on my death bed. Example of where you could do stuff with scope statements

Re: opPow, opDollar

2009-11-08 Thread Stewart Gordon
Matti Niemenmaa wrote: snip It's essentially because Haskell has separate type classes (knda like D interfaces... I won't go into that topic) for integers, fractional numbers, and floating-point numbers. In D the types of those three operators could be something like: anyinteger

foreach syntax, std.mixin

2009-11-08 Thread dsimcha
What are the chances that D gets auto tuple unpacking for foreach loops before D2 goes gold? In other words, it would be nice to write: uint[] foo = [1,2,3,4,5]; uint[] bar = [6,7,8,9,10]; foreach(a, b; zip(foo, bar)) { // Does what you think it does. } Also, how about foreach over ranges

Re: scope(exit) considered harmful

2009-11-08 Thread Bill Baxter
On Sun, Nov 8, 2009 at 8:12 AM, dsimcha dsim...@yahoo.com wrote: Hey, I never programmed at all seriously in C++ before coming to D and I somehow figured out scope(exit).  I'm not even sure you'd be able to pry scope(exit) out of my cold, dead hands.  I might super-glue it to my hands on my

Re: Arrays passed by almost reference?

2009-11-08 Thread Ali Cehreli
Andrei Alexandrescu Wrote: Ali Cehreli wrote: I don't think that this is easy to explain to a learner; and I think that is a good indicator that there is a problem with these semantics. The ball is in your court to define better semantics. Andrei I thought I passed the ball back to

Re: scope(exit) considered harmful

2009-11-08 Thread Walter Bright
Bill Baxter wrote: Well, in C++ you'd probably wrap up myRegionAllocator in a struct and put the .destroy call in its destructor. For use you'd put an instance of the struct on the stack. But scope(exit) is much more convenient than having to put all your cleanup code into a struct.

Re: scope(exit) considered harmful

2009-11-08 Thread Walter Bright
Justin Johansson wrote: Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back on again: #if true .. this code is back on now

Re: scope(exit) considered harmful

2009-11-08 Thread Justin Johansson
Ellery Newcomer Wrote: Justin Johansson wrote: but in the D world beware the Ides of Scopes because if your curly brace block with the true/false conditional contains a scope(exit) you will get explainable but unexpected behaviour if this code is enabled inside an if(true) block.

Re: opPow, opDollar

2009-11-08 Thread Matti Niemenmaa
Stewart Gordon wrote: Matti Niemenmaa wrote: snip It's essentially because Haskell has separate type classes (knda like D interfaces... I won't go into that topic) for integers, fractional numbers, and floating-point numbers. In D the types of those three operators could be something

Re: scope(exit) considered harmful

2009-11-08 Thread Justin Johansson
Walter Bright Wrote: Justin Johansson wrote: Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back

Re: scope(exit) considered harmful

2009-11-08 Thread Don
Walter Bright wrote: Justin Johansson wrote: Long ago in the days before D, I was used to commenting out code with one of two idioms: #if false .. this code is not compiled #endif or if (false) { .. this code is compiled but not executed } and to turn stuff back on again: #if true .. this

Re: scope(exit) considered FREAKING AWESOME

2009-11-08 Thread Justin Johansson
downs Wrote: auto var = hairilyAllocatedObject(); scope(exit) cleanupObject(var); sock.send(htmlhead/headbody); scope(exit) sock.send(/body/html); logln(Digraph D {); scope(exit) logln(}); SDL_LockSurface(display.surface); scope(exit) SDL_UnlockSurface(display.surface); auto dg =

Re: scope(exit) considered harmful

2009-11-08 Thread Bill Baxter
On Sun, Nov 8, 2009 at 10:44 AM, Justin Johansson n...@spam.com wrote: Can you understand my frustration? Yes, I can certainly understand that it's difficult to use scope() constructs when you haven't understood what a scope is. But that's not much of an argument against them. The same rant

Re: scope(exit) considered harmful

2009-11-08 Thread Justin Johansson
dsimcha Wrote: Hey, I never programmed at all seriously in C++ before coming to D and I somehow figured out scope(exit). I'm not even sure you'd be able to pry scope(exit) out of my cold, dead hands. I might super-glue it to my hands on my death bed. Example of where you could do

Re: scope(exit) considered harmful

2009-11-08 Thread Justin Johansson
Bill Baxter Wrote: On Sun, Nov 8, 2009 at 10:44 AM, Justin Johansson n...@spam.com wrote: Can you understand my frustration? Yes, I can certainly understand that it's difficult to use scope() constructs when you haven't understood what a scope is. But that's not much of an argument

Re: foreach syntax, std.mixin

2009-11-08 Thread Bill Baxter
On Sun, Nov 8, 2009 at 9:10 AM, dsimcha dsim...@yahoo.com wrote: What are the chances that D gets auto tuple unpacking for foreach loops before D2 goes gold?  In other words, it would be nice to write: uint[] foo = [1,2,3,4,5]; uint[] bar = [6,7,8,9,10]; foreach(a, b; zip(foo, bar)) {    

Re: foreach syntax, std.mixin

2009-11-08 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article On Sun, Nov 8, 2009 at 9:10 AM, dsimcha dsim...@yahoo.com wrote: What are the chances that D gets auto tuple unpacking for foreach loops b efore D2 goes gold?  In other words, it would be nice to write: uint[] foo = [1,2,3,4,5];

Re: scope(exit) considered harmful

2009-11-08 Thread Walter Bright
Justin Johansson wrote: which was my desired behaviour. I guess I don't understand what the gotcha is, then. Can you be explicit?

Re: scope(exit) considered harmful

2009-11-08 Thread Walter Bright
Justin Johansson wrote: Acknowledge this is what happens with D's scope(exit) as well though to me it doesn't seem as intuitive as its C++ counterpart. It does say scope exit, not function exit. I think it is intuitive.

Re: scope(exit) considered harmful

2009-11-08 Thread Walter Bright
Justin Johansson wrote: C++ constructors/destructors and stack-unwinding mechanism are considered FREAKING AWESOME. Ok, good. Now write (using C++ RAII) the following where both transactions must succeed or neither: void foo() { A(); scope (failure) undo_A(); B(); scope

Re: foreach syntax, std.mixin

2009-11-08 Thread Philippe Sigaud
On Sun, Nov 8, 2009 at 21:14, dsimcha wrote: function like in python. Which does something like zip(iota(1,bar.length),bar). I think the index variant would better be done as an enumerate() Enumerate is a great idea. It's probably much better than requiring every range struct to mix

Re: opPow, opDollar

2009-11-08 Thread Philippe Sigaud
On Sat, Nov 7, 2009 at 17:33, Pelle Månsson pelle.mans...@gmail.com wrote: I am all in favor of adding convenience functions sum and product to phobos. I use them both often enough. vote++ And also min (on a range), max (on a range). Those are simple one-liners, though they can create some

Re: opPow, opDollar

2009-11-08 Thread Philippe Sigaud
On Sat, Nov 7, 2009 at 20:22, dsimcha dsim...@yahoo.com wrote: == Quote from Robert Jacques (sandf...@jhu.edu)'s article I'd recommend rolling that into a basic statistics struct containing common single pass metrics: i.e. sum, mean, variance, min, max, etc. I've been wondering for a while

Re: scope(exit) considered FREAKING AWESOME

2009-11-08 Thread downs
Justin Johansson wrote: downs Wrote: auto var = hairilyAllocatedObject(); scope(exit) cleanupObject(var); sock.send(htmlhead/headbody); scope(exit) sock.send(/body/html); logln(Digraph D {); scope(exit) logln(}); SDL_LockSurface(display.surface); scope(exit)

Re: scope(exit) considered harmful

2009-11-08 Thread Andrei Alexandrescu
Justin Johansson wrote: dsimcha Wrote: Hey, I never programmed at all seriously in C++ before coming to D and I somehow figured out scope(exit). I'm not even sure you'd be able to pry scope(exit) out of my cold, dead hands. I might super-glue it to my hands on my death bed. Example of where

Re: foreach syntax, std.mixin

2009-11-08 Thread dsimcha
== Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article dsimcha wrote: Makes me wonder why noone thought of this until now, or maybe someone did and I forgot. How's: foreach(fooElem, barElem; unpack(zip(foo, bar))) {}, or: foreach(i, elem; enumerate(chain(foo, bar)))

Re: scope(exit) considered harmful

2009-11-08 Thread Lutger
Justin Johansson wrote: ... If scope(exit) is meant to be some mechanism for saving try/finally boiler-plate code, it is a can of worms, otherwise it is a can of i-dont-know-what-it's-good-for. It is that, but also used where you could otherwise use RAII a la C++. To my way of thinking,

Re: scope(failure) considered FREAKING AWESOME

2009-11-08 Thread Justin Johansson
Walter Bright Wrote: Justin Johansson wrote: C++ constructors/destructors and stack-unwinding mechanism are considered FREAKING AWESOME. Ok, good. Now write (using C++ RAII) the following where both transactions must succeed or neither: void foo() { A(); scope (failure)

Re: SIMD/intrinsincs questions

2009-11-08 Thread Lutger
Mike Farnsworth wrote: ... Of course, there are some operations that the available SSE intrinsics cover that the compiler can't expose via the typical operators, so those still need to be supported somehow. Does anyone know if ldc or dmd has those, or if they'll optimize away SSE loads and

Re: Semantics of toString

2009-11-08 Thread Lutger
Justin Johansson wrote: ... So what does toString mean to you? Whatever you got, give it to me as a string for my printf debugging while my debugger is broken.

Re: Semantics of toString

2009-11-08 Thread Lutger
Justin Johansson wrote: I assert that the semantics of toString or similarly named/purposed methods/functions in many PL's (including and not limited to D) is ill-defined. To put this statement into perspective, I would be most appreciative of D NG readers responding with their own idea(s)

Re: scope(exit) considered FREAKING AWESOME

2009-11-08 Thread BCS
Hello Justin, Your examples look fine if one assumes scope(exit) as relating to function scope. If you expect scope(exit) to trigger on exiting the function you will be in error. It's called /scope/ exit because it triggers on exit from ANY scope.

Re: foreach syntax, std.mixin

2009-11-08 Thread bearophile
Bill Baxter: Or I suppose it could be a special syntax in foreach for now. D has an already very large amount of for now inside. Let's start designing things correctly tidy from the start instead, for a change (and let's generalize some of the already present things). Bye, bearophile

Re: foreach syntax, std.mixin

2009-11-08 Thread Bill Baxter
On Sun, Nov 8, 2009 at 1:43 PM, dsimcha dsim...@yahoo.com wrote: == Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article dsimcha wrote: Makes me wonder why noone thought of this until now, or maybe someone did and I forgot.  How's: foreach(fooElem, barElem; unpack(zip(foo,

Re: opPow, opDollar

2009-11-08 Thread Tim Matthews
Walter Bright wrote: Andrei Alexandrescu wrote: In order for everyone to air an informed opinion, a related question is: will loop fusion be allowed with function calls? Loop fusion currently only works with operators, and adding ^^ would allow: a[] = b[] ^^ 3; But with pow you can't do

Re: foreach syntax, std.mixin

2009-11-08 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article On Sun, Nov 8, 2009 at 1:43 PM, dsimcha dsim...@yahoo.com wrote: == Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article dsimcha wrote: Makes me wonder why noone thought of this until now, or maybe someone did and I

Request for comment _ survey of the 'D programming language ' community.

2009-11-08 Thread Nick B
What is the definition that this community is succeeding / making progress ? I would like to propose there is _only_ one. That the community is growing from year to year. From ten years ago when Walter, started the D project it certainly has grown, but compared to one year ago, has it grown

Re: SIMD/intrinsincs questions

2009-11-08 Thread Robert Jacques
On Sun, 08 Nov 2009 17:47:31 -0500, Lutger lutger.blijdest...@gmail.com wrote: Mike Farnsworth wrote: ... Of course, there are some operations that the available SSE intrinsics cover that the compiler can't expose via the typical operators, so those still need to be supported somehow.

Re: Request for comment _ survey of the 'D programming language ' community.

2009-11-08 Thread Travis Boucher
Nick B wrote: What is the definition that this community is succeeding / making progress ? I would like to propose there is _only_ one. That the community is growing from year to year. From ten years ago when Walter, started the D project it certainly has grown, but compared to one year

Re: Request for comment _ survey of the 'D programming language ' community.

2009-11-08 Thread Leandro Lucarella
Nick B, el 9 de noviembre a las 15:19 me escribiste: What is the definition that this community is succeeding / making progress ? I would like to propose there is _only_ one. That the community is growing from year to year. From ten years ago when Walter, started the D project it

Re: Semantics of toString

2009-11-08 Thread Justin Johansson
Lutger Wrote: Justin Johansson wrote: I assert that the semantics of toString or similarly named/purposed methods/functions in many PL's (including and not limited to D) is ill-defined. To put this statement into perspective, I would be most appreciative of D NG readers responding

Re: Request for comment _ survey of the 'D programming language ' community.

2009-11-08 Thread Nick B
Leandro Lucarella wrote: Nick B, el 9 de noviembre a las 15:19 me escribiste: What is the definition that this community is succeeding / making progress ? Git does a very nice and useful survey each year: http://git.or.cz/gitwiki/GitSurvey2009 An DVCS is not the same as a language, but

Re: SIMD/intrinsincs questions

2009-11-08 Thread Michael Farnsworth
On 11/08/2009 06:35 PM, Robert Jacques wrote: On Sun, 08 Nov 2009 17:47:31 -0500, Lutger lutger.blijdest...@gmail.com wrote: Mike Farnsworth wrote: ... Of course, there are some operations that the available SSE intrinsics cover that the compiler can't expose via the typical operators, so

Re: SIMD/intrinsincs questions

2009-11-08 Thread Robert Jacques
On Mon, 09 Nov 2009 01:53:11 -0500, Michael Farnsworth mike.farnswo...@gmail.com wrote: On 11/08/2009 06:35 PM, Robert Jacques wrote: On Sun, 08 Nov 2009 17:47:31 -0500, Lutger lutger.blijdest...@gmail.com wrote: Mike Farnsworth wrote: ... Of course, there are some operations that the

Re: CTFE and structs question

2009-11-08 Thread Bill Baxter
On Sat, Nov 7, 2009 at 10:40 PM, Don nos...@nospam.com wrote: You can create them without templates. std.metastrings was created before CTFE existed, it's rather outdated. It's intended for use with template metaprogramming, not for use with CTFE. I posted about this the other day, wouldn't

Re: CTFE and structs question

2009-11-08 Thread g
Don Wrote: You can do stuff like: struct Foo { int x; } enum Foo b = Foo(56); strange. you can do that only if there is no constructor. Also trying with templates, i got a segfault, i dont know if it is already reported. Why this segfaults?. At least it should print a error

Re: CTFE and structs question

2009-11-08 Thread Don
g wrote: Don Wrote: You can do stuff like: struct Foo { int x; } enum Foo b = Foo(56); strange. you can do that only if there is no constructor. It also works with opCall. ctor calls don't yet work in CTFE calls from module scope (works OK inside a function) -- structural problem

GDI+ in D (was: Win32 to D)

2009-11-08 Thread Stewart Gordon
nomad wrote: I would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point destPoint, GDIPCONST Rect srcRect, Unit srcUnit,

[Issue 3483] Eliminate read-modify-write operations for enums

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3483 Stewart Gordon s...@iname.com changed: What|Removed |Added CC||s...@iname.com ---

[Issue 3481] PATCH: opPow(), x ^^ y as a power operator

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3481 --- Comment #7 from Stewart Gordon s...@iname.com 2009-11-08 06:55:47 PST --- (In reply to comment #6) Logical xor is already in the language, its symbol is !=. Not quite. For example, 1 != 2 evaluates to true, whereas if ^^ is defined as a

[Issue 3488] New: Segfault(expression.c): enum declared with struct initializer in template

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3488 Summary: Segfault(expression.c): enum declared with struct initializer in template Product: D Version: 2.036 Platform: Other OS/Version: Windows Status: NEW

[Issue 3489] New: Address family not supported by protocol family on freebsd

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3489 Summary: Address family not supported by protocol family on freebsd Product: D Version: unspecified Platform: x86 OS/Version: FreeBSD Status: NEW

[Issue 2000] listener.d fixups

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2000 changlon chang...@gmail.com changed: What|Removed |Added CC||chang...@gmail.com ---

[Issue 3489] Address family not supported by protocol family on freebsd

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3489 --- Comment #1 from changlon chang...@gmail.com 2009-11-08 09:24:08 PST --- import std.stdio, std.socket, std.socketstream, std.stream; void main(){ auto Socket sock = new TcpSocket(new

[Issue 3488] Segfault(expression.c): enum declared with struct initializer in template

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3488 g sockpupp...@hotmail.com changed: What|Removed |Added CC||sockpupp...@hotmail.com

[Issue 3488] Segfault(expression.c): enum declared with struct static initializer

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3488 Don clugd...@yahoo.com.au changed: What|Removed |Added Summary|Segfault(expression.c): |Segfault(expression.c):

[Issue 3489] Address family not supported by protocol family on freebsd

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3489 --- Comment #2 from changlon chang...@gmail.com 2009-11-08 19:22:21 PST --- freebsd 7.1 release have the same error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because:

[Issue 3489] Address family not supported by protocol family on freebsd

2009-11-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3489 --- Comment #3 from changlon chang...@gmail.com 2009-11-08 20:46:08 PST --- the follow code can raise the same error : import std.socket; void main(){ auto sock = new TcpSocket(new InternetAddress(127.0.0.1, 80)); } --