🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
AS 2.0: Some issues with the null keyword
Cannot return a null handle:
Obj@ GetObj()
{
if(@obj != null)
return @obj;
return null; // Error!
}
I think NULL should be used instead of null, and 0 (zero) can be used also to make the sytax more C++ like.
Good point. I never thought about that. I will fix it ASAP.
I'm not following the C++ way 100 percent. C++ doesn't have object handles, and pointers can have any value, in which case a special keyword such as null doesn't make that much sense. NULL is traditionally defined with capital letters because that is a common way of defining constants.
C++ has many inconsistencies and quirks that I'd rather not add to AS just to be more like C++. I've already stepped away from the C++ syntax with the object handles, and the way arrays are declared. I try to keep the AS syntax C/C++ like, but some things just don't make sense.
Regards,
Andreas
I'm not following the C++ way 100 percent. C++ doesn't have object handles, and pointers can have any value, in which case a special keyword such as null doesn't make that much sense. NULL is traditionally defined with capital letters because that is a common way of defining constants.
C++ has many inconsistencies and quirks that I'd rather not add to AS just to be more like C++. I've already stepped away from the C++ syntax with the object handles, and the way arrays are declared. I try to keep the AS syntax C/C++ like, but some things just don't make sense.
Regards,
Andreas
Bug fix:
Add the following statement to the asCCompiler::PrepareTemporaryObject() method at line 1691 (after the dt.isReference = false; statement):
dt.isReadOnly = false;
Regards,
Andreas
Add the following statement to the asCCompiler::PrepareTemporaryObject() method at line 1691 (after the dt.isReference = false; statement):
dt.isReadOnly = false;
Regards,
Andreas
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement