No, to be honest, it's not really a problem.
'ref' is alright.
It's a universally acknowledged standard abbreviation of 'reference'.
That would work.
'gen' is not, as it's unclear what it means.
'han' would not be acceptable either..
But this is nerd-jacking.
Opinion: What should I name the generic handle type?
No, to be honest, it's not really a problem.
'ref' is alright.
It's a universally acknowledged standard abbreviation of 'reference'.
That would work.
'gen' is not, as it's unclear what it means.
'han' would not be acceptable either..
But this is nerd-jacking.
Nerd-jacking is good when thinking of new, and frankly needed, features of a language.
What about just providing a field that lets us pick the name when we register it, because we will all have our own opinions on what it should be called.
And you said it's an addon, are there new features coming to the language in the next iteration that allows this? Or is it just a stripped down version of the 'any' type?
There is a new engine feature to support this. The generic handle type (for lack of a decision on the name) is registered as a value type but with a new flag asOBJ_ASHANDLE to allow the script to treat it as if it was a handle.
The dynamic casting is also supported with an new alternative function signature for the asBEHAVE_REF_CAST behaviour: 'void f(?&out)'. This will let the generic handle type receive the type id of the expected type, and return the appropriate pointer (or null if the cast is invalid).
The new engine features are already implemented in the SVN, though not yet documented.
The dynamic casting is also supported with an new alternative function signature for the asBEHAVE_REF_CAST behaviour: 'void f(?&out)'. This will let the generic handle type receive the type id of the expected type, and return the appropriate pointer (or null if the cast is invalid).
The new engine features are already implemented in the SVN, though not yet documented.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
There is a new engine feature to support this. The generic handle type (for lack of a decision on the name) is registered as a value type but with a new flag asOBJ_ASHANDLE to allow the script to treat it as if it was a handle.
The dynamic casting is also supported with an new alternative function signature for the asBEHAVE_REF_CAST behaviour: 'void f(?&out)'. This will let the generic handle type receive the type id of the expected type, and return the appropriate pointer (or null if the cast is invalid).
The new engine features are already implemented in the SVN, though not yet documented.
So basically handles to value types? This could be very handy indeed.
No, it is not handles to value types. The ASHANDLE type is a value type, but it is treated as a handle by the script. You still cannot store a reference to a value type, as the reference could outlive the scope of the value type.
Anyway, the vote is a tie for ref and handle, so I quite selfishly make my own vote count more, thus the decision is: "ref".
Thanks for your opinions everyone.
Regards,
Andreas
Anyway, the vote is a tie for ref and handle, so I quite selfishly make my own vote count more, thus the decision is: "ref".
Thanks for your opinions everyone.
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
Popular Topics
Advertisement