On Tuesday, March 08, 2011 07:40:08 spir wrote:
> On 03/08/2011 03:48 PM, Jonathan M Davis wrote:
> > I really don't understand your problem with module constructors. They're
> > fantastic.
>
> I may be wrong, but I think this point of view is a "where I can from"
> statement. C's char* are fantas
>>
>> I really don't understand your problem with module constructors. They're
>> fantastic.
>
> I may be wrong, but I think this point of view is a "where I can from"
> statement. C's char* are fantastic when you have never used a PL with
> builtin strings. There are languages in which you don't n
On 03/08/2011 03:48 PM, Jonathan M Davis wrote:
I really don't understand your problem with module constructors. They're
fantastic.
I may be wrong, but I think this point of view is a "where I can from"
statement. C's char* are fantastic when you have never used a PL with builtin
strings. The
On Tuesday 08 March 2011 04:54:45 spir wrote:
> On 03/08/2011 09:26 AM, Wilfried Kirschenmann wrote:
> >>> enum deviceType {cpu, gpu}
> >>> auto execDeviceSuffix = [deviceType.cpu:".cpu", deviceType.gpu:".gpu"];
> >>
> >> The way to get what you want to work in this case is to use a module
> >> co
On 03/08/2011 09:26 AM, Wilfried Kirschenmann wrote:
enum deviceType {cpu, gpu}
auto execDeviceSuffix = [deviceType.cpu:".cpu", deviceType.gpu:".gpu"];
The way to get what you want to work in this case is to use a module
constructor. So, you'd do something like this:
string[deviceType] execDe
>> enum deviceType {cpu, gpu}
>> auto execDeviceSuffix = [deviceType.cpu:".cpu", deviceType.gpu:".gpu"];
> The way to get what you want to work in this case is to use a module
> constructor. So, you'd do something like this:
>
> string[deviceType] execDeviceSuffix;
>
> static this()
> {
> e
On 03/07/2011 11:16 AM, Jonathan M Davis wrote:
> On Monday, March 07, 2011 07:22:47 Wilfried Kirschenmann wrote:
>> enum deviceType {cpu, gpu}
>> auto execDeviceSuffix = [deviceType.cpu:".cpu", deviceType.gpu:".gpu"];
[...]
>> This won't compile and give the error:
>> Error: non-constant expre
On Monday, March 07, 2011 07:22:47 Wilfried Kirschenmann wrote:
> Hi,
>
> I'm a beginner in D; I have just begun the book from Andrei.
>
> I would like to know how to statically declare an associative array whose
> key are enums.
>
> example :
> #!../dmd2/linux/bin/rdmd
>
> import std.stdio, st