Feature request : Make Error Messages More Helpful

Don Clugston dac at nospam.com.au
Sat Apr 14 13:27:59 PDT 2007


Julio César Carrascal wrote:
> Dan wrote:
>> Davidl Wrote:
>>
>>> I've considered one solution to make error messages more helpful, add 
>>> one  attribute to DObject
>>
>> Anything like that should be done on the AST, not on the runtime 
>> Objects... that said... I see nothing else wrong with it.
>>
>> : p
>>
> 
> Error messages should be at least as helpful as to allow a solution to 
> FizzBuzz: http://www.adampetersen.se/articles/fizzbuzz.htm
> 
> ;)
This doesn't count?

template Fizz(int x)
{
     static if (x==0) const char [] Fizz = "";
     else const char [] Fizz = Fizz!(x-1) ~ " " ~
     ((x%3==0 && x%5==0)? "FizzBuzz" : (x%3==0) ? "Buzz" : (x%5==0) 
?"Fizz" : x.stringof);
}

int a = Fizz!(100);



More information about the Digitalmars-d mailing list