Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Don
Andrei Alexandrescu wrote: Don wrote: Well timed. I just wrote this operator overloading proposal, part 1. http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP7 I concentrated on getting the use cases established. I'm not sure multiplication is generally commutative (e.g. in linear a

The D Manifesto

2009-10-15 Thread Justin Johansson
Where is it? [Ed, remembering of course that .. > The most important thing is remembering that black text on a white screen > carries absolutely no emotional information whatsoever, in either > direction, in any case. Thank goodness I use white text on a black screen, I get nothing but emotional

Re: MathExp: KISS or All-Out?

2009-10-15 Thread language_fan
Thu, 15 Oct 2009 02:04:09 -0400, Chad J thusly wrote: > I'm reminded of how annoying it is when there are different libraries > for a language that all define their mathematical types differently and > in incompatible ways (all of the Vec2D, Vec3D, etc ever). Also > aggravating is when there is o

Re: DIP6

2009-10-15 Thread Kagamin
Ary Borenszweig Wrote: > > On a US layout -- > > @ is Shift+2 > > but [ and ] are single keystrokes. > > > > --bb > > Ah, two keys. I thought two chars. But I use the pinky finger to do the > shift, isn't that less that a full blown finger to do [ or ]? I thought, I'll break my fingers trying

Re: DIP6

2009-10-15 Thread Kagamin
Kagamin Wrote: > Ary Borenszweig Wrote: > > > > On a US layout -- > > > @ is Shift+2 > > > but [ and ] are single keystrokes. > > > > > > --bb > > > > Ah, two keys. I thought two chars. But I use the pinky finger to do the > > shift, isn't that less that a full blown finger to do [ or ]? > >

Re: Communicating between in and out contracts

2009-10-15 Thread Kagamin
Andrei Alexandrescu Wrote: > void push(T value); > in { >auto oldLength = length(); > } > out { >assert(value == top()); >assert(length == oldLength + 1); > } > > Walter tried to implement that but it turned out to be very difficult > implementation-wis

Re: Revamped concurrency API

2009-10-15 Thread bearophile
Bartosz Milewski: >With every release of D we are narrowing our options. After D2 and TDPL, >backward compatibility will become a major thing, so every ad-hoc feature in >D2 will have to be carried over.< D is a bit compatible with the C language, but one of the main selling points of D (D1, D

Re: Communicating between in and out contracts

2009-10-15 Thread Kagamin
Chris Nicholson-Sauls Wrote: > How hard would it be to do something like this: collect any local variables > declared in > the precondition into a structure, and make that structure transparently > available to the > postcondition. So your push case above gets rewritten to something like this

Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Fawzi Mohamed
On 2009-10-14 23:09:26 +0200, "Robert Jacques" said: On Wed, 14 Oct 2009 16:49:28 -0400, Andrei Alexandrescu wrote: Jason House wrote: Bill Baxter Wrote: On Wed, Oct 14, 2009 at 7:42 AM, Jason House wrote: Andrei Alexandrescu Wrote: Right now we're in trouble with operators: opIndex

Re: MathExp: KISS or All-Out?

2009-10-15 Thread Fawzi Mohamed
On 2009-10-14 23:49:07 +0200, dsimcha said: I'm working on some mathy modules that I'd like to eventually contribute to Phobos, or, if they're too niche, to a standalone lib. One that I've alluded to here in the past few days is MathExp. Basically what it does is parse/interpret/evaluate/mani

Re: The D Manifesto

2009-10-15 Thread Justin Johansson
Justin Johansson Wrote: > Where is it? > > [Ed, remembering of course that .. > > > The most important thing is remembering that black text on a white screen > > carries absolutely no emotional information whatsoever, in either > > direction, in any case. > > Thank goodness I use white text on

Re: The D Manifesto

2009-10-15 Thread Frank Fuente
Justin Johansson Wrote: > Where is it? > > [Ed, remembering of course that .. > > > The most important thing is remembering that black text on a white screen > > carries absolutely no emotional information whatsoever, in either > > direction, in any case. > > Thank goodness I use white text on

Re: Communicating between in and out contracts

2009-10-15 Thread MIURA Masahiro
Andrei Alexandrescu wrote: >void push(T value); >in { > auto oldLength = length(); >} >out { > assert(value == top()); > assert(length == oldLength + 1); >} Another keyword abuse: void push(T value); in { auto in.oldLength = length(); } out { assert(v

Re: The D Manifesto

2009-10-15 Thread Justin Johansson
Frank Fuente Wrote: > Justin Johansson Wrote: > > > Where is it? > > > > [Ed, remembering of course that .. > > > > > The most important thing is remembering that black text on a white screen > > > carries absolutely no emotional information whatsoever, in either > > > direction, in any case. >

Re: Communicating between in and out contracts

2009-10-15 Thread Ary Borenszweig
Kagamin wrote: Andrei Alexandrescu Wrote: void push(T value); in { auto oldLength = length(); } out { assert(value == top()); assert(length == oldLength + 1); } Walter tried to implement that but it turned out to be very difficult implementation-wise.

Re: The D Manifesto

2009-10-15 Thread Frank Fuente
Justin Johansson Wrote: > Frank Fuente Wrote: > > > Justin Johansson Wrote: > > > > > Where is it? > > > > > > [Ed, remembering of course that .. > > > > > > > The most important thing is remembering that black text on a white > > > > screen > > > > carries absolutely no emotional information

Re: Eliminate assert and lazy from D?

2009-10-15 Thread language_fan
Tue, 13 Oct 2009 02:50:11 -0400, bearophile thusly wrote: > Andrei Alexandrescu Wrote: > >> Usually you're >> all for adding features (hey, you just brought up the switch again! >> isn't that ironic?) and cleaning up bad parts of the language, > > Sorry, I'm not a computer scientist, and surely

Re: Eliminate assert and lazy from D?

2009-10-15 Thread language_fan
Tue, 13 Oct 2009 08:51:16 +0200, Frank Benoit thusly wrote: > If it is evaluated exactly once, you do not need lazy at all. And if it > may also not be evaluated, the callers code is not less safe as when > evaluated multiple times. Call by name has its uses. E.g. custom control structures, infin

A time to turn -

2009-10-15 Thread Justin Johansson
- the page. Is this a D1 or a D2 discussion forum? I find it rather humiliating to respond to a post in a D1 context and later finding out that the OP was coming from a D2 context.* (*In reference to a post I made earlier today re XML for D, ranges, streams etc.) It's time to split digitalmar

Re: MathExp: KISS or All-Out?

2009-10-15 Thread Bill Baxter
On Wed, Oct 14, 2009 at 2:49 PM, dsimcha wrote: > I'm working on some mathy modules that I'd like to eventually contribute to > Phobos, or, if they're too niche, to a standalone lib. > One that I've alluded > to here in the past few days is MathExp. Basically what it does is > parse/interpret/eva

Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Steven Schveighoffer
On Thu, 15 Oct 2009 02:58:51 -0400, Don wrote: Andrei Alexandrescu wrote: Also, the much-discussed identity: x @= y<-->x = x @ y is difficult to enforce statically in practice. I think some types would want to define both to achieve good efficiency. It would be hard for the compi

I feel outraged -

2009-10-15 Thread Justin Johansson
- that the .sizeof a delegate is 8 bytes (on a 32-bit machine). AFAIK, stack pushes are still more expensive than a pointer dereference in contemporary CPU architectures. Justin

Re: I feel outraged -

2009-10-15 Thread Steven Schveighoffer
On Thu, 15 Oct 2009 07:15:45 -0400, Justin Johansson wrote: - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). AFAIK, stack pushes are still more expensive than a pointer dereference in contemporary CPU architectures. How do you propose to fix it? I think it is the minimal

What's up anyway -

2009-10-15 Thread downs
Justin Johansson wrote: > - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). > > AFAIK, stack pushes are still more expensive than a pointer dereference in > contemporary > CPU architectures. > > Justin - with this weird way of writing posts? The subject should tell us about the c

Re: MathExp: KISS or All-Out?

2009-10-15 Thread Don
Bill Baxter wrote: On Wed, Oct 14, 2009 at 2:49 PM, dsimcha wrote: I'm working on some mathy modules that I'd like to eventually contribute to Phobos, or, if they're too niche, to a standalone lib. One that I've alluded to here in the past few days is MathExp. Basically what it does is parse/i

Re: What's up anyway -

2009-10-15 Thread Justin Johansson
downs Wrote: > Justin Johansson wrote: > > - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). > > > > AFAIK, stack pushes are still more expensive than a pointer dereference in > > contemporary > > CPU architectures. > > > > Justin > > - with this weird way of writing posts? The s

Re: What's up anyway -

2009-10-15 Thread bearophile
Justin Johansson: > downs: > > Also I have no idea what you mean. Should delegate _values_ be heap > > allocated?! That'd be insanity. Also, I'm fairly sure you're wrong. The > > stack is relatively likely to be in the CPU cache. A random pointer > > dereferencing .. isn't. Also, do you really

Re: MathExp: KISS or All-Out?

2009-10-15 Thread Bill Baxter
On Thu, Oct 15, 2009 at 4:36 AM, Don wrote: > Bill Baxter wrote: >> >> On Wed, Oct 14, 2009 at 2:49 PM, dsimcha wrote: >>> >>> I'm working on some mathy modules that I'd like to eventually contribute >>> to >>> Phobos, or, if they're too niche, to a standalone lib. >>> One that I've alluded >>> t

Re: What's up anyway -

2009-10-15 Thread Steven Schveighoffer
On Thu, 15 Oct 2009 07:45:02 -0400, Justin Johansson wrote: downs Wrote: Justin Johansson wrote: > - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). > > AFAIK, stack pushes are still more expensive than a pointer dereference in contemporary > CPU architectures. > > Justin

Re: What's up anyway -

2009-10-15 Thread Justin Johansson
bearophile Wrote: > Justin Johansson: > > > downs: > > > Also I have no idea what you mean. Should delegate _values_ be heap > > > allocated?! That'd be insanity. Also, I'm fairly sure you're wrong. The > > > stack is relatively likely to be in the CPU cache. A random pointer > > > dereferenci

Re: A time to turn -

2009-10-15 Thread Moritz Warning
On Thu, 15 Oct 2009 07:03:27 -0400, Justin Johansson wrote: > - the page. > > Is this a D1 or a D2 discussion forum? > > I find it rather humiliating to respond to a post in a D1 context and > later finding out that the OP was coming from a D2 context.* > > (*In reference to a post I made earli

Benchmark results: delegate fast, functor no faster, memory allocation slow. Really slow.

2009-10-15 Thread downs
Two discoveries were made from this benchmark. 1) There is no appreciable speed difference between delegates and functors. I re-ran the benchmark several times; sometimes one was faster, sometimes the other - no clear advantage was discernible. The visible differences can be blamed on experimen

Re: Benchmark results: delegate fast, functor no faster, memory allocation slow. Really slow.

2009-10-15 Thread downs
On consideration, this wasn't a test of the two methods at all, but a test of the compiler's ability to inline. Disregard it.

Re: I feel outraged -

2009-10-15 Thread Don
Justin Johansson wrote: - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). AFAIK, stack pushes are still more expensive than a pointer dereference in contemporary CPU architectures. Justin Not so. On 286 and earlier, stack pushes were more expensive. They're the same on 386 an

Re: Get name of alias parameter at compile time?

2009-10-15 Thread dsimcha
Jacob Carlborg Wrote: > On 10/14/09 06:36, dsimcha wrote: > > Is there a way to get the name of an alias parameter at compile time? For > > example: > > > > void doStuff() { > > // Do stuff. > > } > > > > void templ(alias fun)() { > > writeln(fun.stringof); // Prints doStuff. > > } > >

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Denis Koroskin
On Thu, 15 Oct 2009 18:22:37 +0400, dsimcha wrote: Jacob Carlborg Wrote: On 10/14/09 06:36, dsimcha wrote: > Is there a way to get the name of an alias parameter at compile time? For > example: > > void doStuff() { > // Do stuff. > } > > void templ(alias fun)() { > writeln(fun.st

Re: What's up anyway -

2009-10-15 Thread Jeremie Pelletier
Justin Johansson wrote: downs Wrote: Justin Johansson wrote: - that the .sizeof a delegate is 8 bytes (on a 32-bit machine). AFAIK, stack pushes are still more expensive than a pointer dereference in contemporary CPU architectures. Justin - with this weird way of writing posts? The subject

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Lutger
Denis Koroskin wrote: > On Thu, 15 Oct 2009 18:22:37 +0400, dsimcha wrote: > >> Jacob Carlborg Wrote: >> >>> On 10/14/09 06:36, dsimcha wrote: >>> > Is there a way to get the name of an alias parameter at compile >>> time? For >>> > example: >>> > >>> > void doStuff() { >>> > // Do stuff.

Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Robert Jacques
On Thu, 15 Oct 2009 04:48:57 -0400, Fawzi Mohamed wrote: On 2009-10-14 23:09:26 +0200, "Robert Jacques" said: On Wed, 14 Oct 2009 16:49:28 -0400, Andrei Alexandrescu wrote: Jason House wrote: Bill Baxter Wrote: On Wed, Oct 14, 2009 at 7:42 AM, Jason House wrote: Andrei Alexandresc

Re: Get name of alias parameter at compile time?

2009-10-15 Thread dsimcha
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article > Denis Koroskin wrote: > > On Thu, 15 Oct 2009 18:22:37 +0400, dsimcha wrote: > > > >> Jacob Carlborg Wrote: > >> > >>> On 10/14/09 06:36, dsimcha wrote: > >>> > Is there a way to get the name of an alias parameter at compile > >>> tim

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Lutger
Bah, I replied too soon. These also work, makes sense now I think about it: void doStuff(int a ) {} void templ(alias fun)() { writeln( (&fun).stringof[2..$] ); // prints doStuff (really) writeln( fun(int.init).stringof ); // prints doStuff(0) }

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Lutger
dsimcha wrote: > > Yeah, now that I look into it further, what you describe is exactly the > problem. > The obvious way only works for functions w/o parameters. I simplified my > example before I posted it and never bothered to test it. See my reply to my reply (sorry!) for a better way to make

Re: dmd support for IDEs

2009-10-15 Thread Adam D. Ruppe
Sorry for the slow reply here; I keep getting sidetracked. On Mon, Oct 12, 2009 at 08:05:06PM -0500, Andrei Alexandrescu wrote: > One cool thing is combining sshfs with autofs. That way the connection > is automatically made when you first open a dir. For example, if I write: That looks cool. I'l

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Jacob Carlborg
On 10/15/09 17:55, dsimcha wrote: == Quote from Lutger (lutger.blijdest...@gmail.com)'s article Denis Koroskin wrote: On Thu, 15 Oct 2009 18:22:37 +0400, dsimcha wrote: Jacob Carlborg Wrote: On 10/14/09 06:36, dsimcha wrote: Is there a way to get the name of an alias parameter at compile

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Jacob Carlborg
On 10/15/09 18:06, Lutger wrote: dsimcha wrote: Yeah, now that I look into it further, what you describe is exactly the problem. The obvious way only works for functions w/o parameters. I simplified my example before I posted it and never bothered to test it. See my reply to my reply (sorry!

Re: Get name of alias parameter at compile time?

2009-10-15 Thread Lutger
Jacob Carlborg wrote: ... > > Oh, that problem. Just use a function pointer and get the name of that > instead, like this: > http://www.dsource.org/projects/dstep/browser/dstep/internal/Traits.d > (functionNameOf at line 17) Right, good to know LDC does get it right. I found one bugzilla repor

OT Renting a dedicated Server in the US

2009-10-15 Thread BLS
Sorry OT, I would like to rent a dedicated (root) server in the United States Linux Ubuntu 8, min 4GB. so nothing special... Do you have any recommendations ? TIA, Björn

Re: OT Renting a dedicated Server in the US

2009-10-15 Thread Dominik
"BLS" wrote in message news:hb7kml$lh...@digitalmars.com... > Sorry OT, > > I would like to rent a dedicated (root) server in the United States > Linux Ubuntu 8, min 4GB. so nothing special... > Do you have any recommendations ? > > TIA, Björn http://www.fdcservers.net/ (has unmetered 100 and d

[OT] sshfs rocks and sucks

2009-10-15 Thread Andrei Alexandrescu
Adam D. Ruppe wrote: The sshfs lag isn't much, but it adds up quickly when doing several small changes. I find that if any given task takes hours, I can be very patient, but if it takes milliseconds, I get annoyed easily! I agree. I coquetted with the idea of passing sshfs the option of doing

Re: OT Renting a dedicated Server in the US

2009-10-15 Thread BLS
On 15/10/2009 19:04, BLS wrote: Sorry OT, I would like to rent a dedicated (root) server in the United States Linux Ubuntu 8, min 4GB. so nothing special... Do you have any recommendations ? TIA, Björn @ Domnik Sold out ? @ All Should add my price limit is about 150 USD

Re: OT Renting a dedicated Server in the US

2009-10-15 Thread Dominik
"BLS" wrote in message news:hb7mmi$p8...@digitalmars.com... > On 15/10/2009 19:04, BLS wrote: >> Sorry OT, >> >> I would like to rent a dedicated (root) server in the United States >> Linux Ubuntu 8, min 4GB. so nothing special... >> Do you have any recommendations ? >> >> TIA, Björn > > @ Domni

Re: dmd support for IDEs

2009-10-15 Thread language_fan
Sun, 11 Oct 2009 10:48:30 +, language_fan thusly wrote: > Well since there is already a project working on an Eclipse plugin, I > see little use for other IDEs at the moment. The D community is rather > small and only a small amount of people are capable of developing and > willing to donate t

Re: Revamped concurrency API

2009-10-15 Thread Andrei Alexandrescu
bearophile wrote: Bartosz Milewski: With every release of D we are narrowing our options. After D2 and TDPL, backward compatibility will become a major thing, so every ad-hoc feature in D2 will have to be carried over.< D is a bit compatible with the C language, but one of the main selling

Re: Revamped concurrency API

2009-10-15 Thread Bartosz Milewski
bearophile Wrote: > Jeremie Pelletier: > > > I vote for a 'lent' qualifier to be implemented in the compiler. > > You may be right, and Bartosz has explained me why and how to use lent. It > sounds like a nice idea, but it has some costs too (in language complexity, > for example). But I need

Re: Revamped concurrency API

2009-10-15 Thread Bill Baxter
On Thu, Oct 15, 2009 at 12:47 PM, Andrei Alexandrescu wrote: > bearophile wrote: >> >> Bartosz Milewski: >> >>> With every release of D we are narrowing our options. After D2 and TDPL, >>> backward compatibility will become a major thing, so every ad-hoc feature in >>> D2 will have to be carried o

Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Fawzi Mohamed
On 2009-10-15 17:51:56 +0200, "Robert Jacques" said: On Thu, 15 Oct 2009 04:48:57 -0400, Fawzi Mohamed wrote: [...] Note that a ref return for opIndex, could work in most situations. As Bill correctly pointed out sparse matrix offer the most challenging example, there one wants to have two

I feel -

2009-10-15 Thread Gemaine Frazier
completely chilled - a glass or two of wine will do that...

Re: Revamped concurrency API

2009-10-15 Thread Fawzi Mohamed
On 2009-10-15 21:47:05 +0200, Andrei Alexandrescu said: Speaking of switch, I have tried to convince Walter to require either a break; or a goto case xxx; at the end of each snippet inside a switch. I was surprised by his answer: "but I use fall through all the time!" :o) that shows that h

Re: A possible solution for the opIndexXxxAssign morass

2009-10-15 Thread Fawzi Mohamed
On 2009-10-15 22:55:02 +0200, Fawzi Mohamed said: On 2009-10-15 17:51:56 +0200, "Robert Jacques" said: On Thu, 15 Oct 2009 04:48:57 -0400, Fawzi Mohamed wrote: [...] Note that a ref return for opIndex, could work in most situations. As Bill correctly pointed out sparse matrix offer the mo

I love -

2009-10-15 Thread downs
Gemaine Frazier wrote: > completely chilled - a glass or two of wine will do that... you all! Except you, weird spacey goat thing. You freak me out. But man this is some FINE weed!

Re: I love -

2009-10-15 Thread Nick Sabalausky
"downs" wrote in message news:hb83h6$1ht...@digitalmars.com... > Gemaine Frazier wrote: >> completely chilled - a glass or two of wine will do that... > > you all! Except you, weird spacey goat thing. You freak me out. > > But man this is some FINE weed! >From "Half Baked", right?

Re: I love -

2009-10-15 Thread Jeremie Pelletier
Nick Sabalausky wrote: "downs" wrote in message news:hb83h6$1ht...@digitalmars.com... Gemaine Frazier wrote: completely chilled - a glass or two of wine will do that... you all! Except you, weird spacey goat thing. You freak me out. But man this is some FINE weed! From "Half Baked", right?

Error: /PAGESIZE:512 is too small

2009-10-15 Thread Jeremie Pelletier
Error: /PAGESIZE:512 is too small I get this from the librarian when building wxD, if I use /PAGESIZE:1024 it works, but then using the linker against the resulting wxd.lib gives: Warning 178: .LIB pagesize exceeds 512 The executable is still linked but this is a weird error/warning combo fr

Aliasing, and more

2009-10-15 Thread bearophile
I have discussed this topic a little in the past, but I didn't receive a good answer. So I try again explaining the situation better for Walter too. I don't need a full specs for the D1/D2 languages, but now and then a little more language specification helps. In C there are several undefined/un

Re: A time to turn -

2009-10-15 Thread Tim Matthews
Justin Johansson wrote: - the page. Is this a D1 or a D2 discussion forum? I find it rather humiliating to respond to a post in a D1 context and later finding out that the OP was coming from a D2 context.* (*In reference to a post I made earlier today re XML for D, ranges, streams etc.) It'

T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
I talked to Walter about T[new] today and it seems we are having a disagreement. The problem is that I believe T[new] is a container, whereas Walter believes T[new] is nothing but a slice with a couple of extra operations. Paradoxically this seems to be conducive to subtle efficiency issues.

Re: T[new] misgivings

2009-10-15 Thread Rainer Deyke
Andrei Alexandrescu wrote: > int[new] a; > > a = [1, 2, 3]; > > What should that do? This question can be rephrased as, "should 'int[new]' be a reference type or a value type (or something else)?" If 'int[new]' is a reference type, then it must rebind, because that's what assignment does fo

Re: Revamped concurrency API (Don can you contact Bartosz ?)

2009-10-15 Thread Nick B
Nick B wrote: Bartosz Milewski wrote: Nick B Wrote: Could you give us _any_ kind of test case (even if it's enormous)? Bartosz - are you able to provide a test case as requested by Don ? Then it might be possible, to get this bug fixed. Nick B. I can send you the files I have checked out. T

Re: T[new] misgivings

2009-10-15 Thread Walter Bright
Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot be implicitly converted to T[new]

Re: T[new] misgivings

2009-10-15 Thread Robert Jacques
On Thu, 15 Oct 2009 23:16:56 -0400, Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot be implicitly converted to T[new] I agr

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot be implicitly converted to T[new] Then your argument building on similarity betw

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Rainer Deyke wrote: Andrei Alexandrescu wrote: int[new] a; a = [1, 2, 3]; What should that do? This question can be rephrased as, "should 'int[new]' be a reference type or a value type (or something else)?" If 'int[new]' is a reference type, then it must rebind, because that's what assi

Re: T[new] misgivings

2009-10-15 Thread Robert Jacques
On Thu, 15 Oct 2009 22:55:07 -0400, Andrei Alexandrescu wrote: I talked to Walter about T[new] today and it seems we are having a disagreement. The problem is that I believe T[new] is a container, whereas Walter believes T[new] is nothing but a slice with a couple of extra operations.

Re: T[new] misgivings

2009-10-15 Thread Jason House
Andrei Alexandrescu Wrote: > I talked to Walter about T[new] today and it seems we are having a > disagreement. > > The problem is that I believe T[new] is a container, whereas Walter > believes T[new] is nothing but a slice with a couple of extra operations. > > Paradoxically this seems to be

Re: T[new] misgivings

2009-10-15 Thread Jeremie Pelletier
Andrei Alexandrescu wrote: I talked to Walter about T[new] today and it seems we are having a disagreement. The problem is that I believe T[new] is a container, whereas Walter believes T[new] is nothing but a slice with a couple of extra operations. I agree with the container model, it shoul

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Robert Jacques wrote: I like (and have used) the opSliceAssign syntax to represent by value/copy assignment as opposed to opAssign's by reference syntax. You could always define T[new] auto-resize in the case of a[] = b, but then you'd have to decide if that behavior should be extended to slice

Re: T[new] misgivings

2009-10-15 Thread Rainer Deyke
Andrei Alexandrescu wrote: > Rainer Deyke wrote: >> To answer the rephrased question: 'int[new]' should be a value type. > > Well Walter and I agreed they should be pass-by-reference. That doesn't > mean they must be references, and the fact that the simplest syntax has > the worst efficiency remi

Re: T[new] misgivings

2009-10-15 Thread Rainer Deyke
Andrei Alexandrescu wrote: > Then your argument building on similarity between the two is weakened. > > T[new] a; > T[] b; > > a = [1, 2, 3]; > b = [1, 2, 3]; > > Central to your argument was that the two must do the same thing. Since > now literals are in a whole new league (they aren't sli

Re: I love -

2009-10-15 Thread downs
Jeremie Pelletier wrote: > Nick Sabalausky wrote: >> "downs" wrote in message >> news:hb83h6$1ht...@digitalmars.com... >>> Gemaine Frazier wrote: completely chilled - a glass or two of wine will do that... >>> you all! Except you, weird spacey goat thing. You freak me out. >>> >>> But man thi

Re: T[new] misgivings

2009-10-15 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > I talked to Walter about T[new] today and it seems we are having a > disagreement. > The problem is that I believe T[new] is a container, whereas Walter > believes T[new] is nothing but a slice with a couple of extra oper

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Rainer Deyke wrote: Andrei Alexandrescu wrote: Rainer Deyke wrote: To answer the rephrased question: 'int[new]' should be a value type. Well Walter and I agreed they should be pass-by-reference. That doesn't mean they must be references, and the fact that the simplest syntax has the worst effi

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Rainer Deyke wrote: Andrei Alexandrescu wrote: Then your argument building on similarity between the two is weakened. T[new] a; T[] b; a = [1, 2, 3]; b = [1, 2, 3]; Central to your argument was that the two must do the same thing. Since now literals are in a whole new league (they aren't

Re: T[new] misgivings

2009-10-15 Thread Jeremie Pelletier
Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot be implicitly converted to T[new] Then your argument

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot be implicitly converted to T

Re: T[new] misgivings

2009-10-15 Thread Jeremie Pelletier
Andrei Alexandrescu wrote: Jeremie Pelletier wrote: Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should that do? Error. T[] cannot

Re: T[new] misgivings

2009-10-15 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Andrei Alexandrescu wrote: Jeremie Pelletier wrote: Andrei Alexandrescu wrote: Walter Bright wrote: Andrei Alexandrescu wrote: This goes into something more interesting that I thought of after the conversation. Consider: T[new] a; T[] b; ... a = b; What should tha

Re: Delegate perfomance (outrage was redherring)

2009-10-15 Thread Justin Johansson
bearophile Wrote: > Justin Johansson: > > > downs: > > > Also I have no idea what you mean. Should delegate _values_ be heap > > > allocated?! That'd be insanity. Also, I'm fairly sure you're wrong. The > > > stack is relatively likely to be in the CPU cache. A random pointer > > > dereferenci

Re: I love -

2009-10-15 Thread Jeremie Pelletier
downs wrote: Jeremie Pelletier wrote: Nick Sabalausky wrote: "downs" wrote in message news:hb83h6$1ht...@digitalmars.com... Gemaine Frazier wrote: completely chilled - a glass or two of wine will do that... you all! Except you, weird spacey goat thing. You freak me out. But man this is som

Re: Revamped concurrency API

2009-10-15 Thread Chris Nicholson-Sauls
Bill Baxter wrote: case 1: case 3: break; should still be allowed. --bb Or replace with: case 1, 3: break; -- Chris Nicholson-Sauls

Re: Eliminate assert and lazy from D?

2009-10-15 Thread Chris Nicholson-Sauls
Andrei Alexandrescu wrote: Adam D. Ruppe wrote: If not, it seems kinda weird that assert() is just a lib function, but if you put static before it, it becomes a completely different thing. That kinda takes the wind out of the sails of the "remove assert" ship. It randomly occurred to me ear

Re: T[new] misgivings

2009-10-15 Thread Rainer Deyke
Andrei Alexandrescu wrote: > Rainer Deyke wrote: >> So, what's the syntax for user-defined value types that are passed by >> reference going to be? ref struct? opPass? > > No need for new syntax. T[new] is a struct that has a pointer inside. Without new syntax, there's no way to distinguish bet

Re: The D Manifesto

2009-10-15 Thread Chris Nicholson-Sauls
Frank Fuente wrote: Justin Johansson Wrote: Frank Fuente Wrote: Justin Johansson Wrote: Where is it? [Ed, remembering of course that .. The most important thing is remembering that black text on a white screen carries absolutely no emotional information whatsoever, in either direction, i

Re: OT Renting a dedicated Server in the US

2009-10-15 Thread Chris Nicholson-Sauls
BLS wrote: Sorry OT, I would like to rent a dedicated (root) server in the United States Linux Ubuntu 8, min 4GB. so nothing special... Do you have any recommendations ? TIA, Björn http://www.linode.com/ -- Chris Nicholson-Sauls

Re: Delegate perfomance (outrage was redherring)

2009-10-15 Thread bearophile
Justin Johansson: > this turns out to be > a clear demonstration of the performance-enhancing power of D delegates over > an > otherwise ingrained C++ thinking approach. I have changed your benchmark a little, you may want to look at its timings too (I have taken timings with it with DMD and LD