December 21, 2013
Am Sat, 21 Dec 2013 11:34:29 +0100
schrieb "Mike" <none@none.com>:

> 
> > Should the module name then default to the file name?
> > Is there a way to query and print the full module name at
> > compile time?
> 
> Good questions, I'd like to know these myself. Iain? Johannes?

It usually should default to the file name. I don't know why it doesn't work for the object.d file, maybe a bug or maybe intentional. You could file a bug against dmd or ask this question in the main newsgroup.

You can get the module name using __MODULE__, to print it just use
pragma(msg, __MODULE__);
December 21, 2013
On 21 December 2013 11:29, Johannes Pfau <nospam@example.com> wrote:
> Am Sat, 21 Dec 2013 11:34:29 +0100
> schrieb "Mike" <none@none.com>:
>
>>
>> > Should the module name then default to the file name?
>> > Is there a way to query and print the full module name at
>> > compile time?
>>
>> Good questions, I'd like to know these myself. Iain? Johannes?
>
> It usually should default to the file name. I don't know why it doesn't work for the object.d file, maybe a bug or maybe intentional. You could file a bug against dmd or ask this question in the main newsgroup.
>


Answer is quite simply, the module name is only inferred after parsing, until then, the parser does not know this is the object module unless explicitly defined. Hence the errors.
December 21, 2013
On Wednesday, 18 December 2013 at 14:30:12 UTC, Iain Buclaw wrote:
> This has been fixed to not call any library routines, but has not been
> backported to the 4.8 branch yet.
>
> This is something that will be done before New Years (if my list of
> things to do does not grow even more...)

Iain,

Prior to this change my implementation was snowballing with stuff that was just going to get stripped out by the linker in the end. Now the only extra code I need for my simple "Hello World" is 2 lousy lines.

module object;
alias immutable(char)[]  string;

This is a huge win for me as I don't intend to port the entire D runtime, and I'm hoping the toolchain will only require me to add what's absolutely necessary for my code.

Thanks,
Mike
1 2 3
Next ›   Last »