Re: Kitchener Wants You...r programmer friends who don't know D

2009-12-09 Thread Andrei Alexandrescu
Rory McGuire wrote: Andrei Alexandrescu wrote: TDPL is entering a review stage where a collection of coders from all walks of programming life will have one month to submit feedback that will shape the final version of the book. The book has been blessed with feedback from people who alrea

Re: Semantics of ^^

2009-12-09 Thread Chris Nicholson-Sauls
Bill Baxter wrote: On Tue, Dec 8, 2009 at 7:24 PM, Don wrote: * If y == 0, x ^^ y is 1. Need to mention what happens when x is also 0. No. 0^^0 is 1, as well. Is it? That's rather embarrassing for Wolfram Alpha, then (and presumably Mathematica, too) since they have it as "indeterminate"

Re: Kitchener Wants You...r programmer friends who don't know D

2009-12-09 Thread Rory McGuire
Andrei Alexandrescu wrote: > TDPL is entering a review stage where a collection of coders from all > walks of programming life will have one month to submit feedback that > will shape the final version of the book. > > The book has been blessed with feedback from people who already know D >

Evaluation order

2009-12-09 Thread bearophile
Problems in defining the order of evaluations in C#: http://blogs.msdn.com/ericlippert/archive/2009/11/25/the-purpose-revealed.aspx And eventually the named arguments too will see light in D :-) Bye, bearophile

Re: Proof of Concept: Binding to and extending C++ objects via a metricfuckton of templates

2009-12-09 Thread Nick Sabalausky
"BCS" wrote in message news:a6268ffdff18cc46f7aa8b7...@news.digitalmars.com... > please tell me the subject is a freudian slip (or just a typo). > > It's a very precise figure: 1 metric fuckton == 1,000 meteric shitloads

Re: Proof of Concept: Binding to and extending C++ objects via a metricfuckton of templates

2009-12-09 Thread downs
retard wrote: > Thu, 10 Dec 2009 01:01:34 +0100, downs wrote: > >> including such gems as incorrect >> tuple lengths, incorrect tuple slices, endless errors without line >> numbers, spurious template instantiation errors with nonsensical >> parameters, and at least one case where T[0] evaluated to

Re: Proof of Concept: Binding to and extending C++ objects via a metricfuckton of templates

2009-12-09 Thread retard
Thu, 10 Dec 2009 01:01:34 +0100, downs wrote: > including such gems as incorrect > tuple lengths, incorrect tuple slices, endless errors without line > numbers, spurious template instantiation errors with nonsensical > parameters, and at least one case where T[0] evaluated to T, > necessitating th

Re: Proof of Concept: Binding to and extending C++ objects via a metric fuckton of templates

2009-12-09 Thread downs
dsimcha wrote: > == Quote from downs (default_357-l...@yahoo.de)'s article >> I've just committed a module to tools (tools.cpp, > http://dsource.org/projects/scrapple/Trunk/tools/tools/cpp.d ) that should > enable > linking and using any C++ library with D programs without creating a C > wrapper

Re: Proof of Concept: Binding to and extending C++ objects via a metricfuckton of templates

2009-12-09 Thread downs
BCS wrote: > please tell me the subject is a freudian slip (or just a typo). > > Considering the amount of abuse me and the compiler put each other through in the course of writing this, including such gems as incorrect tuple lengths, incorrect tuple slices, endless errors without line numbers,

Re: Proof of Concept: Binding to and extending C++ objects via a metric

2009-12-09 Thread downs
g wrote: > downs Wrote: > >> I've just committed a module to tools (tools.cpp, >> http://dsource.org/projects/scrapple/Trunk/tools/tools/cpp.d ) that should >> enable linking and using any C++ library with D programs without creating a >> C wrapper for it. >> >> The code has been tested with a

Re: Proof of Concept: Binding to and extending C++ objects via a metric fuckton of templates

2009-12-09 Thread dsimcha
== Quote from downs (default_357-l...@yahoo.de)'s article > I've just committed a module to tools (tools.cpp, http://dsource.org/projects/scrapple/Trunk/tools/tools/cpp.d ) that should enable linking and using any C++ library with D programs without creating a C wrapper for it. > The code has bee

Re: Proof of Concept: Binding to and extending C++ objects via a metric

2009-12-09 Thread g
downs Wrote: > I've just committed a module to tools (tools.cpp, > http://dsource.org/projects/scrapple/Trunk/tools/tools/cpp.d ) that should > enable linking and using any C++ library with D programs without creating a C > wrapper for it. > > The code has been tested with a simple multiple-in

Re: Proof of Concept: Binding to and extending C++ objects via a metric

2009-12-09 Thread g
omg

Re: More on semantics of opPow: return type

2009-12-09 Thread bearophile
Joel C. Salomon: > Then we may have to convince Walter not to eliminate the extra > comparison operators. They don't add that much to the language, while they are not easy to remember and add complexity. So I think that even serious numeric programmers will not miss them too much. But I don't p

Re: Proof of Concept: Binding to and extending C++ objects via a metricfuckton of templates

2009-12-09 Thread BCS
please tell me the subject is a freudian slip (or just a typo).

Proof of Concept: Binding to and extending C++ objects via a metric fuckton of templates

2009-12-09 Thread downs
I've just committed a module to tools (tools.cpp, http://dsource.org/projects/scrapple/Trunk/tools/tools/cpp.d ) that should enable linking and using any C++ library with D programs without creating a C wrapper for it. The code has been tested with a simple multiple-inheritance sample: http://

Re: More on semantics of opPow: return type

2009-12-09 Thread Joel C. Salomon
On 12/7/2009 5:37 PM, bearophile wrote: > Lars T. Kyllingstad: >> I searched for FORTRAN code because that's more or less equivalent to >> searching for numerical code. And I think D's "target audience" is >> anyone who needs a fast, close-to-the-metal programming language. This >> definitely in

Unique Objects

2009-12-09 Thread Bartosz Milewski
I have posted a blog about the state-of-the-art results in uniqueness. I discuss the paper by Haller/Odersky, where they present an extension to Scala. I would appreciate your vote on reddit: http://www.reddit.com/r/programming/comments/acsg8/unique_objects/

Kitchener Wants You...r programmer friends who don't know D

2009-12-09 Thread Andrei Alexandrescu
TDPL is entering a review stage where a collection of coders from all walks of programming life will have one month to submit feedback that will shape the final version of the book. The book has been blessed with feedback from people who already know D or are otherwise versed enough with langu

Re: Static member functions

2009-12-09 Thread Jérôme M. Berger
Michal Minich wrote: Hello Denis, OTOH, if you want to protect yourself from (accidental) global state mutation, you are free to declare your static function as pure: struct X { static int x; static void foo() pure { // x = 3; // error } static void bar() { x = 3; // okay } } I was thinking

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Rainer Deyke
Don wrote: > Rainer Deyke wrote: > One that may not survive future >> evolution of the D language, and may not respected by other >> implementations of the D language. > > I think you're confusing 'pure' with 'constant expression'. They are not > the same thing. No. > (I /should/ be removed.

Re: About 0^^0

2009-12-09 Thread Janzert
On 12/9/2009 11:50 AM, Bill Baxter wrote: Found this link about 0^^0: http://mathforum.org/dr.math/faq/faq.0.to.0.power.html I think this explains pretty well why Wolfram is justified in saying 0^^0 is indeterminate, but a PL like D is perfectly justified in saying it's 1. In particular the art

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Andrei Alexandrescu
Andrei Alexandrescu wrote: On a non-degenerate base, any exponent greater than 32 (for int) and 64 (for long) would generate overflow. That can be figured with one test. In fact probably all exponents can be special-cased to use the minimal amount of multiplications (which in the general case

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Andrei Alexandrescu
KennyTM~ wrote: On Dec 9, 09 17:25, Simen kjaeraas wrote: On Wed, 09 Dec 2009 09:36:56 +0100, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as

Re: Semantics of ^^

2009-12-09 Thread Lars T. Kyllingstad
Bill Baxter wrote: On Tue, Dec 8, 2009 at 7:24 PM, Don wrote: * If y == 0, x ^^ y is 1. Need to mention what happens when x is also 0. No. 0^^0 is 1, as well. Is it? That's rather embarrassing for Wolfram Alpha, then (and presumably Mathematica, too) since they have it as "indeterminate"

About 0^^0

2009-12-09 Thread Bill Baxter
Found this link about 0^^0: http://mathforum.org/dr.math/faq/faq.0.to.0.power.html I think this explains pretty well why Wolfram is justified in saying 0^^0 is indeterminate, but a PL like D is perfectly justified in saying it's 1. In particular the article asserts: "Consensus has recently been b

Re: More on semantics of opPow: return type

2009-12-09 Thread Bill Baxter
On Tue, Dec 8, 2009 at 8:07 PM, Don wrote: > Bill Baxter wrote: >> >> On Tue, Dec 8, 2009 at 10:18 AM, Bill Baxter wrote: I agree. Then at least why not make the type of the exponent unsigned? That gives the type system a fighting chance (via e.g. value range propagation)

Re: Semantics of ^^

2009-12-09 Thread Bill Baxter
On Tue, Dec 8, 2009 at 7:24 PM, Don wrote: >>> * If y == 0,  x ^^ y is 1. >> >> Need to mention what happens when x is also 0. > > No.  0^^0 is 1, as well. Is it? That's rather embarrassing for Wolfram Alpha, then (and presumably Mathematica, too) since they have it as "indeterminate": http:/

Re: enhancing enums

2009-12-09 Thread Jeremie Pelletier
Lars T. Kyllingstad wrote: Jeremie Pelletier wrote: hehe45 wrote: In c++ it is valid syntax to have trailing commas at the and of enum definitions: enum {a, b, c, }; This would be a useful addition to D too. The enum class syntax from c++0x should also adopted by D, this would allow named en

Re: dsource is unusable

2009-12-09 Thread Kagamin
Mike Parker Wrote: > AFAIK, zip archives can be automatically generated from a link at the > bottom of any page in the source browser. For example, you can download > the entire Derelict trunk on this page: > > http://www.dsource.org/projects/derelict/browser/trunk Ah, thank you, missed that.

Re: dsource is unusable

2009-12-09 Thread Mike Parker
Kagamin wrote: > So svn access in unusable with dsource and I found no feasible method to get sources from it. Projects don't publish snapshots and trac doesn't provide them either. AFAIK, zip archives can be automatically generated from a link at the bottom of any page in the source browser.

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x or y are floating-point, the result is pow(x, y). If both x a

Re: Semantics of ^^

2009-12-09 Thread Don
Don wrote: Jason House wrote: I think you have a bad corner case: enum int ct = -1; immutable rt = -1; ct ^^ ct // Error (compile time) This would always get rewritten. rt ^^ ct // Error (compile time) rt ^^ rt // Error (run time) ct ^^ rt // Works??? (after rewrite) No, they will all wor

Re: Semantics of ^^

2009-12-09 Thread Don
Jason House wrote: I think you have a bad corner case: enum int ct = -1; immutable rt = -1; ct ^^ ct // Error (compile time) rt ^^ ct // Error (compile time) rt ^^ rt // Error (run time) ct ^^ rt // Works??? (after rewrite) No, they will all work. Both rt and ct are manifest constants.

Re: Semantics of ^^

2009-12-09 Thread Jason House
oops, my message was supposed to be in reply to version 3 that included the rewrite rule for -1 ^^ y Jason House Wrote: > I think you have a bad corner case: > > enum int ct = -1; > immutable rt = -1; > > ct ^^ ct // Error (compile time) > rt ^^ ct // Error (compile time) > rt ^^ rt // Error (

Re: Semantics of ^^

2009-12-09 Thread Jason House
I think you have a bad corner case: enum int ct = -1; immutable rt = -1; ct ^^ ct // Error (compile time) rt ^^ ct // Error (compile time) rt ^^ rt // Error (run time) ct ^^ rt // Works??? (after rewrite) Don Wrote: > Based on everyone's comments, this is what I have come up with: > >

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread bearophile
KennyTM~: > Because 3^^-1 would become 3^^4294967295 I agree, no unsigned values, please. In D unsigned values are bug-prone, it's better to avoid them when possible, they are useful almost only when you need a bitfield (they are useful for arithmetic only exceptionally, when you really need a p

Re: dsource is unusable

2009-12-09 Thread Kagamin
Denis Koroskin Wrote: > I don't think it is dsource problem, it's rather an svn problem. > When using TortoiseSVN, you can go to > Start/Program/TortoiseSVN/Settings/Network/ and specify your proxy. > Internet folks say it helps. I believe there should be similar > configuration option for c

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Rainer Deyke wrote: Don wrote: f() ^^ f() is not a constant expression. It won't get transformed. It can be *interpreted* at compile time, but that'll generate an error. That's a very fine distinction. Yes. This is a very narrow special case. Bill Baxter and others have argued that it is s

Re: dsource is unusable

2009-12-09 Thread Denis Koroskin
On Wed, 09 Dec 2009 14:57:47 +0300, Kagamin wrote: I have well-known problem with svn client: proxy doesn't allow svn report http requests: svn: Server sent unexpected return value (400 Bad Request) in response to REPORT request for '/repos/svn/!svn/vcc/default' So svn access in unusable w

dsource is unusable

2009-12-09 Thread Kagamin
I have well-known problem with svn client: proxy doesn't allow svn report http requests: svn: Server sent unexpected return value (400 Bad Request) in response to REPORT request for '/repos/svn/!svn/vcc/default' So svn access in unusable with dsource and I found no feasible method to get source

Re: A history lesson for D

2009-12-09 Thread William Martin
Justin Johansson Wrote: > Algol-68 came out in, well, 1968. Apparently the language was > considered 'finished' with the release of the Revision of Algol-68 > in 1974. By this time it was too late for the language to gain any > real traction. > > A number of contemporary topics on this newsgro

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Rainer Deyke
Don wrote: > f() ^^ f() is not a constant expression. It won't get transformed. It > can be *interpreted* at compile time, but that'll generate an error. That's a very fine distinction. One that may not survive future evolution of the D language, and may not respected by other implementations of

Re: Static member functions

2009-12-09 Thread Michal Minich
Hello Tomek, Dnia 08-12-2009 o 20:09:10 Tomek Sowiński napisał(a): I think immutable static member functions don't make sense and rightly so. On functions immutable is about "this" and there's no "this". Currently everything inside an immutable struct/class is tagged with "immutable".

Re: Static member functions

2009-12-09 Thread Michal Minich
Hello Denis, OTOH, if you want to protect yourself from (accidental) global state mutation, you are free to declare your static function as pure: struct X { static int x; static void foo() pure { // x = 3; // error } static void bar() { x = 3; // okay } } I was thinking about providing contra

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Don wrote: Rainer Deyke wrote: Don wrote: Rainer Deyke wrote: Not quite. Under the proposal, -1^^-1 works (i.e. produces the correct result) at compile time but fails at runtime. It won't pass CTFE. pure int f() { return -1; } void g(int)(int); g!(f() ^^ f())(0); // Works. No, it doesn't

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Rainer Deyke wrote: Don wrote: Rainer Deyke wrote: Not quite. Under the proposal, -1^^-1 works (i.e. produces the correct result) at compile time but fails at runtime. It won't pass CTFE. pure int f() { return -1; } void g(int)(int); g!(f() ^^ f())(0); // Works. No, it doesn't work. It's

A history lesson for D

2009-12-09 Thread Justin Johansson
Algol-68 came out in, well, 1968. Apparently the language was considered 'finished' with the release of the Revision of Algol-68 in 1974. By this time it was too late for the language to gain any real traction. A number of contemporary topics on this newsgroup should be tempered with a soberi

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Rainer Deyke
Don wrote: > Rainer Deyke wrote: >> Not quite. Under the proposal, -1^^-1 works (i.e. produces the correct >> result) at compile time but fails at runtime. > > It won't pass CTFE. pure int f() { return -1; } void g(int)(int); g!(f() ^^ f())(0); // Works. g!(0)(f() ^^ f()); // Runtime error? 'f(

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Simen kjaeraas wrote: On Wed, 09 Dec 2009 09:36:56 +0100, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Rainer Deyke wrote: Lars T. Kyllingstad wrote: Rainer Deyke wrote: I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined behavior. However, having different behavior if x is a compile-time constant than if x is a variable is unacceptable because it silently changes the (defi

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
Rainer Deyke wrote: Lars T. Kyllingstad wrote: Rainer Deyke wrote: I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined behavior. However, having different behavior if x is a compile-time constant than if x is a variable is unacceptable because it silently changes the (defi

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Lars T. Kyllingstad
Rainer Deyke wrote: Lars T. Kyllingstad wrote: Rainer Deyke wrote: I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined behavior. However, having different behavior if x is a compile-time constant than if x is a variable is unacceptable because it silently changes the (defi

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
KennyTM~ wrote: On Dec 9, 09 16:36, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x or y are floating-point, t

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Rainer Deyke
Lars T. Kyllingstad wrote: > Rainer Deyke wrote: >> I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined >> behavior. However, having different behavior if x is a compile-time >> constant than if x is a variable is unacceptable because it silently >> changes the (defined) behav

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread KennyTM~
On Dec 9, 09 17:25, Simen kjaeraas wrote: On Wed, 09 Dec 2009 09:36:56 +0100, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x *

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread KennyTM~
On Dec 9, 09 16:36, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x or y are floating-point, the result is pow(

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Simen kjaeraas
On Wed, 09 Dec 2009 09:36:56 +0100, Don wrote: CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x or y are floating-point

Re: enhancing enums

2009-12-09 Thread Lars T. Kyllingstad
Jeremie Pelletier wrote: hehe45 wrote: In c++ it is valid syntax to have trailing commas at the and of enum definitions: enum {a, b, c, }; This would be a useful addition to D too. The enum class syntax from c++0x should also adopted by D, this would allow named enums which are not automatica

Re: Semantics of ^^

2009-12-09 Thread Lars T. Kyllingstad
Don wrote: Bill Baxter wrote: On Tue, Dec 8, 2009 at 2:32 AM, Don wrote: Based on everyone's comments, this is what I have come up with: x ^^ y is right associative, and has a precedence intermediate between multiplication and unary operators. Is that consistent with ma

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Lars T. Kyllingstad
Rainer Deyke wrote: Don wrote: Note that by definining the 0,1, -1 cases as "rewriting" rules rather than return values, it should be clearer that they don't apply to variables having those values. I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined behavior. However, hav

Re: More on semantics of opPow: return type

2009-12-09 Thread Simen kjaeraas
On Wed, 09 Dec 2009 05:28:23 +0100, Andrei Alexandrescu wrote: Don wrote: Bill Baxter wrote: On Tue, Dec 8, 2009 at 10:18 AM, Bill Baxter wrote: I agree. Then at least why not make the type of the exponent unsigned? That gives the type system a fighting chance (via e.g. value range pro

Re: Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Rainer Deyke
Don wrote: > Note that by definining the 0,1, -1 cases as "rewriting" rules rather > than return values, it should be clearer that they don't apply to > variables having those values. I don't care if x^^y with y < 0 is 0, a runtime error, or even undefined behavior. However, having different beha

FUFUFU

2009-12-09 Thread FUFUFU
dfdf Wrote: > fdfdfd FUFUFU

Semantics of ^^, Version 3 (Final?)

2009-12-09 Thread Don
CHANGES BASED ON FURTHER COMMENTS x ^^ y is right associative, and has a precedence intermediate between unary and postfix operators. The type of x ^^ y is the same as the type of x * y. * If either x or y are floating-point, the result is pow(x, y). If both x and y are int