Re: Keeping a list of instances and garbage-collection

2009-03-31 Thread grauzone
Actually, scratch that. Any 4 byte pattern can look like a pointer. Unless you manage to encode it in a way the 4 byte cells look like they're pointing into an address range not managed by the GC. For example, most OSes reserve the last 1 or 2 GBs for the kernel. If your byte quadruple looks li

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Max Samukha
On Mon, 30 Mar 2009 22:04:57 +0200, Trass3r wrote: >Max Samukha schrieb: >> It's possible to statically unroll the foreach's with a template >> generating a tuple of consequtive integers (not tested): >> >> template Sequence(size_t count, size_t index = 0) >> { >>static if (index < count) >>

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming to Linux

2009-03-31 Thread Kagamin
Sergey Gromov Wrote: > > This is a lie. There is just no way for cigarette-chomping executives to > > not know, what are licenses and how they work. > > Sure they know. They know too well that one wrong step, one ignorant > developer, and they may kiss good-bye to their precious intellectual >

Re: Licence question about Indemnification

2009-03-31 Thread Kagamin
Chris Wrote: > You agree to indemnify Symantec from all claims or demands Note the use of "from" preposition. Indemnify from = defend, indemnify for = compensate.

Re: Time to invent a different file format to hold meta data info

2009-03-31 Thread Kagamin
Unknown W. Brackets Wrote: > Well, I'm not so sure. Every time you invent meta data, someone will > invent a language that goes outside that meta data. It's reality. API will do the same. > Programs would benefit from such an API as well; it could provide basic > runtime information (manglin

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Max Samukha
On Tue, 31 Mar 2009 10:55:22 +0200, Max Samukha wrote: >On Mon, 30 Mar 2009 22:04:57 +0200, Trass3r wrote: > >>Max Samukha schrieb: >>> It's possible to statically unroll the foreach's with a template >>> generating a tuple of consequtive integers (not tested): >>> >>> template Sequence(size_t

Re: Licence question about Indemnification

2009-03-31 Thread Kagamin
BTW, how do you understand Microsoft EULA? "you will indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorneys’ and experts’ fees, that arise or result from the use or distribution of your Application"

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Trass3r
Max Samukha schrieb: So it is a tuple although the docs tell us it's an array? Yeah, __traits returns expressions of various types depending on the Id. In case of getVirtualFunctions, it's a tuple expression. You may want to look through traits.c in dmd sources to see what's going on. So th

Re: The Case for D

2009-03-31 Thread Andrei Alexandrescu
Yes, in probably a couple of months. Andrei Saaa wrote: Will we be able to read the article online after polishing? I am writing an article for a programming magazine entitled "The Case for D". Would anyone be interested in reviewing it before publication? Please send me private email if s

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Trass3r
Max Samukha schrieb: "variable main.main.i voids have no value" __traits is buggy. template isFunction(C, string member) { enum isFunction = is(typeof(mixin("C." ~ member)) == function); } void main() { //SpinLock lock; enum members = __traits(allMembers, Class); foreach (i;

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming to Linux

2009-03-31 Thread Sergey Gromov
Mon, 30 Mar 2009 18:09:21 -0400, Steven Schveighoffer wrote: > On Mon, 30 Mar 2009 18:03:02 -0400, Bill Baxter wrote: > >> On Tue, Mar 31, 2009 at 6:36 AM, Steven Schveighoffer >> wrote: >>> On Mon, 30 Mar 2009 16:00:02 -0400, Yigal Chripun >>> wrote: >>> people in the US sued MacDonald's

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Max Samukha
On Tue, 31 Mar 2009 13:53:02 +0200, Trass3r wrote: >Max Samukha schrieb: >>> So it is a tuple although the docs tell us it's an array? >>> >> >> Yeah, __traits returns expressions of various types depending on the >> Id. In case of getVirtualFunctions, it's a tuple expression. You may >> want to

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming to Linux

2009-03-31 Thread Sergey Gromov
Tue, 31 Mar 2009 05:15:24 -0400, Kagamin wrote: > Sergey Gromov Wrote: > >>> This is a lie. There is just no way for cigarette-chomping executives to >>> not know, what are licenses and how they work. >> >> Sure they know. They know too well that one wrong step, one ignorant >> developer, and

Re: Time to invent a different file format to hold meta data info

2009-03-31 Thread Unknown W. Brackets
Well, an API allows programatic reduction, handshaking (version upgrades), and the like. A file format can do some of these things as well, but it starts to get more complicated, and you start wasting space for bc, etc. etc. Also, a file format would have to be generated by running the compil

Re: Keeping a list of instances and garbage-collection

2009-03-31 Thread Sean Kelly
grauzone wrote: Sean Kelly wrote: == Quote from Sergey Gromov (snake.sc...@gmail.com)'s article Sun, 29 Mar 2009 17:42:48 -0400, Chad J wrote: Maybe what you are looking for are the GC.removeRoot or GC.removeRange functions which are available in both Phobos and Tango? http://www.dsource.org/p

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming to Linux

2009-03-31 Thread Steven Schveighoffer
On Tue, 31 Mar 2009 02:02:03 -0400, Yigal Chripun wrote: On 31/03/2009 00:36, Steven Schveighoffer wrote: No, it would not be reasonable. In fact that would just be a nice fat paycheck for the plaintiff's lawyer (and probably the defendant's lawyer) and nothing else. Nobody can expect someo

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming to Linux

2009-03-31 Thread Joel C. Salomon
Bill Baxter wrote: > On Tue, Mar 31, 2009 at 7:09 AM, Steven Schveighoffer > wrote: >> On Mon, 30 Mar 2009 18:03:02 -0400, Bill Baxter wrote: >>> Peanuts aren't actually nuts, you know. They're legumes. So there >>> might well be a case where the lable said "100% peanuts" and someone >>> aller

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Simen Kjaeraas
dsimcha wrote: == Quote from Denis Koroskin (2kor...@gmail.com)'s article That said, I don't think there is a need for something like this. Certainly no speedup and little clarity compared to declaring variable right before invoking doStuff. Here's an example of where it would be a useful pi

Re: Licence question about Indemnification

2009-03-31 Thread Georg Wrede
Kagamin wrote: BTW, how do you understand Microsoft EULA? "you will indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorneys’ and experts’ fees, that arise or result from the use or distribution of your Application" That's clear enough. You

Re: Licence question about Indemnification

2009-03-31 Thread Steven Schveighoffer
On Tue, 31 Mar 2009 12:08:29 -0400, Georg Wrede wrote: Or, while I know some istalling programs make you check a box stating you agree, but say you buy a PC with the OS already installed, and then start programming, say, using this PowerShell thingy, and the crap hits the fan -- because of so

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Jarrett Billingsley
2009/3/30 dsimcha : > // How it works now: > uint foo; > string bar; > unpack(foo, bar) = someFunction(); > > // vs. how I want it to work: > unpack(auto foo, auto bar) = someFunction(); Cute, but uh, I'd much rather see tuples just be returnable. That would practically remove the need for out pa

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread dsimcha
== Quote from Jarrett Billingsley (jarrett.billings...@gmail.com)'s article > 2009/3/30 dsimcha : > > // How it works now: > > uint foo; > > string bar; > > unpack(foo, bar) = someFunction(); > > > > // vs. how I want it to work: > > unpack(auto foo, auto bar) = someFunction(); > Cute, but uh, I'd

Re: Eric S. Raymond on GPL and BSD licenses. & Microsoft coming toLinux

2009-03-31 Thread BCS
Reply to Yigal, On 30/03/2009 04:42, Mike Parker wrote: No, it gives no freedom to developers at all. Using any GPL code in your project /forces/ you to open your source. It takes the decision of whether to open or not out of your hands and puts it in the hands of whomever created the GPLed pr

Re: Licence question about Indemnification

2009-03-31 Thread Chris
"Kagamin" > Chris Wrote: > >> You agree to indemnify Symantec from all claims or demands > > Note the use of "from" preposition. Indemnify from = defend, indemnify for > = compensate. Ok this could be a solution. Thanks to everybody.

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: 2009/3/30 dsimcha : // How it works now: uint foo; string bar; unpack(foo, bar) = someFunction(); // vs. how I want it to work: unpack(auto foo, auto bar) = someFunction(); Cute, but uh, I'd much rather see tuples just be returnable. They are. Andrei

Dynamic loading of D modules

2009-03-31 Thread Steve Teale
I have been doing some work on this, based on Eric Anderton et al's DDL. I wanted something that would be compatible with DMD2.x and Phobos, and was relatively simple to understand. The result can be found at http://www.britseyeview.com/dml/.

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Jarrett Billingsley
On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu wrote: > Jarrett Billingsley wrote: >> >> 2009/3/30 dsimcha : >>> >>> // How it works now: >>> uint foo; >>> string bar; >>> unpack(foo, bar) = someFunction(); >>> >>> // vs. how I want it to work: >>> unpack(auto foo, auto bar) = someFunction()

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: 2009/3/30 dsimcha : // How it works now: uint foo; string bar; unpack(foo, bar) = someFunction(); // vs. how I want it to work: unpack(auto foo, auto bar) = someFunction(); Cute

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Jarrett Billingsley
On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu wrote: > > import std.typecons; > > Tuple!(int, float) foo() > { >    return tuple(2, 4.5); > } > > The addition of the alias this feature and of constructor templates makes > std.typecons.Tuple even better. > Cool, but.. Why not just make tup

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Sergey Gromov
Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: > Jarrett Billingsley wrote: >> On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu >> wrote: >>> Jarrett Billingsley wrote: 2009/3/30 dsimcha : > // How it works now: > uint foo; > string bar; > unpack(foo, bar) =

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: > > Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: > > > Jarrett Billingsley wrote: > >> On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu > >> wrote: > >>> Jarrett Billingsley wrote: > 2009/3/30 dsimcha : > > // How it

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu wrote: import std.typecons; Tuple!(int, float) foo() { return tuple(2, 4.5); } The addition of the alias this feature and of constructor templates makes std.typecons.Tuple even better. Cool, but.. Why not j

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Bill Baxter wrote: On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: 2009/3/30 dsimcha : // How it works now: u

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread grauzone
Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu wrote: import std.typecons; Tuple!(int, float) foo() { return tuple(2, 4.5); } The addition of the alias this feature and of constructor templates makes std.typecons.Tuple even bet

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 6:16 AM, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> >> On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov >> wrote: >>> >>> Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: >>> Jarrett Billingsley wrote: > > On Tue, Mar 31, 2009 at 1:32 PM, Andrei

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 6:16 AM, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> >> On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov >> wrote: >>> >>> Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: >>> Jarrett Billingsley wrote: > > On Tue, Mar 31, 2009 at 1:32 PM, Andrei

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Christopher Wright
Trass3r wrote: Yeah extreeemely buggy. dmd also crashes if that enum members is changed to const members or invariant members. Buggy __traits is the major reason I'm not on d2. If __traits were not buggy, I could do, god, so many things! Though it would be even better to have the runtime equ

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: > Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: > >> Jarrett Billingsley wrote: >>> On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu >>> wrote: Jarrett Billingsley wrote: > 2009/3/30 dsimcha : >> // How it works n

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Trass3r
Christopher Wright schrieb: Buggy __traits is the major reason I'm not on d2. If __traits were not buggy, I could do, god, so many things! Though it would be even better to have the runtime equivalent. Any chance traits get fixed anytime soon?

Four things

2009-03-31 Thread bearophile
In this post I list four random things I have seen/found lately. Some of them may be interesting for the development of D. C# has arrays of arrays as D, plus it has built-in multidimensional arrays too: http://msdn.microsoft.com/en-us/library/aa288453(VS.71).aspx They have some advantages: - On t

Unofficial wish list status.(Apr 2009)

2009-03-31 Thread 4tuu4k002
Hi This is the monthly status for the unofficial d wish list: http://all-technology.com/eigenpolls/dwishlist/ Right now the wish list looks like this: 199 Stack tracing (#26) 195 Reflection API (#6) 132 vectorization (#10) 112 Multiple return values (tuples (#28) 99 Multiple opCast per cl

Re: Four things

2009-03-31 Thread Jarrett Billingsley
On Tue, Mar 31, 2009 at 7:31 PM, bearophile wrote: > > Java has tons of standard exceptions, you can see some of them humorously > explained here: > http://rymden.nu/exceptions.html > I don't need hundreds of different exceptions organized in a deep tree, but I > have felt the need to define few

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Daniel Keep
Andrei Alexandrescu wrote: > Jarrett Billingsley wrote: >> On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu >> wrote: >>> import std.typecons; >>> >>> Tuple!(int, float) foo() >>> { >>>return tuple(2, 4.5); >>> } >>> >>> The addition of the alias this feature and of constructor templates

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Leandro Lucarella
Bill Baxter, el 1 de abril a las 05:22 me escribiste: > Right. In my ideal world I could use tuples like this: > > (int,float) a; > > a = returns_tuple(); > > a[0] = 2; > a[1] = 3.4; > > (int,float) z = returns_tuple(); > > (int x, float y) = returns_tuple(); > > auto tup = (2, 3.4); > > t

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Bill Baxter wrote: On Wed, Apr 1, 2009 at 6:16 AM, Andrei Alexandrescu wrote: Bill Baxter wrote: On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Bill Baxter wrote: On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 1:32 PM, Andrei Alexandrescu wrote: Jarrett Billingsley wrote: 2009/3/30 dsimcha : // How it works now: u

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Daniel Keep wrote: Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu wrote: import std.typecons; Tuple!(int, float) foo() { return tuple(2, 4.5); } The addition of the alias this feature and of constructor templates makes std.type

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Bill Baxter, el 1 de abril a las 05:22 me escribiste: Right. In my ideal world I could use tuples like this: (int,float) a; a = returns_tuple(); a[0] = 2; a[1] = 3.4; (int,float) z = returns_tuple(); (int x, float y) = returns_tuple(); auto tup = (2, 3.4); takes

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Sergey Gromov
Tue, 31 Mar 2009 17:54:30 -0700, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> On Wed, Apr 1, 2009 at 6:16 AM, Andrei Alexandrescu >> wrote: >>> Bill Baxter wrote: On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov wrote: > Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote

Re: Shouldn't __traits return Tuples?

2009-03-31 Thread Christopher Wright
Trass3r wrote: Christopher Wright schrieb: Buggy __traits is the major reason I'm not on d2. If __traits were not buggy, I could do, god, so many things! Though it would be even better to have the runtime equivalent. Any chance traits get fixed anytime soon? I was using __traits + CTFE aro

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Leandro Lucarella
Andrei Alexandrescu, el 31 de marzo a las 17:57 me escribiste: > Leandro Lucarella wrote: > >Bill Baxter, el 1 de abril a las 05:22 me escribiste: > >>Right. In my ideal world I could use tuples like this: > >> > >>(int,float) a; > >> > >>a = returns_tuple(); > >> > >>a[0] = 2; > >>a[1] = 3.4; >

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Sergey Gromov wrote: Comma expression is not ambiguous. It's a comma expression. Renaming it into a tuple constructor expression does not add any ambiguity. Parentheses here are only required to separate the comma expression from an assignment expression which otherwise would become a part of c

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 31 de marzo a las 17:55 me escribiste: But in Python or ML, no question. I'd happily write a function that returns (2, 4.2) without giving it much thought. Now perhaps cogent arguments like "blech" and "belch" can convince me that I should embrac

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Leandro Lucarella
Andrei Alexandrescu, el 31 de marzo a las 17:55 me escribiste: > >But in Python or ML, no question. I'd happily write a function that > >returns (2, 4.2) without giving it much thought. Now perhaps cogent > >arguments like "blech" and "belch" can convince me that I should > >embrace the Tuple!(int

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread bearophile
Andrei Alexandrescu: > Well I think a language can only have so many built-in types. We can't > go on forever. Too many built-ins become confusing (see Fortress), but D is quite far from that point (see Python, that has more than D and they are just fine and easy to use and remember. I'd also

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 31 de marzo a las 17:57 me escribiste: Agree. They should be first class citizen as dynamic arrays or hashes. Why? Not grokking it. It's perfectly explained in this thread why, all I have to say will repeate something already said (the int[] vs

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: Well I think a language can only have so many built-in types. We can't go on forever. Too many built-ins become confusing (see Fortress), but D is quite far from that point (see Python, that has more than D and they are just fine and easy to use and reme

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Sergey Gromov wrote: Tue, 31 Mar 2009 18:38:35 -0700, Andrei Alexandrescu wrote: Sergey Gromov wrote: Comma expression is not ambiguous. It's a comma expression. Renaming it into a tuple constructor expression does not add any ambiguity. Parentheses here are only required to separate the com

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Sergey Gromov wrote: Tue, 31 Mar 2009 18:38:35 -0700, Andrei Alexandrescu wrote: Sergey Gromov wrote: Comma expression is not ambiguous. It's a comma expression. Renaming it into a tuple constructor expression does not add any ambiguity. Parentheses here are only required to separate the com

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 9:55 AM, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> >> On Wed, Apr 1, 2009 at 5:03 AM, Sergey Gromov >> wrote: >>> >>> Tue, 31 Mar 2009 12:18:21 -0700, Andrei Alexandrescu wrote: >>> Jarrett Billingsley wrote: > > On Tue, Mar 31, 2009 at 1:32 PM, Andrei

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Leandro Lucarella
Andrei Alexandrescu, el 31 de marzo a las 18:42 me escribiste: > Leandro Lucarella wrote: > >Andrei Alexandrescu, el 31 de marzo a las 17:55 me escribiste: > >>>But in Python or ML, no question. I'd happily write a function that > >>>returns (2, 4.2) without giving it much thought. Now perhaps cog

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Sergey Gromov
Tue, 31 Mar 2009 18:38:35 -0700, Andrei Alexandrescu wrote: > Sergey Gromov wrote: >> Comma expression is not ambiguous. It's a comma expression. Renaming >> it into a tuple constructor expression does not add any ambiguity. >> Parentheses here are only required to separate the comma expression

Re: Four things

2009-03-31 Thread Rainer Deyke
bearophile wrote: > C# has arrays of arrays as D, plus it has built-in multidimensional > arrays too: > http://msdn.microsoft.com/en-us/library/aa288453(VS.71).aspx They > have some advantages: - On them the compiler can use some extra > optimizations, common in all Fortran compilers. D seems a la

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Sergey Gromov
Tue, 31 Mar 2009 18:55:10 -0700, Andrei Alexandrescu wrote: > Sergey Gromov wrote: >> Tue, 31 Mar 2009 18:38:35 -0700, Andrei Alexandrescu wrote: >> >>> Sergey Gromov wrote: Comma expression is not ambiguous. It's a comma expression. Renaming it into a tuple constructor expression doe

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article > Ok, then we'll introduce balanced budget amendment for types to ensure > this doesn't happen. For every new type added one must be removed. > We're going to vote complex types off the island, right? Maybe we > could get rid of associative

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 10:53 AM, Andrei Alexandrescu wrote: > I guess I can't bring myself to dislike tuple(1, 2) in D. > I'd actually be a heck of a lot happier with that than Tuple!(1,2). Especially if using it didn't require any explicit import. --bb

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread dsimcha
== Quote from Bill Baxter (wbax...@gmail.com)'s article > On Wed, Apr 1, 2009 at 10:53 AM, Andrei Alexandrescu > wrote: > > I guess I can't bring myself to dislike tuple(1, 2) in D. > > > I'd actually be a heck of a lot happier with that than Tuple!(1,2). > Especially if using it didn't require an

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Daniel Keep
Andrei Alexandrescu wrote: > Daniel Keep wrote: >> >> Andrei Alexandrescu wrote: >>> Jarrett Billingsley wrote: ... Why not just make tuples first-class types? <_< >>> Why not not? >>> >>> Andrei >> >> Because people keep having to invent hacks to work around the fact that >> we can

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 11:15 AM, dsimcha wrote: > == Quote from Bill Baxter (wbax...@gmail.com)'s article >> We're going to vote complex types off the island, right?   Maybe we >> could get rid of associative arrays as a built-in too. > > Aren't builtin complex types on the way out anyhow? Right.

Online dmd source repositiries

2009-03-31 Thread Jason House
I frequently look at the changelog of Phobos on dsource. Is there a similar place to look for the dmd front end as well as the back end? If not, can we set one up?

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Bill Baxter wrote: On Wed, Apr 1, 2009 at 10:53 AM, Andrei Alexandrescu wrote: I guess I can't bring myself to dislike tuple(1, 2) in D. I'd actually be a heck of a lot happier with that than Tuple!(1,2). Especially if using it didn't require any explicit import. --bb Tuple!(...) tuple(.

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
Bill Baxter wrote: Ok, then we'll introduce balanced budget amendment for types to ensure this doesn't happen. For every new type added one must be removed. We're going to vote complex types off the island, right? Maybe we could get rid of associative arrays as a built-in too. Ironic as that

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Bill Baxter
On Wed, Apr 1, 2009 at 1:12 PM, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> >> On Wed, Apr 1, 2009 at 10:53 AM, Andrei Alexandrescu >> wrote: >> >>> I guess I can't bring myself to dislike tuple(1, 2) in D. >>> >> >> I'd actually be a heck of a lot happier with that than Tuple!(1,2). >> Es

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread bearophile
Andrei Alexandrescu: > So we must add lists too. Notice the the python "list" is an array dynamic on the right, it's not a linked list. Regarding tuple: I don't like the name "tuple" of typecons, because they aren't the tuples of D, they are structs. That's why I have named them Record/record

Re: Four things

2009-03-31 Thread bearophile
Rainer Deyke: > However, I'm not sure what advantage a built-in type would provide over a > library type.< Some C++ libs show that you can implement some of the optimizations I was talking about (present in Fortran compilers, that juggle, split, merge and slice nested for loops in various ways

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: So we must add lists too. Notice the the python "list" is an array dynamic on the right, it's not a linked list. I know. My point was that I might want to add a reasonable data structure to the language, and it's hard to build an argument on what to

Re: Declaring Ref Variables Inside Function Calls

2009-03-31 Thread bearophile
Andrei Alexandrescu: >D is at fault because it called typelists tuples. I told Walter not to, and he >went ahead and did so anyway. Now we're living with the consequences.< I see, and you are right. Then why not rename tuples of D2 to a more correct name (typelists)? Being D2 in alpha still the