December 01, 2013
On 11/30/2013 1:19 PM, Chris Cain wrote:
> C, however, is a horrific mess.

The trick to reading C declarations is the form matches exactly how it is used in an expression. For example, a function pointer fp:

    int (*fp)(int);   // declare

    (*fp)(3);         // use

December 02, 2013
On Saturday, 30 November 2013 at 18:16:23 UTC, Walter Bright
wrote:

>
> It's easier than that:
>
> struct Rectangular {
>     Point x,y;
> }
>
> struct Rectangular {
>     Rectangle rectangle;
>     alias this rectangle;
> }

Are there any plans so that you can have multiple aliases per
struct/class? That would be really awesome :-).
December 02, 2013
On Mon, Dec 02, 2013 at 05:12:47PM +0100, Bienlein wrote:
> On Saturday, 30 November 2013 at 18:16:23 UTC, Walter Bright wrote:
> 
> >It's easier than that:
> >
> >struct Rectangular {
> >    Point x,y;
> >}
> >
> >struct Rectangular {
> >    Rectangle rectangle;
> >    alias this rectangle;
> >}
> 
> Are there any plans so that you can have multiple aliases per struct/class? That would be really awesome :-).

+1. Can we have multiple alias this? Pretty please? :)


T

-- 
A mathematician is a device for turning coffee into theorems. -- P. Erdos
December 02, 2013
On Monday, 2 December 2013 at 16:19:11 UTC, H. S. Teoh wrote:
> +1. Can we have multiple alias this? Pretty please? :)

It think it is all about "pretty pulls please" ;)
December 02, 2013
On Mon, Dec 02, 2013 at 05:34:12PM +0100, Dicebot wrote:
> On Monday, 2 December 2013 at 16:19:11 UTC, H. S. Teoh wrote:
> >+1. Can we have multiple alias this? Pretty please? :)
> 
> It think it is all about "pretty pulls please" ;)

I know, I know... I just need to find the time to sit down and dig into the dmd code. Unfortunately, unlike Phobos where the code is easy to understand (thanks to being written in D), the dmd code is harder. Well, that, and I just haven't had the time to look over it more carefully.

OTOH, there's also the temptation to wait until we've bootstrapped dmd into D, so that I can work with D source code instead of C++. :)


T

-- 
Guns don't kill people. Bullets do.
December 02, 2013
On Saturday, 30 November 2013 at 21:19:15 UTC, Chris Cain wrote:
> On Friday, 29 November 2013 at 16:15:10 UTC, Chris wrote:
>> I agree that D, too, can be a bit confusing. I sometimes have problems with AA declarations.
>>
>> Example:
>>
>> string[string][string] hm; // What am I?

    string[string][string] hm;

The result is a string, obtained through associative array with key string, obtained through associative array with key string which is located at hm.

> How about something *ridiculous* in right-to-left reading:
>
> rofl *[string][]*bool;

    bool*[][string]* rofl;

The result is bool, through a pointer, stored in an array, obtained through associative array with key of string, stored in array, and all pointeded to from a location rofl.

It really doesn't matter to me, but I'm not use to Go's backward style so I prefer D's choice.
December 03, 2013
On Monday, 2 December 2013 at 21:33:19 UTC, Jesse Phillips wrote:
> The result is a string, obtained through associative array with key string, obtained through associative array with key string which is located at hm.
>...
> The result is bool, through a pointer, stored in an array, obtained through associative array with key of string, stored in array, and all pointeded to from a location rofl.

Maybe it's just me, but if you said that (or wrote that) without the code I wouldn't have the beginnings of understanding what you were talking about.
December 03, 2013
On Tuesday, 3 December 2013 at 00:24:08 UTC, Chris Cain wrote:
> On Monday, 2 December 2013 at 21:33:19 UTC, Jesse Phillips wrote:
>> The result is a string, obtained through associative array with key string, obtained through associative array with key string which is located at hm.
>>...
>> The result is bool, through a pointer, stored in an array, obtained through associative array with key of string, stored in array, and all pointeded to from a location rofl.
>
> Maybe it's just me, but if you said that (or wrote that) without the code I wouldn't have the beginnings of understanding what you were talking about.

Thats ok, I can say the same thing about what you wrote. There are just too many details to keep in my head, so a nice succinct syntax is greatly appreciated. IMO English isn't the language to use for these complex descriptions e.g.[1].

1. http://stackoverflow.com/questions/264309/why-do-people-defend-the-regex-syntax/264384#264384
December 03, 2013
"H. S. Teoh" <hsteoh@quickfur.ath.cx> wrote in message news:mailman.208.1386005781.3242.digitalmars-d@puremagic.com...
> On Mon, Dec 02, 2013 at 05:34:12PM +0100, Dicebot wrote:
>> On Monday, 2 December 2013 at 16:19:11 UTC, H. S. Teoh wrote:
>> >+1. Can we have multiple alias this? Pretty please? :)
>>
>> It think it is all about "pretty pulls please" ;)
>
> I know, I know... I just need to find the time to sit down and dig into the dmd code. Unfortunately, unlike Phobos where the code is easy to understand (thanks to being written in D), the dmd code is harder. Well, that, and I just haven't had the time to look over it more carefully.
>
> OTOH, there's also the temptation to wait until we've bootstrapped dmd into D, so that I can work with D source code instead of C++. :)
>

The D version is automatically generated from the C++ version, so time spent learning the C++ code would not be wasted.


December 03, 2013
On 29/11/13 06:14, brad clawsie wrote:
> First I tried installing dmd from source, which was fine but then I would get
> strange errors about referring to a file "object.d" when trying to build dub.

Had you created a dmd.conf file containing the right locations for runtime/Phobos and placed in the same directory as the dmd binary?