digitalmars.D - Feature request : Make Error Messages More Helpful
- Davidl (15/15) Apr 03 2007 I've considered one solution to make error messages more helpful, add on...
- Dan (3/13) Apr 03 2007 Anything like that should be done on the AST, not on the runtime Objects...
- =?ISO-8859-1?Q?Julio_C=E9sar_Carrascal?= (4/13) Apr 14 2007 Error messages should be at least as helpful as to allow a solution to
- Don Clugston (10/26) Apr 14 2007 This doesn't count?
- =?ISO-8859-1?Q?Julio_C=E9sar_Carrascal?= (2/11) Apr 14 2007 Very nice. I should have tried before posting. Je je.
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 ;)
Apr 03 2007
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
Apr 03 2007
Dan wrote:Davidl Wrote:Error messages should be at least as helpful as to allow a solution to FizzBuzz: http://www.adampetersen.se/articles/fizzbuzz.htm ;)I've considered one solution to make error messages more helpful, add one attribute to DObjectAnything like that should be done on the AST, not on the runtime Objects... that said... I see nothing else wrong with it. : p
Apr 14 2007
Julio César Carrascal wrote:Dan wrote: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);Davidl Wrote:Error messages should be at least as helpful as to allow a solution to FizzBuzz: http://www.adampetersen.se/articles/fizzbuzz.htm ;)I've considered one solution to make error messages more helpful, add one attribute to DObjectAnything like that should be done on the AST, not on the runtime Objects... that said... I see nothing else wrong with it. : p
Apr 14 2007
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.
Apr 14 2007