🎉 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

Started by
1 comment, last by WitchLord 19 years, 5 months ago
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.
Advertisement
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


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement