Re: Short list with things to finish for D2

2009-12-18 Thread Joel C. Salomon
On 12/16/2009 2:36 PM, Jesse Phillips wrote: __ indicates proprietary language extension __ we don't want you using this much (__gshared) __ this way we aren't adding a keyword to the standard namespace (__traits) At least those have been the reasons I've heard. This makes __ absolutely

Re: Short list with things to finish for D2

2009-12-16 Thread KennyTM~
On Dec 16, 09 07:21, Jesse Phillips wrote: lws Wrote: On 2009-11-19 15:46:57 -0800, Bill Baxterwbax...@gmail.com said: On Wed, Nov 18, 2009 at 8:33 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I am thinking that representing operators by their exact token representation

Re: Short list with things to finish for D2

2009-12-16 Thread Jesse Phillips
KennyTM~ Wrote: On Dec 16, 09 07:21, Jesse Phillips wrote: http://digitalmars.com/d/2.0/rationale.html However it does have this nice little gem: __ keywords should indicate a proprietary language extension, not a basic part of the language. Which makes you wonder why D has

Re: Short list with things to finish for D2

2009-12-16 Thread Robert Clipsham
On 15/12/09 23:21, Jesse Phillips wrote: There is a page for the rational which I thought gave the OP's explination: http://digitalmars.com/d/2.0/rationale.html However it does have this nice little gem: __ keywords should indicate a proprietary language extension, not a basic part of the

Re: Short list with things to finish for D2

2009-12-15 Thread Jesse Phillips
lws Wrote: On 2009-11-19 15:46:57 -0800, Bill Baxter wbax...@gmail.com said: On Wed, Nov 18, 2009 at 8:33 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I am thinking that representing operators by their exact token representation is a principled approach because it

Re: Short list with things to finish for D2

2009-12-14 Thread lws
On 2009-11-19 15:46:57 -0800, Bill Baxter wbax...@gmail.com said: On Wed, Nov 18, 2009 at 8:33 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I am thinking that representing operators by their exact token representation is a principled approach because it allows for unambiguous

Re: Short list with things to finish for D2

2009-12-14 Thread lws
On 2009-11-20 02:18:03 -0800, Pelle Månsson pelle.mans...@gmail.com said: Andrei Alexandrescu wrote: Bill Baxter wrote: On Thu, Nov 19, 2009 at 8:46 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: grauzone wrote: What's with opSomethingAssign (or expr1[expr2] @= expr3 in

Re: Short list with things to finish for D2

2009-12-10 Thread Stewart Gordon
Simen kjaeraas wrote: On Tue, 08 Dec 2009 04:02:21 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 12/07/2009 08:33 PM, Stewart Gordon wrote: bearophile wrote: snip In Python you usually just omit the value: a[:5] === a[0 .. 5] a[5:] === a[5 .. $] Which doesn't accommodate

Re: Short list with things to finish for D2

2009-12-10 Thread bearophile
Stewart Gordon: But in D, you can use a negative index/key in an AA or custom array type. This is natural easy to do in Python too. And is there any equivalent in Python to a[$/2] or anything fancy like that? You have to do it in explicit way: a[len(a) / 2] Or today better (// is the

Re: Short list with things to finish for D2

2009-12-08 Thread Simen kjaeraas
On Tue, 08 Dec 2009 04:02:21 +0100, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 12/07/2009 08:33 PM, Stewart Gordon wrote: bearophile wrote: snip In Python you usually just omit the value: a[:5] === a[0 .. 5] a[5:] === a[5 .. $] Which doesn't accommodate anything equivalent to

Re: Short list with things to finish for D2

2009-12-07 Thread Stewart Gordon
bearophile wrote: snip In Python you usually just omit the value: a[:5] === a[0 .. 5] a[5:] === a[5 .. $] Which doesn't accommodate anything equivalent to a[$-4 .. $-2]. Or you can also use None, this can useful because you can put None inside a variable, etc (while in D you can't put $

Re: Short list with things to finish for D2

2009-12-07 Thread Ellery Newcomer
On 12/07/2009 08:33 PM, Stewart Gordon wrote: bearophile wrote: snip In Python you usually just omit the value: a[:5] === a[0 .. 5] a[5:] === a[5 .. $] Which doesn't accommodate anything equivalent to a[$-4 .. $-2]. you mean this? a[-4:-2] Or you can also use None, this can useful

Re: Short list with things to finish for D2

2009-12-07 Thread bearophile
Stewart Gordon: Which doesn't accommodate anything equivalent to a[$-4 .. $-2]. In Python: a = abcdefgh a[-4 : -2] 'ef' Or you can also use None, this can useful because you can put None inside a variable, etc (while in D you can't put $ inside a variable to represent the end of that

Re: Short list with things to finish for D2

2009-11-28 Thread bearophile
Stewart Gordon: Only for built-in linear arrays. Half the point is: What if somebody creates a type for which the lower bound is something different? This can be useful. For example an array with indices in a .. z+1 :-) maybe we need some symbol like ^ to denote the lower bound, and

Re: Short list with things to finish for D2

2009-11-27 Thread Stewart Gordon
Denis Koroskin wrote: snip Lower bound is always 0 in D, unlike VB where is can take an arbitrary value. As such, there is no need for opLowerBound in D. Only for built-in linear arrays. Half the point is: What if somebody creates a type for which the lower bound is something different?

Re: Short list with things to finish for D2

2009-11-25 Thread Don
aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of course you can define a where clause using strings. (I'm not sure when you'd

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of course you can define a where clause using strings. Even today,

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 00:46:39 +0300, Travis Boucher boucher.tra...@gmail.com wrote: Denis Koroskin wrote: On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert g...@green-stores.de wrote: how about opLimit ? I recall that Visual Basic has UBound function that returns upper bound of a

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 11:42:53 +0300, Don nos...@nospam.com wrote: Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Denis Koroskin wrote: On Wed, 25 Nov 2009 11:42:53 +0300, Don nos...@nospam.com wrote: Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5 UBound(a, 3) - 4 Works for single-dimensional arrays, too: Dim b(8) As Byte UBound(b) - 8 I brought a

Re: Short list with things to finish for D2

2009-11-25 Thread Ellery Newcomer
On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5 UBound(a, 3) - 4 Works for single-dimensional arrays, too: Dim b(8) As Byte

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100

Re: Short list with things to finish for D2

2009-11-25 Thread Pelle Månsson
Denis Koroskin wrote: On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte

Re: Short list with things to finish for D2

2009-11-25 Thread Ellery Newcomer
On 11/25/2009 01:40 PM, Denis Koroskin wrote: IIRC lower bound is 1 by default in VB and therefore b(0) is illegal. Nope. Dim b(8) as String is equivalent to Dim b(0 to 8) as String and therefore b(0) is very legal.

Re: Short list with things to finish for D2

2009-11-24 Thread Gerrit Wichert
how about opLimit ?

Re: Short list with things to finish for D2

2009-11-24 Thread Denis Koroskin
On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert g...@green-stores.de wrote: how about opLimit ? I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5 UBound(a, 3) - 4 Works

Re: Short list with things to finish for D2

2009-11-24 Thread Don
aarti_pl wrote: Lutger pisze: yigal chripun wrote: aarti_pl Wrote: There's nothing more hideous than all those frameworks in Java/C++ that try to re-enginer SQL into functions, templates, LINQ, whatever. SQL *is* a perfectly designed language for its purpose and it doesn't need to be

Re: Short list with things to finish for D2

2009-11-24 Thread aarti_pl
Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of course you can define a where clause using strings. (I'm not sure when you'd want to, though. I

Re: Short list with things to finish for D2

2009-11-24 Thread Travis Boucher
Denis Koroskin wrote: On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert g...@green-stores.de wrote: how about opLimit ? I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5

Re: Short list with things to finish for D2

2009-11-23 Thread yigal chripun
aarti_pl Wrote: Walter Bright pisze: Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and cross product. Yup. Anything

Re: Short list with things to finish for D2

2009-11-23 Thread Don
yigal chripun wrote: aarti_pl Wrote: Walter Bright pisze: Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and cross product. Yup.

Re: Short list with things to finish for D2

2009-11-23 Thread Chad J
Don wrote: yigal chripun wrote: aarti_pl Wrote: Walter Bright pisze: Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and cross product.

Re: Short list with things to finish for D2

2009-11-23 Thread Don
Chad J wrote: Don wrote: yigal chripun wrote: aarti_pl Wrote: Walter Bright pisze: Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and

Re: Short list with things to finish for D2

2009-11-23 Thread Steven Schveighoffer
On Thu, 19 Nov 2009 13:54:04 -0500, dsimcha dsim...@yahoo.com wrote: The hook doesn't sound like a bad idea, but it raises a lot of issues with the implementation details. These are things I could figure out given plenty of time. I'd like weak refs, too. However, I don't think this makes

Re: Short list with things to finish for D2

2009-11-23 Thread yigal chripun
Don Wrote: Chad J wrote: Don wrote: I quite agree. What we can do already is: auto statement = db.execute!(`select $a from table where $b 100 $c Like A*`)(visitcars.name,visitcars.id, visitcars.surname); which I personally like much better than the proposed goal: It would be

Re: Short list with things to finish for D2

2009-11-23 Thread Bill Baxter
On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote: This sounds like a job for better mixin syntax. . So let template#(args) be equivalent to mixin(template!(args)). Then you can do auto statement = db.execute#(`select $visitcars.name from table where $visitcars.id 100

Re: Short list with things to finish for D2

2009-11-23 Thread Steven Schveighoffer
On Mon, 23 Nov 2009 07:38:32 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote: This sounds like a job for better mixin syntax. . So let template#(args) be equivalent to mixin(template!(args)). Then you can do auto statement =

Re: Short list with things to finish for D2

2009-11-23 Thread Lars T. Kyllingstad
Bill Baxter wrote: On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote: This sounds like a job for better mixin syntax. . So let template#(args) be equivalent to mixin(template!(args)). Then you can do auto statement = db.execute#(`select $visitcars.name from table where

Re: Short list with things to finish for D2

2009-11-23 Thread Don
Lars T. Kyllingstad wrote: Bill Baxter wrote: On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote: This sounds like a job for better mixin syntax. . So let template#(args) be equivalent to mixin(template!(args)). Then you can do auto statement = db.execute#(`select $visitcars.name

Re: Short list with things to finish for D2

2009-11-23 Thread Lutger
yigal chripun wrote: aarti_pl Wrote: ... There's nothing more hideous than all those frameworks in Java/C++ that try to re-enginer SQL into functions, templates, LINQ, whatever. SQL *is* a perfectly designed language for its purpose and it doesn't need to be redisnged! The only problem

Re: Short list with things to finish for D2

2009-11-23 Thread Bill Baxter
On Mon, Nov 23, 2009 at 5:32 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 Nov 2009 07:38:32 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote: This sounds like a job for better mixin syntax. . So let template#(args) be

Re: Short list with things to finish for D2

2009-11-23 Thread aarti_pl
Lutger pisze: yigal chripun wrote: aarti_pl Wrote: There's nothing more hideous than all those frameworks in Java/C++ that try to re-enginer SQL into functions, templates, LINQ, whatever. SQL *is* a perfectly designed language for its purpose and it doesn't need to be redisnged! The

Re: Short list with things to finish for D2

2009-11-23 Thread aarti_pl
yigal chripun pisze: aarti_pl Wrote: Walter Bright pisze: Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and cross product. Yup.

Re: Short list with things to finish for D2

2009-11-23 Thread Steven Schveighoffer
On Mon, 23 Nov 2009 12:49:01 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 5:32 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 Nov 2009 07:38:32 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 3:12 AM, Don nos...@nospam.com wrote:

Re: Short list with things to finish for D2

2009-11-23 Thread Bill Baxter
On Mon, Nov 23, 2009 at 12:11 PM, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 Nov 2009 12:49:01 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 5:32 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 Nov 2009 07:38:32 -0500, Bill Baxter

Re: Short list with things to finish for D2

2009-11-23 Thread Steven Schveighoffer
On Mon, 23 Nov 2009 15:22:35 -0500, Bill Baxter wbax...@gmail.com wrote: On Mon, Nov 23, 2009 at 12:11 PM, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 Nov 2009 12:49:01 -0500, Bill Baxter wbax...@gmail.com wrote: I think Walter had intended template mixins to take the place of

Re: Short list with things to finish for D2

2009-11-23 Thread Simen kjaeraas
Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: How about auto template MixMeInAutomatically(T) { ... } void main() { MixMeInAutomatically!int; ... } Would this be ambiguous? It would be using auto for something completely new, but it would at

Re: Short list with things to finish for D2

2009-11-21 Thread Don
Justin Johansson wrote: Stewart Gordon wrote: aarti_pl wrote: snip I agree. opDollar is not particularly fitting to D language operator concept. opLength/opSize would fit better. snip Why I believe opLength and opSize are also wrong names:

Re: Short list with things to finish for D2

2009-11-21 Thread Walter Bright
Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: If we use @safe and @trusted to indicate unequivocally no escape, then there is no analysis to be done - the hard part of the analysis has already been done manually by the user. The problem then becomes: T[]

Re: Short list with things to finish for D2

2009-11-21 Thread Stewart Gordon
Denis Koroskin wrote: On Sat, 21 Nov 2009 09:06:53 +0300, Don nos...@nospam.com wrote: Justin Johansson wrote: Stewart Gordon wrote: snip Why I believe opLength and opSize are also wrong names: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Re_opDollar_12939.html

Re: Short list with things to finish for D2

2009-11-21 Thread Justin Johansson
Stewart Gordon wrote: Denis Koroskin wrote: On Sat, 21 Nov 2009 09:06:53 +0300, Don nos...@nospam.com wrote: Justin Johansson wrote: Stewart Gordon wrote: snip Why I believe opLength and opSize are also wrong names:

Re: Short list with things to finish for D2

2009-11-21 Thread Travis Boucher
Justin Johansson wrote: Stewart Gordon wrote: Denis Koroskin wrote: On Sat, 21 Nov 2009 09:06:53 +0300, Don nos...@nospam.com wrote: Justin Johansson wrote: Stewart Gordon wrote: snip Why I believe opLength and opSize are also wrong names:

Re: Short list with things to finish for D2

2009-11-21 Thread Lutger
Chad J wrote: Andrei Alexandrescu wrote: grauzone wrote: Also, you should fix the auto-flattening of tuples before it's too late. I think everyone agrees that auto-flattening is a bad idea, and that tuples should be nestable. Flattening can be done manually with an unary operator.

Re: Short list with things to finish for D2

2009-11-21 Thread Phil Deets
On Sat, 21 Nov 2009 13:21:10 -0500, aarti_pl aa...@interia.pl wrote: [snip] Problem with current approach is that I have to define SQL in D/Java in following way: auto statement = Select(visitcars.name).Where(And(More(visitcards.id, 100), Like(visitcards.surname, A*))); Please look at

Re: Short list with things to finish for D2

2009-11-20 Thread Don
aarti_pl wrote: bearophile pisze: aarti_pl: I think that proposed names exactly reflect the meaning. So I would say it is perfectly consistent with D convention. Dollars are money, but opDollar is not a member function that returns the price of a struct. So I don't agree with you, or I

Re: Short list with things to finish for D2

2009-11-20 Thread Pelle Månsson
Rainer Deyke wrote: Andrei Alexandrescu wrote: I am thinking that representing operators by their exact token representation is a principled approach because it allows for unambiguous mapping, testing with if and static if, and also allows saving source code by using only one string mixin. It

Re: Short list with things to finish for D2

2009-11-20 Thread Pelle Månsson
Andrei Alexandrescu wrote: Bill Baxter wrote: On Thu, Nov 19, 2009 at 8:46 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: grauzone wrote: What's with opSomethingAssign (or expr1[expr2] @= expr3 in general)? opBinary doesn't seem to solve any of those. opBinary does solve

Re: Short list with things to finish for D2

2009-11-20 Thread Simen kjaeraas
Don nos...@nospam.com wrote: aarti_pl wrote: bearophile pisze: aarti_pl: I think that proposed names exactly reflect the meaning. So I would say it is perfectly consistent with D convention. Dollars are money, but opDollar is not a member function that returns the price of a struct. So

Re: Short list with things to finish for D2

2009-11-20 Thread Pelle Månsson
Andrei Alexandrescu wrote: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s

Re: Short list with things to finish for D2

2009-11-20 Thread Don
Walter Bright wrote: aarti_pl wrote: I know that quite a few people here doesn't like to allow users to define their own operators, because it might obfuscate code. But it doesn't have to be like this. Someone here already mentioned here that it is not real problem for programs in C++. Good

Re: Short list with things to finish for D2

2009-11-20 Thread bearophile
Don: Unfortunately $ is not necessarily the length, nor the size. It might not even be an arithmetic type. Is opEnd a fitter name? Bye, bearophile

Re: Short list with things to finish for D2

2009-11-20 Thread Don
Simen kjaeraas wrote: Don nos...@nospam.com wrote: aarti_pl wrote: bearophile pisze: aarti_pl: I think that proposed names exactly reflect the meaning. So I would say it is perfectly consistent with D convention. Dollars are money, but opDollar is not a member function that returns the

Re: Short list with things to finish for D2

2009-11-20 Thread Pelle Månsson
Andrei Alexandrescu wrote: * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this: T opBinary(string op)(T rhs) { ... } The string is +, *, etc. We need to design what happens with read-modify-write operators like += (should they

Re: Short list with things to finish for D2

2009-11-20 Thread Walter Bright
Don wrote: There's not many sensible operators anyway. opPow is the only missing one that's present in many other general-purpose languages. The only other ones I think are remotely interesting are dot and cross product. Yup. Anything beyond that, you generally want a full DSL, probably with

Re: Short list with things to finish for D2

2009-11-20 Thread Andrei Alexandrescu
Pelle Månsson wrote: Andrei Alexandrescu wrote: * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this: T opBinary(string op)(T rhs) { ... } The string is +, *, etc. We need to design what happens with read-modify-write

Re: Short list with things to finish for D2

2009-11-20 Thread Lutger
Andrei Alexandrescu wrote: Kyle wrote: Andrei Alexandrescu Wrote: 6. There must be many things I forgot to mention, or that cause grief to many of us. Please add to/comment on this list. Uniform function call syntax. It's in the book. I'm adding this message as a reminder to add a

Re: Short list with things to finish for D2

2009-11-20 Thread Stewart Gordon
Andrei Alexandrescu wrote: We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is clearly understood by all of us that there are many things that could and probably should be done. What do you mean by finale, exactly?

Re: Short list with things to finish for D2

2009-11-20 Thread Justin Johansson
Stewart Gordon wrote: aarti_pl wrote: snip I agree. opDollar is not particularly fitting to D language operator concept. opLength/opSize would fit better. snip Why I believe opLength and opSize are also wrong names:

Re: Short list with things to finish for D2

2009-11-19 Thread Lars T. Kyllingstad
Justin Johansson wrote: 6. There must be many things I forgot to mention, or that cause grief to many of us. Please add to/comment on this list. Sorry I'm not familiar with any prior discussion on this or even where it's at (basically I'm in D1 world), but what about constructors for

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
Gzp wrote: bearophile wrote: Andrei Alexandrescu: * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this: T opBinary(string op)(T rhs) { ... } The string is +, *, etc. Can you show an example of defining an operator, like a

Re: Short list with things to finish for D2

2009-11-19 Thread retard
Wed, 18 Nov 2009 18:35:18 -0800, Andrei Alexandrescu wrote: grauzone wrote: Andrei Alexandrescu wrote: The rewrite is done long after lexing, so no low-level problems there. Oh, I thought it would let you introduce new operators. But it's only about the existing ones. I find the idea to

Re: Short list with things to finish for D2

2009-11-19 Thread Justin Johansson
Lars T. Kyllingstad wrote: Justin Johansson wrote: 6. There must be many things I forgot to mention, or that cause grief to many of us. Please add to/comment on this list. Sorry I'm not familiar with any prior discussion on this or even where it's at (basically I'm in D1 world), but what

Re: Short list with things to finish for D2

2009-11-19 Thread Simen kjaeraas
retard r...@tard.com.invalid wrote: Does the new system allow overriding only some binary operations and not all of them at once? struct S { S opBinary( string op )( S rhs ) if ( op == + ) { // Do stuff } } I thought generic member functions were non-virtual? Andrei

Re: Short list with things to finish for D2

2009-11-19 Thread retard
Thu, 19 Nov 2009 09:33:07 +0100, Simen kjaeraas wrote: retard r...@tard.com.invalid wrote: Does the new system allow overriding only some binary operations and not all of them at once? struct S { S opBinary( string op )( S rhs ) if ( op == + ) { // Do stuff } } I

Re: Short list with things to finish for D2

2009-11-19 Thread gzp
Yes; opBinary was just given as an example. Unary operators look like this: T opUnary(string op)(); (And maybe trinary operators ?: ) :) Can they still be overloaded ? Will they have a similar syntax ? If so what about the e++ and ++e operators? How they are distinct ? Or is the latter

Re: Short list with things to finish for D2

2009-11-19 Thread Lars T. Kyllingstad
Andrei Alexandrescu wrote: We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is clearly understood by all of us that there are many things that could and probably should be done. 1. Currently Walter and Don are

Re: Short list with things to finish for D2

2009-11-19 Thread Chad J
Andrei Alexandrescu wrote: grauzone wrote: Also, you should fix the auto-flattening of tuples before it's too late. I think everyone agrees that auto-flattening is a bad idea, and that tuples should be nestable. Flattening can be done manually with an unary operator. (Introducing sane

Re: Short list with things to finish for D2

2009-11-19 Thread Chad J
Andrei Alexandrescu wrote: * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this: T opBinary(string op)(T rhs) { ... } The string is +, *, etc. We need to design what happens with read-modify-write operators like += (should

Re: Short list with things to finish for D2

2009-11-19 Thread Chad J
Andrei Alexandrescu wrote: ... Any more thoughts, please let them known. ... Andrei I like what I'm reading. Pretty clever! I imagine it'd be convenient to easily distinguish between pure binary operators and opAssign binary operators. I can easily envision myself marking operator

Re: Short list with things to finish for D2

2009-11-19 Thread bearophile
Andrei Alexandrescu: Static function parameters Walter tried to implement them and ran into a number of odd semantic issues. I'd like to know more about those semantic issues, I am curious. Bye, bearophile

Re: Short list with things to finish for D2

2009-11-19 Thread Steven Schveighoffer
On Wed, 18 Nov 2009 18:14:08 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is clearly understood by all of us that there are many things that

Re: Short list with things to finish for D2

2009-11-19 Thread Kyle
Andrei Alexandrescu Wrote: Yes; opBinary was just given as an example. Unary operators look like this: T opUnary(string op)(); Why not do T op(string op)(); // unary T op(string op)(T rhs); // binary

Re: Short list with things to finish for D2

2009-11-19 Thread dsimcha
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Wed, 18 Nov 2009 18:14:08 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is

Re: Short list with things to finish for D2

2009-11-19 Thread dsimcha
== Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article Andrei Alexandrescu wrote: grauzone wrote: Also, you should fix the auto-flattening of tuples before it's too late. I think everyone agrees that auto-flattening is a bad idea, and that tuples should be nestable.

Re: Short list with things to finish for D2

2009-11-19 Thread grauzone
Andrei Alexandrescu wrote: Any more thoughts, please let them known. Again, this is the ideal time to contribute. But meh, it's a hack is difficult to discuss. Well that's just like as if Bjarne Stroustrup would ask you: What would you have done in my place? This looked like the right thing

Re: Short list with things to finish for D2

2009-11-19 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because the book has a few failing unittests. In fact, I was hoping I could talk you or David into doing it :o). Andrei Unfortunately, I've come to hate the MRU idea because it would fail miserably for

Re: Short list with things to finish for D2

2009-11-19 Thread grauzone
Andrei Alexandrescu wrote: grauzone wrote: Andrei Alexandrescu wrote: 3. It was mentioned in this group that if getopt() does not work in SafeD, then SafeD may as well pack and go home. I agree. We need to make it work. Three ideas discussed with Walter: If that's such an issue, why don't

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
grauzone wrote: Andrei Alexandrescu wrote: Any more thoughts, please let them known. Again, this is the ideal time to contribute. But meh, it's a hack is difficult to discuss. Well that's just like as if Bjarne Stroustrup would ask you: What would you have done in my place? This looked like

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because the book has a few failing unittests. In fact, I was hoping I could talk you or David into doing it :o). Andrei Unfortunately, I've come to hate the MRU idea because it would

Re: Short list with things to finish for D2

2009-11-19 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because the book has a few failing unittests. In fact, I was hoping I could talk you or David into doing it

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
grauzone wrote: Andrei Alexandrescu wrote: grauzone wrote: Andrei Alexandrescu wrote: 3. It was mentioned in this group that if getopt() does not work in SafeD, then SafeD may as well pack and go home. I agree. We need to make it work. Three ideas discussed with Walter: If that's such an

Re: Short list with things to finish for D2

2009-11-19 Thread grauzone
Andrei Alexandrescu wrote: opBinary does solve opIndex* morass because it only adds one function per category, not one function per operator. For example: struct T { // op can be =, +=, -= etc. E opAssign(string op)(E rhs) { ... } // op can be =, +=, -= etc. E

Re: Short list with things to finish for D2

2009-11-19 Thread grauzone
Andrei Alexandrescu wrote: You mean use a struct for the string-value pair? A struct cannot have a ref member, so it would still need to store a pointer. (But maybe I misunderstood the point.) Like this: void main(string[] commandline) { struct Args { string param1 =

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because the book has a few failing unittests. In fact, I was hoping I could talk you or David

Re: Short list with things to finish for D2

2009-11-19 Thread Steven Schveighoffer
On Thu, 19 Nov 2009 12:01:25 -0500, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because the book has a few failing

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
grauzone wrote: Andrei Alexandrescu wrote: You mean use a struct for the string-value pair? A struct cannot have a ref member, so it would still need to store a pointer. (But maybe I misunderstood the point.) Like this: void main(string[] commandline) { struct Args { string

Re: Short list with things to finish for D2

2009-11-19 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Thu, 19 Nov 2009 12:01:25 -0500, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Yes, it will be because

Re: Short list with things to finish for D2

2009-11-19 Thread aarti_pl
Andrei Alexandrescu pisze: We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is clearly understood by all of us that there are many things that could and probably should be done. 1. Currently Walter and Don are

  1   2   >