Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jakob Ovrum
On Thursday, 3 May 2012 at 05:14:43 UTC, James Miller wrote: On Wednesday, 2 May 2012 at 18:26:11 UTC, Jakob Ovrum wrote: This project is finally published and documented, so here's an announcement. https://github.com/JakobOvrum/bootDoc bootDoc is a configurable DDoc theme, with advanced

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Nick Sabalausky
Jakob Ovrum jakobov...@gmail.com wrote in message news:lbskaseedspulyyna...@forum.dlang.org... On Wednesday, 2 May 2012 at 21:42:21 UTC, Nick Sabalausky wrote: While it would be nice if the nav tree were still there w/o JS, and I'm not personally a fan of CSS(or HTML)-based frames, this is

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jakob Ovrum
On Thursday, 3 May 2012 at 05:44:47 UTC, Ary Manzana wrote: On 5/3/12 1:26 AM, Jakob Ovrum wrote: This project is finally published and documented, so here's an announcement. https://github.com/JakobOvrum/bootDoc bootDoc is a configurable DDoc theme, with advanced JavaScript features like a

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Ary Manzana
On 5/3/12 1:23 PM, Jakob Ovrum wrote: On Thursday, 3 May 2012 at 05:44:47 UTC, Ary Manzana wrote: On 5/3/12 1:26 AM, Jakob Ovrum wrote: This project is finally published and documented, so here's an announcement. https://github.com/JakobOvrum/bootDoc bootDoc is a configurable DDoc theme,

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jacob Carlborg
On 2012-05-03 08:09, Jakob Ovrum wrote: I am considering putting the module tree and symbol tree in tabs instead of below each other. I think that would be a good idea. -- /Jacob Carlborg

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jacob Carlborg
On 2012-05-03 08:53, Ary Manzana wrote: Oh, I just said that because I have a pull request waiting for that feature to be incorporated in DMD... but I don't think it'll happen... I really hope we get this functionality. -- /Jacob Carlborg

Re: Introducing vibe.d!

2012-05-03 Thread Sönke Ludwig
Am 03.05.2012 00:18, schrieb bls: Am 01.05.2012 23:46, schrieb Sönke Ludwig: I made a post with Steve Teale's MySQL driver as an example: http://vibed.org/blog/posts/writing-native-db-drivers There were some hidden gotchas, but I hope the current port doesn't break anything from the original

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Ary Manzana
On 5/3/12 2:10 PM, Jacob Carlborg wrote: On 2012-05-03 08:09, Jakob Ovrum wrote: I am considering putting the module tree and symbol tree in tabs instead of below each other. I think that would be a good idea. I'm not sure. I'd like the symbols to be under the same tree. With tabs you'd

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Rory McGuire
Would be great if you could make it an accordion with a live search at the top. On Thu, May 3, 2012 at 10:09 AM, Ary Manzana a...@esperanto.org.ar wrote: On 5/3/12 2:10 PM, Jacob Carlborg wrote: On 2012-05-03 08:09, Jakob Ovrum wrote: I am considering putting the module tree and symbol

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread James Miller
On Thursday, 3 May 2012 at 06:09:31 UTC, Jakob Ovrum wrote: On Thursday, 3 May 2012 at 05:14:43 UTC, James Miller wrote: On Wednesday, 2 May 2012 at 18:26:11 UTC, Jakob Ovrum wrote: This project is finally published and documented, so here's an announcement.

Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread bls
Am 30.04.2012 08:38, schrieb Sönke Ludwig: If you mean automatic generation of a REST interface for an existing D interface, then it's definitely planned. I can imagine a sloppy version where the HTTP method is always POST or can be POST/GET as desired by the client. But I would also like to

Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread bls
Am 03.05.2012 11:22, schrieb bls: Should be POST GET PUT DELETE I would be fantastic if vibe.d can implement a REST SERVER following this guideline : A very interesting read regarding implementing a rest server (PHP) http://www.gen-x-design.com/archives/create-a-rest-api-with-php/ Bjoern

Re: Introducing vibe.d!

2012-05-03 Thread SomeDude
On Wednesday, 2 May 2012 at 22:18:12 UTC, bls wrote: Am 01.05.2012 23:46, schrieb Sönke Ludwig: I made a post with Steve Teale's MySQL driver as an example: http://vibed.org/blog/posts/writing-native-db-drivers There were some hidden gotchas, but I hope the current port doesn't break

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Ary Manzana
On 5/3/12 6:41 PM, Jacob Carlborg wrote: On 2012-05-03 10:09, Ary Manzana wrote: I'm not sure. I'd like the symbols to be under the same tree. With tabs you'd have to click twice to go from one place to another. I didn't even know the symbols where there until a scrolled down. The same

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jakob Ovrum
On Thursday, 3 May 2012 at 12:33:33 UTC, Ary Manzana wrote: On 5/3/12 6:41 PM, Jacob Carlborg wrote: On 2012-05-03 10:09, Ary Manzana wrote: I'm not sure. I'd like the symbols to be under the same tree. With tabs you'd have to click twice to go from one place to another. I didn't even

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jacob Carlborg
What I meant with under the same tree is + std + algorithm * map * reduce * ... Aha, I was thinking more like below the tree as it is now. -- /Jacob Carlborg

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Jacob Carlborg
On 2012-05-03 14:43, Jakob Ovrum wrote: There would be a lot of wasted whitespace to the left, and overflow for long symbol names would become an even bigger issue. I do understand the problem though, and I want to fix it. Some more opinions are much appreciated. The right side is pretty

Re: bootDoc - advanced DDoc framework using Twitter's Bootstrap

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 08:43:43 -0400, Jakob Ovrum jakobov...@gmail.com wrote: On Thursday, 3 May 2012 at 12:33:33 UTC, Ary Manzana wrote: On 5/3/12 6:41 PM, Jacob Carlborg wrote: On 2012-05-03 10:09, Ary Manzana wrote: I'm not sure. I'd like the symbols to be under the same tree. With tabs

Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread Chris NS
I've been playing around with vibe in my free time the last few days, and here are the beginnings of a stab at REST: https://github.com/csauls/zeal.d/blob/master/source/zeal/http/router.d Admittedly it rips off the Rails way of recognizing and pathing the REST actions, but I admit a small bias

Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread Kagamin
On Thursday, 3 May 2012 at 09:22:23 UTC, bls wrote: Should be POST GET PUT DELETE I'm afraid, some proxies may cut unusual http verbs. SVN relies on them and if a proxy is not nice, it gets broken.

Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Mehrdad
I believe all of these static assertions (and some variants thereof) should pass, due to the semantics of const, immutable, and shared. immutable struct Immutable { } const struct Const { } shared struct Shared { } static assert(is(Immutable == immutable(Immutable))); static assert(is(Immutable

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Jonathan M Davis
On Wednesday, May 02, 2012 23:00:57 Mehrdad wrote: I believe all of these static assertions (and some variants thereof) should pass, due to the semantics of const, immutable, and shared. immutable struct Immutable { } const struct Const { } shared struct Shared { } static

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Mehrdad
Marking a struct's definition as const or immutable just makes all of its members const or immutable. The type itself can't be const or immutable. What sense does it make to have a struct whose members are all const, and which is not automatically const by itself?

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-03 Thread Mehrdad
Okay, that's for shared. What about const though?

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Jonathan M Davis
On Wednesday, May 02, 2012 23:19:40 Mehrdad wrote: Marking a struct's definition as const or immutable just makes all of its members const or immutable. The type itself can't be const or immutable. What sense does it make to have a struct whose members are all const, and which is not

Re: Oddness with C binding

2012-05-03 Thread Don Clugston
On 03/05/12 06:28, James Miller wrote: I'm writing bindings to XCB right now, and its mostly going smoothly. However I have encountered a very strange problem. This bit of code segfaults with DMD: auto connection = xcb_connect(null, null); auto setup = xcb_get_setup(connection); auto iter =

Re: Does D have too many features?

2012-05-03 Thread akaz
It's hard to grep for (since with is used in comments quite often), Try to search for with( or with\s(, that are less common in normal text. There is no tool (maybe the compiler could provide such a tool) to remove all comments? That way, you could do: cat file.d | tool | grep

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Chris Cain
On Thursday, 3 May 2012 at 06:00:58 UTC, Mehrdad wrote: I believe all of these static assertions (and some variants thereof) should pass, due to the semantics of const, immutable, and shared. ... Do people agree? This doesn't even pass: static assert(is(Immutable == Immutable)); The

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Chris Cain
On Thursday, 3 May 2012 at 07:45:53 UTC, Chris Cain wrote: The straightforward answer to this is that you really ought to have a main method :-) ... Well, I just updated DMD to 2.059 (from 2.058) and lo and behold, this doesn't pass for the new version. Interesting. And apparently static

Re: D3 is potentially damaging

2012-05-03 Thread James Miller
On Wednesday, 2 May 2012 at 01:11:52 UTC, Alex Rønne Petersen wrote: On 02-05-2012 03:08, ixid wrote: The idea of D3 is a worrying one- it suggests a number of things that would not be good for the success and adoption of the language. That the language is experimental and more of a pet

Re: How can D become adopted at my company?

2012-05-03 Thread Don Clugston
On 30/04/12 01:03, Manu wrote: On 30 April 2012 01:24, Tove t...@fransson.se mailto:t...@fransson.se wrote: On Sunday, 29 April 2012 at 22:13:22 UTC, Manu wrote: Is it technically possible to have a precise GC clean up all unreferenced memory in one big pass?

Re: Oddness with C binding

2012-05-03 Thread Shahid
I was blocked by Issue 5570 (DMD64), here was the progress I made before giving up https://gist.github.com/1131642

How to modify an element in a range/collection using its member function?

2012-05-03 Thread Jens Mueller
Hi, in Phobos opIndex returns a copy due to the reasons outlined in TDPL p. 378 (hiding the storage). Even though I find the argumentation convincing and opIndexAssign/opIndexOpAssign usually makes the design sound I ran into surprises when using member functions. I use the Zip the range which

Re: An observation

2012-05-03 Thread Tobias Pankrath
Not that I'm advocating Mutt, but I do recommend taking the time to learn to use a threading mail/news reader. It will help you keep up with very high traffic mailing lists/forums, and not just the D forums. (D's forums are relatively tame, comparatively speaking. I've been on mailing lists

Re: How to modify an element in a range/collection using its member function?

2012-05-03 Thread Peter Alexander
I don't think that opIndexAssign/opIndexOpAssign were ever a good idea. Yeah, it works fine when all you are doing is x[i] = y, but that doesn't scale, as you have found out. It's short-sighted. x[i] is an L-value for arrays, so it should be for everything else where it makes sense.

Re: How to modify an element in a range/collection using its member function?

2012-05-03 Thread Chris Cain
On Thursday, 3 May 2012 at 10:03:55 UTC, Jens Mueller wrote: What is a good solution when using member functions on a range's/container's element? Note, the problem only applies when storing structs because classes behave like references. I think in this case, it might make sense to store

Windows batch file to compile D code

2012-05-03 Thread Iain Staffell
Hi all. I have been trying (quite badly) to get started with D for a while. On my first attempt I gave up before even compiling Hello World, because it was too difficult to find out how to even compile a program in Windows. (I know.. I said I was bad at this..) Second time around I tried

Re: Windows batch file to compile D code

2012-05-03 Thread David
Am 03.05.2012 14:31, schrieb Iain Staffell: Hi all. I have been trying (quite badly) to get started with D for a while. On my first attempt I gave up before even compiling Hello World, because it was too difficult to find out how to even compile a program in Windows. (I know.. I said I was bad

Re: Does D have too many features?

2012-05-03 Thread Don Clugston
On 01/05/12 00:33, Timon Gehr wrote: On 04/30/2012 11:28 PM, bearophile wrote: Walter: The first thing to emphasize is that NONE of this will happen for D2. The emphasis on D2 is fixing implementation and toolchain issues. Breaking existing code is off the table unless we are pretty much

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 03:45:51 -0400, Chris Cain clc...@uncg.edu wrote: On Thursday, 3 May 2012 at 06:00:58 UTC, Mehrdad wrote: I believe all of these static assertions (and some variants thereof) should pass, due to the semantics of const, immutable, and shared. ... Do people agree?

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-03 Thread Steven Schveighoffer
On Wed, 02 May 2012 12:59:34 -0400, David Nadlinger s...@klickverbot.at wrote: On Wednesday, 2 May 2012 at 16:52:33 UTC, Alex Rønne Petersen wrote: shared? Almost always in any non-trivial application. shared is only useful if you're dealing with templatized functions that can actually

Re: Does D have too many features?

2012-05-03 Thread Don Clugston
On 28/04/12 20:47, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already agreed upon ones are typedef and the cfloat, cdouble and creal types. What's your list?

From Ada 2012

2012-05-03 Thread bearophile
Ada shares many purposes with D: correctness from the language design too, mostly imperative, native compilation, efficiency of the binary, closeness to the metal (even more, because not requiring a GC, it's probably usable in more situations), generic programming, OOP, strong static typing,

Re: Does D have too many features?

2012-05-03 Thread Andrei Alexandrescu
On 5/3/12 9:55 AM, Don Clugston wrote: On 28/04/12 20:47, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already agreed upon ones are typedef and the cfloat,

Re: D3 is potentially damaging

2012-05-03 Thread H. S. Teoh
On Thu, May 03, 2012 at 10:22:16AM +0200, James Miller wrote: [...] D3 would be fine, iff it was easy to port D2 across and easy to continue using D2 code. A big problem with Python2 - Python3 is the fact that it is a nightmare to have both running side-by-side. I don't really think that D3

Re: An observation

2012-05-03 Thread H. S. Teoh
On Thu, May 03, 2012 at 12:07:44PM +0200, Tobias Pankrath wrote: Not that I'm advocating Mutt, but I do recommend taking the time to learn to use a threading mail/news reader. It will help you keep up with very high traffic mailing lists/forums, and not just the D forums. (D's forums are

Growing pains

2012-05-03 Thread Andrei Alexandrescu
Just letting you all know we're working on the frustrating and increasingly frequent Load at xx.xx, try again later errors when reading this forum through NNTP. They are caused by a significant growth spurt in newsgroup readership that occurred in recent times. We are working with our provider

Re: Does D have too many features?

2012-05-03 Thread Don Clugston
On 03/05/12 16:13, Andrei Alexandrescu wrote: On 5/3/12 9:55 AM, Don Clugston wrote: On 28/04/12 20:47, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already

Pure memoization, and more

2012-05-03 Thread bearophile
Threads like Why D const is annoying show that there is desire for logical immutability, for pure memoization, etc. I'd like the memoization of a pure function to be pure still. This is a closely related group of problems (including pointer equality, external pointers, finalizers, and weak

Re: When is casting const() away actually necessary? (Used to be: Re: Why D const is annoying)

2012-05-03 Thread David Nadlinger
On Thursday, 3 May 2012 at 13:40:41 UTC, Steven Schveighoffer wrote: On Wed, 02 May 2012 12:59:34 -0400, David Nadlinger s...@klickverbot.at wrote: Additionally, shared is currently little more than a marker for non-TLS data. No, it's very important that it is a type constructor. For

Re: Pure memoization, and more

2012-05-03 Thread David Nadlinger
On Thursday, 3 May 2012 at 15:50:36 UTC, bearophile wrote: Threads like Why D const is annoying show that there is desire for logical immutability, for pure memoization, etc. I'd like the memoization of a pure function to be pure still. If you are performing a »logically pure« operation which

Re: From Ada 2012

2012-05-03 Thread Artur Skawina
On 05/03/12 16:04, bearophile wrote: [p.19] Arrays can be indexed by any discrete types (integers, enumeration) This is quite handy for enums (and sometimes chars), and reliable. Currently in D if you define an array with enum index you get an associative array, that is wasteful in both

Re: Pure memoization, and more

2012-05-03 Thread bearophile
David Nadlinger: If you are performing a »logically pure« operation which can't be proven to be so due to the limits of the type system, you can always just use a cast in the implementation. casts are dangerous, better to avoid them where possible. Those papers try to avoid unsafe casts in

Re: Windows batch file to compile D code

2012-05-03 Thread Manu
Are you a visual studio user? Tried VisualD? If not, tried Mono-D? On 3 May 2012 15:31, Iain Staffell staff...@gmail.com wrote: Hi all. I have been trying (quite badly) to get started with D for a while. On my first attempt I gave up before even compiling Hello World, because it was too

Re: How can D become adopted at my company?

2012-05-03 Thread Manu
On 3 May 2012 12:27, Don Clugston d...@nospam.com wrote: On 30/04/12 01:03, Manu wrote: On 30 April 2012 01:24, Tove t...@fransson.se mailto:t...@fransson.se wrote: On Sunday, 29 April 2012 at 22:13:22 UTC, Manu wrote: Is it technically possible to have a precise GC clean up all

Re: An observation

2012-05-03 Thread Regan Heath
On Thu, 03 May 2012 15:31:25 +0100, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, May 03, 2012 at 12:07:44PM +0200, Tobias Pankrath wrote: Not that I'm advocating Mutt, but I do recommend taking the time to learn to use a threading mail/news reader. It will help you keep up with very

Re: Does D have too many features?

2012-05-03 Thread Alex Rønne Petersen
On 03-05-2012 17:13, Don Clugston wrote: On 03/05/12 16:13, Andrei Alexandrescu wrote: On 5/3/12 9:55 AM, Don Clugston wrote: On 28/04/12 20:47, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not

Re: From Ada 2012

2012-05-03 Thread Kagamin
On Thursday, 3 May 2012 at 14:04:41 UTC, bearophile wrote: [p.21] The compiler decides if it has to be passed by reference of copy procedure Do_Something (P1 : in Huge_Structure) –- Passed by reference if too big D offers more low-level knowlege/control here, it doesn't decide to pass by

Re: From Ada 2012

2012-05-03 Thread bearophile
Currently in D if you define an array with enum index you get an associative array, that is wasteful in both memory and performance for most enums that have contiguous values (but I think maybe D implementations will be free to use a more efficient array here, because the interface of AAs is

Class methods in D?

2012-05-03 Thread Mehrdad
In Windows, you need to register a window class before you can actually create an instance of it. Mapping this idea to D (and most other languages, I admit) is hard. Microsoft's solution in C# is pretty ugly. The problem is this: You make a class like class Window { HWND handle;

Re: Class methods in D?

2012-05-03 Thread Mehrdad
this() { this.handle = className(this.className, ...); } whoops, typo. That line should say: this() { this.handle = CreateWindow(this.className, ...); }

Feature !request into std.algorithm

2012-05-03 Thread bioinfornatics
into std.algorithm they are countUntil that is a useful function buit when you want the first index of many token is same sequence you need to all many times countUntil and then loop many time in the same sequence. This is a inefficiency way. i have wrote a function where loop at max one time over

Re: From Ada 2012

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 13:03:34 -0400, Kagamin s...@here.lot wrote: On Thursday, 3 May 2012 at 14:04:41 UTC, bearophile wrote: [p.21] The compiler decides if it has to be passed by reference of copy procedure Do_Something (P1 : in Huge_Structure) –- Passed by reference if too big D offers

Re: Class methods in D?

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 13:21:55 -0400, Mehrdad wfunct...@hotmail.com wrote: In Windows, you need to register a window class before you can actually create an instance of it. Mapping this idea to D (and most other languages, I admit) is hard. Microsoft's solution in C# is pretty ugly. The

Re: Class methods in D?

2012-05-03 Thread Mehrdad
On Thursday, 3 May 2012 at 17:45:20 UTC, Steven Schveighoffer wrote: This works: import std.stdio; class A { string name; this() {this.name = typeid(this).name;} } class B : A {} void main() { A b = new B; A a = new A; writefln(A: %s, B: %s, a.name, b.name); } outputs: A:

Re: Const/Shared/Immutable anomalies in D that should be fixed

2012-05-03 Thread kenji hara
It is bug 7038 and has been fixed in 2.059. http://d.puremagic.com/issues/show_bug.cgi?id=7038 Kenji Hara 2012/05/03 15:04 Mehrdad wfunct...@hotmail.com: I believe all of these static assertions (and some variants thereof) should pass, due to the semantics of const, immutable, and shared.

Re: Class methods in D?

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 13:48:24 -0400, Mehrdad wfunct...@hotmail.com wrote: On Thursday, 3 May 2012 at 17:45:20 UTC, Steven Schveighoffer wrote: This works: import std.stdio; class A { string name; this() {this.name = typeid(this).name;} } class B : A {} void main() { A b = new B; A

Re: Class methods in D?

2012-05-03 Thread Mehrdad
There's the RTInfo method I told you about (recently added) if you want to stick the information directly into TypeInfo at compile time. There's also static ctors. Just add a hashtable based on the class name, and use typeid(this).name as the initial key. You have to handle all the

scope ref const(T) -- error?!

2012-05-03 Thread Mehrdad
What's wrong with passing a struct as scope ref const? I want to avoid copying the struct, and its information is only read inside the function...

Re: From Ada 2012

2012-05-03 Thread Alex Rønne Petersen
On 03-05-2012 19:36, Steven Schveighoffer wrote: On Thu, 03 May 2012 13:03:34 -0400, Kagamin s...@here.lot wrote: On Thursday, 3 May 2012 at 14:04:41 UTC, bearophile wrote: [p.21] The compiler decides if it has to be passed by reference of copy procedure Do_Something (P1 : in Huge_Structure)

Re: Class methods in D?

2012-05-03 Thread Simon
On 03/05/2012 18:21, Mehrdad wrote: In Windows, you need to register a window class before you can actually create an instance of it. If you are mucking about on 'doze you might find my dubious port of the ATL window classes relevant: http://www.sstk.co.uk/atlWinD.php That does all that

Re: Class methods in D?

2012-05-03 Thread Mehrdad
On Thursday, 3 May 2012 at 18:32:18 UTC, Simon wrote: On 03/05/2012 18:21, Mehrdad wrote: In Windows, you need to register a window class before you can actually create an instance of it. If you are mucking about on 'doze you might find my dubious port of the ATL window classes relevant:

virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
I need to get a pointer to a virtual method, which is in turn a function pointer, being set by virtual method binding. Can anyone, please, tell me how to get it? Taking the delegate of the method won't do, because I need it to behave exactly as a virtual method call, except I pass the this

Re: From Ada 2012

2012-05-03 Thread Alex Rønne Petersen
On 03-05-2012 20:29, Alex Rønne Petersen wrote: On 03-05-2012 19:36, Steven Schveighoffer wrote: On Thu, 03 May 2012 13:03:34 -0400, Kagamin s...@here.lot wrote: On Thursday, 3 May 2012 at 14:04:41 UTC, bearophile wrote: [p.21] The compiler decides if it has to be passed by reference of

Re: Windows batch file to compile D code

2012-05-03 Thread simendsjo
On Thu, 03 May 2012 15:29:07 +0200, David d...@dav1d.de wrote: Am 03.05.2012 14:31, schrieb Iain Staffell: Hi all. I have been trying (quite badly) to get started with D for a while. On my first attempt I gave up before even compiling Hello World, because it was too difficult to find out how

Re: virtual method pointer

2012-05-03 Thread Alex Rønne Petersen
On 03-05-2012 20:46, Gor Gyolchanyan wrote: I need to get a pointer to a virtual method, which is in turn a function pointer, being set by virtual method binding. Can anyone, please, tell me how to get it? Taking the delegate of the method won't do, because I need it to behave exactly as a

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
class B: A { void foo() { writeln(B.foo called); } } void main() { auto a = new A(); auto fn = a.foo; auto ptr = fn.funcptr; auto b = new B(); (cast(void function(A))ptr)(b); } will this work? On Thu, May 3, 2012 at 10:54 PM, Alex Rønne Petersen

Re: Does D have too many features?

2012-05-03 Thread Sean Kelly
On May 3, 2012, at 8:13 AM, Don Clugston wrote: On 03/05/12 16:13, Andrei Alexandrescu wrote: Good ones. In fact I even discounted them from this discussion because I'd already considered them gone. Walter agreed that I don't mention them in TDPL, with the intent to have them peter out.

Re: Does D have too many features?

2012-05-03 Thread Sean Kelly
On May 3, 2012, at 9:58 AM, Alex Rønne Petersen wrote: On 03-05-2012 17:13, Don Clugston wrote: Well, they are also used in druntime, in core.stdc.math BTW I *hate* that module, I don't know why it exists. Even worse, it seems to be growing -- people are adding more things to it.

Re: virtual method pointer

2012-05-03 Thread Mehrdad
On Thursday, 3 May 2012 at 18:47:11 UTC, Gor Gyolchanyan wrote: I need to get a pointer to a virtual method, which is in turn a function pointer, being set by virtual method binding. Can anyone, please, tell me how to get it? Taking the delegate of the method won't do, because I need it to

Re: virtual method pointer

2012-05-03 Thread Timon Gehr
On 05/03/2012 09:01 PM, Gor Gyolchanyan wrote: class B: A { void foo() { writeln(B.foo called); } } void main() { auto a = new A(); auto fn =a.foo; auto ptr = fn.funcptr; auto b = new B(); (cast(void function(A))ptr)(b); } will this work? It

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
No, because I'm not supposed to get delegates in the first place. What I want is to have a pointer to a pointer to a function, so I can make a true virtual call. On Thu, May 3, 2012 at 11:09 PM, Mehrdad wfunct...@hotmail.com wrote: On Thursday, 3 May 2012 at 18:47:11 UTC, Gor Gyolchanyan wrote:

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
So, you're saying, that the foo function actually takes the *this, which we ass manually, extracts the real foo method and calls it? AFAIK, that shouldn't be the case. The delegate extracts the A's foo and call to the delegate should be a direct call to A.foo, not a virtual call. On Thu, May 3,

Re: Class methods in D?

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 14:05:26 -0400, Mehrdad wfunct...@hotmail.com wrote: There's the RTInfo method I told you about (recently added) if you want to stick the information directly into TypeInfo at compile time. There's also static ctors. Just add a hashtable based on the class name, and

Re: virtual method pointer

2012-05-03 Thread Timon Gehr
On 05/03/2012 09:18 PM, Gor Gyolchanyan wrote: So, you're saying, that the foo function actually takes the *this, which we ass manually, extracts the real foo method and calls it? AFAIK, that shouldn't be the case. The delegate extracts the A's foo and call to the delegate should be a direct

Re: Class methods in D?

2012-05-03 Thread Mehrdad
Oo ok I'll take a look at it, thanks.

Re: virtual method pointer

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 14:46:58 -0400, Gor Gyolchanyan gor.f.gyolchan...@gmail.com wrote: I need to get a pointer to a virtual method, which is in turn a function pointer, being set by virtual method binding. Not exactly. There is a workaround: http://www.drdobbs.com/blogs/cpp/231600610

Re: From Ada 2012

2012-05-03 Thread Paulo Pinto
Am 03.05.2012 16:04, schrieb bearophile: Ada shares many purposes with D: correctness from the language design too, mostly imperative, native compilation, efficiency of the binary, closeness to the metal (even more, because not requiring a GC, it's probably usable in more situations), generic

Re: scope ref const(T) -- error?!

2012-05-03 Thread Manu
You're looking for 'in ref T'? I was also trying to do this today funnily enough, and it seems a shame this doesn't work. Is this a bug, or is it intended that it's not supported? On 3 May 2012 21:28, Mehrdad wfunct...@hotmail.com wrote: What's wrong with passing a struct as scope ref const?

Re: Does D have too many features?

2012-05-03 Thread Don
On 03.05.2012 21:08, Sean Kelly wrote: On May 3, 2012, at 8:13 AM, Don Clugston wrote: On 03/05/12 16:13, Andrei Alexandrescu wrote: Good ones. In fact I even discounted them from this discussion because I'd already considered them gone. Walter agreed that I don't mention them in TDPL, with

Re: Growing pains

2012-05-03 Thread SomeDude
On Thursday, 3 May 2012 at 14:50:09 UTC, Andrei Alexandrescu wrote: Just letting you all know we're working on the frustrating and increasingly frequent Load at xx.xx, try again later errors when reading this forum through NNTP. They are caused by a significant growth spurt in newsgroup

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
That workaround is pretty obvious, but I can't afford to make an extra call every time. This event system is supposed to be ultra-fast. Isn't there a way to get to the vtable etry itself? On Thu, May 3, 2012 at 11:26 PM, Steven Schveighoffer schvei...@yahoo.com wrote: On Thu, 03 May 2012

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
No, I intend to call these methods very frequently and I can't afford any performance loss. What I expect to have is something like a virtual table entry. I tied looking at the virtual tables and searching for the method delegate's .funcptr in the vtable, but didn't find it. Having that vtable

Re: Does D have too many features?

2012-05-03 Thread Jonathan M Davis
On Thursday, May 03, 2012 15:30:40 Don Clugston wrote: What is this D3 thing As far as I can tell, 'D3' was invented by newcomers to the forums. I think that what it comes down to is that there are a variety of people who want features added or changed in D which are either not going to

Re: Does D have too many features?

2012-05-03 Thread Sean Kelly
On May 3, 2012, at 1:11 PM, Don wrote: On 03.05.2012 21:08, Sean Kelly wrote: On May 3, 2012, at 8:13 AM, Don Clugston wrote: On 03/05/12 16:13, Andrei Alexandrescu wrote: Good ones. In fact I even discounted them from this discussion because I'd already considered them gone. Walter

Re: Growing pains

2012-05-03 Thread deadalnix
Le 03/05/2012 16:50, Andrei Alexandrescu a écrit : Just letting you all know we're working on the frustrating and increasingly frequent Load at xx.xx, try again later errors when reading this forum through NNTP. They are caused by a significant growth spurt in newsgroup readership that occurred

Re: virtual method pointer

2012-05-03 Thread deadalnix
Le 03/05/2012 22:22, Gor Gyolchanyan a écrit : That workaround is pretty obvious, but I can't afford to make an extra call every time. This event system is supposed to be ultra-fast. Isn't there a way to get to the vtable etry itself? Well : 1/ Such a trivial thing is surely inlined by any

Re: Growing pains

2012-05-03 Thread Ali Çehreli
On 05/03/2012 01:52 PM, deadalnix wrote: Le 03/05/2012 16:50, Andrei Alexandrescu a écrit : Just letting you all know we're working on the frustrating and increasingly frequent Load at xx.xx, try again later errors when reading this forum through NNTP. They are caused by a significant growth

Re: virtual method pointer

2012-05-03 Thread Gor Gyolchanyan
Good point. That raises the question: How should I make the fastest possible dynamic dispatch of this kind? On Fri, May 4, 2012 at 12:57 AM, deadalnix deadal...@gmail.com wrote: Le 03/05/2012 22:22, Gor Gyolchanyan a écrit : That workaround is pretty obvious, but I can't afford to make an

Re: virtual method pointer

2012-05-03 Thread Steven Schveighoffer
On Thu, 03 May 2012 16:22:56 -0400, Gor Gyolchanyan gor.f.gyolchan...@gmail.com wrote: That workaround is pretty obvious, but I can't afford to make an extra call every time. This event system is supposed to be ultra-fast. Isn't there a way to get to the vtable etry itself? Well, you can

  1   2   3   >