Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 11:03 PM, Nick Sabalausky wrote: On Tue, 18 Sep 2012 18:02:10 -0400 Andrei Alexandrescu wrote: On 9/18/12 5:07 PM, "Øivind" wrote: * For all tests, the best run is selected, but would it not be reasonable in some cases to get the average value? Maybe excluding the runs that are mor

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 3:01 PM, foobar wrote: On Thursday, 20 September 2012 at 12:35:15 UTC, Andrei Alexandrescu wrote: Let's use the minimum. It is understood it's not what you'll see in production, but it is an excellent proxy for indicative and reproducible performance numbers. Andrei From the resp

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 2:37 PM, Jacob Carlborg wrote: On 2012-09-20 14:36, Andrei Alexandrescu wrote: Let's use the minimum. It is understood it's not what you'll see in production, but it is an excellent proxy for indicative and reproducible performance numbers. Why not min, max and average? For a ver

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 10:05 AM, Manu wrote: On 20 September 2012 15:36, Andrei Alexandrescu mailto:seewebsiteforem...@erdani.org>> wrote: Let's use the minimum. It is understood it's not what you'll see in production, but it is an excellent proxy for indicative and reproducible performance numbe

GDC Explorer - an online disassembler for D

2012-09-20 Thread Andrei Alexandrescu
I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. We got to talk a bit about D and he hacked together support for D by using gdc. Take a look at http://d.godbolt.org, I think it's pretty darn cool! I'm talking to him ab

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Nick Sabalausky
On Tue, 18 Sep 2012 18:02:10 -0400 Andrei Alexandrescu wrote: > On 9/18/12 5:07 PM, "Øivind" wrote: > > * For all tests, the best run is selected, but would it not be > > reasonable in some cases to get the average value? Maybe excluding > > the runs that are more than a couple std. deviations aw

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 1:37 PM, Jacob Carlborg wrote: On 2012-09-20 14:36, Andrei Alexandrescu wrote: Let's use the minimum. It is understood it's not what you'll see in production, but it is an excellent proxy for indicative and reproducible performance numbers. Why not min, max and average? Because m

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Timon Gehr
On 09/21/2012 12:29 AM, Jonathan M Davis wrote: ... In order for your foo function to be called, it must be fully compiled first (including its entire body, since CTFE needs the full definition of the function, not just its signature). The body cannot be fully compiled until the template that it'

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Timon Gehr
On 09/20/2012 11:22 PM, Jens Mueller wrote: Hi, I do not understand the following error message given the code: string foo(string f) { if (f == "somestring") { return "got somestring"; } return bar!(foo("somestring")); } template bar(string s) { enum bar = s;

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jonathan M Davis
On Friday, September 21, 2012 00:29:48 Jonathan M Davis wrote: > As far as a function's behavior goes, > it's identical regardless of whether it's run at compile time or runtime > (save that __ctfe is true at compile time but not runtime). Actually, that's not quite true (though it's very close).

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jonathan M Davis
On Friday, September 21, 2012 00:11:51 Jens Mueller wrote: > I thought foo is interpreted at compile time. > There seems to be a subtle difference I'm not getting. > Because you can do the factorial using CTFE even though you have > recursion. I.e. there you have a call to the function itself. I.e.

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jens Mueller
Jonathan M Davis wrote: > On Thursday, September 20, 2012 23:22:36 Jens Mueller wrote: > > Hi, > > > > I do not understand the following error message given the code: > > > > string foo(string f) > > { > > if (f == "somestring") > > { > > return "got somestring"; > > } > > return bar!(foo("somest

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jens Mueller
Simen Kjaeraas wrote: > On Thu, 20 Sep 2012 23:22:36 +0200, Jens Mueller > wrote: > > >string foo(string f) > >{ > >if (f == "somestring") > >{ > >return "got somestring"; > >} > >return bar!(foo("somestring")); > >} > > > >template bar(string s) > >{ > >enum bar = s;

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Peter Alexander
I'm guessing the problem is that it's trying to call CTFE on a function whose full AST isn't known yet (because it requires the CTFE param, which requires the function etc.) This could work in theory, but I'm guessing the implementation is tricky.

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jens Mueller
Jonathan M Davis wrote: > On Thursday, September 20, 2012 22:55:23 Jens Mueller wrote: > > You say that JUnit silently runs all unittests before the first > > specified one, don't you? > > Yes. At least, that was its behavior the last time that I used it (which was > admittedly a few years ago).

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 23:22:36 Jens Mueller wrote: > Hi, > > I do not understand the following error message given the code: > > string foo(string f) > { > if (f == "somestring") > { > return "got somestring"; > } > return bar!(foo("somestring")); > } > > template bar(string s) > { > e

Re: [OT] Was: totally satisfied :D

2012-09-20 Thread Nick Sabalausky
On Tue, 18 Sep 2012 00:29:11 -0700 Walter Bright wrote: > > I tend to snicker at companies that insist they only hire the top 1%. > It seems that about 90% of the engineers out there must be in that > top 1% . > I bet that's marketing-speak for "Our applicant-to-hire ratio is 100:1, and natural

Re: Infer function template parameters

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 21:57:47 Jonas Drewsen wrote: > In foreach statements the type can be inferred: > > foreach (MyFooBar fooBar; fooBars) writeln(fooBar); > same as: > foreach (foobar; fooBars) writeln(fooBar); > > This is nice and tidy. > Wouldn't it make sense to allow the same for

Re: CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Simen Kjaeraas
On Thu, 20 Sep 2012 23:22:36 +0200, Jens Mueller wrote: string foo(string f) { if (f == "somestring") { return "got somestring"; } return bar!(foo("somestring")); } template bar(string s) { enum bar = s; } In line 7 I call the template bar. But I call with the

CTFE calling a template: Error: expression ... is not a valid template value argument

2012-09-20 Thread Jens Mueller
Hi, I do not understand the following error message given the code: string foo(string f) { if (f == "somestring") { return "got somestring"; } return bar!(foo("somestring")); } template bar(string s) { enum bar = s; } I'll with dmd v2.060 get: test.d(7):calle

Re: [OT] Was: totally satisfied :D

2012-09-20 Thread Nick Sabalausky
On Thu, 20 Sep 2012 08:46:00 -0400 "Steven Schveighoffer" wrote: > On Wed, 19 Sep 2012 17:05:35 -0400, Nick Sabalausky > wrote: > > > On Wed, 19 Sep 2012 10:11:50 -0400 > > "Steven Schveighoffer" wrote: > > > >> I cannot argue that Apple's audio volume isn't too simplistic for > >> its own g

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 22:55:23 Jens Mueller wrote: > You say that JUnit silently runs all unittests before the first > specified one, don't you? Yes. At least, that was its behavior the last time that I used it (which was admittedly a few years ago). > If that is done silently that's i

Re: Infer function template parameters

2012-09-20 Thread Timon Gehr
On 09/20/2012 10:52 PM, Peter Alexander wrote: On Thursday, 20 September 2012 at 19:56:48 UTC, Jonas Drewsen wrote: Wouldn't it make sense to allow the same for function templates as well: What am I missing (except some code that needs chaging because only param type and not name has been spec

Re: LDC blacklisted in Ubuntu

2012-09-20 Thread David Nadlinger
On Thursday, 20 September 2012 at 20:07:56 UTC, Jonas Drewsen wrote: I've done some debs before and might be able to find some time to do it depending on how complex the package is. I haven't tried LDC before though. Can you provide some info on how to get started with the LDC building/packagi

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Tobias Pankrath
On Thursday, 20 September 2012 at 16:52:40 UTC, Johannes Pfau wrote: snip It should be possible to generate test cases programmatically [at compile time]. For instance if I have a program that reads files in format A and produces B (e.g. a compiler) it should be possible to have a folder wi

Re: Infer function template parameters

2012-09-20 Thread Timon Gehr
On 09/20/2012 09:57 PM, Jonas Drewsen wrote: ... What am I missing (except some code that needs chaging because only param type and not name has been specified in [i]t? Nothing, that is about it. (C backwards-compatibility could maybe be added) Of course, we could make upper case identifiers i

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jens Mueller
Jonathan M Davis wrote: > On Thursday, September 20, 2012 18:53:38 Johannes Pfau wrote: > > Proposal: > [snip] > > In general, I'm all for instrumenting druntime such that unit testing tools > could run unit tests individually and present their output in a customized > manner, just so long as it

Re: Infer function template parameters

2012-09-20 Thread Peter Alexander
On Thursday, 20 September 2012 at 19:56:48 UTC, Jonas Drewsen wrote: Wouldn't it make sense to allow the same for function templates as well: What am I missing (except some code that needs chaging because only param type and not name has been specified in t? I can't see any implementation i

Re: LDC blacklisted in Ubuntu

2012-09-20 Thread David Nadlinger
On Thursday, 20 September 2012 at 18:03:18 UTC, David Nadlinger wrote: Unfortunately, nobody on the core dev team uses Ubuntu for their daily work, or has other experiences with Debian packages. I didn't mean "packages" of course, but "packaging". Knowing how to use dpkg or build the occasiona

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jens Mueller
Johannes Pfau wrote: > Current situation: > The compiler combines all unittests of a module into one huge function. > If a unittest in a module fails, the rest won't be executed. The > runtime (which is responsible for calling that per module unittest > method) must always run all unittests of a mo

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 18:53:38 Johannes Pfau wrote: > Proposal: [snip] In general, I'm all for instrumenting druntime such that unit testing tools could run unit tests individually and present their output in a customized manner, just so long as it doesn't really change how unit tests

Re: LDC blacklisted in Ubuntu

2012-09-20 Thread Jonas Drewsen
On Thursday, 20 September 2012 at 18:03:18 UTC, David Nadlinger wrote: On Thursday, 20 September 2012 at 17:26:25 UTC, Joseph Rushton Wakeling wrote: Some rather urgent news: LDC has just been blacklisted in Ubuntu. It would be great if somebody from the D community experienced in packaging c

Re: Infer function template parameters

2012-09-20 Thread Jonas Drewsen
On Thursday, 20 September 2012 at 19:56:48 UTC, Jonas Drewsen wrote: In foreach statements the type can be inferred: Clicked the send butten too early by mistake but I guess you get the idea. /Jonas

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Johannes Pfau
Am Thu, 20 Sep 2012 20:51:47 +0200 schrieb Jacob Carlborg : > On 2012-09-20 19:37, Johannes Pfau wrote: > > > That's just an example output. We could leave the druntime > > test runner as is and don't change the output at all. We could only > > print the failure messages. Or we could collect all

Re: Review of Andrei's std.benchmark

2012-09-20 Thread foobar
On Thursday, 20 September 2012 at 12:35:15 UTC, Andrei Alexandrescu wrote: On 9/20/12 2:42 AM, Manu wrote: On 19 September 2012 12:38, Peter Alexander > wrote: The fastest execution time is rarely useful to me, I'm almost always much

Re: Why do not have `0o` prefix for octal numbers?

2012-09-20 Thread monarch_dodra
On Thursday, 20 September 2012 at 18:12:50 UTC, Steven Schveighoffer wrote: On Wed, 19 Sep 2012 12:15:19 -0400, monarch_dodra wrote: On Wednesday, 19 September 2012 at 16:02:41 UTC, Hauleth wrote: Some time ago I've asked on SO why most languages have `0` prefix for octal numbers. My opinion

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jacob Carlborg
On 2012-09-20 19:37, Johannes Pfau wrote: That's just an example output. We could leave the druntime test runner as is and don't change the output at all. We could only print the failure messages. Or we could collect all failures and print them at the end. All that can easily be changed in drunt

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Dmitry Olshansky
On 20-Sep-12 22:18, bearophile wrote: Johannes Pfau: The perfect solution: Would allow user defined attributes on tests, so you could name them, assign categories, etc. But till we have those user defined attributes, this seems to be a good solution. We have @disable, maybe it's usable for un

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Jacob Carlborg
On 2012-09-20 14:36, Andrei Alexandrescu wrote: Let's use the minimum. It is understood it's not what you'll see in production, but it is an excellent proxy for indicative and reproducible performance numbers. Why not min, max and average? -- /Jacob Carlborg

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread bearophile
Johannes Pfau: The perfect solution: Would allow user defined attributes on tests, so you could name them, assign categories, etc. But till we have those user defined attributes, this seems to be a good solution. We have @disable, maybe it's usable for unittests too :-) Bye, bearophile

Re: Why do not have `0o` prefix for octal numbers?

2012-09-20 Thread Steven Schveighoffer
On Wed, 19 Sep 2012 12:15:19 -0400, monarch_dodra wrote: On Wednesday, 19 September 2012 at 16:02:41 UTC, Hauleth wrote: Some time ago I've asked on SO why most languages have `0` prefix for octal numbers. My opinion is the same as D designers that it cause a lot of bugs, but why octal nu

Re: LDC blacklisted in Ubuntu

2012-09-20 Thread David Nadlinger
On Thursday, 20 September 2012 at 17:26:25 UTC, Joseph Rushton Wakeling wrote: Some rather urgent news: LDC has just been blacklisted in Ubuntu. It is not really news, as the LDC version in the Debian repo has not been updated for ages. But yes, it would definitely be important to have an LDC

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Johannes Pfau
Am Thu, 20 Sep 2012 19:27:00 +0200 schrieb "Jesse Phillips" : > > I didn't read everything in your post, where does the FAILURE > show up. If it is intermixed with the SUCCESS, then I could see > that as a problem. > > While I can't say I've hated/liked the lack of output for > unittest succ

Re: Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Jesse Phillips
On Thursday, 20 September 2012 at 16:52:40 UTC, Johannes Pfau wrote: Sample output: Testing generated/linux/debug/32/unittest/std/array std/array.d:86 SUCCESS std/array.d:145 SUCCESS std/array.d:183 SUCCESS std/array.d:200 SUCCESS std/array.d:231 SUCCESS

LDC blacklisted in Ubuntu

2012-09-20 Thread Joseph Rushton Wakeling
Some rather urgent news: LDC has just been blacklisted in Ubuntu. https://bugs.launchpad.net/ubuntu/+source/ldc/+bug/941549 This seems to be entirely down to no one keeping the Debian universe up to date with the latest LDC work. :-( Could someone on the LDC team get in touch with Ubuntu and s

Extending unittests [proposal] [Proof Of Concept]

2012-09-20 Thread Johannes Pfau
Current situation: The compiler combines all unittests of a module into one huge function. If a unittest in a module fails, the rest won't be executed. The runtime (which is responsible for calling that per module unittest method) must always run all unittests of a module. Goal: The runtime / test

Re: no-arg constructor for structs (again)

2012-09-20 Thread Timon Gehr
On 09/20/2012 10:11 AM, Felix Hufnagel wrote: ... but whats even more confusing: you are not allowed to declare an no_arg constructor. but you are allowed to declare one where all parameters have default parameters. but then, how to call it without args? auto k = S(); doesn't work? struct S{

Re: classes structs

2012-09-20 Thread Timon Gehr
On 09/20/2012 03:43 AM, David Currie wrote: On Tuesday, 18 September 2012 at 18:42:33 UTC, Timon Gehr wrote: On 09/18/2012 07:07 AM, David Currie wrote: [ALL CAPS] It does not matter who is the loudest guy in the room. If you have a point to make, just make it. (Stating the conclusion is not

Re: Weird Link Error

2012-09-20 Thread freeman
I started seeing these same errors after installing 2.6. Perhaps it is a linker problem tied to some conf file (in debian or dmd)? The crude solution that works for me is to delete / re-establish soft-linked libraries. On Thursday, 20 September 2012 at 13:08:19 UTC, Daniel wrote: I have searched

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Manu
On 20 September 2012 15:36, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 9/20/12 2:42 AM, Manu wrote: > >> On 19 September 2012 12:38, Peter Alexander >> > > >> wrote: >> >> The fastest execution time is rarely useful to me, I'm al

Re: Weird Link Error

2012-09-20 Thread Daniel
On Thursday, 20 September 2012 at 13:38:03 UTC, Adam D. Ruppe wrote: On Thursday, 20 September 2012 at 13:19:08 UTC, Daniel wrote: Oh wow I had the main function inside a class, I can't believe the answer was so simple. I feel like an idiot now. The linker errors are really hard to read if you

Re: Weird Link Error

2012-09-20 Thread Adam D. Ruppe
On Thursday, 20 September 2012 at 13:19:08 UTC, Daniel wrote: Oh wow I had the main function inside a class, I can't believe the answer was so simple. I feel like an idiot now. The linker errors are really hard to read if you haven't seen them before (and sometimes even then)...

Re: Weird Link Error

2012-09-20 Thread Jens Mueller
Daniel wrote: > I have searched everywhere and I can't find anything so I decided to > come here. I have a simple Hello World program in the file Test.d, > it compiles just fine but when I try this... Can you attach the Test.d? But it looks like you didn't define a main function. > [daniel@arch D

Re: Weird Link Error

2012-09-20 Thread Daniel
On Thursday, 20 September 2012 at 13:12:41 UTC, Adam D. Ruppe wrote: On Thursday, 20 September 2012 at 13:08:19 UTC, Daniel wrote: undefined reference to `_Dmain' Does your program have a main() function? Oh wow I had the main function inside a class, I can't believe the answer was so simpl

Re: Weird Link Error

2012-09-20 Thread Adam D. Ruppe
On Thursday, 20 September 2012 at 13:08:19 UTC, Daniel wrote: undefined reference to `_Dmain' Does your program have a main() function?

Weird Link Error

2012-09-20 Thread Daniel
I have searched everywhere and I can't find anything so I decided to come here. I have a simple Hello World program in the file Test.d, it compiles just fine but when I try this... [daniel@arch D]$ dmd Test.o /usr/lib/libphobos2.a(dmain2_459_1a5.o): In function `_D2rt6dmain24mainUiPPaZi7runMai

Re: [OT] Was: totally satisfied :D

2012-09-20 Thread Steven Schveighoffer
On Wed, 19 Sep 2012 17:05:35 -0400, Nick Sabalausky wrote: On Wed, 19 Sep 2012 10:11:50 -0400 "Steven Schveighoffer" wrote: I cannot argue that Apple's audio volume isn't too simplistic for its own good. AIUI, they have two "volumes", one for the ringer, and one for playing audio, games,

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Andrei Alexandrescu
On 9/20/12 2:42 AM, Manu wrote: On 19 September 2012 12:38, Peter Alexander mailto:peter.alexander...@gmail.com>> wrote: The fastest execution time is rarely useful to me, I'm almost always much more interested in the slowest execution time. In realtime software,

From APL

2012-09-20 Thread bearophile
The paper touches only a small subset of what's needed to write modern program, it's mostly about array operations and related matters. It compares some parts of the old Fortran 88 with parts of the dead APL language. The author seems fond of APL, and several things written in the paper are unf

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 12:57:03 monarch_dodra wrote: > BTW: std.container also has MakeContainter, but, AFAIK, I've > never seen ANYONE use it :/ What std.container has is make, which is supposed to construct a type where it goes by default (classes on the heap with new, and structs on t

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread monarch_dodra
On Thursday, 20 September 2012 at 10:46:22 UTC, Johannes Pfau wrote: That's what I did in std.digest. All Digests have a start() method, even if it's not necessary for that specific Digest. It's probably a good solution if you want a uniform interface for types which need initialization and

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread Johannes Pfau
Am Thu, 20 Sep 2012 12:23:12 +0200 schrieb "monarch_dodra" : > > That is a good point, I'd also make the "default" heap allocated, > but give a way to access a stack allocated payload. > > Regarding the "developer mistake", the problem is that currently: > "Misnstdrand a;" > Will create a valid

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread monarch_dodra
On Thursday, 20 September 2012 at 09:58:41 UTC, Johannes Pfau wrote: Am Thu, 20 Sep 2012 08:51:28 +0200 schrieb "monarch_dodra" : > Moving to classes would definitely break code, but it should > be possible to > make them reference types simply by making it so that their > internal state is >

Re: no-arg constructor for structs (again)

2012-09-20 Thread Don Clugston
On 20/09/12 11:09, Jonathan M Davis wrote: On Thursday, September 20, 2012 10:11:41 Felix Hufnagel wrote: On Thursday, 20 September 2012 at 00:14:04 UTC, Jonathan M Davis wrote: On Thursday, September 20, 2012 00:12:04 Felix Hufnagel wrote: isn't it even worse? import std.stdio; struct S { i

Re: no-arg constructor for structs (again)

2012-09-20 Thread deadalnix
Le 20/09/2012 00:12, Felix Hufnagel a écrit : isn't it even worse? import std.stdio; struct S { int i; this(void* p = null){this.i = 5;} } void main() { //S l(); //gives a linker error auto k = S(); writeln(k.i); //prints 0 } Last time I checked it, it was not working. No constructor was calle

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread Johannes Pfau
Am Thu, 20 Sep 2012 08:51:28 +0200 schrieb "monarch_dodra" : > > Moving to classes would definitely break code, but it should be > > possible to > > make them reference types simply by making it so that their > > internal state is > > in a separate object held by a pointer. > > I was thinking

Re: no-arg constructor for structs (again)

2012-09-20 Thread deadalnix
Le 20/09/2012 08:26, monarch_dodra a écrit : On Wednesday, 19 September 2012 at 12:31:08 UTC, Maxim Fomin wrote: On Wednesday, 19 September 2012 at 11:51:13 UTC, monarch_dodra wrote: The biggest issue with not having a no-arg constructor can easilly be seen if you have ever worked with a "Refer

Re: no-arg constructor for structs (again)

2012-09-20 Thread monarch_dodra
On Thursday, 20 September 2012 at 09:22:39 UTC, David wrote: The only thing I really miss is: class Foo {} struct Bar { Foo foo = new Foo(); } void main() { Bar s = Bar(); assert(s.foo !is null); } That probably won't _ever_ work, because that is a default *instruction*, not a

Re: no-arg constructor for structs (again)

2012-09-20 Thread David
The only thing I really miss is: class Foo {} struct Bar { Foo foo = new Foo(); } void main() { Bar s = Bar(); assert(s.foo !is null); }

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread monarch_dodra
On Thursday, 20 September 2012 at 07:26:01 UTC, Jonathan M Davis wrote: On Thursday, September 20, 2012 08:51:28 monarch_dodra wrote: On Tuesday, 18 September 2012 at 17:59:04 UTC, Jonathan M Davis wrote: > On Tuesday, September 18, 2012 17:05:26 monarch_dodra wrote: >> This is issue #1: I'd pr

Re: no-arg constructor for structs (again)

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 10:11:41 Felix Hufnagel wrote: > On Thursday, 20 September 2012 at 00:14:04 UTC, Jonathan M Davis > > wrote: > > On Thursday, September 20, 2012 00:12:04 Felix Hufnagel wrote: > >> isn't it even worse? > >> > >> import std.stdio; > >> struct S > >> { > >> int i; >

Re: no-arg constructor for structs (again)

2012-09-20 Thread Felix Hufnagel
On Thursday, 20 September 2012 at 00:14:04 UTC, Jonathan M Davis wrote: On Thursday, September 20, 2012 00:12:04 Felix Hufnagel wrote: isn't it even worse? import std.stdio; struct S { int i; this(void* p = null){this.i = 5;} } void main() { //S l(); //gives a linker error auto k = S(); writeln

Re: Review of Andrei's std.benchmark

2012-09-20 Thread Manu
On 19 September 2012 12:38, Peter Alexander wrote: > The fastest execution time is rarely useful to me, I'm almost always much >> more interested in the slowest execution time. >> In realtime software, the slowest time is often the only important factor, >> everything must be designed to tolerate

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 08:51:28 monarch_dodra wrote: > On Tuesday, 18 September 2012 at 17:59:04 UTC, Jonathan M Davis > > wrote: > > On Tuesday, September 18, 2012 17:05:26 monarch_dodra wrote: > >> This is issue #1: I'd propose that all objects in std.random be > >> migrated to classes