Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 03, 2007 Feature request : Make Error Messages More Helpful | ||||
---|---|---|---|---|
| ||||
I've considered one solution to make error messages more helpful, add one attribute to DObject bool thissymtriggeredanerror; and when error triggered make this DObject 's attribut thissymtriggeredanerror to be true and each check of emiting error messages would first try to figure out whether all expressions statements has thissymtriggeredanerror set to be false, then real semantic parse is executed. this would avoid the great bunch error messages coz by only 1 simple mistake like user forget to declare a variable, and user mis declared the prototype of a func. this could help user to read the error message more efficiently. though this feature request should be in rather low priority ;) |
April 03, 2007 Re: Feature request : Make Error Messages More Helpful | ||||
---|---|---|---|---|
| ||||
Posted in reply to Davidl | Davidl Wrote:
> I've considered one solution to make error messages more helpful, add one
> attribute to DObject
> bool thissymtriggeredanerror;
> this would avoid the great bunch error messages coz by only 1 simple
> mistake like user forget to
> declare a variable, and user mis declared the prototype of a func. this
> could help user to read
> the error message more efficiently.
>
> though this feature request should be in rather low priority ;)
Anything like that should be done on the AST, not on the runtime Objects... that said... I see nothing else wrong with it.
: p
|
April 14, 2007 Re: Feature request : Make Error Messages More Helpful | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dan | 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 ;) |
April 14, 2007 Re: Feature request : Make Error Messages More Helpful | ||||
---|---|---|---|---|
| ||||
Posted in reply to Julio César Carrascal | 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);
|
April 15, 2007 Re: Feature request : Make Error Messages More Helpful | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | Don Clugston wrote:
> 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);
Very nice. I should have tried before posting. Je je.
|
Copyright © 1999-2021 by the D Language Foundation